diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b26621c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* text=auto eol=lf +*.{bat,cmd} text eol=crlf \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fa3ee97 --- /dev/null +++ b/.gitignore @@ -0,0 +1,48 @@ +###################################################################### +# Build Tools + +.gradle +/build/ +!gradle/wrapper/gradle-wrapper.jar + +target/ +!.mvn/wrapper/maven-wrapper.jar + +###################################################################### +# IDE + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### JRebel ### +rebel.xml + +### NetBeans ### +nbproject/private/ +build/* +nbbuild/ +nbdist/ +.nb-gradle/ + +###################################################################### +# Others +*.log +*.xml.versionsBackup +*.swp + +!*/build/*.java +!*/build/*.html +!*/build/*.xml + +.flattened-pom.xml diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..22593d5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2023 ruoyi-ai + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 3c3f37b..381cf45 100644 --- a/README.md +++ b/README.md @@ -1 +1,239 @@ -AI标书系统2.0-后端 \ No newline at end of file + + +# RuoYi AI + + + + + +[![Contributors][contributors-shield]][contributors-url] +[![Forks][forks-shield]][forks-url] +[![Stargazers][stars-shield]][stars-url] +[![Issues][issues-shield]][issues-url] +[![MIT License][license-shield]][license-url] + + + +
+ + +Logo + +

快速搭建属于自己的 AI 助手平台

+ +

+ 全新升级,开箱即用,简单高效 +
+ 探索本项目的文档 » +
+
+ 项目预览 + · + 报告Bug + · + 提出新特性 +

+ +## 目录 + +- [源码地址](#源码地址) +- [特色功能](#特色功能) +- [项目演示](#项目演示) + - [后台管理](#后台管理) + - [用户端](#用户端) + - [小程序端](#小程序端) +- [开发前的配置要求](#开发前的配置要求) +- [文件目录说明](#文件目录说明) +- [使用到的框架](#使用到的框架) +- [贡献者](#贡献者) + - [如何参与开源项目](#如何参与开源项目) +- [版本控制](#版本控制) +- [作者](#作者) +- [鸣谢](#鸣谢) + +### 源码地址 +- 项目文档: https://doc.pandarobot.chat +- 前端-后台管理: https://github.com/ageerle/ruoyi-admin +- 前端-用户端: https://github.com/ageerle/ruoyi-web +- 小程序端: https://github.com/ageerle/ruoyi-uniapp +- 演示地址: https://web.pandarobot.chat +- 后台管理: https://admin.pandarobot.chat +- 用户名: admin 密码:admin123 +- +### gitcode源码地址 +- https://gitcode.com/ageerle/ruoyi-ai +- https://gitcode.com/ageerle/ruoyi-web +- https://gitcode.com/ageerle/ruoyi-admin +- https://gitcode.com/ageerle/ruoyi-uniapp + +### 特色功能 +1. 全套开源系统:提供完整的前端应用、后台管理以及小程序应用,基于MIT协议,开箱即用。 +2. 本地RAG方案:集成Milvus/Weaviate向量库、本地向量化模型与Ollama,实现本地化RAG +3. 丰富插件功能:支持联网、SQL查询插件及Text2API插件,扩展系统能力与应用场景。 +4. 内置SSE、websocket等网络协议,支持对接多种大语言模型,同时还集成了MidJourney和DALLE AI绘画功能 +5. 强大的多媒体功能:支持AI翻译、PPT制作、语音克隆和翻唱等 +6. 扩展功能:支持将大模型接入个人或企业微信 +7. 支付功能:支持易支付、微信支付等多种支付方式 + +### 项目演示 + +#### 后台管理 +
+ drawing + drawing + drawing + drawing +
+ + +#### 用户端 +
+ drawing + drawing + drawing + drawing +
+ +#### 小程序端 +
+ drawing + drawing +
+ +### 开发前的配置要求 + +1. jdk 17 +2. mysql 5.7、8.0 +3. redis 版本必须 >= 5.X +4. maven 3.8+ +5. nodejs 20+ & pnpm + +### 文件目录说明 +RuoYi-AI + +``` +├─ ruoyi-admin // 管理模块 +│ └─ RuoYiApplication // 启动类 +│ └─ RuoYiServletInitializer // 容器部署初始化类 +│ └─ resources // 资源文件 +│ └─ i18n/messages.properties // 国际化配置文件 +│ └─ application.yml // 框架总配置文件 +│ └─ application-dev.yml // 开发环境配置文件 +│ └─ application-prod.yml // 生产环境配置文件 +│ └─ banner.txt // 框架启动图标 +│ └─ logback-plus.xml // 日志配置文件 +│ └─ ip2region.xdb // IP区域地址库 +├─ ruoyi-common // 通用模块 +│ └─ ruoyi-common-bom // common依赖包管理 + └─ ruoyi-common-chat // 聊天模块 +│ └─ ruoyi-common-core // 核心模块 +│ └─ ruoyi-common-doc // 系统接口模块 +│ └─ ruoyi-common-encrypt // 数据加解密模块 +│ └─ ruoyi-common-excel // excel模块 +│ └─ ruoyi-common-idempotent // 幂等功能模块 +│ └─ ruoyi-common-json // 序列化模块 +│ └─ ruoyi-common-log // 日志模块 +│ └─ ruoyi-common-mail // 邮件模块 +│ └─ ruoyi-common-mybatis // 数据库模块 +│ └─ ruoyi-common-oss // oss服务模块 +│ └─ ruoyi-common-pay // 支付模块 +│ └─ ruoyi-common-ratelimiter // 限流功能模块 +│ └─ ruoyi-common-redis // 缓存服务模块 +│ └─ ruoyi-common-satoken // satoken模块 +│ └─ ruoyi-common-security // 安全模块 +│ └─ ruoyi-common-sensitive // 脱敏模块 +│ └─ ruoyi-common-sms // 短信模块 +│ └─ ruoyi-common-tenant // 租户模块 +│ └─ ruoyi-common-translation // 通用翻译模块 +│ └─ ruoyi-common-web // web模块 +├─ ruoyi-modules // 模块组 +│ └─ ruoyi-demo // 演示模块 +│ └─ ruoyi-system // 业务模块 +├─ .run // 执行脚本文件 +├─ .editorconfig // 编辑器编码格式配置 +├─ LICENSE // 开源协议 +├─ pom.xml // 公共依赖 +├─ README.md // 框架说明文件 + + +``` + +### 版本控制 + +该项目使用Git进行版本管理。您可以在repository参看当前可用版本。 + + + +### 版权说明 + +该项目使用了MIT授权许可,详情请参阅 [LICENSE.txt](https://github.com/ageerle/ruoyi-ai/blob/main/LICENSE) + + +### 作者寄语 + +最近,我们的项目意外地受到了广泛关注,甚至被许多人误以为是一个已经成熟且能够快速落地的项目。然而,事实并非如此。这个项目是我个人在业余时间进行的研究,主要目的是学习和探索。它是一个以人工智能(AI)为核心的平台,旨在帮助企业通过配置的方式快速构建AI应用。 + +#### 项目现状 + +目前,项目还处于早期阶段,距离成熟还有很长的路要走。由于个人精力有限,项目的发展速度受到了一定的限制。为了加快项目的进度,我真诚地希望更多人能够参与到项目中来。无论是经验丰富的开发者,还是刚刚入门的小白,我都热烈欢迎你们提交Pull Request(PR)。即使代码修改得很少,或者存在一些错误,都没有关系。我会认真审核每一位贡献者的代码,并和大家一起完善项目。 + +#### 开发计划 + +- 智能体管理 + +通过设置提示词、插件、知识库等,用户可以快速构建一个AI应用。这将极大地简化AI应用的开发流程,降低开发门槛,使更多企业能够轻松地利用AI技术。 +
+ drawing +
+ +- 流程编排 + +通过流程编排功能,用户可以将不同的模型按照业务逻辑进行有序连接。这将解决单一模型能力不足的问题,充分发挥多个模型的协同作用,从而更好地满足企业的复杂业务需求。 + +- 感谢 + +最后,我要感谢RuoYi-Vue-Plus、chatgpt-java、chatgpt-web-midjourney-proxy等优秀框架。正是因为这些项目的开源和共享,我才能够在这个基础上进行开发,使我们的项目能够取得今天的成果。再次感谢这些项目及其背后的开发者们! + +希望更多志同道合的朋友能够加入我们,共同推动这个项目的发展。让我们一起努力,将这个项目打造成一个真正成熟、实用的AI平台! + +#### 如何参与开源项目 + +贡献使开源社区成为一个学习、激励和创造的绝佳场所。你所作的任何贡献都是**非常感谢**的。 + +1. Fork 这个项目 +2. 创建你的功能分支 (`git checkout -b feature/dev`) +3. 提交你的更改 (`git commit -m 'Add some dev'`) +4. 推送到分支 (`git push origin feature/dev`) +5. 打开拉取请求 +6. pr请提交到GitHub上,会定时同步到gitee + +#### 项目文档 +1. 项目文档基于vitepress构建 +2. 按照[如何参与开源项目](#如何参与开源项目)拉取 https://github.com/ageerle/ruoyi-doc +3. 安装依赖:npm install +4. 启动项目:npm run docs:dev +5. 主页路径:docs/guide/introduction/index.md + +### 鸣谢 +- [chatgpt-java](https://github.com/Grt1228/chatgpt-java) +- [RuoYi-Vue-Plus](https://gitee.com/dromara/RuoYi-Vue-Plus) +- [chatgpt-web-midjourney-proxy](https://github.com/Dooy/chatgpt-web-midjourney-proxy) +- [Vben Admin](https://github.com/vbenjs/vue-vben-admin) +- [Naive UI](https://www.naiveui.com) + + +[your-project-path]:https://github.com/ageerle/ruoyi-ai +[contributors-shield]: https://img.shields.io/github/contributors/ageerle/ruoyi-ai.svg?style=flat-square +[contributors-url]: https://github.com/ageerle/ruoyi-ai/graphs/contributors +[forks-shield]: https://img.shields.io/github/forks/ageerle/ruoyi-ai.svg?style=flat-square +[forks-url]: https://github.com/ageerle/ruoyi-ai/network/members +[stars-shield]: https://img.shields.io/github/stars/ageerle/ruoyi-ai.svg?style=flat-square +[stars-url]: https://github.com/ageerle/ruoyi-ai/stargazers +[issues-shield]: https://img.shields.io/github/issues/ageerle/ruoyi-ai.svg?style=flat-square +[issues-url]: https://img.shields.io/github/issues/ageerle/ruoyi-ai.svg +[license-shield]: https://img.shields.io/github/license/ageerle/ruoyi-ai.svg?style=flat-square +[license-url]: https://github.com/ageerle/ruoyi-ai/blob/master/LICENSE.txt +[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555 + + + diff --git a/aibidding-admin/Dockerfile b/aibidding-admin/Dockerfile new file mode 100644 index 0000000..94de4d6 --- /dev/null +++ b/aibidding-admin/Dockerfile @@ -0,0 +1,35 @@ +#基础镜像 +FROM findepi/graalvm:java17-native + +# 设置环境变量 +ENV LANG C.UTF-8 +ENV LANGUAGE C.UTF-8 +ENV LC_ALL C.UTF-8 +ENV SERVER_PORT=6039 + +MAINTAINER ageerle + +RUN mkdir -p /aibidding/server/logs \ + /aibidding/server/temp \ + /aibidding/skywalking/agent + + +#工作空间 +WORKDIR /ruoyi/server + + + +EXPOSE ${SERVER_PORT} + +ADD ./target/ruoyi-admin.jar ./app.jar + + +ENTRYPOINT ["java", \ + "-Djava.security.egd=file:/dev/./urandom", \ + "-Dserver.port=${SERVER_PORT}", \ + # 应用名称 如果想区分集群节点监控 改成不同的名称即可 +# "-Dskywalking.agent.service_name=aibidding-server", \ +# "-javaagent:/aibidding/skywalking/agent/skywalking-agent.jar", \ + "-jar", "app.jar"] + + diff --git a/aibidding-admin/pom.xml b/aibidding-admin/pom.xml new file mode 100644 index 0000000..b77047c --- /dev/null +++ b/aibidding-admin/pom.xml @@ -0,0 +1,129 @@ + + + + ruoyi-ai + org.ruoyi + ${revision} + ../pom.xml + + 4.0.0 + jar + aibidding-admin + + + web服务入口 + + + + + + + com.mysql + mysql-connector-j + + + + + com.oracle.database.jdbc + ojdbc8 + + + + + org.postgresql + postgresql + + + + + com.microsoft.sqlserver + mssql-jdbc + + + + org.ruoyi + aibidding-common-doc + + + + org.ruoyi + aibidding-system + + + + org.ruoyi + aibidding-fusion + + + + org.ruoyi + aibidding-knowledge + + + + org.ruoyi + aibidding-generator + + + + + org.ruoyi + aibidding-demo + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + net.coobird + thumbnailator + 0.4.11 + + + io.github.ollama4j + ollama4j + 1.0.79 + compile + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven-jar-plugin.version} + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + false + ${project.artifactId} + + + + + + diff --git a/aibidding-admin/src/main/java/org/aibidding/RuoYiAIApplication.java b/aibidding-admin/src/main/java/org/aibidding/RuoYiAIApplication.java new file mode 100644 index 0000000..ba6b329 --- /dev/null +++ b/aibidding-admin/src/main/java/org/aibidding/RuoYiAIApplication.java @@ -0,0 +1,21 @@ +package org.aibidding; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; + +/** + * 启动程序 + * + * @author Lion Li + */ +@SpringBootApplication +public class RuoYiAIApplication { + + public static void main(String[] args) { + SpringApplication application = new SpringApplication(RuoYiAIApplication.class); + application.setApplicationStartup(new BufferingApplicationStartup(2048)); + application.run(args); + System.out.println("(♥◠‿◠)ノ゙ AIBidding2.0系统启动成功 ლ(´ڡ`ლ)゙"); + } +} diff --git a/aibidding-admin/src/main/java/org/aibidding/RuoYiAIServletInitializer.java b/aibidding-admin/src/main/java/org/aibidding/RuoYiAIServletInitializer.java new file mode 100644 index 0000000..e313ef3 --- /dev/null +++ b/aibidding-admin/src/main/java/org/aibidding/RuoYiAIServletInitializer.java @@ -0,0 +1,18 @@ +package org.aibidding; + +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +/** + * web容器中进行部署 + * + * @author Lion Li + */ +public class RuoYiAIServletInitializer extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(RuoYiAIApplication.class); + } + +} diff --git a/aibidding-admin/src/main/java/org/aibidding/controller/AuthController.java b/aibidding-admin/src/main/java/org/aibidding/controller/AuthController.java new file mode 100644 index 0000000..24cccad --- /dev/null +++ b/aibidding-admin/src/main/java/org/aibidding/controller/AuthController.java @@ -0,0 +1,174 @@ +package org.aibidding.controller; + +import cn.dev33.satoken.annotation.SaIgnore; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.json.JSONUtil; +import me.chanjar.weixin.common.error.WxErrorException; +import org.aibidding.common.core.constant.Constants; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.domain.model.EmailLoginBody; +import org.aibidding.common.core.domain.model.LoginBody; +import org.aibidding.common.core.domain.model.RegisterBody; +import org.aibidding.common.core.domain.model.SmsLoginBody; +import org.aibidding.common.core.domain.model.VisitorLoginBody; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StreamUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.common.tenant.helper.TenantHelper; +import org.aibidding.system.domain.bo.SysTenantBo; +import org.aibidding.system.domain.vo.LoginTenantVo; +import org.aibidding.system.domain.vo.SysTenantVo; +import org.aibidding.system.domain.vo.TenantListVo; +import org.aibidding.system.service.ISysTenantService; + +import org.aibidding.system.service.SysLoginService; +import org.aibidding.system.service.SysRegisterService; +import org.aibidding.system.domain.vo.LoginVo; + +import jakarta.servlet.http.HttpServletRequest; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.net.URL; +import java.util.List; + +/** + * 认证 + * + * @author Lion Li + */ +@SaIgnore +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/auth") +public class AuthController { + + private final SysLoginService loginService; + private final SysRegisterService registerService; + private final ISysTenantService tenantService; + + + @PostMapping("/xcxLogin") + public R login(@Validated @RequestBody String xcxCode) throws WxErrorException { + + String openidFromCode = loginService.getOpenidFromCode((String) JSONUtil.parseObj(xcxCode).get("xcxCode")); + LoginVo loginVo = loginService.mpLogin(openidFromCode); + return R.ok(loginVo); + } + + /** + * 登录方法 + * + * @param body 登录信息 + * @return 结果 + */ + @PostMapping("/login") + public R login(@Validated @RequestBody LoginBody body) { + body.setTenantId(Constants.TENANT_ID); + LoginVo loginVo = new LoginVo(); + // 生成令牌 + String token = loginService.login( + body.getTenantId(), + body.getUsername(), body.getPassword(), + body.getCode(), body.getUuid()); + loginVo.setToken(token); + loginVo.setUserInfo(LoginHelper.getLoginUser()); + return R.ok(loginVo); + } + + /** + * 短信登录 + * + * @param body 登录信息 + * @return 结果 + */ + @PostMapping("/smsLogin") + public R smsLogin(@Validated @RequestBody SmsLoginBody body) { + LoginVo loginVo = new LoginVo(); + // 生成令牌 + String token = loginService.smsLogin(body.getTenantId(), body.getPhonenumber(), body.getSmsCode()); + loginVo.setToken(token); + return R.ok(loginVo); + } + + /** + * 访客登录 + * + * @param loginBody 登录信息 + * @return token信息 + */ + @PostMapping("/visitorLogin") + public R visitorLogin(@RequestBody VisitorLoginBody loginBody) { + LoginVo loginVo = new LoginVo(); + return R.ok(loginVo); + } + + /** + * 邮件登录 + * + * @param body 登录信息 + * @return 结果 + */ + @PostMapping("/emailLogin") + public R emailLogin(@Validated @RequestBody EmailLoginBody body) { + LoginVo loginVo = new LoginVo(); + // 生成令牌 + String token = loginService.emailLogin(body.getTenantId(), body.getEmail(), body.getEmailCode()); + loginVo.setToken(token); + return R.ok(loginVo); + } + + /** + * 退出登录 + */ + @PostMapping("/logout") + public R logout() { + loginService.logout(); + return R.ok("退出成功"); + } + + /** + * 用户注册 + */ + @PostMapping("/register") + public R register(@Validated @RequestBody RegisterBody user, HttpServletRequest request) { + String domainName = request.getServerName(); + user.setDomainName(domainName); + registerService.register(user); + return R.ok(); + } + + /** + * 重置密码 + */ + @PostMapping("/reset/password") + @SaIgnore + public R resetPassWord(@Validated @RequestBody RegisterBody user) { + registerService.resetPassWord(user); + return R.ok(); + } + + /** + * 登录页面租户下拉框 + * + * @return 租户列表 + */ + @GetMapping("/tenant/list") + public R tenantList(HttpServletRequest request) throws Exception { + List tenantList = tenantService.queryList(new SysTenantBo()); + List voList = MapstructUtils.convert(tenantList, TenantListVo.class); + // 获取域名 + String host = new URL(request.getRequestURL().toString()).getHost(); + // 根据域名进行筛选 + List list = StreamUtils.filter(voList, vo -> StringUtils.equals(vo.getDomain(), host)); + // 返回对象 + LoginTenantVo vo = new LoginTenantVo(); + vo.setVoList(CollUtil.isNotEmpty(list) ? list : voList); + vo.setTenantEnabled(TenantHelper.isEnable()); + return R.ok(vo); + } + +} diff --git a/aibidding-admin/src/main/java/org/aibidding/controller/CaptchaController.java b/aibidding-admin/src/main/java/org/aibidding/controller/CaptchaController.java new file mode 100644 index 0000000..4ab4bbc --- /dev/null +++ b/aibidding-admin/src/main/java/org/aibidding/controller/CaptchaController.java @@ -0,0 +1,152 @@ +package org.aibidding.controller; + +import cn.dev33.satoken.annotation.SaIgnore; +import cn.hutool.captcha.AbstractCaptcha; +import cn.hutool.captcha.generator.CodeGenerator; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.RandomUtil; +import org.aibidding.common.core.constant.Constants; +import org.aibidding.common.core.constant.GlobalConstants; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.service.ConfigService; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.core.utils.reflect.ReflectUtils; +import org.aibidding.common.mail.utils.MailUtils; +import org.aibidding.common.redis.utils.RedisUtils; +import org.aibidding.common.sms.config.properties.SmsProperties; +import org.aibidding.common.sms.core.SmsTemplate; +import org.aibidding.common.sms.entity.SmsResult; +import org.aibidding.common.web.config.properties.CaptchaProperties; +import org.aibidding.common.web.enums.CaptchaType; +import org.aibidding.system.domain.request.EmailRequest; +import org.aibidding.system.domain.vo.CaptchaVo; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.expression.Expression; +import org.springframework.expression.ExpressionParser; +import org.springframework.expression.spel.standard.SpelExpressionParser; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import java.time.Duration; +import java.util.*; + +/** + * 验证码操作处理 + * + * @author Lion Li + */ +@SaIgnore +@Slf4j +@Validated +@RequiredArgsConstructor +@RestController +public class CaptchaController { + + private final CaptchaProperties captchaProperties; + private final SmsProperties smsProperties; + private final ConfigService configService; + + /** + * 短信验证码 + * + * @param phonenumber 用户手机号 + */ + @GetMapping("/resource/sms/code") + public R smsCode(@NotBlank(message = "{user.phonenumber.not.blank}") String phonenumber) { + if (!smsProperties.getEnabled()) { + return R.fail("当前系统没有开启短信功能!"); + } + String key = GlobalConstants.CAPTCHA_CODE_KEY + phonenumber; + String code = RandomUtil.randomNumbers(4); + RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION)); + // 验证码模板id 自行处理 (查数据库或写死均可) + String templateId = ""; + Map map = new HashMap<>(1); + map.put("code", code); + SmsTemplate smsTemplate = SpringUtils.getBean(SmsTemplate.class); + SmsResult result = smsTemplate.send(phonenumber, templateId, map); + if (!result.isSuccess()) { + log.error("验证码短信发送异常 => {}", result); + return R.fail(result.getMessage()); + } + return R.ok(); + } + + /** + * 邮箱验证码 + * + * @param emailRequest 用户邮箱 + */ + @PostMapping("/resource/email/code") + public R emailCode(@RequestBody @Valid EmailRequest emailRequest) { + String key = GlobalConstants.CAPTCHA_CODE_KEY + emailRequest.getUsername(); + String code = RandomUtil.randomNumbers(4); + RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION)); + // 检验邮箱后缀 + String suffix = configService.getConfigValue("mail", "suffix"); + String prompt = configService.getConfigValue("mail", "prompt"); + if(StringUtils.isNotEmpty(suffix)){ + // 动态的域名列表 + String[] invalidDomains = suffix.split(","); + for (String domain : invalidDomains) { + if (emailRequest.getUsername().endsWith(domain)) { + throw new ServiceException(prompt); + } + } + } + // 自定义邮箱模板 + String model = configService.getConfigValue("mail", "mailModel"); + String mailTitle = configService.getConfigValue("mail", "mailTitle"); + String replacedModel = model.replace("{code}", code); + try { + MailUtils.sendHtml(emailRequest.getUsername(), mailTitle, replacedModel); + } catch (Exception e) { + log.error("邮箱验证码发送异常 => {}", e.getMessage()); + return R.fail(e.getMessage()); + } + return R.ok(); + } + + /** + * 生成验证码 + */ + @GetMapping("/auth/code") + public R getCode() { + CaptchaVo captchaVo = new CaptchaVo(); + boolean captchaEnabled = captchaProperties.getEnable(); + if (!captchaEnabled) { + captchaVo.setCaptchaEnabled(false); + return R.ok(captchaVo); + } + // 保存验证码信息 + String uuid = IdUtil.simpleUUID(); + String verifyKey = GlobalConstants.CAPTCHA_CODE_KEY + uuid; + // 生成验证码 + CaptchaType captchaType = captchaProperties.getType(); + boolean isMath = CaptchaType.MATH == captchaType; + Integer length = isMath ? captchaProperties.getNumberLength() : captchaProperties.getCharLength(); + CodeGenerator codeGenerator = ReflectUtils.newInstance(captchaType.getClazz(), length); + AbstractCaptcha captcha = SpringUtils.getBean(captchaProperties.getCategory().getClazz()); + captcha.setGenerator(codeGenerator); + captcha.createCode(); + String code = captcha.getCode(); + if (isMath) { + ExpressionParser parser = new SpelExpressionParser(); + Expression exp = parser.parseExpression(StringUtils.remove(code, "=")); + code = exp.getValue(String.class); + } + RedisUtils.setCacheObject(verifyKey, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION)); + captchaVo.setUuid(uuid); + captchaVo.setImg(captcha.getImageBase64()); + return R.ok(captchaVo); + } + +} diff --git a/aibidding-admin/src/main/java/org/aibidding/controller/IndexController.java b/aibidding-admin/src/main/java/org/aibidding/controller/IndexController.java new file mode 100644 index 0000000..8607d2f --- /dev/null +++ b/aibidding-admin/src/main/java/org/aibidding/controller/IndexController.java @@ -0,0 +1,26 @@ +package org.aibidding.controller; + +import cn.dev33.satoken.annotation.SaIgnore; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 首页 + * + * @author Lion Li + */ +@SaIgnore +@RequiredArgsConstructor +@RestController +public class IndexController { + + /** + * 访问首页,提示语 + */ + @GetMapping("/") + public String index() { + return "RuoYi-AI 启动成功"; + } + +} diff --git a/aibidding-admin/src/main/java/org/aibidding/controller/KnowledgeController.java b/aibidding-admin/src/main/java/org/aibidding/controller/KnowledgeController.java new file mode 100644 index 0000000..d7446e5 --- /dev/null +++ b/aibidding-admin/src/main/java/org/aibidding/controller/KnowledgeController.java @@ -0,0 +1,208 @@ +package org.aibidding.controller; + +import cn.dev33.satoken.stp.StpUtil; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.chat.config.ChatConfig; +import org.aibidding.common.chat.domain.request.ChatRequest; +import org.aibidding.common.chat.entity.chat.ChatCompletion; +import org.aibidding.common.chat.entity.chat.Message; +import org.aibidding.common.chat.openai.OpenAiStreamClient; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.knowledge.domain.bo.KnowledgeAttachBo; +import org.aibidding.knowledge.domain.bo.KnowledgeFragmentBo; +import org.aibidding.knowledge.domain.bo.KnowledgeInfoBo; +import org.aibidding.knowledge.domain.req.KnowledgeInfoUploadRequest; +import org.aibidding.knowledge.domain.vo.KnowledgeAttachVo; +import org.aibidding.knowledge.domain.vo.KnowledgeFragmentVo; +import org.aibidding.knowledge.domain.vo.KnowledgeInfoVo; +import org.aibidding.knowledge.service.EmbeddingService; +import org.aibidding.knowledge.service.IKnowledgeAttachService; +import org.aibidding.knowledge.service.IKnowledgeFragmentService; +import org.aibidding.knowledge.service.IKnowledgeInfoService; +import org.aibidding.system.listener.SSEEventSourceListener; +import org.aibidding.system.service.ISseService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.aibidding.knowledge.chain.vectorstore.VectorStore; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; + +import java.util.List; + + +/** + * 知识库 + * + * @author Lion Li + * @date 2024-10-21 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/knowledge") +public class KnowledgeController extends BaseController { + + private final IKnowledgeInfoService knowledgeInfoService; + + private final VectorStore vectorStore; + + private final IKnowledgeAttachService attachService; + + private final IKnowledgeFragmentService fragmentService; + + private final EmbeddingService embeddingService; + + private OpenAiStreamClient openAiStreamClient; + + private final ChatConfig chatConfig; + + private final ISseService sseService; + + /** + * 知识库对话 + */ + @PostMapping("/send") + public SseEmitter send(@RequestBody @Valid ChatRequest chatRequest) { + + openAiStreamClient = chatConfig.getOpenAiStreamClient(); + SseEmitter sseEmitter = new SseEmitter(0L); + SSEEventSourceListener openAIEventSourceListener = new SSEEventSourceListener(sseEmitter); + List messages = chatRequest.getMessages(); + String content = messages.get(messages.size() - 1).getContent().toString(); + List nearestList; + List queryVector = embeddingService.getQueryVector(content, chatRequest.getKid()); + nearestList = vectorStore.nearest(queryVector,chatRequest.getKid()); + for (String prompt : nearestList) { + Message sysMessage = Message.builder().content(prompt).role(Message.Role.USER).build(); + messages.add(sysMessage); + } + Message userMessage = Message.builder().content(content + (nearestList.size() > 0 ? "\n\n注意:回答问题时,须严格根据我给你的系统上下文内容原文进行回答,请不要自己发挥,回答时保持原来文本的段落层级" : "") ).role(Message.Role.USER).build(); + messages.add(userMessage); + if (chatRequest.getModel().startsWith("ollama")) { + return sseService.ollamaChat(chatRequest); + } + + ChatCompletion completion = ChatCompletion + .builder() + .messages(messages) + .model(chatRequest.getModel()) + .temperature(chatRequest.getTemperature()) + .topP(chatRequest.getTop_p()) + .stream(true) + .build(); + openAiStreamClient.streamChatCompletion(completion, openAIEventSourceListener); + + return sseEmitter; + } + + /** + * 根据用户信息查询本地知识库 + */ + @GetMapping("/list") + public TableDataInfo list(KnowledgeInfoBo bo, PageQuery pageQuery) { + if(!StpUtil.isLogin()){ + return null; + } + bo.setUid(LoginHelper.getUserId()); + return knowledgeInfoService.queryPageList(bo, pageQuery); + } + + /** + * 新增知识库 + */ + @Log(title = "知识库", businessType = BusinessType.INSERT) + @PostMapping("/save") + public R save(@Validated(AddGroup.class) @RequestBody KnowledgeInfoBo bo) { + knowledgeInfoService.saveOne(bo); + return R.ok(); + } + + /** + * 删除知识库 + */ + @PostMapping("/remove/{id}") + public R remove(@PathVariable String id){ + knowledgeInfoService.removeKnowledge(id); + return R.ok("删除知识库成功!"); + } + + /** + * 修改知识库 + */ + @Log(title = "知识库", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + public R edit( @RequestBody KnowledgeInfoBo bo) { + return toAjax(knowledgeInfoService.updateByBo(bo)); + } + + /** + * 导出知识库列表 + */ + @Log(title = "知识库", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(KnowledgeInfoBo bo, HttpServletResponse response) { + List list = knowledgeInfoService.queryList(bo); + ExcelUtil.exportExcel(list, "知识库", KnowledgeInfoVo.class, response); + } + + /** + * 查询知识附件信息 + */ + @GetMapping("/detail/{kid}") + public TableDataInfo attach(KnowledgeAttachBo bo, PageQuery pageQuery,@PathVariable String kid){ + bo.setKid(kid); + return attachService.queryPageList(bo, pageQuery); + } + + /** + * 上传知识库附件 + */ + @PostMapping(value = "/attach/upload") + public R upload(KnowledgeInfoUploadRequest request){ + knowledgeInfoService.upload(request); + return R.ok("上传知识库附件成功!"); + } + + /** + * 获取知识库附件详细信息 + * + * @param id 主键 + */ + @GetMapping("attach/info/{id}") + public R getAttachInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(attachService.queryById(id)); + } + + /** + * 删除知识库附件 + * + */ + @PostMapping("attach/remove/{docId}") + public R removeAttach(@NotEmpty(message = "主键不能为空") @PathVariable String docId) { + attachService.removeKnowledgeAttach(docId); + return R.ok(); + } + + + /** + * 查询知识片段 + */ + @GetMapping("/fragment/list/{docId}") + public TableDataInfo fragmentList(KnowledgeFragmentBo bo, PageQuery pageQuery, @PathVariable String docId) { + bo.setDocId(docId); + return fragmentService.queryPageList(bo, pageQuery); + } + +} diff --git a/aibidding-admin/src/main/resources/application-dev.yml b/aibidding-admin/src/main/resources/application-dev.yml new file mode 100644 index 0000000..ad6468b --- /dev/null +++ b/aibidding-admin/src/main/resources/application-dev.yml @@ -0,0 +1,99 @@ +--- # 监控中心配置 +spring.boot.admin.client: + # 增加客户端开关 + enabled: false + url: http://localhost:9090/admin + instance: + service-host-type: IP + username: aibidding + password: 123456 + +--- # 数据源配置 +spring: + datasource: + type: com.zaxxer.hikari.HikariDataSource + # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content + dynamic: + # 性能分析插件(有性能损耗 不建议生产环境使用) + p6spy: true + # 设置默认的数据源或者数据源组,默认值即为 master + primary: master + # 严格模式 匹配不到数据源则报错 + strict: true + datasource: + # 主库数据源 + master: + type: ${spring.datasource.type} + driverClassName: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true + username: ry-vue + password: hTMeGJdpfLrLCwWD + + + hikari: + # 最大连接池数量 + maxPoolSize: 20 + # 最小空闲线程数量 + minIdle: 10 + # 配置获取连接等待超时的时间 + connectionTimeout: 30000 + # 校验超时时间 + validationTimeout: 5000 + # 空闲连接存活最大时间,默认10分钟 + idleTimeout: 600000 + # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟 + maxLifetime: 1800000 + # 连接测试query(配置检测连接是否有效) + connectionTestQuery: SELECT 1 + # 多久检查一次连接的活性 + keepaliveTime: 30000 + +--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉) +spring.data: + redis: + # 地址 + host: 127.0.0.1 + # 端口,默认为6379 + port: 6379 + # 数据库索引 + database: 0 + # 密码(如没有密码请注释掉) + # password: 123456 + # 连接超时时间 + timeout: 10S + # 是否开启ssl + ssl: false + +redisson: + # redis key前缀 + keyPrefix: + # 线程池数量 + threads: 4 + # Netty线程池数量 + nettyThreads: 8 + # 单节点配置 + singleServerConfig: + # 客户端名称 + clientName: ${ruoyi.name} + # 最小空闲连接数 + connectionMinimumIdleSize: 8 + # 连接池大小 + connectionPoolSize: 32 + # 连接空闲超时,单位:毫秒 + idleConnectionTimeout: 10000 + # 命令等待超时,单位:毫秒 + timeout: 3000 + # 发布和订阅连接池大小 + subscriptionConnectionPoolSize: 50 + +--- # sms 短信 +sms: + enabled: false + # 阿里云 dysmsapi.aliyuncs.com + # 腾讯云 sms.tencentcloudapi.com + endpoint: "dysmsapi.aliyuncs.com" + accessKeyId: xxxxxxx + accessKeySecret: xxxxxx + signName: 测试 + # 腾讯专用 + sdkAppId: diff --git a/aibidding-admin/src/main/resources/application-prod.yml b/aibidding-admin/src/main/resources/application-prod.yml new file mode 100644 index 0000000..22efdf6 --- /dev/null +++ b/aibidding-admin/src/main/resources/application-prod.yml @@ -0,0 +1,174 @@ +--- # 临时文件存储位置 避免临时文件被系统清理报错 +spring.servlet.multipart.location: /ruoyi/server/temp + +--- # 监控中心配置 +spring.boot.admin.client: + # 增加客户端开关 + enabled: false + url: http://localhost:9090/admin + instance: + service-host-type: IP + username: aibidding + password: 123456 + +--- # xxl-job 配置 +xxl.job: + # 执行器开关 + enabled: false + # 调度中心地址:如调度中心集群部署存在多个地址则用逗号分隔。 + admin-addresses: http://localhost:9100/xxl-job-admin + # 执行器通讯TOKEN:非空时启用 + access-token: xxl-job + executor: + # 执行器AppName:执行器心跳注册分组依据;为空则关闭自动注册 + appname: xxl-job-executor + # 执行器端口号 执行器从9101开始往后写 + port: 9101 + # 执行器注册:默认IP:PORT + address: + # 执行器IP:默认自动获取IP + ip: + # 执行器运行日志文件存储磁盘路径 + logpath: ./logs/xxl-job + # 执行器日志文件保存天数:大于3生效 + logretentiondays: 30 + +--- # 数据源配置 +spring: + datasource: + type: com.zaxxer.hikari.HikariDataSource + # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content + dynamic: + # 性能分析插件(有性能损耗 不建议生产环境使用) + p6spy: false + # 设置默认的数据源或者数据源组,默认值即为 master + primary: master + # 严格模式 匹配不到数据源则报错 + strict: true + datasource: + # 主库数据源 + master: + type: ${spring.datasource.type} + driverClassName: com.mysql.cj.jdbc.Driver + # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 + # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) + url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true + username: root + password: root + # 从库数据源 + slave: + lazy: true + type: ${spring.datasource.type} + driverClassName: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true + username: + password: +# oracle: +# type: ${spring.datasource.type} +# driverClassName: oracle.jdbc.OracleDriver +# url: jdbc:oracle:thin:@//localhost:1521/XE +# username: ROOT +# password: root +# hikari: +# connectionTestQuery: SELECT 1 FROM DUAL +# postgres: +# type: ${spring.datasource.type} +# driverClassName: org.postgresql.Driver +# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true +# username: root +# password: root +# sqlserver: +# type: ${spring.datasource.type} +# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver +# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true +# username: SA +# password: root + hikari: + # 最大连接池数量 + maxPoolSize: 20 + # 最小空闲线程数量 + minIdle: 10 + # 配置获取连接等待超时的时间 + connectionTimeout: 30000 + # 校验超时时间 + validationTimeout: 5000 + # 空闲连接存活最大时间,默认10分钟 + idleTimeout: 600000 + # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟 + maxLifetime: 1800000 + # 连接测试query(配置检测连接是否有效) + connectionTestQuery: SELECT 1 + # 多久检查一次连接的活性 + keepaliveTime: 30000 + +--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉) +spring.data: + redis: + # 地址 + host: localhost + # 端口,默认为6379 + port: 6379 + # 数据库索引 + database: 0 + # 密码(如没有密码请注释掉) + # password: + # 连接超时时间 + timeout: 10s + # 是否开启ssl + ssl: false + +redisson: + # redis key前缀 + keyPrefix: + # 线程池数量 + threads: 16 + # Netty线程池数量 + nettyThreads: 32 + # 单节点配置 + singleServerConfig: + # 客户端名称 + clientName: ${ruoyi.name} + # 最小空闲连接数 + connectionMinimumIdleSize: 32 + # 连接池大小 + connectionPoolSize: 64 + # 连接空闲超时,单位:毫秒 + idleConnectionTimeout: 10000 + # 命令等待超时,单位:毫秒 + timeout: 3000 + # 发布和订阅连接池大小 + subscriptionConnectionPoolSize: 50 + +--- # mail 邮件发送 +mail: + enabled: false + host: smtp.163.com + port: 465 + # 是否需要用户名密码验证 + auth: true + # 发送方,遵循RFC-822标准 + from: xxx@163.com + # 用户名(注意:如果使用foxmail邮箱,此处user为qq号) + user: xxx@163.com + # 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助) + pass: xxxxxxxxxx + # 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。 + starttlsEnable: true + # 使用SSL安全连接 + sslEnable: true + # SMTP超时时长,单位毫秒,缺省值不超时 + timeout: 0 + # Socket连接超时值,单位毫秒,缺省值不超时 + connectionTimeout: 0 + +--- # sms 短信 +sms: + enabled: false + # 阿里云 dysmsapi.aliyuncs.com + # 腾讯云 sms.tencentcloudapi.com + endpoint: "dysmsapi.aliyuncs.com" + accessKeyId: xxxxxxx + accessKeySecret: xxxxxx + signName: 测试 + # 腾讯专用 + sdkAppId: diff --git a/aibidding-admin/src/main/resources/application.yml b/aibidding-admin/src/main/resources/application.yml new file mode 100644 index 0000000..1784c09 --- /dev/null +++ b/aibidding-admin/src/main/resources/application.yml @@ -0,0 +1,322 @@ + +# 项目相关配置 +ruoyi: + # 名称 + name: "ruoyi" + # 版本 + version: ${revision} + # 版权年份 + copyrightYear: 2025 + # 实例演示开关 + demoEnabled: true + # 获取ip地址开关 + addressEnabled: false + +captcha: + enable: false + # 页面 <参数设置> 可开启关闭 验证码校验 + # 验证码类型 math 数组计算 char 字符验证 + type: MATH + # line 线段干扰 circle 圆圈干扰 shear 扭曲干扰 + category: CIRCLE + # 数字验证码位数 + numberLength: 1 + # 字符验证码长度 + charLength: 4 + +# 开发环境配置 +server: + # 服务器的HTTP端口,默认为8080 + port: 6039 + servlet: + # 应用的访问路径 + context-path: / + # undertow 配置 + undertow: + # HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的 + max-http-post-size: -1 + # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理 + # 每块buffer的空间大小,越小的空间被利用越充分 + buffer-size: 512 + # 是否分配的直接内存 + direct-buffers: true + threads: + # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程 + io: 8 + # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载 + worker: 256 + +# 日志配置 +logging: + level: + org.ruoyi: @logging.level@ + org.springframework: warn + config: classpath:logback-plus.xml + +# 用户配置 +user: + password: + # 密码最大错误次数 + maxRetryCount: 5 + # 密码锁定时间(默认10分钟) + lockTime: 10 + +# Spring配置 +spring: + application: + name: ${ruoyi.name} + # 资源信息 + messages: + # 国际化资源文件路径 + basename: i18n/messages + profiles: + active: @profiles.active@ + # 文件上传 + servlet: + multipart: + # 单个文件大小 + max-file-size: 50MB + # 设置总上传的文件大小 + max-request-size: 200MB + mvc: + format: + date-time: yyyy-MM-dd HH:mm:ss + jackson: + # 日期格式化 + date-format: yyyy-MM-dd HH:mm:ss + serialization: + # 格式化输出 + indent_output: false + # 忽略无法转换的对象 + fail_on_empty_beans: false + deserialization: + # 允许对象忽略json中不存在的属性 + fail_on_unknown_properties: false + +# Sa-Token配置 +sa-token: + # token名称 (同时也是cookie名称) + token-name: Authorization + # token有效期 设为7天 (必定过期) 单位: 秒 + timeout: 604800 + # token临时有效期 (指定时间无操作就过期) 单位: 秒 + activity-timeout: 604800 + # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) + is-concurrent: true + # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token) + is-share: false + # 是否尝试从header里读取token + is-read-header: true + # 是否尝试从cookie里读取token + is-read-cookie: false + # token前缀 + token-prefix: "Bearer" + # jwt秘钥 + jwt-secret-key: abcdefghijklmnopqrstuvwxyz + +# security配置 +security: + # 排除路径 + excludes: + # 支付回调 + - /pay/returnUrl + - /pay/notifyUrl + # 上传文件 + - /resource/oss/upload + # 重置密码 + - /auth/reset/password + # 聊天接口 + - /chat + # 静态资源 + - /*.html + - /**/*.html + - /**/*.css + - /**/*.js + # 公共路径 + - /favicon.ico + - /error + # swagger 文档配置 + - /*/api-docs + - /*/api-docs/** + # actuator 监控配置 + - /actuator + - /actuator/** +# 多租户配置 +tenant: + # 是否开启 + enable: false + # 排除表 + excludes: + - sys_menu + - sys_tenant + - sys_tenant_package + - sys_role_dept + - sys_role_menu + - sys_user_post + - sys_user_role + +# MyBatisPlus配置 +# https://baomidou.com/config/ +mybatis-plus: + # 不支持多包, 如有需要可在注解配置 或 提升扫包等级 + # 例如 com.**.**.mapper + mapperPackage: org.aibidding.**.mapper + # 对应的 XML 文件位置 + mapperLocations: classpath*:mapper/**/*Mapper.xml + # 实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: org.ruoyi.**.domain + # 启动时是否检查 MyBatis XML 文件的存在,默认不检查 + checkConfigLocation: false + configuration: + # 自动驼峰命名规则(camel case)映射 + mapUnderscoreToCamelCase: true + # MyBatis 自动映射策略 + # NONE:不启用 PARTIAL:只对非嵌套 resultMap 自动映射 FULL:对所有 resultMap 自动映射 + autoMappingBehavior: FULL + # MyBatis 自动映射时未知列或未知属性处理策 + # NONE:不做处理 WARNING:打印相关警告 FAILING:抛出异常和详细信息 + autoMappingUnknownColumnBehavior: NONE + # 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl + # 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl + # 默认日志输出 org.apache.ibatis.logging.slf4j.Slf4jImpl + logImpl: org.apache.ibatis.logging.nologging.NoLoggingImpl + global-config: + # 是否打印 Logo banner + banner: true + dbConfig: + # 主键类型 + # AUTO 自增 NONE 空 INPUT 用户输入 ASSIGN_ID 雪花 ASSIGN_UUID 唯一 UUID + idType: ASSIGN_ID + # 逻辑已删除值 + logicDeleteValue: 2 + # 逻辑未删除值 + logicNotDeleteValue: 0 + # 字段验证策略之 insert,在 insert 的时候的字段验证策略 + # IGNORED 忽略 NOT_NULL 非NULL NOT_EMPTY 非空 DEFAULT 默认 NEVER 不加入 SQL + insertStrategy: NOT_NULL + # 字段验证策略之 update,在 update 的时候的字段验证策略 + updateStrategy: NOT_NULL + # 字段验证策略之 select,在 select 的时候的字段验证策略既 wrapper 根据内部 entity 生成的 where 条件 + where-strategy: NOT_NULL + +# 数据加密 +mybatis-encryptor: + # 是否开启加密 + enable: false + # 默认加密算法 + algorithm: BASE64 + # 编码方式 BASE64/HEX。默认BASE64 + encode: BASE64 + # 安全秘钥 对称算法的秘钥 如:AES,SM4 + password: + # 公私钥 非对称算法的公私钥 如:SM2,RSA + publicKey: + privateKey: + +# Swagger配置 +swagger: + info: + # 标题 + title: '标题:${ruoyi.name}多租户管理系统_接口文档' + # 描述 + description: '描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...' + # 版本 + version: '版本号: ${ruoyi.version}' + # 作者信息 + contact: + name: ageerle + email: ageerle@163.com + url: https://gitee.com/ageerle/ruoyi-ai + components: + # 鉴权方式配置 + security-schemes: + apiKey: + type: APIKEY + in: HEADER + name: ${sa-token.token-name} + +springdoc: + api-docs: + # 是否开启接口文档 + enabled: true + swagger-ui: + # 持久化认证数据 + persistAuthorization: true + #这里定义了两个分组,可定义多个,也可以不定义 + group-configs: + - group: 1.演示模块 + packages-to-scan: org.ruoyi.demo + - group: 2.通用模块 + packages-to-scan: org.ruoyi.web + - group: 3.系统模块 + packages-to-scan: org.ruoyi.system + - group: 4.代码生成模块 + packages-to-scan: org.ruoyi.generator + +# 防止XSS攻击 +xss: + # 过滤开关 + enabled: true + # 排除链接(多个用逗号分隔) + excludes: /system/notice + # 匹配链接 + urlPatterns: /system/*,/monitor/*,/tool/* + +# 全局线程池相关配置 +thread-pool: + # 是否开启线程池 + enabled: false + # 队列最大长度 + queueCapacity: 128 + # 线程池维护线程所允许的空闲时间 + keepAliveSeconds: 300 + +--- # 分布式锁 lock4j 全局配置 +lock4j: + # 获取分布式锁超时时间,默认为 3000 毫秒 + acquire-timeout: 3000 + # 分布式锁的超时时间,默认为 30 秒 + expire: 30000 + +--- # Actuator 监控端点的配置项 +management: + endpoints: + web: + exposure: + include: '*' + endpoint: + health: + show-details: ALWAYS + logfile: + external-file: ./logs/sys-console.log + +# websocket +websocket: + enabled: true + # 路径 + path: '/resource/websocket' + # 设置访问源地址 + allowedOrigins: '*' + +# 微信小程序配置信息 +wx: + miniapp: + configs: + - appid: # 你的appid + secret: # 你的secret + token: #微信小程序消息服务器配置的token + aesKey: #微信小程序消息服务器配置的EncodingAESKey + msgDataFormat: JSON + + # 企业微信应用 +wechat: + cp: + corpId: + appConfigs: + - agentId: + secret: '' + token: '' + aesKey: '' + + + diff --git a/aibidding-admin/src/main/resources/banner.txt b/aibidding-admin/src/main/resources/banner.txt new file mode 100644 index 0000000..1a0b58f --- /dev/null +++ b/aibidding-admin/src/main/resources/banner.txt @@ -0,0 +1,2 @@ +Application Version: ${revision} +Spring Boot Version: ${spring-boot.version} diff --git a/aibidding-admin/src/main/resources/i18n/messages.properties b/aibidding-admin/src/main/resources/i18n/messages.properties new file mode 100644 index 0000000..4f2da28 --- /dev/null +++ b/aibidding-admin/src/main/resources/i18n/messages.properties @@ -0,0 +1,54 @@ +#错误消息 +not.null=* 必须填写 +user.jcaptcha.error=验证码错误 +user.jcaptcha.expire=验证码已失效 +user.not.exists=对不起, 您的账号:{0} 不存在. +user.password.not.match=用户不存在/密码错误 +user.password.retry.limit.count=密码输入错误{0}次 +user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟 +user.password.delete=对不起,您的账号:{0} 已被删除 +user.blocked=对不起,您的账号:{0} 已禁用,请联系管理员 +role.blocked=角色已封禁,请联系管理员 +user.logout.success=退出成功 +length.not.valid=长度必须在{min}到{max}个字符之间 +user.username.not.blank=用户名不能为空 +user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 +user.username.length.valid=账户长度必须在{min}到{max}个字符之间 +user.password.not.blank=用户密码不能为空 +user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间 +user.password.not.valid=* 5-50个字符 +user.email.not.valid=邮箱格式错误 +user.email.not.blank=邮箱不能为空 +user.phonenumber.not.blank=用户手机号不能为空 +user.mobile.phone.number.not.valid=手机号格式错误 +user.login.success=登录成功 +user.register.success=注册成功 +user.register.save.error=保存用户 {0} 失败,注册账号已存在 +user.register.error=注册失败,请联系系统管理人员 +user.notfound=请重新登录 +user.forcelogout=管理员强制退出,请重新登录 +user.unknown.error=未知错误,请重新登录 +##文件上传消息 +upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! +upload.filename.exceed.length=上传的文件名最长{0}个字符 +##权限 +no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] +no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] +no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] +no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] +no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] +no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] +repeat.submit.message=不允许重复提交,请稍候再试 +rate.limiter.message=访问过于频繁,请稍候再试 +sms.code.not.blank=短信验证码不能为空 +sms.code.retry.limit.count=短信验证码输入错误{0}次 +sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}分钟 +email.code.not.blank=邮箱验证码不能为空 +email.code.retry.limit.count=邮箱验证码输入错误{0}次 +email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,帐户锁定{1}分钟 +xcx.code.not.blank=小程序code不能为空 +##租户 +tenant.number.not.blank=租户编号不能为空 +tenant.not.exists=对不起, 您的租户不存在,请联系管理员 +tenant.blocked=对不起,您的租户已禁用,请联系管理员 +tenant.expired=对不起,您的租户已过期,请联系管理员 diff --git a/aibidding-admin/src/main/resources/i18n/messages_en_US.properties b/aibidding-admin/src/main/resources/i18n/messages_en_US.properties new file mode 100644 index 0000000..0c738a3 --- /dev/null +++ b/aibidding-admin/src/main/resources/i18n/messages_en_US.properties @@ -0,0 +1,54 @@ +#错误消息 +not.null=* Required fill in +user.jcaptcha.error=Captcha error +user.jcaptcha.expire=Captcha invalid +user.not.exists=Sorry, your account: {0} does not exist +user.password.not.match=User does not exist/Password error +user.password.retry.limit.count=Password input error {0} times +user.password.retry.limit.exceed=Password input error {0} times, account locked for {1} minutes +user.password.delete=Sorry, your account:{0} has been deleted +user.blocked=Sorry, your account: {0} has been disabled. Please contact the administrator +role.blocked=Role disabled,please contact administrators +user.logout.success=Exit successful +length.not.valid=The length must be between {min} and {max} characters +user.username.not.blank=Username cannot be blank +user.username.not.valid=* 2 to 20 chinese characters, letters, numbers or underscores, and must start with a non number +user.username.length.valid=Account length must be between {min} and {max} characters +user.password.not.blank=Password cannot be empty +user.password.length.valid=Password length must be between {min} and {max} characters +user.password.not.valid=* 5-50 characters +user.email.not.valid=Mailbox format error +user.email.not.blank=Mailbox cannot be blank +user.phonenumber.not.blank=Phone number cannot be blank +user.mobile.phone.number.not.valid=Phone number format error +user.login.success=Login successful +user.register.success=Register successful +user.register.save.error=Failed to save user {0}, The registered account already exists +user.register.error=Register failed, please contact system administrator +user.notfound=Please login again +user.forcelogout=The administrator is forced to exit,please login again +user.unknown.error=Unknown error, please login again +##文件上传消息 +upload.exceed.maxSize=The uploaded file size exceeds the limit file size!
the maximum allowed file size is:{0}MB! +upload.filename.exceed.length=The maximum length of uploaded file name is {0} characters +##权限 +no.permission=You do not have permission to the data,please contact your administrator to add permissions [{0}] +no.create.permission=You do not have permission to create data,please contact your administrator to add permissions [{0}] +no.update.permission=You do not have permission to modify data,please contact your administrator to add permissions [{0}] +no.delete.permission=You do not have permission to delete data,please contact your administrator to add permissions [{0}] +no.export.permission=You do not have permission to export data,please contact your administrator to add permissions [{0}] +no.view.permission=You do not have permission to view data,please contact your administrator to add permissions [{0}] +repeat.submit.message=Repeat submit is not allowed, please try again later +rate.limiter.message=Visit too frequently, please try again later +sms.code.not.blank=Sms code cannot be blank +sms.code.retry.limit.count=Sms code input error {0} times +sms.code.retry.limit.exceed=Sms code input error {0} times, account locked for {1} minutes +email.code.not.blank=Email code cannot be blank +email.code.retry.limit.count=Email code input error {0} times +email.code.retry.limit.exceed=Email code input error {0} times, account locked for {1} minutes +xcx.code.not.blank=Mini program code cannot be blank +##租户 +tenant.number.not.blank=Tenant number cannot be blank +tenant.not.exists=Sorry, your tenant does not exist. Please contact the administrator +tenant.blocked=Sorry, your tenant is disabled. Please contact the administrator +tenant.expired=Sorry, your tenant has expired. Please contact the administrator. diff --git a/aibidding-admin/src/main/resources/i18n/messages_zh_CN.properties b/aibidding-admin/src/main/resources/i18n/messages_zh_CN.properties new file mode 100644 index 0000000..4f2da28 --- /dev/null +++ b/aibidding-admin/src/main/resources/i18n/messages_zh_CN.properties @@ -0,0 +1,54 @@ +#错误消息 +not.null=* 必须填写 +user.jcaptcha.error=验证码错误 +user.jcaptcha.expire=验证码已失效 +user.not.exists=对不起, 您的账号:{0} 不存在. +user.password.not.match=用户不存在/密码错误 +user.password.retry.limit.count=密码输入错误{0}次 +user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟 +user.password.delete=对不起,您的账号:{0} 已被删除 +user.blocked=对不起,您的账号:{0} 已禁用,请联系管理员 +role.blocked=角色已封禁,请联系管理员 +user.logout.success=退出成功 +length.not.valid=长度必须在{min}到{max}个字符之间 +user.username.not.blank=用户名不能为空 +user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 +user.username.length.valid=账户长度必须在{min}到{max}个字符之间 +user.password.not.blank=用户密码不能为空 +user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间 +user.password.not.valid=* 5-50个字符 +user.email.not.valid=邮箱格式错误 +user.email.not.blank=邮箱不能为空 +user.phonenumber.not.blank=用户手机号不能为空 +user.mobile.phone.number.not.valid=手机号格式错误 +user.login.success=登录成功 +user.register.success=注册成功 +user.register.save.error=保存用户 {0} 失败,注册账号已存在 +user.register.error=注册失败,请联系系统管理人员 +user.notfound=请重新登录 +user.forcelogout=管理员强制退出,请重新登录 +user.unknown.error=未知错误,请重新登录 +##文件上传消息 +upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! +upload.filename.exceed.length=上传的文件名最长{0}个字符 +##权限 +no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] +no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] +no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] +no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] +no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] +no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] +repeat.submit.message=不允许重复提交,请稍候再试 +rate.limiter.message=访问过于频繁,请稍候再试 +sms.code.not.blank=短信验证码不能为空 +sms.code.retry.limit.count=短信验证码输入错误{0}次 +sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}分钟 +email.code.not.blank=邮箱验证码不能为空 +email.code.retry.limit.count=邮箱验证码输入错误{0}次 +email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,帐户锁定{1}分钟 +xcx.code.not.blank=小程序code不能为空 +##租户 +tenant.number.not.blank=租户编号不能为空 +tenant.not.exists=对不起, 您的租户不存在,请联系管理员 +tenant.blocked=对不起,您的租户已禁用,请联系管理员 +tenant.expired=对不起,您的租户已过期,请联系管理员 diff --git a/aibidding-admin/src/main/resources/ip2region.xdb b/aibidding-admin/src/main/resources/ip2region.xdb new file mode 100644 index 0000000..31f96a1 Binary files /dev/null and b/aibidding-admin/src/main/resources/ip2region.xdb differ diff --git a/aibidding-admin/src/main/resources/logback-plus.xml b/aibidding-admin/src/main/resources/logback-plus.xml new file mode 100644 index 0000000..40fa33b --- /dev/null +++ b/aibidding-admin/src/main/resources/logback-plus.xml @@ -0,0 +1,129 @@ + + + + + + + + + + ${console.log.pattern} + utf-8 + + + + + + ${log.path}/sys-console.log + + + ${log.path}/sys-console.%d{yyyy-MM-dd}.log + + 1 + + + ${log.pattern} + utf-8 + + + + INFO + + + + + + ${log.path}/sys-info.log + + + + ${log.path}/sys-info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/sys-error.log + + + + ${log.path}/sys-error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + 0 + + 512 + + + + + + + + 0 + + 512 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aibidding-admin/src/main/resources/spy.properties b/aibidding-admin/src/main/resources/spy.properties new file mode 100644 index 0000000..cbce200 --- /dev/null +++ b/aibidding-admin/src/main/resources/spy.properties @@ -0,0 +1 @@ +exclude=SELECT 1 diff --git a/aibidding-common/aibidding-common-bom/pom.xml b/aibidding-common/aibidding-common-bom/pom.xml new file mode 100644 index 0000000..67f5696 --- /dev/null +++ b/aibidding-common/aibidding-common-bom/pom.xml @@ -0,0 +1,187 @@ + + + 4.0.0 + + org.ruoyi + aibidding-common-bom + ${revision} + pom + + + ruoyi-common-bom common依赖项 + + + + 1.0.0 + + + + + + + org.ruoyi + aibidding-common-core + ${revision} + + + + + org.ruoyi + aibidding-common-doc + ${revision} + + + + + org.ruoyi + aibidding-common-excel + ${revision} + + + + + org.ruoyi + aibidding-common-idempotent + ${revision} + + + + + org.ruoyi + aibidding-common-log + ${revision} + + + + + org.ruoyi + aibidding-common-mail + ${revision} + + + + + org.ruoyi + aibidding-common-mybatis + ${revision} + + + + + org.ruoyi + aibidding-common-oss + ${revision} + + + + + org.ruoyi + aibidding-common-ratelimiter + ${revision} + + + + + org.ruoyi + aibidding-common-redis + ${revision} + + + + + org.ruoyi + aibidding-common-satoken + ${revision} + + + + + org.ruoyi + aibidding-common-security + ${revision} + + + + + org.ruoyi + aibidding-common-sms + ${revision} + + + + + org.ruoyi + aibidding-common-web + ${revision} + + + + + org.ruoyi + aibidding-common-translation + ${revision} + + + + + org.ruoyi + aibidding-common-sensitive + ${revision} + + + + + org.ruoyi + aibidding-common-json + ${revision} + + + + + org.ruoyi + aibidding-common-encrypt + ${revision} + + + + + org.ruoyi + aibidding-common-tenant + ${revision} + + + + + org.ruoyi + aibidding-common-chat + ${revision} + + + + + org.ruoyi + aibidding-common-wechat + ${revision} + + + + + org.ruoyi + aibidding-fusion + ${revision} + + + + + + + org.ruoyi + aibidding-common-pay + ${revision} + + + + + diff --git a/aibidding-common/aibidding-common-chat/pom.xml b/aibidding-common/aibidding-common-chat/pom.xml new file mode 100644 index 0000000..da45bcb --- /dev/null +++ b/aibidding-common/aibidding-common-chat/pom.xml @@ -0,0 +1,118 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-chat + + + ruoyi-common-chat 模块 + + + + 2.9.0 + + + + + org.ruoyi + aibidding-common-core + + + + mysql + mysql-connector-java + 8.0.33 + + + + com.azure + azure-ai-openai + 1.0.0-beta.12 + + + + io.github.ollama4j + ollama4j + 1.0.79 + + + + + org.ruoyi + aibidding-common-json + 1.0.0 + + + + org.ruoyi + aibidding-common-redis + + + org.ruoyi + aibidding-common-satoken + + + + com.squareup.retrofit2 + retrofit + ${retrofit2.version} + + + com.squareup.retrofit2 + converter-jackson + ${retrofit2.version} + + + com.squareup.retrofit2 + adapter-rxjava2 + ${retrofit2.version} + + + + com.knuddels + jtokkit + 0.5.0 + + + + cn.hutool + hutool-all + 5.8.12 + + + + org.springframework.boot + spring-boot-starter-websocket + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + junit + junit + + + + cn.bigmodel.openapi + oapi-java-sdk + release-V4-2.3.0 + + + com.squareup.okhttp + okhttp + 2.7.5 + compile + + + diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/config/ChatConfig.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/config/ChatConfig.java new file mode 100644 index 0000000..369430b --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/config/ChatConfig.java @@ -0,0 +1,56 @@ +package org.aibidding.common.chat.config; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; +import org.aibidding.common.chat.openai.OpenAiStreamClient; +import org.aibidding.common.chat.openai.function.KeyRandomStrategy; +import org.aibidding.common.chat.openai.interceptor.OpenAILogger; +import org.aibidding.common.core.service.ConfigService; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.Collections; +import java.util.concurrent.TimeUnit; + +/** + * Chat配置类 + * + * @date: 2023/5/16 + */ +@Configuration +@RequiredArgsConstructor +public class ChatConfig { + + @Getter + private OpenAiStreamClient openAiStreamClient; + + private final ConfigService configService; + + // 重启才会生效 + @Bean + public OpenAiStreamClient openAiStreamClient() { + String apiHost = configService.getConfigValue("chat", "apiHost"); + String apiKey = configService.getConfigValue("chat", "apiKey"); + openAiStreamClient = createOpenAiStreamClient(apiHost,apiKey); + return openAiStreamClient; + } + + public OpenAiStreamClient createOpenAiStreamClient(String apiHost, String apiKey) { + HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor(new OpenAILogger()); + httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS); + OkHttpClient okHttpClient = new OkHttpClient.Builder() + .addInterceptor(httpLoggingInterceptor) + .connectTimeout(30, TimeUnit.SECONDS) + .writeTimeout(600, TimeUnit.SECONDS) + .readTimeout(600, TimeUnit.SECONDS) + .build(); + return OpenAiStreamClient.builder() + .apiHost(apiHost) + .apiKey(Collections.singletonList(apiKey)) + .keyStrategy(new KeyRandomStrategy()) + .okHttpClient(okHttpClient) + .build(); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/config/LocalCache.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/config/LocalCache.java new file mode 100644 index 0000000..5db22ad --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/config/LocalCache.java @@ -0,0 +1,36 @@ +package org.aibidding.common.chat.config; + +import cn.hutool.cache.CacheUtil; +import cn.hutool.cache.impl.TimedCache; +import cn.hutool.core.date.DateUnit; +import lombok.extern.slf4j.Slf4j; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @date 2023-03-10 + */ +@Slf4j +public class LocalCache { + /** + * 缓存时长 + */ + public static final long TIMEOUT = 30 * DateUnit.MINUTE.getMillis(); + /** + * 清理间隔 + */ + private static final long CLEAN_TIMEOUT = 30 * DateUnit.MINUTE.getMillis(); + + /** + * 缓存对象 + */ + public static final TimedCache CACHE = CacheUtil.newTimedCache(TIMEOUT); + + + static { + //启动定时任务 + CACHE.schedulePrune(CLEAN_TIMEOUT); + } + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/config/WebSocketConfig.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/config/WebSocketConfig.java new file mode 100644 index 0000000..28c3dff --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/config/WebSocketConfig.java @@ -0,0 +1,62 @@ +package org.aibidding.common.chat.config; + +import cn.hutool.core.util.StrUtil; +import org.aibidding.common.chat.config.properties.WebSocketProperties; +import org.aibidding.common.chat.handler.PlusWebSocketHandler; +import org.aibidding.common.chat.interceptor.PlusWebSocketInterceptor; +import org.aibidding.common.chat.listener.WebSocketTopicListener; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.web.socket.WebSocketHandler; +import org.springframework.web.socket.config.annotation.EnableWebSocket; +import org.springframework.web.socket.config.annotation.WebSocketConfigurer; +import org.springframework.web.socket.server.HandshakeInterceptor; + +/** + * WebSocket 配置 + * + * @author zendwang + */ +@AutoConfiguration +@ConditionalOnProperty(value = "websocket.enabled", havingValue = "true") +@EnableConfigurationProperties(WebSocketProperties.class) +@EnableWebSocket +public class WebSocketConfig { + + @Bean + public WebSocketConfigurer webSocketConfigurer(HandshakeInterceptor handshakeInterceptor, + WebSocketHandler webSocketHandler, + WebSocketProperties webSocketProperties) { + // 如果WebSocket的路径为空,则设置默认路径为 "/websocket" + if (StrUtil.isBlank(webSocketProperties.getPath())) { + webSocketProperties.setPath("/websocket"); + } + // 如果允许跨域访问的地址为空,则设置为 "*",表示允许所有来源的跨域请求 + if (StrUtil.isBlank(webSocketProperties.getAllowedOrigins())) { + webSocketProperties.setAllowedOrigins("*"); + } + // 返回一个WebSocketConfigurer对象,用于配置WebSocket + return registry -> registry + // 添加WebSocket处理程序和拦截器到指定路径,设置允许的跨域来源 + .addHandler(webSocketHandler, webSocketProperties.getPath()) + .addInterceptors(handshakeInterceptor) + .setAllowedOrigins(webSocketProperties.getAllowedOrigins()); + } + + @Bean + public HandshakeInterceptor handshakeInterceptor() { + return new PlusWebSocketInterceptor(); + } + + @Bean + public WebSocketHandler webSocketHandler() { + return new PlusWebSocketHandler(); + } + + @Bean + public WebSocketTopicListener topicListener() { + return new WebSocketTopicListener(); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/config/properties/WebSocketProperties.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/config/properties/WebSocketProperties.java new file mode 100644 index 0000000..9015aac --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/config/properties/WebSocketProperties.java @@ -0,0 +1,26 @@ +package org.aibidding.common.chat.config.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * WebSocket 配置项 + * + * @author zendwang + */ +@ConfigurationProperties("websocket") +@Data +public class WebSocketProperties { + + private Boolean enabled; + + /** + * 路径 + */ + private String path; + + /** + * 设置访问源地址 + */ + private String allowedOrigins; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/constant/OpenAIConst.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/constant/OpenAIConst.java new file mode 100644 index 0000000..f9e10e1 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/constant/OpenAIConst.java @@ -0,0 +1,15 @@ +package org.aibidding.common.chat.constant; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @since 2023-03-06 + */ +public class OpenAIConst { + + public final static String OPENAI_HOST = "https://api.openai.com/"; + + public final static int SUCCEED_CODE = 200; + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/constant/WebSocketConstants.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/constant/WebSocketConstants.java new file mode 100644 index 0000000..8b8fcd8 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/constant/WebSocketConstants.java @@ -0,0 +1,28 @@ +package org.aibidding.common.chat.constant; + +/** + * websocket的常量配置 + * + * @author zendwang + */ +public interface WebSocketConstants { + /** + * websocketSession中的参数的key + */ + String LOGIN_USER_KEY = "loginUser"; + + /** + * 订阅的频道 + */ + String WEB_SOCKET_TOPIC = "global:websocket"; + + /** + * 前端心跳检查的命令 + */ + String PING = "ping"; + + /** + * 服务端心跳恢复的字符串 + */ + String PONG = "pong"; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/ConsoleEventSourceListenerV2.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/ConsoleEventSourceListenerV2.java new file mode 100644 index 0000000..d373161 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/ConsoleEventSourceListenerV2.java @@ -0,0 +1,73 @@ +package org.aibidding.common.chat.demo; + +import cn.hutool.json.JSONUtil; + +import lombok.Getter; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Response; +import okhttp3.ResponseBody; +import okhttp3.sse.EventSource; +import okhttp3.sse.EventSourceListener; +import org.aibidding.common.chat.entity.chat.ChatCompletionResponse; + +import java.util.Objects; +import java.util.concurrent.CountDownLatch; + +/** + * 描述: sse + * + * @author https:www.unfbx.com + * 2023-06-15 + */ +@Slf4j +public class ConsoleEventSourceListenerV2 extends EventSourceListener { + @Getter + String args = ""; + final CountDownLatch countDownLatch; + + public ConsoleEventSourceListenerV2(CountDownLatch countDownLatch) { + this.countDownLatch = countDownLatch; + } + + @Override + public void onOpen(EventSource eventSource, Response response) { + log.info("OpenAI建立sse连接..."); + } + + @Override + public void onEvent(EventSource eventSource, String id, String type, String data) { + log.info("OpenAI返回数据:{}", data); + if (data.equals("[DONE]")) { + log.info("OpenAI返回数据结束了"); + countDownLatch.countDown(); + return; + } + ChatCompletionResponse chatCompletionResponse = JSONUtil.toBean(data, ChatCompletionResponse.class); + if(Objects.nonNull(chatCompletionResponse.getChoices().get(0).getDelta().getFunctionCall())){ + args += chatCompletionResponse.getChoices().get(0).getDelta().getFunctionCall().getArguments(); + } + } + + @Override + public void onClosed(EventSource eventSource) { + log.info("OpenAI关闭sse连接..."); + } + + @SneakyThrows + @Override + public void onFailure(EventSource eventSource, Throwable t, Response response) { + if(Objects.isNull(response)){ + log.error("OpenAI sse连接异常:{}", t); + eventSource.cancel(); + return; + } + ResponseBody body = response.body(); + if (Objects.nonNull(body)) { + log.error("OpenAI sse连接异常data:{},异常:{}", body.string(), t); + } else { + log.error("OpenAI sse连接异常data:{},异常:{}", response, t); + } + eventSource.cancel(); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/ConsoleEventSourceListenerV3.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/ConsoleEventSourceListenerV3.java new file mode 100644 index 0000000..99eb8f2 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/ConsoleEventSourceListenerV3.java @@ -0,0 +1,92 @@ +package org.aibidding.common.chat.demo; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.json.JSONUtil; +import lombok.Getter; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Response; +import okhttp3.ResponseBody; +import okhttp3.sse.EventSource; +import okhttp3.sse.EventSourceListener; +import org.aibidding.common.chat.entity.chat.ChatCompletionResponse; +import org.aibidding.common.chat.entity.chat.Message; +import org.aibidding.common.chat.entity.chat.tool.ToolCallFunction; +import org.aibidding.common.chat.entity.chat.tool.ToolCalls; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.CountDownLatch; + +/** + * 描述: demo测试实现类,仅供思路参考 + * + * @author https:www.unfbx.com + * 2023-11-12 + */ +@Slf4j +public class ConsoleEventSourceListenerV3 extends EventSourceListener { + @Getter + List choices = new ArrayList<>(); + @Getter + ToolCalls toolCalls = new ToolCalls(); + @Getter + ToolCallFunction toolCallFunction = ToolCallFunction.builder().name("").arguments("").build(); + final CountDownLatch countDownLatch; + + public ConsoleEventSourceListenerV3(CountDownLatch countDownLatch) { + this.countDownLatch = countDownLatch; + } + + @Override + public void onOpen(EventSource eventSource, Response response) { + log.info("OpenAI建立sse连接..."); + } + + @Override + public void onEvent(EventSource eventSource, String id, String type, String data) { + log.info("OpenAI返回数据:{}", data); + if (data.equals("[DONE]")) { + log.info("OpenAI返回数据结束了"); + return; + } + ChatCompletionResponse chatCompletionResponse = JSONUtil.toBean(data, ChatCompletionResponse.class); + Message delta = chatCompletionResponse.getChoices().get(0).getDelta(); + if (CollectionUtil.isNotEmpty(delta.getToolCalls())) { + choices.addAll(delta.getToolCalls()); + } + } + + @Override + public void onClosed(EventSource eventSource) { + if(CollectionUtil.isNotEmpty(choices)){ + toolCalls.setId(choices.get(0).getId()); + toolCalls.setType(choices.get(0).getType()); + choices.forEach(e -> { + toolCallFunction.setName(e.getFunction().getName()); + toolCallFunction.setArguments(toolCallFunction.getArguments() + e.getFunction().getArguments()); + toolCalls.setFunction(toolCallFunction); + }); + } + log.info("OpenAI关闭sse连接..."); + countDownLatch.countDown(); + } + + @SneakyThrows + @Override + public void onFailure(EventSource eventSource, Throwable t, Response response) { + if(Objects.isNull(response)){ + log.error("OpenAI sse连接异常:{}", t); + eventSource.cancel(); + return; + } + ResponseBody body = response.body(); + if (Objects.nonNull(body)) { + log.error("OpenAI sse连接异常data:{},异常:{}", body.string(), t); + } else { + log.error("OpenAI sse连接异常data:{},异常:{}", response, t); + } + eventSource.cancel(); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/PluginTest.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/PluginTest.java new file mode 100644 index 0000000..0790d48 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/PluginTest.java @@ -0,0 +1,417 @@ +package org.aibidding.common.chat.demo; + +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONObject; +import lombok.Builder; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; +import org.junit.Before; +import org.junit.Test; +import org.aibidding.common.chat.entity.chat.*; +import org.aibidding.common.chat.entity.chat.tool.ToolCallFunction; +import org.aibidding.common.chat.entity.chat.tool.ToolCalls; +import org.aibidding.common.chat.entity.chat.tool.Tools; +import org.aibidding.common.chat.entity.chat.tool.ToolsFunction; +import org.aibidding.common.chat.openai.OpenAiClient; +import org.aibidding.common.chat.openai.OpenAiStreamClient; +import org.aibidding.common.chat.openai.function.KeyRandomStrategy; +import org.aibidding.common.chat.openai.interceptor.DynamicKeyOpenAiAuthInterceptor; +import org.aibidding.common.chat.openai.interceptor.OpenAILogger; +import org.aibidding.common.chat.openai.interceptor.OpenAiResponseInterceptor; +import org.aibidding.common.chat.openai.plugin.PluginAbstract; +import org.aibidding.common.chat.plugin.CmdPlugin; +import org.aibidding.common.chat.plugin.CmdReq; +import org.aibidding.common.chat.sse.ConsoleEventSourceListener; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +/** + * 描述: + * + * @author ageerle@163.com + * date 2025/3/8 + */ +@Slf4j +public class PluginTest { + + private OpenAiClient openAiClient; + private OpenAiStreamClient openAiStreamClient; + + @Before + public void before() { + //可以为null +// Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 7890)); + HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor(new OpenAILogger()); + //!!!!千万别再生产或者测试环境打开BODY级别日志!!!! + //!!!生产或者测试环境建议设置为这三种级别:NONE,BASIC,HEADERS,!!! + httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS); + OkHttpClient okHttpClient = new OkHttpClient + .Builder() +// .proxy(proxy) + .addInterceptor(httpLoggingInterceptor) + .addInterceptor(new OpenAiResponseInterceptor()) + .connectTimeout(10, TimeUnit.SECONDS) + .writeTimeout(30, TimeUnit.SECONDS) + .readTimeout(30, TimeUnit.SECONDS) + .build(); + openAiClient = OpenAiClient.builder() + //支持多key传入,请求时候随机选择 + .apiKey(Arrays.asList("sk-xx")) + //自定义key的获取策略:默认KeyRandomStrategy + //.keyStrategy(new KeyRandomStrategy()) + .keyStrategy(new KeyRandomStrategy()) + .okHttpClient(okHttpClient) + //自己做了代理就传代理地址,没有可不不传,(关注公众号回复:openai ,获取免费的测试代理地址) + .apiHost("https://api.pandarobot.chat/") + .build(); + + openAiStreamClient = OpenAiStreamClient.builder() + //支持多key传入,请求时候随机选择 + .apiKey(Arrays.asList("sk-xx")) + //自定义key的获取策略:默认KeyRandomStrategy + .keyStrategy(new KeyRandomStrategy()) + .authInterceptor(new DynamicKeyOpenAiAuthInterceptor()) + .okHttpClient(okHttpClient) + //自己做了代理就传代理地址,没有可不不传,(关注公众号回复:openai ,获取免费的测试代理地址) + .apiHost("https://api.pandarobot.chat/") + .build(); + } + + + @Test + public void chatFunction() { + //模型:GPT_3_5_TURBO_16K_0613 + Message message = Message.builder().role(Message.Role.USER).content("给我输出一个长度为2的中文词语,并解释下词语对应物品的用途").build(); + //属性一 + JSONObject wordLength = new JSONObject(); + wordLength.put("type", "number"); + wordLength.put("description", "词语的长度"); + //属性二 + JSONObject language = new JSONObject(); + language.put("type", "string"); + language.put("enum", Arrays.asList("zh", "en")); + language.put("description", "语言类型,例如:zh代表中文、en代表英语"); + //参数 + JSONObject properties = new JSONObject(); + properties.put("wordLength", wordLength); + properties.put("language", language); + + Parameters parameters = Parameters.builder() + .type("object") + .properties(properties) + .required(Collections.singletonList("wordLength")).build(); + Functions functions = Functions.builder() + .name("getOneWord") + .description("获取一个指定长度和语言类型的词语") + .parameters(parameters) + .build(); + + ChatCompletion chatCompletion = ChatCompletion + .builder() + .messages(Collections.singletonList(message)) + .functions(Collections.singletonList(functions)) + .functionCall("auto") + .model(ChatCompletion.Model.GPT_4_1106_PREVIEW.getName()) + .build(); + ChatCompletionResponse chatCompletionResponse = openAiClient.chatCompletion(chatCompletion); + + ChatChoice chatChoice = chatCompletionResponse.getChoices().get(0); + log.info("构造的方法值:{}", chatChoice.getMessage().getFunctionCall()); + log.info("构造的方法名称:{}", chatChoice.getMessage().getFunctionCall().getName()); + log.info("构造的方法参数:{}", chatChoice.getMessage().getFunctionCall().getArguments()); + WordParam wordParam = JSONUtil.toBean(chatChoice.getMessage().getFunctionCall().getArguments(), WordParam.class); + String oneWord = getOneWord(wordParam); + + FunctionCall functionCall = FunctionCall.builder() + .arguments(chatChoice.getMessage().getFunctionCall().getArguments()) + .name("getOneWord") + .build(); + Message message2 = Message.builder().role(Message.Role.ASSISTANT).content("方法参数").functionCall(functionCall).build(); + String content + = "{ " + + "\"wordLength\": \"3\", " + + "\"language\": \"zh\", " + + "\"word\": \"" + oneWord + "\"," + + "\"用途\": [\"直接吃\", \"做沙拉\", \"售卖\"]" + + "}"; + Message message3 = Message.builder().role(Message.Role.FUNCTION).name("getOneWord").content(content).build(); + List messageList = Arrays.asList(message, message2, message3); + ChatCompletion chatCompletionV2 = ChatCompletion + .builder() + .messages(messageList) + .model(ChatCompletion.Model.GPT_4_1106_PREVIEW.getName()) + .build(); + ChatCompletionResponse chatCompletionResponseV2 = openAiClient.chatCompletion(chatCompletionV2); + log.info("自定义的方法返回值:{}",chatCompletionResponseV2.getChoices().get(0).getMessage().getContent()); + } + + + @Test + public void plugin() { + CmdPlugin plugin = new CmdPlugin(CmdReq.class); + // 插件名称 + plugin.setName("命令行工具"); + // 方法名称 + plugin.setFunction("openCmd"); + // 方法说明 + plugin.setDescription("提供一个命令行指令,比如<记事本>,指令使用中文,以function返回结果为准"); + + PluginAbstract.Arg arg = new PluginAbstract.Arg(); + // 参数名称 + arg.setName("cmd"); + // 参数说明 + arg.setDescription("命令行指令"); + // 参数类型 + arg.setType("string"); + arg.setRequired(true); + plugin.setArgs(Collections.singletonList(arg)); + + Message message2 = Message.builder().role(Message.Role.USER).content("帮我打开计算器,结合上下文判断指令是否执行成功,只用回复成功或者失败").build(); + List messages = new ArrayList<>(); + messages.add(message2); + //有四个重载方法,都可以使用 + ChatCompletionResponse response = openAiClient.chatCompletionWithPlugin(messages,"gpt-4o-mini",plugin); + log.info("自定义的方法返回值:{}", response.getChoices().get(0).getMessage().getContent()); + } + + /** + * 自定义返回数据格式 + */ + @Test + public void diyReturnDataModelChat() { + Message message = Message.builder().role(Message.Role.USER).content("随机输出10个单词,使用json输出").build(); + ChatCompletion chatCompletion = ChatCompletion + .builder() + .messages(Collections.singletonList(message)) + .responseFormat(ResponseFormat.builder().type(ResponseFormat.Type.JSON_OBJECT.getName()).build()) + .model(ChatCompletion.Model.GPT_4_1106_PREVIEW.getName()) + .build(); + ChatCompletionResponse chatCompletionResponse = openAiClient.chatCompletion(chatCompletion); + chatCompletionResponse.getChoices().forEach(e -> System.out.println(e.getMessage())); + } + + @Test + public void streamPlugin() { + WeatherPlugin plugin = new WeatherPlugin(WeatherReq.class); + plugin.setName("知心天气"); + plugin.setFunction("getLocationWeather"); + plugin.setDescription("提供一个地址,方法将会获取该地址的天气的实时温度信息。"); + PluginAbstract.Arg arg = new PluginAbstract.Arg(); + arg.setName("location"); + arg.setDescription("地名"); + arg.setType("string"); + arg.setRequired(true); + plugin.setArgs(Collections.singletonList(arg)); + +// Message message1 = Message.builder().role(Message.Role.USER).content("秦始皇统一了哪六国。").build(); + Message message2 = Message.builder().role(Message.Role.USER).content("获取上海市的天气现在多少度,然后再给出3个推荐的户外运动。").build(); + List messages = new ArrayList<>(); +// messages.add(message1); + messages.add(message2); + //默认模型:GPT_3_5_TURBO_16K_0613 + //有四个重载方法,都可以使用 + openAiStreamClient.streamChatCompletionWithPlugin(messages, ChatCompletion.Model.GPT_4_1106_PREVIEW.getName(), new ConsoleEventSourceListener(), plugin); + CountDownLatch countDownLatch = new CountDownLatch(1); + try { + countDownLatch.await(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * tools使用示例 + */ + @Test + public void toolsChat() { + Message message = Message.builder().role(Message.Role.USER).content("给我输出一个长度为2的中文词语,并解释下词语对应物品的用途").build(); + //属性一 + JSONObject wordLength = new JSONObject(); + wordLength.put("type", "number"); + wordLength.put("description", "词语的长度"); + //属性二 + JSONObject language = new JSONObject(); + language.put("type", "string"); + language.put("enum", Arrays.asList("zh", "en")); + language.put("description", "语言类型,例如:zh代表中文、en代表英语"); + //参数 + JSONObject properties = new JSONObject(); + properties.put("wordLength", wordLength); + properties.put("language", language); + Parameters parameters = Parameters.builder() + .type("object") + .properties(properties) + .required(Collections.singletonList("wordLength")).build(); + Tools tools = Tools.builder() + .type(Tools.Type.FUNCTION.getName()) + .function(ToolsFunction.builder().name("getOneWord").description("获取一个指定长度和语言类型的词语").parameters(parameters).build()) + .build(); + + ChatCompletion chatCompletion = ChatCompletion + .builder() + .messages(Collections.singletonList(message)) + .tools(Collections.singletonList(tools)) + .model(ChatCompletion.Model.GPT_4_1106_PREVIEW.getName()) + .build(); + ChatCompletionResponse chatCompletionResponse = openAiClient.chatCompletion(chatCompletion); + + ChatChoice chatChoice = chatCompletionResponse.getChoices().get(0); + log.info("构造的方法值:{}", chatChoice.getMessage().getToolCalls()); + + ToolCalls openAiReturnToolCalls = chatChoice.getMessage().getToolCalls().get(0); + WordParam wordParam = JSONUtil.toBean(openAiReturnToolCalls.getFunction().getArguments(), WordParam.class); + String oneWord = getOneWord(wordParam); + + + ToolCallFunction tcf = ToolCallFunction.builder().name("getOneWord").arguments(openAiReturnToolCalls.getFunction().getArguments()).build(); + ToolCalls tc = ToolCalls.builder().id(openAiReturnToolCalls.getId()).type(ToolCalls.Type.FUNCTION.getName()).function(tcf).build(); + //构造tool call + Message message2 = Message.builder().role(Message.Role.ASSISTANT).content("方法参数").toolCalls(Collections.singletonList(tc)).build(); + String content + = "{ " + + "\"wordLength\": \"3\", " + + "\"language\": \"zh\", " + + "\"word\": \"" + oneWord + "\"," + + "\"用途\": [\"直接吃\", \"做沙拉\", \"售卖\"]" + + "}"; + Message message3 = Message.builder().toolCallId(openAiReturnToolCalls.getId()).role(Message.Role.TOOL).name("getOneWord").content(content).build(); + List messageList = Arrays.asList(message, message2, message3); + ChatCompletion chatCompletionV2 = ChatCompletion + .builder() + .messages(messageList) + .model(ChatCompletion.Model.GPT_4_1106_PREVIEW.getName()) + .build(); + ChatCompletionResponse chatCompletionResponseV2 = openAiClient.chatCompletion(chatCompletionV2); + log.info("自定义的方法返回值:{}", chatCompletionResponseV2.getChoices().get(0).getMessage().getContent()); + + } + + /** + * tools流式输出使用示例 + */ + @Test + public void streamToolsChat() { + + CountDownLatch countDownLatch = new CountDownLatch(1); + ConsoleEventSourceListenerV3 eventSourceListener = new ConsoleEventSourceListenerV3(countDownLatch); + + Message message = Message.builder().role(Message.Role.USER).content("给我输出一个长度为2的中文词语,并解释下词语对应物品的用途").build(); + //属性一 + JSONObject wordLength = new JSONObject(); + wordLength.put("type", "number"); + wordLength.put("description", "词语的长度"); + //属性二 + JSONObject language = new JSONObject(); + language.put("type", "string"); + language.put("enum", Arrays.asList("zh", "en")); + language.put("description", "语言类型,例如:zh代表中文、en代表英语"); + //参数 + JSONObject properties = new JSONObject(); + properties.put("wordLength", wordLength); + properties.put("language", language); + Parameters parameters = Parameters.builder() + .type("object") + .properties(properties) + .required(Collections.singletonList("wordLength")).build(); + Tools tools = Tools.builder() + .type(Tools.Type.FUNCTION.getName()) + .function(ToolsFunction.builder().name("getOneWord").description("获取一个指定长度和语言类型的词语").parameters(parameters).build()) + .build(); + + ChatCompletion chatCompletion = ChatCompletion + .builder() + .messages(Collections.singletonList(message)) + .tools(Collections.singletonList(tools)) + .model(ChatCompletion.Model.GPT_4_1106_PREVIEW.getName()) + .build(); + openAiStreamClient.streamChatCompletion(chatCompletion, eventSourceListener); + + try { + countDownLatch.await(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + ToolCalls openAiReturnToolCalls = eventSourceListener.getToolCalls(); + WordParam wordParam = JSONUtil.toBean(openAiReturnToolCalls.getFunction().getArguments(), WordParam.class); + String oneWord = getOneWord(wordParam); + + + ToolCallFunction tcf = ToolCallFunction.builder().name("getOneWord").arguments(openAiReturnToolCalls.getFunction().getArguments()).build(); + ToolCalls tc = ToolCalls.builder().id(openAiReturnToolCalls.getId()).type(ToolCalls.Type.FUNCTION.getName()).function(tcf).build(); + //构造tool call + Message message2 = Message.builder().role(Message.Role.ASSISTANT).content("方法参数").toolCalls(Collections.singletonList(tc)).build(); + String content + = "{ " + + "\"wordLength\": \"3\", " + + "\"language\": \"zh\", " + + "\"word\": \"" + oneWord + "\"," + + "\"用途\": [\"直接吃\", \"做沙拉\", \"售卖\"]" + + "}"; + Message message3 = Message.builder().toolCallId(openAiReturnToolCalls.getId()).role(Message.Role.TOOL).name("getOneWord").content(content).build(); + List messageList = Arrays.asList(message, message2, message3); + ChatCompletion chatCompletionV2 = ChatCompletion + .builder() + .messages(messageList) + .model(ChatCompletion.Model.GPT_4_1106_PREVIEW.getName()) + .build(); + + + CountDownLatch countDownLatch1 = new CountDownLatch(1); + openAiStreamClient.streamChatCompletion(chatCompletionV2, new ConsoleEventSourceListenerV3(countDownLatch)); + try { + countDownLatch1.await(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + try { + countDownLatch1.await(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + } + + + @Data + @Builder + static class WordParam { + private int wordLength; + @Builder.Default + private String language = "zh"; + } + + + /** + * 获取一个词语(根据语言和字符长度查询) + * @param wordParam + * @return + */ + public String getOneWord(WordParam wordParam) { + + List zh = Arrays.asList("大香蕉", "哈密瓜", "苹果"); + List en = Arrays.asList("apple", "banana", "cantaloupe"); + if (wordParam.getLanguage().equals("zh")) { + for (String e : zh) { + if (e.length() == wordParam.getWordLength()) { + return e; + } + } + } + if (wordParam.getLanguage().equals("en")) { + for (String e : en) { + if (e.length() == wordParam.getWordLength()) { + return e; + } + } + } + return "西瓜"; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/WeatherPlugin.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/WeatherPlugin.java new file mode 100644 index 0000000..7b80ece --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/WeatherPlugin.java @@ -0,0 +1,24 @@ +package org.aibidding.common.chat.demo; + + +import org.aibidding.common.chat.openai.plugin.PluginAbstract; + +public class WeatherPlugin extends PluginAbstract { + + public WeatherPlugin(Class r) { + super(r); + } + + @Override + public WeatherResp func(WeatherReq args) { + WeatherResp weatherResp = new WeatherResp(); + weatherResp.setTemp("25到28摄氏度"); + weatherResp.setLevel(3); + return weatherResp; + } + + @Override + public String content(WeatherResp weatherResp) { + return "当前天气温度:" + weatherResp.getTemp() + ",风力等级:" + weatherResp.getLevel(); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/WeatherReq.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/WeatherReq.java new file mode 100644 index 0000000..503ce01 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/WeatherReq.java @@ -0,0 +1,13 @@ +package org.aibidding.common.chat.demo; + + +import lombok.Data; +import org.aibidding.common.chat.openai.plugin.PluginParam; + +@Data +public class WeatherReq extends PluginParam { + /** + * 城市 + */ + private String location; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/WeatherResp.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/WeatherResp.java new file mode 100644 index 0000000..02ae4c4 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/WeatherResp.java @@ -0,0 +1,15 @@ +package org.aibidding.common.chat.demo; + +import lombok.Data; + +@Data +public class WeatherResp { + /** + * 温度 + */ + private String temp; + /** + * 风力等级 + */ + private Integer level; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/WebSearchToolsTest.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/WebSearchToolsTest.java new file mode 100644 index 0000000..c19c886 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/demo/WebSearchToolsTest.java @@ -0,0 +1,223 @@ +package org.aibidding.common.chat.demo; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.zhipu.oapi.ClientV4; +import com.zhipu.oapi.Constants; +import com.zhipu.oapi.service.v4.tools.*; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; + + +import com.zhipu.oapi.service.v4.model.*; +import io.reactivex.Flowable; + +import java.util.HashMap; +import java.util.Map; + + +public class WebSearchToolsTest { + + private final static Logger logger = LoggerFactory.getLogger(WebSearchToolsTest.class); + private static final String API_SECRET_KEY = "xx"; + + private static final ClientV4 client = new ClientV4.Builder(API_SECRET_KEY) + .networkConfig(300, 100, 100, 100, TimeUnit.SECONDS) + .connectionPool(new okhttp3.ConnectionPool(8, 1, TimeUnit.SECONDS)) + .build(); + private static final ObjectMapper mapper = new ObjectMapper(); + // 请自定义自己的业务id + private static final String requestIdTemplate = "mycompany-%d"; + + + @Test + public void test1() throws JsonProcessingException { + +// json 转换 ArrayList + String jsonString = "[\n" + + " {\n" + + " \"content\": \"今天武汉天气怎么样\",\n" + + " \"role\": \"user\"\n" + + " }\n" + + " ]"; + + ArrayList messages = new ObjectMapper().readValue(jsonString, new TypeReference>() { + }); + + + String requestId = String.format(requestIdTemplate, System.currentTimeMillis()); + WebSearchParamsRequest chatCompletionRequest = WebSearchParamsRequest.builder() + .model("web-search-pro") + .stream(Boolean.TRUE) + .messages(messages) + .requestId(requestId) + .build(); + WebSearchApiResponse webSearchApiResponse = client.webSearchProStreamingInvoke(chatCompletionRequest); + if (webSearchApiResponse.isSuccess()) { + AtomicBoolean isFirst = new AtomicBoolean(true); + List choices = new ArrayList<>(); + AtomicReference lastAccumulator = new AtomicReference<>(); + + webSearchApiResponse.getFlowable().map(result -> result) + .doOnNext(accumulator -> { + { + if (isFirst.getAndSet(false)) { + logger.info("Response: "); + } + ChoiceDelta delta = accumulator.getChoices().get(0).getDelta(); + if (delta != null && delta.getToolCalls() != null) { + logger.info("tool_calls: {}", mapper.writeValueAsString(delta.getToolCalls())); + } + choices.add(delta); + lastAccumulator.set(accumulator); + + } + }) + .doOnComplete(() -> System.out.println("Stream completed.")) + .doOnError(throwable -> System.err.println("Error: " + throwable)) // Handle errors + .blockingSubscribe();// Use blockingSubscribe instead of blockingGet() + + WebSearchPro chatMessageAccumulator = lastAccumulator.get(); + + webSearchApiResponse.setFlowable(null);// 打印前置空 + webSearchApiResponse.setData(chatMessageAccumulator); + } + logger.info("model output: {}", mapper.writeValueAsString(webSearchApiResponse)); + client.getConfig().getHttpClient().dispatcher().executorService().shutdown(); + + client.getConfig().getHttpClient().connectionPool().evictAll(); + // List all active threads + for (Thread t : Thread.getAllStackTraces().keySet()) { + logger.info("Thread: " + t.getName() + " State: " + t.getState()); + } + + } + + + @Test + public void test2() throws JsonProcessingException { + +// json 转换 ArrayList + String jsonString = "[\n" + + " {\n" + + " \"content\": \"今天天气怎么样\",\n" + + " \"role\": \"user\"\n" + + " }\n" + + " ]"; + + ArrayList messages = new ObjectMapper().readValue(jsonString, new TypeReference>() { + }); + + + String requestId = String.format(requestIdTemplate, System.currentTimeMillis()); + WebSearchParamsRequest chatCompletionRequest = WebSearchParamsRequest.builder() + .model("web-search-pro") + .stream(Boolean.FALSE) + .messages(messages) + .requestId(requestId) + .build(); + WebSearchApiResponse webSearchApiResponse = client.invokeWebSearchPro(chatCompletionRequest); + + logger.info("model output: {}", mapper.writeValueAsString(webSearchApiResponse)); + + } + + + @Test + public void testFunctionSSE() throws JsonProcessingException { + List messages = new ArrayList<>(); + ChatMessage chatMessage = new ChatMessage(ChatMessageRole.USER.value(), "成都到北京要多久,天气如何"); + messages.add(chatMessage); + String requestId = String.format(requestIdTemplate, System.currentTimeMillis()); + // 函数调用参数构建部分 + List chatToolList = new ArrayList<>(); + ChatTool chatTool = new ChatTool(); + + chatTool.setType(ChatToolType.FUNCTION.value()); + ChatFunctionParameters chatFunctionParameters = new ChatFunctionParameters(); + chatFunctionParameters.setType("object"); + Map properties = new HashMap<>(); + properties.put("location", new HashMap() {{ + put("type", "string"); + put("description", "城市,如:北京"); + }}); + properties.put("unit", new HashMap() {{ + put("type", "string"); + put("enum", new ArrayList() {{ + add("celsius"); + add("fahrenheit"); + }}); + }}); + chatFunctionParameters.setProperties(properties); + ChatFunction chatFunction = ChatFunction.builder() + .name("get_weather") + .description("Get the current weather of a location") + .parameters(chatFunctionParameters) + .build(); + chatTool.setFunction(chatFunction); + chatToolList.add(chatTool); + HashMap extraJson = new HashMap<>(); + extraJson.put("temperature", 0.5); + extraJson.put("max_tokens", 50); + + ChatCompletionRequest chatCompletionRequest = ChatCompletionRequest.builder() + .model(Constants.ModelChatGLM4) + .stream(Boolean.TRUE) + .messages(messages) + .requestId(requestId) + .tools(chatToolList) + .toolChoice("auto") + .extraJson(extraJson) + .build(); + ModelApiResponse sseModelApiResp = client.invokeModelApi(chatCompletionRequest); + if (sseModelApiResp.isSuccess()) { + AtomicBoolean isFirst = new AtomicBoolean(true); + List choices = new ArrayList<>(); + ChatMessageAccumulator chatMessageAccumulator = mapStreamToAccumulator(sseModelApiResp.getFlowable()) + .doOnNext(accumulator -> { + { + if (isFirst.getAndSet(false)) { + logger.info("Response: "); + } + if (accumulator.getDelta() != null && accumulator.getDelta().getTool_calls() != null) { + String jsonString = mapper.writeValueAsString(accumulator.getDelta().getTool_calls()); + logger.info("tool_calls: {}", jsonString); + } + if (accumulator.getDelta() != null && accumulator.getDelta().getContent() != null) { + logger.info(accumulator.getDelta().getContent()); + } + choices.add(accumulator.getChoice()); + } + }) + .doOnComplete(System.out::println) + .lastElement() + .blockingGet(); + + + ModelData data = new ModelData(); + data.setChoices(choices); + data.setUsage(chatMessageAccumulator.getUsage()); + data.setId(chatMessageAccumulator.getId()); + data.setCreated(chatMessageAccumulator.getCreated()); + data.setRequestId(chatCompletionRequest.getRequestId()); + sseModelApiResp.setFlowable(null);// 打印前置空 + sseModelApiResp.setData(data); + } + logger.info("model output: {}", mapper.writeValueAsString(sseModelApiResp)); + } + + public static Flowable mapStreamToAccumulator(Flowable flowable) { + return flowable.map(chunk -> { + return new ChatMessageAccumulator(chunk.getChoices().get(0).getDelta(), null, chunk.getChoices().get(0), chunk.getUsage(), chunk.getCreated(), chunk.getId()); + }); + } + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/domain/request/ChatRequest.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/domain/request/ChatRequest.java new file mode 100644 index 0000000..548551a --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/domain/request/ChatRequest.java @@ -0,0 +1,65 @@ +package org.aibidding.common.chat.domain.request; + +import org.aibidding.common.chat.entity.chat.Message; +import jakarta.validation.constraints.NotEmpty; +import lombok.Data; + +import java.util.List; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @sine 2023-04-08 + */ +@Data +public class ChatRequest { + + + private String frequency_penalty; + + private String max_tokens; + + @NotEmpty(message = "对话消息不能为空") + List messages; + + @NotEmpty(message = "传入的模型不能为空") + private String model; + + private String presence_penalty; + + private String stream; + + private double temperature; + + private double top_p = 1; + + /** + * 知识库id + */ + private String kid; + + private String userId; +// + +// +// /** +// * gpt的默认设置 +// */ +// private String systemMessage = ""; +// +// +// +// private double temperature = 0.2; +// +// /** +// * 上下文的条数 +// */ +// private Integer contentNumber = 10; +// +// /** +// * 是否携带上下文 +// */ +// private Boolean usingContext = Boolean.TRUE; + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/domain/request/Dall3Request.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/domain/request/Dall3Request.java new file mode 100644 index 0000000..131c66f --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/domain/request/Dall3Request.java @@ -0,0 +1,33 @@ +package org.aibidding.common.chat.domain.request; + +import jakarta.validation.constraints.NotEmpty; +import lombok.Data; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @sine 2023-04-08 + */ +@Data +public class Dall3Request { + + @NotEmpty(message = "传入的模型不能为空") + private String model; + + @NotEmpty(message = "提示词不能为空") + private String prompt; + + /** 图片大小 */ + @NotEmpty(message = "图片大小不能为空") + private String size ; + + /** 图片质量 */ + @NotEmpty(message = "图片质量不能为空") + private String quality; + + /** 图片风格 */ + @NotEmpty(message = "图片风格不能为空") + private String style; + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/Tts/TextToSpeech.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/Tts/TextToSpeech.java new file mode 100644 index 0000000..745214c --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/Tts/TextToSpeech.java @@ -0,0 +1,48 @@ +package org.aibidding.common.chat.entity.Tts; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +@Data +@Builder +@JsonInclude(JsonInclude.Include.NON_NULL) +@NoArgsConstructor +@AllArgsConstructor +public class TextToSpeech { + + @Builder.Default + private String model = Model.TTS_1.getName(); + /** + * 音频声音源 + * + * @see TtsVoice + */ + private String voice; + /** + * 输入内容 + */ + private String input; + /** + * 输出音频文件格式 + * + * @see TtsFormat + */ + @JsonProperty("response_format") + private String responseFormat; + /** + * 速度调节,默认是1,取值范围0.25——4.0 + */ + private Double speed; + + + @Getter + @AllArgsConstructor + public enum Model { + TTS_1("tts-1"), + TTS_1_HD("tts-1-hd"), + ; + private final String name; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/Tts/TtsFormat.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/Tts/TtsFormat.java new file mode 100644 index 0000000..84e937c --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/Tts/TtsFormat.java @@ -0,0 +1,15 @@ +package org.aibidding.common.chat.entity.Tts; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum TtsFormat { + MP3("mp3"), + OPUS("opus"), + AAC("aac"), + FLAC("flac"), + ; + private final String name; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/Tts/TtsVoice.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/Tts/TtsVoice.java new file mode 100644 index 0000000..bed6e8f --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/Tts/TtsVoice.java @@ -0,0 +1,23 @@ +package org.aibidding.common.chat.entity.Tts; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 生成不同声音的音频 + *

具体语音效果参考:https://platform.openai.com/docs/guides/text-to-speech

+ */ +@Getter +@AllArgsConstructor +public enum TtsVoice { + + ALLOY("alloy"), + ECHO("echo"), + FABLE("fable"), + ONYX("onyx"), + NOVA("nova"), + SHIMMER("shimmer"), + ; + + private final String name; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/BillingUsage.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/BillingUsage.java new file mode 100644 index 0000000..52537f2 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/BillingUsage.java @@ -0,0 +1,33 @@ +package org.aibidding.common.chat.entity.billing; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 描述:金额消耗信息 + * + * @author https:www.unfbx.com + * @since 2023-04-08 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class BillingUsage { + + @JsonProperty("object") + private String object; + /** + * 账号金额消耗明细 + */ + @JsonProperty("daily_costs") + private List dailyCosts; + /** + * 总使用金额:美分 + */ + @JsonProperty("total_usage") + private BigDecimal totalUsage; + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/CreditGrantsResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/CreditGrantsResponse.java new file mode 100644 index 0000000..677da11 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/CreditGrantsResponse.java @@ -0,0 +1,39 @@ +package org.aibidding.common.chat.entity.billing; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 描述:余额查询接口返回值 + * + * @author https:www.unfbx.com + * @since 2023-03-18 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class CreditGrantsResponse implements Serializable { + private String object; + /** + * 总金额:美元 + */ + @JsonProperty("total_granted") + private BigDecimal totalGranted; + /** + * 总使用金额:美元 + */ + @JsonProperty("total_used") + private BigDecimal totalUsed; + /** + * 总剩余金额:美元 + */ + @JsonProperty("total_available") + private BigDecimal totalAvailable; + /** + * 余额明细 + */ + private Grants grants; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/DailyCost.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/DailyCost.java new file mode 100644 index 0000000..8e1b287 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/DailyCost.java @@ -0,0 +1,28 @@ +package org.aibidding.common.chat.entity.billing; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.util.List; + +/** + * 描述:金额消耗列表 + * + * @author https:www.unfbx.com + * @since 2023-04-08 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class DailyCost { + /** + * 时间戳 + */ + @JsonProperty("timestamp") + private long timestamp; + /** + * 模型消耗金额详情 + */ + @JsonProperty("line_items") + private List lineItems; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/Datum.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/Datum.java new file mode 100644 index 0000000..17388dd --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/Datum.java @@ -0,0 +1,40 @@ +package org.aibidding.common.chat.entity.billing; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @since 2023-03-18 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class Datum { + private String object; + private String id; + /** + * 赠送金额:美元 + */ + @JsonProperty("grant_amount") + private BigDecimal grantAmount; + /** + * 使用金额:美元 + */ + @JsonProperty("used_amount") + private BigDecimal usedAmount; + /** + * 生效时间戳 + */ + @JsonProperty("effective_at") + private Long effectiveAt; + /** + * 过期时间戳 + */ + @JsonProperty("expires_at") + private Long expiresAt; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/Grants.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/Grants.java new file mode 100644 index 0000000..93a444e --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/Grants.java @@ -0,0 +1,21 @@ +package org.aibidding.common.chat.entity.billing; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.util.List; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @since 2023-03-18 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class Grants { + private String object; + @JsonProperty("data") + private List data; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/KeyInfo.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/KeyInfo.java new file mode 100644 index 0000000..3f32142 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/KeyInfo.java @@ -0,0 +1,56 @@ +package org.aibidding.common.chat.entity.billing; + +import lombok.*; + +import java.time.LocalDate; + +/** + * openKey信息 + * + * @author admin + * @date 2023/6/15 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@ToString +public class KeyInfo { + /** + * 订阅类型 + */ + private String planTitle; + /** + * key值 + */ + private String keyValue; + /** + * 剩余额度 + */ + private Double remaining; + + /** + * 账户总余额 + */ + private Double totalAmount; + + /** + * 已使用的额度 + */ + private Double totalUsage; + + /** + * 截至日期 + */ + private LocalDate limitDate; + + /** + * 是否绑卡 + */ + private Boolean isHasPaymentMethod; + + /** + * 最高可用模型 + */ + private String model; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/LineItem.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/LineItem.java new file mode 100644 index 0000000..f400c97 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/LineItem.java @@ -0,0 +1,25 @@ +package org.aibidding.common.chat.entity.billing; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 描述:金额消耗列表 + * + * @author https:www.unfbx.com + * @since 2023-04-08 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class LineItem { + /** + * 模型名称 + */ + private String name; + /** + * 消耗金额 + */ + private BigDecimal cost; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/Plan.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/Plan.java new file mode 100644 index 0000000..344dad8 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/Plan.java @@ -0,0 +1,17 @@ +package org.aibidding.common.chat.entity.billing; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @since 2023-04-08 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class Plan { + private String title; + private String id; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/Subscription.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/Subscription.java new file mode 100644 index 0000000..3a23a05 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/billing/Subscription.java @@ -0,0 +1,73 @@ +package org.aibidding.common.chat.entity.billing; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +/** + * 描述:账户信息 + * + * @author https:www.unfbx.com + * @since 2023-04-08 + */ +@Data +public class Subscription { + + @JsonProperty("object") + private String object; + + /** + * 付款方式 + */ + @JsonProperty("has_payment_method") + private boolean hasPaymentMethod; + + @JsonProperty("canceled") + private boolean canceled; + @JsonProperty("canceled_at") + private Object canceledAt; + + @JsonProperty("delinquent") + private Object delinquent; + @JsonProperty("access_until") + private long accessUntil; + @JsonProperty("soft_limit") + private long softLimit; + @JsonProperty("hard_limit") + private long hardLimit; + @JsonProperty("system_hard_limit") + private long systemHardLimit; + @JsonProperty("soft_limit_usd") + private double softLimitUsd; + @JsonProperty("hard_limit_usd") + private double hardLimitUsd; + @JsonProperty("system_hard_limit_usd") + private double systemHardLimitUsd; + /** + * 计划 + */ + @JsonProperty("plan") + private Plan plan; + + /** + * 账户名称 + */ + @JsonProperty("account_name") + private String accountName; + + @JsonProperty("po_number") + private Object poNumber; + + /** + * 账单邮箱 + */ + @JsonProperty("billing_email") + private Object billingEmail; + @JsonProperty("tax_ids") + private Object taxIds; + @JsonProperty("billing_address") + private Object billingAddress; + @JsonProperty("business_address") + private Object businessAddress; + @JsonProperty("primary") + private Boolean primary; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/BaseChatCompletion.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/BaseChatCompletion.java new file mode 100644 index 0000000..bbfe2a0 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/BaseChatCompletion.java @@ -0,0 +1,255 @@ +package org.aibidding.common.chat.entity.chat; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import lombok.experimental.SuperBuilder; +import org.aibidding.common.chat.entity.chat.tool.Tools; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +import static org.aibidding.common.chat.entity.chat.BaseChatCompletion.Model.GPT_3_5_TURBO; + +/** + * 描述: chat模型基础类 + * + * @author https:www.unfbx.com + * @since 1.1.2 + * 2023-11-10 + */ +@Data +@SuperBuilder +@JsonInclude(JsonInclude.Include.NON_NULL) +@NoArgsConstructor +@AllArgsConstructor +public class BaseChatCompletion implements Serializable { + + @NonNull + @Builder.Default + private String model = GPT_3_5_TURBO.getName(); + + /** + * 指定模型必须输出的格式的对象。 + * + * @since 1.1.2 + */ + @JsonProperty("response_format") + private ResponseFormat responseFormat; + + /** + * 已过时 + * + * @see #tools + */ + @Deprecated + private List functions; + + /** + * 取值:null,auto或者自定义 + * functions没有值的时候默认为:null + * functions存在值得时候默认为:auto + * 也可以自定义 + *

已过时

+ * + * @see #toolChoice + */ + @Deprecated + @JsonProperty("function_call") + private Object functionCall; + + /** + * 模型可能调用的工具列表。 + * 当前版本仅支持:functions + * + * @since 1.1.2 + */ + private List tools; + + /** + * 取值:String或者ToolChoiceObj + * + * @since 1.1.2 + */ + @JsonProperty("tool_choice") + private Object toolChoice; + + /** + * 使用什么取样温度,0到2之间。较高的值(如0.8)将使输出更加随机,而较低的值(如0.2)将使输出更加集中和确定。 + *

+ * We generally recommend altering this or but not both.top_p + */ + @Builder.Default + private double temperature = 0.2; + + /** + * 使用温度采样的替代方法称为核心采样,其中模型考虑具有top_p概率质量的令牌的结果。因此,0.1 意味着只考虑包含前 10% 概率质量的代币。 + *

+ * 我们通常建议更改此设置,但不要同时更改两者。temperature + */ + @JsonProperty("top_p") + @Builder.Default + private Double topP = 1d; + + + /** + * 为每个提示生成的完成次数。 + */ + @Builder.Default + private Integer n = 1; + + + /** + * 是否流式输出. + * default:false + */ + @Builder.Default + private boolean stream = false; + /** + * 停止输出标识 + */ + private List stop; + /** + * 最大支持4096 + */ + @JsonProperty("max_tokens") + @Builder.Default + private Integer maxTokens = 2048; + + + @JsonProperty("presence_penalty") + @Builder.Default + private double presencePenalty = 0; + + /** + * -2.0 ~~ 2.0 + */ + @JsonProperty("frequency_penalty") + @Builder.Default + private double frequencyPenalty = 0; + + @JsonProperty("logit_bias") + private Map logitBias; + /** + * 用户唯一值,确保接口不被重复调用 + */ + private String user; + + /** + * @since 1.1.2 + */ + private Integer seed; + + + /** + * 最新模型参考官方文档: + * 官方稳定模型列表 + */ + @Getter + @AllArgsConstructor + public enum Model { + /** + * gpt-3.5-turbo + */ + GPT_3_5_TURBO("gpt-3.5-turbo"), + /** + * 临时模型,不建议使用,2023年9 月 13 日将被弃用 + */ + @Deprecated + GPT_3_5_TURBO_0301("gpt-3.5-turbo-0301"), + /** + * gpt-3.5-turbo-0613 支持函数 + */ + GPT_3_5_TURBO_1106("gpt-3.5-turbo-1106"), + + GPT_3_5_TURBO_0613("gpt-3.5-turbo-0613"), + /** + * gpt-3.5-turbo-16k 超长上下文 + */ + GPT_3_5_TURBO_16K("gpt-3.5-turbo-16k"), + /** + * gpt-3.5-turbo-16k-0613 超长上下文 支持函数 + */ + GPT_3_5_TURBO_16K_0613("gpt-3.5-turbo-16k-0613"), + /** + * gpt-3.5-turbo-0125 超长上下文 支持函数 + */ + GPT_3_5_TURBO_0125("gpt-3.5-turbo-0125"), + /** + * GPT4.0 + */ + GPT_4("gpt-4"), + /** + * 临时模型,不建议使用,2023年9 月 13 日将被弃用 + */ + @Deprecated + GPT_4_0314("gpt-4-0314"), + /** + * GPT4.0 超长上下文 + */ + GPT_4_32K("gpt-4-32k"), + /** + * 临时模型,不建议使用,2023年9 月 13 日将被弃用 + */ + @Deprecated + GPT_4_32K_0314("gpt-4-32k-0314"), + + /** + * gpt-4-0613,支持函数 + */ + GPT_4_0613("gpt-4-0613"), + /** + * gpt-4-0613,支持函数 + */ + GPT_4_32K_0613("gpt-4-32k-0613"), + /** + * 支持数组模式,支持function call,支持可重复输出 + */ + GPT_4_1106_PREVIEW("gpt-4-1106-preview"), + /** + * 支持图片 + */ + GPT_4_VISION_PREVIEW("gpt-4-vision-preview"), + /** + * gpt-4-0613,支持函数 + */ + GPT_4_0125_PREVIEW("gpt-4-0125-preview"), + + /** + * GPT_4_ALL + */ + GPT_4_ALL("gpt-4-all"), + + GPT_4_GIZMO("gpt-4-gizmo"), + + NET("net"), + + CLAUDE_3_SONNET("claude-3-sonnet-20240229"), + + GEMINI_PRO("gemini-pro"), + + STABLE_DIFFUSION("stable-diffusion"), + + SUNO_V3("suno-v3"), + ; + private final String name; + } + + @Getter + @AllArgsConstructor + public enum ChatType { + /** + * 对话类型 - 输入 + */ + CHAT_IN("in"), + /** + * 对话类型 - 输出 + */ + CHAT_OUT("out"), + + ; + private final String name; + } + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/BaseMessage.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/BaseMessage.java new file mode 100644 index 0000000..9f2207e --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/BaseMessage.java @@ -0,0 +1,84 @@ +package org.aibidding.common.chat.entity.chat; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.Getter; +import org.aibidding.common.chat.entity.chat.tool.ToolCalls; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @since 1.1.2 + * 2023-03-02 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +@AllArgsConstructor +public class BaseMessage implements Serializable { + + /** + * 目前支持四个中角色参考官网,进行情景输入: + * https://platform.openai.com/docs/guides/chat/introduction + */ + private String role; + + + private String name; + + /** + * The tool calls generated by the model, such as function calls. + * @since 1.1.2 + */ + @JsonProperty("tool_calls") + private List toolCalls; + + /** + * @since 1.1.2 + */ + @JsonProperty("tool_call_id") + private String toolCallId; + + @Deprecated + @JsonProperty("function_call") + private FunctionCall functionCall; + + + /** + * 构造函数 + * + * @param role 角色 + * @param name name + * @param functionCall functionCall + */ + public BaseMessage(String role, String name, FunctionCall functionCall) { + this.role = role; + this.name = name; + this.functionCall = functionCall; + } + + public BaseMessage() { + } + + + @Getter + @AllArgsConstructor + public enum Role { + + SYSTEM("system"), + USER("user"), + ASSISTANT("assistant"), + FUNCTION("function"), + TOOL("tool"), + ; + private final String name; + } + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ChatChoice.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ChatChoice.java new file mode 100644 index 0000000..5993ac3 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ChatChoice.java @@ -0,0 +1,31 @@ +package org.aibidding.common.chat.entity.chat; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @since 2023-03-02 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class ChatChoice implements Serializable { + private long index; + /** + * 请求参数stream为true返回是delta + */ + @JsonProperty("delta") + private Message delta; + /** + * 请求参数stream为false返回是message + */ + @JsonProperty("message") + private Message message; + @JsonProperty("finish_reason") + private String finishReason; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ChatCompletion.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ChatCompletion.java new file mode 100644 index 0000000..6d58743 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ChatCompletion.java @@ -0,0 +1,34 @@ +package org.aibidding.common.chat.entity.chat; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.NonNull; +import lombok.experimental.SuperBuilder; +import lombok.extern.slf4j.Slf4j; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述: chat模型参数 + * + * @author https:www.unfbx.com + * 2023-03-02 + */ +@Data +@SuperBuilder +@Slf4j +@JsonInclude(JsonInclude.Include.NON_NULL) +@NoArgsConstructor +@AllArgsConstructor +public class ChatCompletion extends BaseChatCompletion implements Serializable { + + /** + * 问题描述 + */ + @NonNull + private List messages; + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ChatCompletionResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ChatCompletionResponse.java new file mode 100644 index 0000000..831dbc3 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ChatCompletionResponse.java @@ -0,0 +1,25 @@ +package org.aibidding.common.chat.entity.chat; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; +import org.aibidding.common.chat.entity.common.Usage; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述: chat答案类 + * + * @author https:www.unfbx.com + * 2023-03-02 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class ChatCompletionResponse implements Serializable { + private String id; + private String object; + private long created; + private String model; + private List choices; + private Usage usage; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ChatCompletionWithPicture.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ChatCompletionWithPicture.java new file mode 100644 index 0000000..812c608 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ChatCompletionWithPicture.java @@ -0,0 +1,32 @@ +package org.aibidding.common.chat.entity.chat; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import lombok.extern.slf4j.Slf4j; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述: chat模型附带图片的参数 + * + * @author https:www.unfbx.com + * @since 1.1.2 + * 2023-11-10 + */ +@Data +@SuperBuilder +@Slf4j +@JsonInclude(JsonInclude.Include.NON_NULL) +@NoArgsConstructor +@AllArgsConstructor +public class ChatCompletionWithPicture extends BaseChatCompletion implements Serializable { + /** + * 问题描述 + */ + private List messages; + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/Content.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/Content.java new file mode 100644 index 0000000..e10942f --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/Content.java @@ -0,0 +1,43 @@ +package org.aibidding.common.chat.entity.chat; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import lombok.extern.slf4j.Slf4j; + +/** + * 描述: + * + * @author https://www.unfbx.com + * @since 1.1.2 + * 2023-11-10 + */ +@Data +@Builder +@Slf4j +@JsonInclude(JsonInclude.Include.NON_NULL) +@NoArgsConstructor +@AllArgsConstructor +public class Content { + /** + * 输入类型:text、image_url + * + * @see Type + */ + private String type; + private String text; + @JsonProperty("image_url") + private ImageUrl imageUrl; + + /** + * 生成图片风格 + */ + @Getter + @AllArgsConstructor + public enum Type { + TEXT("text"), + IMAGE_URL("image_url"), + ; + private final String name; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/FunctionCall.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/FunctionCall.java new file mode 100644 index 0000000..4badc93 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/FunctionCall.java @@ -0,0 +1,27 @@ +package org.aibidding.common.chat.entity.chat; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 描述:函数调用返回值 + * + * @author https://www.unfbx.com + * @since 2023-06-14 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class FunctionCall { + /** + * 方法名 + */ + private String name; + /** + * 方法参数 + */ + private String arguments; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/Functions.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/Functions.java new file mode 100644 index 0000000..2de7087 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/Functions.java @@ -0,0 +1,46 @@ +package org.aibidding.common.chat.entity.chat; + +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述:方法参数实体类,实例数据如下 + *

+ *     {
+ *          "name": "get_current_weather",
+ *          "description": "Get the current weather in a given location",
+ *          "parameters": {
+ *              "type": "object",
+ *              "properties": {
+ *                  "location": {
+ *                      "type": "string",
+ *                      "description": "The city and state, e.g. San Francisco, CA"
+ *                  },
+ *                  "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
+ *              },
+ *              "required": ["location"]
+ *          },
+ *     }
+ * 
+ * @author https:www.unfbx.com + * @since 2023-06-14 + */ +@Data +@Builder +public class Functions implements Serializable { + /** + * 方法名称 + */ + private String name; + /** + * 方法描述 + */ + private String description; + /** + * 方法参数 + * 扩展参数可以继承Parameters自己实现,json格式的数据 + */ + private Parameters parameters; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ImageUrl.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ImageUrl.java new file mode 100644 index 0000000..848779a --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ImageUrl.java @@ -0,0 +1,28 @@ +package org.aibidding.common.chat.entity.chat; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +/** + * 描述: + * + * @author https://www.unfbx.com + * 2023-11-10 + */ +@Data +@Builder +@Slf4j +@JsonInclude(JsonInclude.Include.NON_NULL) +@NoArgsConstructor +@AllArgsConstructor +public class ImageUrl { + /** + * 图片地址,支持base64. eg: data:image/jpeg;base64,{base64_image} + * https://platform.openai.com/docs/guides/vision + */ + private String url; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/Message.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/Message.java new file mode 100644 index 0000000..f158310 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/Message.java @@ -0,0 +1,107 @@ +package org.aibidding.common.chat.entity.chat; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; +import org.aibidding.common.chat.entity.chat.tool.ToolCalls; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @since 2023-03-02 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public class Message extends BaseMessage implements Serializable { + + private Object content; + + public static Builder builder() { + return new Builder(); + } + + /** + * 构造函数 + * + * @param role 角色 + * @param name name + * @param content content + * @param functionCall functionCall + */ + public Message(String role, String name, String content, List toolCalls, String toolCallId, FunctionCall functionCall) { + this.content = content; + super.setRole(role); + super.setName(name); + super.setToolCalls(toolCalls); + super.setToolCallId(toolCallId); + super.setFunctionCall(functionCall); + } + + public Message() { + } + + private Message(Builder builder) { + setContent(builder.content); + super.setRole(builder.role); + super.setName(builder.name); + super.setFunctionCall(builder.functionCall); + super.setToolCalls(builder.toolCalls); + super.setToolCallId(builder.toolCallId); + } + + public static final class Builder { + private String role; + private String content; + private String name; + private String toolCallId; + private List toolCalls; + private FunctionCall functionCall; + + public Builder() { + } + + public Builder role(Role role) { + this.role = role.getName(); + return this; + } + + public Builder role(String role) { + this.role = role; + return this; + } + + public Builder content(String content) { + this.content = content; + return this; + } + + public Builder name(String name) { + this.name = name; + return this; + } + + public Builder functionCall(FunctionCall functionCall) { + this.functionCall = functionCall; + return this; + } + + public Builder toolCalls(List toolCalls) { + this.toolCalls = toolCalls; + return this; + } + + public Builder toolCallId(String toolCallId) { + this.toolCallId = toolCallId; + return this; + } + + public Message build() { + return new Message(this); + } + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/MessagePicture.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/MessagePicture.java new file mode 100644 index 0000000..055d898 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/MessagePicture.java @@ -0,0 +1,114 @@ +package org.aibidding.common.chat.entity.chat; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Data; +import org.aibidding.common.chat.entity.chat.tool.ToolCalls; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @since 2023-03-02 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +@AllArgsConstructor +public class MessagePicture extends BaseMessage implements Serializable { + /** + * Content数组支持多图片输入 + * https://platform.openai.com/docs/guides/vision + */ + private List content; + + + public static Builder builder() { + return new Builder(); + } + + /** + * 构造函数 + * + * @param role 角色 + * @param name name + * @param content content + * @param functionCall functionCall + */ + public MessagePicture(String role, String name, List content, List toolCalls, String toolCallId, FunctionCall functionCall) { + this.content = content; + super.setRole(role); + super.setName(name); + super.setToolCalls(toolCalls); + super.setToolCallId(toolCallId); + super.setFunctionCall(functionCall); + } + + public MessagePicture() { + } + + private MessagePicture(Builder builder) { + setContent(builder.content); + super.setRole(builder.role); + super.setName(builder.name); + super.setFunctionCall(builder.functionCall); + super.setToolCalls(builder.toolCalls); + super.setToolCallId(builder.toolCallId); + } + + public static final class Builder { + private String role; + private List content; + private String name; + private String toolCallId; + private List toolCalls; + private FunctionCall functionCall; + + public Builder() { + } + + public Builder role(Role role) { + this.role = role.getName(); + return this; + } + + public Builder role(String role) { + this.role = role; + return this; + } + + public Builder content(List content) { + this.content = content; + return this; + } + + public Builder name(String name) { + this.name = name; + return this; + } + + public Builder functionCall(FunctionCall functionCall) { + this.functionCall = functionCall; + return this; + } + + public Builder toolCalls(List toolCalls) { + this.toolCalls = toolCalls; + return this; + } + + public Builder toolCallId(String toolCallId) { + this.toolCallId = toolCallId; + return this; + } + + public MessagePicture build() { + return new MessagePicture(this); + } + } + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/Parameters.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/Parameters.java new file mode 100644 index 0000000..4a1a6f1 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/Parameters.java @@ -0,0 +1,42 @@ +package org.aibidding.common.chat.entity.chat; + +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +/** + * 描述:方法参数类,扩展参数可以继承Parameters自己实现 + * 参考: + *
+ * {
+ *     "type": "object",
+ *     "properties": {
+ *         "location": {
+ *             "type": "string",
+ *             "description": "The city and state, e.g. San Francisco, CA"
+ *         },
+ *         "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
+ *     },
+ *     "required": ["location"]
+ * }
+ * 
+ * @author https:www.unfbx.com + * @since 2023-06-14 + */ +@Data +@Builder +public class Parameters implements Serializable { + /** + * 参数类型 + */ + private String type; + /** + * 参数属性、描述 + */ + private Object properties; + /** + * 方法必输字段 + */ + private List required; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ResponseFormat.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ResponseFormat.java new file mode 100644 index 0000000..4751630 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/ResponseFormat.java @@ -0,0 +1,29 @@ +package org.aibidding.common.chat.entity.chat; + +import lombok.*; + +/** + * 指定模型必须输出的格式的对象。 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ResponseFormat { + /** + * 默认:text + * + * @see Type + */ + private String type; + + @Getter + @AllArgsConstructor + public enum Type { + JSON_OBJECT("json_object"), + TEXT("text"), + ; + private final String name; + + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolCallFunction.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolCallFunction.java new file mode 100644 index 0000000..694174c --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolCallFunction.java @@ -0,0 +1,31 @@ +package org.aibidding.common.chat.entity.chat.tool; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * ToolCall 的 Function参数 + * The function that the model called. + * + * @author https:www.unfbx.com + * @since 1.1.2 + * 2023-11-09 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ToolCallFunction implements Serializable { + /** + * 方法名 + */ + private String name; + /** + * 方法参数 + */ + private String arguments; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolCalls.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolCalls.java new file mode 100644 index 0000000..277f268 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolCalls.java @@ -0,0 +1,37 @@ +package org.aibidding.common.chat.entity.chat.tool; + +import lombok.*; + +import java.io.Serializable; + +/** + * The tool calls generated by the model, such as function calls. + * + * @author unfbx + * @since 1.1.2 + * 2023-11-09 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ToolCalls implements Serializable { + /** + * The ID of the tool call. + */ + private String id; + /** + * The type of the tool. Currently, only function is supported. + */ + private String type; + + private ToolCallFunction function; + + @Getter + @AllArgsConstructor + public enum Type { + FUNCTION("function"), + ; + private final String name; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolChoice.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolChoice.java new file mode 100644 index 0000000..fd9a66b --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolChoice.java @@ -0,0 +1,27 @@ +package org.aibidding.common.chat.entity.chat.tool; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.Getter; + +import java.io.Serializable; + +/** + * choice和object同时存在是以object为准 + * + * @author unfbx + * @since 1.1.2 + * 2023-11-09 + */ +@Data +public class ToolChoice implements Serializable { + + @Getter + @AllArgsConstructor + public enum Choice { + NONE("none"), + AUTO("auto"), + ; + private final String name; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolChoiceObj.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolChoiceObj.java new file mode 100644 index 0000000..887a94f --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolChoiceObj.java @@ -0,0 +1,33 @@ +package org.aibidding.common.chat.entity.chat.tool; + +import lombok.*; + +/** + * @author unfbx + * @since 1.1.2 + * 2023-11-09 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ToolChoiceObj { + /** + * 需要调用的方法名称 + */ + private ToolChoiceObjFunction function; + /** + * 工具的类型。目前仅支持函数。 + * + * @see Type + */ + private String type; + + @Getter + @AllArgsConstructor + public enum Type { + FUNCTION("function"), + ; + private final String name; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolChoiceObjFunction.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolChoiceObjFunction.java new file mode 100644 index 0000000..4d89dec --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolChoiceObjFunction.java @@ -0,0 +1,21 @@ +package org.aibidding.common.chat.entity.chat.tool; + + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author unfbx + * @since 1.1.2 + * 2023-11-09 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ToolChoiceObjFunction { + + private String name; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/Tools.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/Tools.java new file mode 100644 index 0000000..a6e3bd0 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/Tools.java @@ -0,0 +1,35 @@ +package org.aibidding.common.chat.entity.chat.tool; + + +import lombok.*; + +import java.io.Serializable; + +/** + * @author unfbx + * @since 1.1.2 + * 2023-11-09 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class Tools implements Serializable { + + /** + * 目前只支持:function + * + * @see Type + */ + private String type; + + private ToolsFunction function; + + @Getter + @AllArgsConstructor + public enum Type { + FUNCTION("function"), + ; + private final String name; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolsFunction.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolsFunction.java new file mode 100644 index 0000000..e4906f5 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/chat/tool/ToolsFunction.java @@ -0,0 +1,36 @@ +package org.aibidding.common.chat.entity.chat.tool; + + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.aibidding.common.chat.entity.chat.Parameters; + +import java.io.Serializable; + +/** + * @author unfbx + * @since 1.1.2 + * 2023-11-09 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ToolsFunction implements Serializable { + + /** + * 要调用的函数的名称。必须是 a-z、A-Z、0-9,或包含下划线和破折号,最大长度为 64 + */ + private String name; + /** + * 对函数功能的描述,模型使用它来选择何时以及如何调用该函数。 + */ + private String description; + /** + * 函数接受的参数,描述为 JSON Schema 对象 + * 扩展参数可以继承Parameters自己实现,json格式的数据 + */ + private Parameters parameters; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/common/Choice.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/common/Choice.java new file mode 100644 index 0000000..456dd7b --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/common/Choice.java @@ -0,0 +1,23 @@ +package org.aibidding.common.chat.entity.common; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class Choice implements Serializable { + private String text; + private long index; + private Object logprobs; + @JsonProperty("finish_reason") + private String finishReason; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/common/DeleteResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/common/DeleteResponse.java new file mode 100644 index 0000000..163d5e3 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/common/DeleteResponse.java @@ -0,0 +1,20 @@ +package org.aibidding.common.chat.entity.common; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class DeleteResponse implements Serializable { + private String id; + private String object; + private boolean deleted; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/common/OpenAiResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/common/OpenAiResponse.java new file mode 100644 index 0000000..f042937 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/common/OpenAiResponse.java @@ -0,0 +1,30 @@ +package org.aibidding.common.chat.entity.common; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class OpenAiResponse implements Serializable { + private String object; + private List data; + private Error error; + + + @Data + @JsonIgnoreProperties(ignoreUnknown = true) + public class Error { + private String message; + private String type; + private String param; + private String code; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/common/Usage.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/common/Usage.java new file mode 100644 index 0000000..a4e769e --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/common/Usage.java @@ -0,0 +1,24 @@ +package org.aibidding.common.chat.entity.common; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class Usage implements Serializable { + @JsonProperty("prompt_tokens") + private long promptTokens; + @JsonProperty("completion_tokens") + private long completionTokens; + @JsonProperty("total_tokens") + private long totalTokens; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/completions/Completion.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/completions/Completion.java new file mode 100644 index 0000000..7ff7f00 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/completions/Completion.java @@ -0,0 +1,125 @@ +package org.aibidding.common.chat.entity.completions; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import lombok.extern.slf4j.Slf4j; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * 描述: 问题类 + * + * @author https:www.unfbx.com + * 2023-02-11 + */ +@Data +@Builder +@Slf4j +@JsonInclude(JsonInclude.Include.NON_NULL) +@NoArgsConstructor +@AllArgsConstructor +public class Completion implements Serializable { + + @NonNull + @Builder.Default + private String model = Model.DAVINCI_003.getName(); + /** + * 问题描述 + */ + @NonNull + private String prompt; + /** + * 完成输出后的后缀,用于格式化输出结果 + */ + private String suffix; + + /** + * 最大支持4096 + */ + @JsonProperty("max_tokens") + @Builder.Default + private Integer maxTokens = 2048; + /** + * 使用什么取样温度,0到2之间。较高的值(如0.8)将使输出更加随机,而较低的值(如0.2)将使输出更加集中和确定。 + *

+ * We generally recommend altering this or but not both.top_p + */ + @Builder.Default + private double temperature = 0; + + /** + * 使用温度采样的替代方法称为核心采样,其中模型考虑具有top_p概率质量的令牌的结果。因此,0.1 意味着只考虑包含前 10% 概率质量的代币。 + *

+ * 我们通常建议更改此设置,但不要同时更改两者。temperature + */ + @JsonProperty("top_p") + @Builder.Default + private Double topP = 1d; + + /** + * 为每个提示生成的完成次数。 + */ + @Builder.Default + private Integer n = 1; + + @Builder.Default + private boolean stream = false; + /** + * 最大值:5 + */ + private Integer logprobs; + + @Builder.Default + private boolean echo = false; + + private List stop; + + @JsonProperty("presence_penalty") + @Builder.Default + private double presencePenalty = 0; + + /** + * -2.0 ~~ 2.0 + */ + @JsonProperty("frequency_penalty") + @Builder.Default + private double frequencyPenalty = 0; + + @JsonProperty("best_of") + @Builder.Default + private Integer bestOf = 1; + + @JsonProperty("logit_bias") + private Map logitBias; + /** + * 用户唯一值,确保接口不被重复调用 + */ + private String user; + + /** + * 获取当前参数的tokens数 + * @return token数量 + */ +// public long tokens() { +// if (StrUtil.isBlank(this.prompt) || StrUtil.isBlank(this.model)) { +// log.warn("参数异常model:{},prompt:{}", this.model, this.prompt); +// return 0; +// } +// return TikTokensUtil.tokens(this.model, this.prompt); +// } + + @Getter + @AllArgsConstructor + public enum Model { + DAVINCI_003("text-davinci-003"), + DAVINCI_002("text-davinci-002"), + DAVINCI("davinci"), + ; + private String name; + } +} + + diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/completions/CompletionResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/completions/CompletionResponse.java new file mode 100644 index 0000000..cb510ef --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/completions/CompletionResponse.java @@ -0,0 +1,26 @@ +package org.aibidding.common.chat.entity.completions; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; +import org.aibidding.common.chat.entity.common.Choice; +import org.aibidding.common.chat.entity.common.OpenAiResponse; +import org.aibidding.common.chat.entity.common.Usage; + +import java.io.Serializable; + +/** + * 描述: 答案类 + * + * @author https:www.unfbx.com + * 2023-02-11 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class CompletionResponse extends OpenAiResponse implements Serializable { + private String id; + private String object; + private long created; + private String model; + private Choice[] choices; + private Usage usage; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/dto/WebSocketMessageDto.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/dto/WebSocketMessageDto.java new file mode 100644 index 0000000..22ca9c3 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/dto/WebSocketMessageDto.java @@ -0,0 +1,29 @@ +package org.aibidding.common.chat.entity.dto; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.List; + +/** + * 消息的dto + * + * @author zendwang + */ +@Data +public class WebSocketMessageDto implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 需要推送到的session key 列表 + */ + private List sessionKeys; + + /** + * 需要发送的消息 + */ + private String message; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/edits/Edit.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/edits/Edit.java new file mode 100644 index 0000000..4b54743 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/edits/Edit.java @@ -0,0 +1,104 @@ +package org.aibidding.common.chat.entity.edits; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import lombok.extern.slf4j.Slf4j; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Getter +@Builder +@Slf4j +@NoArgsConstructor +@AllArgsConstructor +public class Edit implements Serializable { + /** + * 编辑模型,目前支持两种 + */ + @NonNull + private String model; + + @NonNull + private String input; + /** + * 提示说明。告知模型如何修改。 + */ + @NonNull + private String instruction; + + + /** + * 使用什么取样温度,0到2之间。较高的值(如0.8)将使输出更加随机,而较低的值(如0.2)将使输出更加集中和确定。 + * + * We generally recommend altering this or but not both.top_p + */ + @Builder.Default + private double temperature = 0; + + /** + * 使用温度采样的替代方法称为核心采样,其中模型考虑具有top_p概率质量的令牌的结果。因此,0.1 意味着只考虑包含前 10% 概率质量的代币。 + * + * 我们通常建议更改此设置,但不要同时更改两者。temperature + */ + @JsonProperty("top_p") + @Builder.Default + private Double topP = 1d; + + /** + * 为每个提示生成的完成次数。 + */ + @Builder.Default + private Integer n = 1; + + public void setModel(Model model) { + this.model = model.getName(); + } + + public void setTemperature(double temperature) { + if (temperature > 2 || temperature < 0) { + log.error("temperature参数异常,temperature属于[0,2]"); + this.temperature = 2; + return; + } + if (temperature < 0) { + log.error("temperature参数异常,temperature属于[0,2]"); + this.temperature = 0; + return; + } + this.temperature = temperature; + } + + + public void setTopP(Double topP) { + this.topP = topP; + } + + public void setN(Integer n) { + this.n = n; + } + + public void setInput(String input) { + this.input = input; + } + + public void setInstruction(String instruction) { + this.instruction = instruction; + } + @Getter + @AllArgsConstructor + public enum Model { + TEXT_DAVINCI_EDIT_001("text-davinci-edit-001"), + CODE_DAVINCI_EDIT_001("code-davinci-edit-001"), + ; + private String name; + } +} + + + diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/edits/EditResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/edits/EditResponse.java new file mode 100644 index 0000000..fb5e789 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/edits/EditResponse.java @@ -0,0 +1,26 @@ +package org.aibidding.common.chat.entity.edits; + + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; +import org.aibidding.common.chat.entity.common.Choice; +import org.aibidding.common.chat.entity.common.Usage; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class EditResponse implements Serializable { + private String id; + private String object; + private long created; + private String model; + private Choice[] choices; + private Usage usage; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/embeddings/Embedding.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/embeddings/Embedding.java new file mode 100644 index 0000000..d494116 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/embeddings/Embedding.java @@ -0,0 +1,54 @@ +package org.aibidding.common.chat.entity.embeddings; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.*; +import lombok.extern.slf4j.Slf4j; + +import java.io.Serializable; +import java.util.List; +import java.util.Objects; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Getter +@Slf4j +@Builder +@JsonInclude(JsonInclude.Include.NON_NULL) +@NoArgsConstructor +@AllArgsConstructor +public class Embedding implements Serializable { + @NonNull + @Builder.Default + private String model = Model.TEXT_EMBEDDING_ADA_002.getName(); + /** + * 必选项:长度不能超过:8192 + */ + @NonNull + private List input; + + private String user; + + public void setModel(Model model) { + if (Objects.isNull(model)) { + model = Model.TEXT_EMBEDDING_ADA_002; + } + this.model = model.getName(); + } + + + public void setUser(String user) { + this.user = user; + } + + @Getter + @AllArgsConstructor + public enum Model { + TEXT_EMBEDDING_ADA_002("text-embedding-ada-002"), + ; + private String name; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/embeddings/EmbeddingResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/embeddings/EmbeddingResponse.java new file mode 100644 index 0000000..b55fa80 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/embeddings/EmbeddingResponse.java @@ -0,0 +1,24 @@ +package org.aibidding.common.chat.entity.embeddings; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; +import org.aibidding.common.chat.entity.common.Usage; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class EmbeddingResponse implements Serializable { + + private String object; + private List data; + private String model; + private Usage usage; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/embeddings/Item.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/embeddings/Item.java new file mode 100644 index 0000000..b1a5d62 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/embeddings/Item.java @@ -0,0 +1,16 @@ +package org.aibidding.common.chat.entity.embeddings; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class Item implements Serializable { + private String object; + private List embedding; + private Integer index; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/engines/Engine.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/engines/Engine.java new file mode 100644 index 0000000..1cdc54b --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/engines/Engine.java @@ -0,0 +1,25 @@ +package org.aibidding.common.chat.entity.engines; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class Engine implements Serializable { + + private String id; + private String object; + private String owner; + private boolean ready; + private Object permissions; + private long created; + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/files/File.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/files/File.java new file mode 100644 index 0000000..2f0210b --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/files/File.java @@ -0,0 +1,34 @@ +package org.aibidding.common.chat.entity.files; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class File implements Serializable { + +// private String id; +// private String object; +// private long bytes; +// private long created_at; +// private String filename; +// private String purpose; +// private String status; +// @JsonProperty("status_details") +// private String statusDetails; + + private long bytes; + private long created_at; + private String filename; + private String id; + private String object; + private String url; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/files/UploadFileResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/files/UploadFileResponse.java new file mode 100644 index 0000000..b000495 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/files/UploadFileResponse.java @@ -0,0 +1,17 @@ +package org.aibidding.common.chat.entity.files; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class UploadFileResponse extends File implements Serializable { +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/Event.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/Event.java new file mode 100644 index 0000000..35d90e1 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/Event.java @@ -0,0 +1,17 @@ +package org.aibidding.common.chat.entity.fineTune; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class Event implements Serializable { + private String object; + @JsonProperty("created_at") + private long createdAt; + private String level; + private String message; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/FineTune.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/FineTune.java new file mode 100644 index 0000000..66713f9 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/FineTune.java @@ -0,0 +1,122 @@ +package org.aibidding.common.chat.entity.fineTune; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.chat.openai.exception.CommonError; +import org.aibidding.common.core.exception.base.BaseException; + +import java.io.Serializable; +import java.util.List; +import java.util.Objects; + +@Getter +@Slf4j +@Builder +@JsonInclude(JsonInclude.Include.NON_NULL) +@NoArgsConstructor +@AllArgsConstructor +public class FineTune implements Serializable { + + /** + * 上传的文件ID + */ + @NonNull + @JsonProperty("training_file") + private String trainingFile; + + @JsonProperty("validation_file") + private String validationFile; + /** + * 参考 + * @see Model + */ + private String model; + + @JsonProperty("n_epochs") + @Builder.Default + private Integer n_epochs = 4; + + @JsonProperty("batch_size") + private Integer batchSize; + + @JsonProperty("learning_rate_multiplier") + private Double learningRateMultiplier; + + @JsonProperty("prompt_loss_weight") + @Builder.Default + private Double promptLossWeight = 0.01; + + @JsonProperty("compute_classification_metrics") + @Builder.Default + private boolean computeClassificationMetrics = false; + + @JsonProperty("classification_n_classes") + private Integer classificationNClasses; + + @JsonProperty("classification_betas") + private List classificationBetas; + + private String suffix; + + public void setTrainingFile(String trainingFile) { + this.trainingFile = trainingFile; + } + + public void setValidationFile(String validationFile) { + this.validationFile = validationFile; + } + + public void setModel(String model) { + this.model = model; + } + + public void setN_epochs(Integer n_epochs) { + this.n_epochs = n_epochs; + } + + public void setBatchSize(Integer batchSize) { + this.batchSize = batchSize; + } + + public void setLearningRateMultiplier(Double learningRateMultiplier) { + this.learningRateMultiplier = learningRateMultiplier; + } + + public void setPromptLossWeight(Double promptLossWeight) { + this.promptLossWeight = promptLossWeight; + } + + public void setComputeClassificationMetrics(boolean computeClassificationMetrics) { + this.computeClassificationMetrics = computeClassificationMetrics; + } + + public void setClassificationNClasses(Integer classificationNClasses) { + this.classificationNClasses = classificationNClasses; + } + + public void setClassificationBetas(List classificationBetas) { + this.classificationBetas = classificationBetas; + } + + public void setSuffix(String suffix) { + if(Objects.nonNull(suffix) && !"".equals(suffix) && suffix.length() > 40){ + log.error("后缀长度不能大于40"); + throw new BaseException(CommonError.PARAM_ERROR.msg()); + } + this.suffix = suffix; + } + + @Getter + @AllArgsConstructor + public enum Model { + // or a fine-tuned model created after 2022-04-21. + ADA("ada"), + BABBAGE("babbage"), + CURIE("curie"), + DAVINCI("davinci"), + ; + private String name; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/FineTuneDeleteResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/FineTuneDeleteResponse.java new file mode 100644 index 0000000..c2c43cc --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/FineTuneDeleteResponse.java @@ -0,0 +1,18 @@ +package org.aibidding.common.chat.entity.fineTune; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class FineTuneDeleteResponse implements Serializable { + + private String id; + + private String object; + + private boolean deleted; + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/FineTuneResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/FineTuneResponse.java new file mode 100644 index 0000000..42f92f1 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/FineTuneResponse.java @@ -0,0 +1,49 @@ +package org.aibidding.common.chat.entity.fineTune; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class FineTuneResponse implements Serializable { + + private String id; + + private String object; + + private String model; + + @JsonProperty("created_at") + private long createdAt; + + private List events; + + @JsonProperty("fine_tuned_model") + private String fineTunedModel; + + @JsonProperty("hyperparams") + private HyperParam hyperParams; + + @JsonProperty("organization_id") + private String organizationId; + + @JsonProperty("result_files") + private List resultFiles; + + private String status; + + @JsonProperty("validation_files") + private List validationFiles; + + @JsonProperty("training_files") + private List trainingFiles; + + @JsonProperty("updated_at") + private long updatedAt; + + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/HyperParam.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/HyperParam.java new file mode 100644 index 0000000..96a0a06 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/HyperParam.java @@ -0,0 +1,21 @@ +package org.aibidding.common.chat.entity.fineTune; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class HyperParam implements Serializable { + + @JsonProperty("batch_size") + private Integer batchSize; + @JsonProperty("learning_rate_multiplier") + private Double learningRateMultiplier; + @JsonProperty("n_epochs") + private Integer nEpochs; + @JsonProperty("prompt_loss_weight") + private Double promptLossWeight; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/TrainingFile.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/TrainingFile.java new file mode 100644 index 0000000..55b1387 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/fineTune/TrainingFile.java @@ -0,0 +1,23 @@ +package org.aibidding.common.chat.entity.fineTune; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class TrainingFile implements Serializable { + + private String id; + private String object; + private long bytes; + @JsonProperty("created_at") + private long createdAt; + private String filename; + private String purpose; + private String status; + @JsonProperty("status_details") + private String statusDetails; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/Image.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/Image.java new file mode 100644 index 0000000..f615112 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/Image.java @@ -0,0 +1,111 @@ +package org.aibidding.common.chat.entity.images; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Getter +@Slf4j +@Builder +@JsonInclude(JsonInclude.Include.NON_NULL) +@NoArgsConstructor +@AllArgsConstructor +public class Image implements Serializable { + + /** + * 提示词:dall-e-2支持1000字符、dall-e-3支持4000字符 + */ + private String prompt; + /** + * 支持dall-e-2、dall-e-3 + * + * @see Model + */ + @Builder.Default + private String model = Model.DALL_E_3.getName(); + + /** + * 此参数仅仅dall-e-3,默认值:standard + * + * @see Quality + */ + private String quality; + + /** + * 为每个提示生成的个数,dall-e-3只能为1。 + */ + private Integer n; + /** + * 图片尺寸,默认值:1024x1024 + * dall-e-2支持:256x256, 512x512, or 1024x1024 + * dall-e-3支持:1024x1024, 1792x1024, or 1024x1792 + * + * @see SizeEnum + */ + private String size; + /** + * 此参数仅仅dall-e-3,取值范围:vivid、natural + * 默认值:vivid + * + * @see Style + */ + private String style; + + /** + * 生成图片格式:url、b64_json + * + * @see ResponseFormat + */ + @JsonProperty("response_format") + private String responseFormat; + + private String user; + + /** + * 图片生成模型 + */ + @Getter + @AllArgsConstructor + public enum Model { + DALL_E_2("dall-e-2"), + DALL_E_3("dall-e-3"), + ; + private final String name; + } + + /** + * 生成图片质量 + */ + @Getter + @AllArgsConstructor + public enum Quality { + STANDARD("standard"), + HD("hd"), + ; + private final String name; + } + + /** + * 生成图片风格 + */ + @Getter + @AllArgsConstructor + public enum Style { + VIVID("vivid"), + NATURAL("natural"), + ; + private final String name; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/ImageEdit.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/ImageEdit.java new file mode 100644 index 0000000..216346f --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/ImageEdit.java @@ -0,0 +1,98 @@ +package org.aibidding.common.chat.entity.images; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.chat.openai.exception.CommonError; +import org.aibidding.common.core.exception.base.BaseException; + +import java.io.Serializable; +import java.util.Objects; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Getter +@Slf4j +@Builder +@JsonInclude(JsonInclude.Include.NON_NULL) +@NoArgsConstructor +@AllArgsConstructor +public class ImageEdit implements Serializable { + /** + * 必选项:描述文字,最多1000字符 + */ + @NonNull + private String prompt; + /** + * 为每个提示生成的完成次数。 + */ + @Builder.Default + private Integer n = 1; + /** + * 256x256 + * 512x512 + * 1024x1024 + */ + @Builder.Default + private String size = SizeEnum.size_512.getName(); + + @JsonProperty("response_format") + @Builder.Default + private String responseFormat = ResponseFormat.URL.getName(); + + private String user; + + public ImageEdit setN(Integer n) { + if(n < 1){ + log.warn("n最小值1"); + n = 1; + } + if(n > 10){ + log.warn("n最大值10"); + n = 10; + } + this.n = n; + return this; + } + + public ImageEdit setPrompt(String prompt) { + if(Objects.isNull(prompt) || "".equals(prompt)){ + log.error("参数异常"); + throw new BaseException(CommonError.PARAM_ERROR.msg()); + } + if(prompt.length() > 1000){ + log.error("长度超过1000"); + throw new BaseException(CommonError.PARAM_ERROR.msg()); + } + this.prompt = prompt; + return this; + } + + public ImageEdit setSize(SizeEnum size) { + if(Objects.isNull(size)){ + size = SizeEnum.size_512; + } + this.size = size.getName(); + return this; + } + + public ImageEdit setResponseFormat(ResponseFormat responseFormat) { + if(Objects.isNull(responseFormat)){ + responseFormat = ResponseFormat.URL; + } + this.responseFormat = responseFormat.getName(); + return this; + } + + public ImageEdit setUser(String user) { + this.user = user; + return this; + } + + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/ImageResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/ImageResponse.java new file mode 100644 index 0000000..207feae --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/ImageResponse.java @@ -0,0 +1,20 @@ +package org.aibidding.common.chat.entity.images; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class ImageResponse implements Serializable { + private long created; + private List data; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/ImageVariations.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/ImageVariations.java new file mode 100644 index 0000000..bb9c633 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/ImageVariations.java @@ -0,0 +1,81 @@ +package org.aibidding.common.chat.entity.images; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import java.io.Serializable; +import java.util.Objects; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Getter +@Slf4j +@Builder +@JsonInclude(JsonInclude.Include.NON_NULL) +@NoArgsConstructor +@AllArgsConstructor +public class ImageVariations implements Serializable { + /** + * 为每个提示生成的完成次数。 + */ + @Builder.Default + private Integer n = 1; + /** + * 256x256 + * 512x512 + * 1024x1024 + */ + @Builder.Default + private String size = SizeEnum.size_512.getName(); + + @JsonProperty("response_format") + @Builder.Default + private String responseFormat = ResponseFormat.URL.getName(); + + private String user; + + + public void setN(Integer n) { + if (n < 1) { + log.warn("n最小值1"); + this.n = 1; + return; + } + if (n > 10) { + log.warn("n最大值10"); + this.n = 10; + return; + } + this.n = n; + } + + + public void setSize(SizeEnum size) { + if (Objects.isNull(size)) { + size = SizeEnum.size_512; + } + this.size = size.getName(); + } + + public void setResponseFormat(ResponseFormat responseFormat) { + if (Objects.isNull(responseFormat)) { + responseFormat = ResponseFormat.URL; + } + this.responseFormat = responseFormat.getName(); + } + + public void setUser(String user) { + this.user = user; + } + + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/Item.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/Item.java new file mode 100644 index 0000000..7f66b2c --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/Item.java @@ -0,0 +1,21 @@ +package org.aibidding.common.chat.entity.images; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class Item implements Serializable { + private String url; + @JsonProperty("b64_json") + private String b64Json; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/ResponseFormat.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/ResponseFormat.java new file mode 100644 index 0000000..e772e5f --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/ResponseFormat.java @@ -0,0 +1,22 @@ +package org.aibidding.common.chat.entity.images; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@AllArgsConstructor +@Getter +public enum ResponseFormat implements Serializable { + URL("url"), + B64_JSON("b64_json"), + ; + + private String name; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/SizeEnum.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/SizeEnum.java new file mode 100644 index 0000000..2c694a6 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/images/SizeEnum.java @@ -0,0 +1,26 @@ +package org.aibidding.common.chat.entity.images; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Getter +@AllArgsConstructor +public enum SizeEnum implements Serializable { + size_1024_1792("1024x1792"), + size_1792_1024("1792x1024"), + size_1024("1024x1024"), + size_512("512x512"), + size_256("256x256"), + + ; + private String name; + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/LocalModelsSearchRequest.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/LocalModelsSearchRequest.java new file mode 100644 index 0000000..362b85b --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/LocalModelsSearchRequest.java @@ -0,0 +1,38 @@ +package org.aibidding.common.chat.entity.models; + +import lombok.Data; + +import java.util.List; + +/** + * @program: RUOYIAI + * @ClassName LocalModelsSearchRequest + * @description: + * @author: hejh + * @create: 2025-03-15 17:22 + * @Version 1.0 + **/ +@Data +public class LocalModelsSearchRequest { + + private List text; + private String model_name; + private String delimiter; + private int k; + private int block_size; + private int overlap_chars; + + // 构造函数、Getter 和 Setter + public LocalModelsSearchRequest(List text, String model_name, String delimiter, int k, int block_size, int overlap_chars) { + this.text = text; + this.model_name = model_name; + this.delimiter = delimiter; + this.k = k; + this.block_size = block_size; + this.overlap_chars = overlap_chars; + } + + +} + + diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/LocalModelsSearchResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/LocalModelsSearchResponse.java new file mode 100644 index 0000000..24cf8a4 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/LocalModelsSearchResponse.java @@ -0,0 +1,20 @@ +package org.aibidding.common.chat.entity.models; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.util.List; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class LocalModelsSearchResponse { + @JsonProperty("topKEmbeddings") + + private List>> topKEmbeddings; // 处理三层嵌套数组 + + // 默认构造函数 + public LocalModelsSearchResponse() {} + + + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/Model.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/Model.java new file mode 100644 index 0000000..3ef411c --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/Model.java @@ -0,0 +1,29 @@ +package org.aibidding.common.chat.entity.models; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class Model implements Serializable { + + private String id; + private String object; + private long created; + @JsonProperty("owned_by") + private String ownedBy; + @JsonProperty("permission") + private List permission; + private String root; + private Object parent; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/ModelResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/ModelResponse.java new file mode 100644 index 0000000..cfe309e --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/ModelResponse.java @@ -0,0 +1,20 @@ +package org.aibidding.common.chat.entity.models; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class ModelResponse implements Serializable { + private String object; + private List data; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/Permission.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/Permission.java new file mode 100644 index 0000000..5ef80f9 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/models/Permission.java @@ -0,0 +1,45 @@ +package org.aibidding.common.chat.entity.models; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class Permission implements Serializable { + + private String id; + @JsonProperty("object") + private String object; + @JsonProperty("created") + private long created; + @JsonProperty("allow_create_engine") + private boolean allowCreateEngine; + @JsonProperty("allow_sampling") + private boolean allowSampling; + @JsonProperty("allow_logprobs") + private boolean allowLogprobs; + @JsonProperty("allow_search_indices") + private boolean allowSearchIndices; + @JsonProperty("allow_view") + private boolean allowView; + @JsonProperty("allow_fine_tuning") + private boolean allowFineTuning; + @JsonProperty("organization") + private String organization; + /** + * 不知道是什么类型的数据 + */ + @JsonProperty("group") + private Object group; + @JsonProperty("is_blocking") + private boolean isBlocking; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/Categories.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/Categories.java new file mode 100644 index 0000000..47c6302 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/Categories.java @@ -0,0 +1,50 @@ +package org.aibidding.common.chat.entity.moderations; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class Categories implements Serializable { + /** + * 表达、煽动或宣扬基于种族、性别、民族、宗教、国籍、性取向、残疾状况或种姓的仇恨的内容。 + */ + private boolean hate; + /** + * 仇恨内容,还包括对目标群体的暴力或严重伤害。 + */ + @JsonProperty("hate/threatening") + private boolean hateThreatening; + /** + * 宣扬、鼓励或描绘自残行为(例如自杀、割伤和饮食失调)的内容。 + */ + @JsonProperty("self-harm") + private boolean selfHarm; + /** + * 旨在引起性兴奋的内容,例如对性活动的描述,或宣传性服务(不包括性教育和健康)的内容。 + */ + private boolean sexual; + /** + * 包含未满 18 周岁的个人的色情内容。 + */ + @JsonProperty("sexual/minors") + private boolean sexualMinors; + /** + * 宣扬或美化暴力或歌颂他人遭受苦难或羞辱的内容。 + */ + private boolean violence; + /** + * 以极端血腥细节描绘死亡、暴力或严重身体伤害的暴力内容。 + */ + @JsonProperty("violence/graphic") + private boolean violenceGraphic; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/CategoryScores.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/CategoryScores.java new file mode 100644 index 0000000..f4ee50e --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/CategoryScores.java @@ -0,0 +1,31 @@ +package org.aibidding.common.chat.entity.moderations; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class CategoryScores implements Serializable { + private BigDecimal hate; + @JsonProperty("hate/threatening") + private BigDecimal hateThreatening; + @JsonProperty("self-harm") + private BigDecimal selfHarm; + private BigDecimal sexual; + @JsonProperty("sexual/minors") + private BigDecimal sexualMinors; + private BigDecimal violence; + @JsonProperty("violence/graphic") + private BigDecimal violenceGraphic; + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/Moderation.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/Moderation.java new file mode 100644 index 0000000..dd95749 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/Moderation.java @@ -0,0 +1,54 @@ +package org.aibidding.common.chat.entity.moderations; + +import lombok.*; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.chat.openai.exception.CommonError; +import org.aibidding.common.core.exception.base.BaseException; + +import java.io.Serializable; +import java.util.List; +import java.util.Objects; + +/** + * 描述:文本审核,敏感词鉴别 + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Getter +@Builder +@Slf4j +@NoArgsConstructor +@AllArgsConstructor +public class Moderation implements Serializable { + + @NonNull + private List input; + @Builder.Default + private String model = Model.TEXT_MODERATION_LATEST.getName(); + + public void setInput(List input) { + if (Objects.isNull(input) || input.size() == 0) { + log.error("input不能为空"); + throw new BaseException(CommonError.PARAM_ERROR.msg()); + } + this.input = input; + } + + public void setModel(Model model) { + if (Objects.isNull(model)) { + model = Model.TEXT_MODERATION_LATEST; + } + this.model = model.getName(); + } + + @Getter + @AllArgsConstructor + public enum Model { + TEXT_MODERATION_STABLE("text-moderation-stable"), + TEXT_MODERATION_LATEST("text-moderation-latest"), + ; + + private String name; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/ModerationResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/ModerationResponse.java new file mode 100644 index 0000000..3813fa1 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/ModerationResponse.java @@ -0,0 +1,21 @@ +package org.aibidding.common.chat.entity.moderations; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class ModerationResponse implements Serializable { + private String id; + private String model; + private List results; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/Result.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/Result.java new file mode 100644 index 0000000..58efcce --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/moderations/Result.java @@ -0,0 +1,22 @@ +package org.aibidding.common.chat.entity.moderations; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class Result implements Serializable { + private Categories categories; + @JsonProperty("category_scores") + private CategoryScores categoryScores; + private boolean flagged; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/whisper/Transcriptions.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/whisper/Transcriptions.java new file mode 100644 index 0000000..4d640f8 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/whisper/Transcriptions.java @@ -0,0 +1,49 @@ +package org.aibidding.common.chat.entity.whisper; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.FieldNameConstants; + +/** + * @author Admin + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@FieldNameConstants +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Transcriptions extends Whisper { + /** + * 模型目前只支持这一种:WHISPER_1 + */ + @Builder.Default + private String model = Model.WHISPER_1.getName(); + /** + * 提示语,需要与语音语言匹配 + */ + private String prompt; + /** + * 输出的格式,采用以下选项之一:json、text、srt、verbose_json 或 vtt。 + * 默认值:json + */ + @JsonProperty("response_format") + @Builder.Default + private String responseFormat = ResponseFormat.JSON.getName(); + /** + * 温度控制随机效果:0-1,值越大输出更加随机 + * 默认值:0 + */ + @Builder.Default + private Double temperature = 0d; + /** + * 输入音频的语言,以 ISO-639-1 格式提供输入语言将提高准确性和延迟。 + * 参考:ISO-639-1 + */ + private String language; + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/whisper/Translations.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/whisper/Translations.java new file mode 100644 index 0000000..009574a --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/whisper/Translations.java @@ -0,0 +1,41 @@ +package org.aibidding.common.chat.entity.whisper; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.FieldNameConstants; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@FieldNameConstants +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Translations { + /** + * 模型目前只支持这一种:WHISPER_1 + */ + @Builder.Default + private String model = Whisper.Model.WHISPER_1.getName(); + /** + * 提示语,需要与语音语言匹配 + */ + private String prompt; + /** + * 输出的格式,采用以下选项之一:json、text、srt、verbose_json 或 vtt。 + * 默认值:json + */ + @JsonProperty("response_format") + @Builder.Default + private String responseFormat = Whisper.ResponseFormat.JSON.getName(); + /** + * 温度控制随机效果:0-1,值越大输出更加随机 + * 默认值:0 + */ + @Builder.Default + private double temperature = 0; + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/whisper/Whisper.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/whisper/Whisper.java new file mode 100644 index 0000000..fa89689 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/whisper/Whisper.java @@ -0,0 +1,38 @@ +package org.aibidding.common.chat.entity.whisper; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.Getter; + +import java.io.Serializable; + +/** + * 描述:语音转文字 + * + * @author https:www.unfbx.com + * @since 2023-03-02 + */ +@Data +public class Whisper implements Serializable { + + + @Getter + @AllArgsConstructor + public enum Model { + WHISPER_1("whisper-1"), + ; + private String name; + } + + @Getter + @AllArgsConstructor + public enum ResponseFormat { + JSON("json"), + TEXT("text"), + SRT("srt"), + VERBOSE_JSON("verbose_json"), + VTT("vtt"), + ; + private String name; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/whisper/WhisperResponse.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/whisper/WhisperResponse.java new file mode 100644 index 0000000..7556932 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/entity/whisper/WhisperResponse.java @@ -0,0 +1,19 @@ +package org.aibidding.common.chat.entity.whisper; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @since 2023-03-02 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class WhisperResponse implements Serializable { + + private String text; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/handler/PlusWebSocketHandler.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/handler/PlusWebSocketHandler.java new file mode 100644 index 0000000..b454015 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/handler/PlusWebSocketHandler.java @@ -0,0 +1,122 @@ +package org.aibidding.common.chat.handler; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.chat.config.LocalCache; +import org.aibidding.common.chat.entity.chat.ChatCompletion; +import org.aibidding.common.chat.entity.chat.Message; +import org.aibidding.common.chat.holder.WebSocketSessionHolder; +import org.aibidding.common.chat.listener.WebSocketEventListener; +import org.aibidding.common.chat.openai.OpenAiStreamClient; +import org.aibidding.common.chat.utils.WebSocketUtils; +import org.aibidding.common.core.utils.SpringUtils; +import org.springframework.web.socket.*; +import org.springframework.web.socket.handler.AbstractWebSocketHandler; + +import java.util.ArrayList; +import java.util.List; + +/** + * WebSocketHandler 实现类 + * + * @author zendwang + */ +@Slf4j +public class PlusWebSocketHandler extends AbstractWebSocketHandler { + + /** + * 连接成功后 + */ + @Override + public void afterConnectionEstablished(WebSocketSession session) { + WebSocketSessionHolder.addSession(session.getId(), session); + } + + /** + * 处理发送来的文本消息 + * + * @param session + * @param message + */ + @Override + protected void handleTextMessage(WebSocketSession session, TextMessage message) { + WebSocketEventListener eventSourceListener = new WebSocketEventListener(session); + String messageContext = (String) LocalCache.CACHE.get(session.getId()); + List messages = new ArrayList<>(); + if (StrUtil.isNotBlank(messageContext)) { + messages = JSONUtil.toList(messageContext, Message.class); + // 上下文长度 + int contextSize=10; + if (messages.size() >= contextSize) { + messages = messages.subList(1, contextSize); + } + Message currentMessage = Message.builder().content(message.getPayload()).role(Message.Role.USER).build(); + messages.add(currentMessage); + } else { + Message currentMessage = Message.builder().content(message.getPayload()).role(Message.Role.USER).build(); + messages.add(currentMessage); + } + ChatCompletion chatCompletion = ChatCompletion + .builder() + .model("gpt-4o-mini") + .messages(messages) + .temperature(0.2) + .stream(true) + .build(); + OpenAiStreamClient openAiStreamClient=(OpenAiStreamClient) SpringUtils.context().getBean("openAiStreamClient"); + openAiStreamClient.streamChatCompletion(chatCompletion, eventSourceListener); + LocalCache.CACHE.put(session.getId(), JSONUtil.toJsonStr(messages), LocalCache.TIMEOUT); + } + + + @Override + protected void handleBinaryMessage(WebSocketSession session, BinaryMessage message) throws Exception { + super.handleBinaryMessage(session, message); + } + + /** + * 心跳监测的回复 + * + * @param session + * @param message + * @throws Exception + */ + @Override + protected void handlePongMessage(WebSocketSession session, PongMessage message) throws Exception { + WebSocketUtils.sendPongMessage(session); + } + + /** + * 连接出错时 + * + * @param session + * @param exception + * @throws Exception + */ + @Override + public void handleTransportError(WebSocketSession session, Throwable exception) throws Exception { + log.error("[transport error] sessionId: {} , exception:{}", session.getId(), exception.getMessage()); + } + + /** + * 连接关闭后 + * + * @param session + * @param status + */ + @Override + public void afterConnectionClosed(WebSocketSession session, CloseStatus status) { + WebSocketSessionHolder.removeSession(session.getId()); + } + + /** + * 指示处理程序是否支持接收部分消息 + * + * @return 如果支持接收部分消息,则返回true;否则返回false + */ + @Override + public boolean supportsPartialMessages() { + return false; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/holder/WebSocketSessionHolder.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/holder/WebSocketSessionHolder.java new file mode 100644 index 0000000..8e1ac2c --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/holder/WebSocketSessionHolder.java @@ -0,0 +1,37 @@ +package org.aibidding.common.chat.holder; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.springframework.web.socket.WebSocketSession; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * WebSocketSession 用于保存当前所有在线的会话信息 + * + * @author zendwang + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class WebSocketSessionHolder { + + private static final Map USER_SESSION_MAP = new ConcurrentHashMap<>(); + + public static void addSession(String sessionKey, WebSocketSession session) { + USER_SESSION_MAP.put(sessionKey, session); + } + + public static void removeSession(String sessionKey) { + if (USER_SESSION_MAP.containsKey(sessionKey)) { + USER_SESSION_MAP.remove(sessionKey); + } + } + + public static WebSocketSession getSessions(Long sessionKey) { + return USER_SESSION_MAP.get(sessionKey); + } + + public static Boolean existSession(Long sessionKey) { + return USER_SESSION_MAP.containsKey(sessionKey); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/interceptor/PlusWebSocketInterceptor.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/interceptor/PlusWebSocketInterceptor.java new file mode 100644 index 0000000..ffbdd9d --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/interceptor/PlusWebSocketInterceptor.java @@ -0,0 +1,46 @@ +package org.aibidding.common.chat.interceptor; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.server.ServerHttpRequest; +import org.springframework.http.server.ServerHttpResponse; +import org.springframework.web.socket.WebSocketHandler; +import org.springframework.web.socket.server.HandshakeInterceptor; + +import java.util.Map; + +/** + * WebSocket握手请求的拦截器 + * + * @author zendwang + */ +@Slf4j +public class PlusWebSocketInterceptor implements HandshakeInterceptor { + + /** + * 握手前 + * + * @param request request + * @param response response + * @param wsHandler wsHandler + * @param attributes attributes + * @return 是否握手成功 + */ + @Override + public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map attributes) { + return true; + } + + + /** + * 握手后 + * + * @param request request + * @param response response + * @param wsHandler wsHandler + * @param exception 异常 + */ + @Override + public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Exception exception) { + + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/listener/WebSocketEventListener.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/listener/WebSocketEventListener.java new file mode 100644 index 0000000..9310a31 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/listener/WebSocketEventListener.java @@ -0,0 +1,90 @@ +package org.aibidding.common.chat.listener; + +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Response; +import okhttp3.ResponseBody; +import okhttp3.sse.EventSource; +import okhttp3.sse.EventSourceListener; +import org.aibidding.common.chat.entity.chat.ChatCompletionResponse; +import org.springframework.web.socket.TextMessage; +import org.springframework.web.socket.WebSocketSession; + +import java.util.Objects; + +/** + * 描述:OpenAI流式输出Socket接收 + * + * @author https:www.unfbx.com + * @date 2023-03-23 + */ +@Slf4j +public class WebSocketEventListener extends EventSourceListener { + + private WebSocketSession session; + + /** + * 消息结束标识 + */ + private final String msgEnd = "[DONE]"; + + public WebSocketEventListener(WebSocketSession session) { + this.session = session; + } + + /** + * {@inheritDoc} + */ + @Override + public void onOpen(EventSource eventSource, Response response) { + log.info("OpenAI建立Socket连接..."); + } + + /** + * {@inheritDoc} + */ + @SneakyThrows + @Override + public void onEvent(EventSource eventSource, String id, String type, String data) { + log.info("OpenAI返回数据:{}", data); + if (data.equals(msgEnd)) { + log.info("OpenAI返回数据结束了"); + session.sendMessage(new TextMessage(msgEnd)); + return; + } + ObjectMapper mapper = new ObjectMapper(); + // 读取Json + ChatCompletionResponse completionResponse = mapper.readValue(data, ChatCompletionResponse.class); + String delta = ""; + try { + delta = mapper.writeValueAsString(completionResponse.getChoices().get(0).getDelta()); + }catch (Exception e){ + log.error("转换失败{}",e.getMessage()); + } + session.sendMessage(new TextMessage(delta)); + } + + + @Override + public void onClosed(EventSource eventSource) { + log.info("OpenAI关闭Socket连接..."); + } + + + @SneakyThrows + @Override + public void onFailure(EventSource eventSource, Throwable t, Response response) { + if (Objects.isNull(response)) { + return; + } + ResponseBody body = response.body(); + if (Objects.nonNull(body)) { + // 返回非流式回复内容 + log.error("Socket连接异常data:{},异常:{}", body.string(), t); + } else { + log.error("Socket连接异常data:{},异常:{}", response, t); + } + eventSource.cancel(); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/listener/WebSocketTopicListener.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/listener/WebSocketTopicListener.java new file mode 100644 index 0000000..2bc012d --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/listener/WebSocketTopicListener.java @@ -0,0 +1,38 @@ +package org.aibidding.common.chat.listener; + +import cn.hutool.core.collection.CollUtil; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.chat.holder.WebSocketSessionHolder; +import org.aibidding.common.chat.utils.WebSocketUtils; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.core.Ordered; + +/** + * WebSocket 主题订阅监听器 + * + * @author zendwang + */ +@Slf4j +public class WebSocketTopicListener implements ApplicationRunner, Ordered { + + @Override + public void run(ApplicationArguments args) throws Exception { + WebSocketUtils.subscribeMessage((message) -> { + log.info("WebSocket主题订阅收到消息session keys={} message={}!", message.getSessionKeys(), message.getMessage()); + if (CollUtil.isNotEmpty(message.getSessionKeys())) { + message.getSessionKeys().forEach(key -> { + if (WebSocketSessionHolder.existSession(key)) { + WebSocketUtils.sendMessage(key, message.getMessage()); + } + }); + } + }); + log.info("初始化WebSocket主题订阅监听器成功"); + } + + @Override + public int getOrder() { + return -1; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/localModels/LocalModelsofitClient.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/localModels/LocalModelsofitClient.java new file mode 100644 index 0000000..8e7a43d --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/localModels/LocalModelsofitClient.java @@ -0,0 +1,198 @@ +package org.aibidding.common.chat.localModels; + +import io.micrometer.common.util.StringUtils; +import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; +import org.aibidding.common.chat.entity.models.LocalModelsSearchRequest; +import org.aibidding.common.chat.entity.models.LocalModelsSearchResponse; +import org.springframework.stereotype.Service; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +import retrofit2.Retrofit; +import retrofit2.converter.jackson.JacksonConverterFactory; + +import java.util.List; +import java.util.concurrent.CountDownLatch; + +@Slf4j +@Service +public class LocalModelsofitClient { + private static final String BASE_URL = "http://127.0.0.1:5000"; // Flask 服务的 URL + private static Retrofit retrofit = null; + + // 获取 Retrofit 实例 + public static Retrofit getRetrofitInstance() { + if (retrofit == null) { + OkHttpClient client = new OkHttpClient.Builder() + .build(); + + retrofit = new Retrofit.Builder() + .baseUrl(BASE_URL) + .client(client) + .addConverterFactory(JacksonConverterFactory.create()) // 使用 Jackson 处理 JSON 转换 + .build(); + } + return retrofit; + } + + /** + * 向 Flask 服务发送文本向量化请求 + * + * @param queries 查询文本列表 + * @param modelName 模型名称 + * @param delimiter 文本分隔符 + * @param topK 返回的结果数 + * @param blockSize 文本块大小 + * @param overlapChars 重叠字符数 + * @return 返回计算得到的 Top K 嵌入向量列表 + */ + + public static List> getTopKEmbeddings( + List queries, + String modelName, + String delimiter, + int topK, + int blockSize, + int overlapChars) { + + modelName = (!StringUtils.isEmpty(modelName)) ? modelName : "msmarco-distilbert-base-tas-b"; // 默认模型名称 + delimiter = (!StringUtils.isEmpty(delimiter) ) ? delimiter : "."; // 默认分隔符 + topK = (topK > 0) ? topK : 3; // 默认返回 3 个结果 + blockSize = (blockSize > 0) ? blockSize : 500; // 默认文本块大小为 500 + overlapChars = (overlapChars > 0) ? overlapChars : 50; // 默认重叠字符数为 50 + + // 创建 Retrofit 实例 + Retrofit retrofit = getRetrofitInstance(); + + // 创建 SearchService 接口 + SearchService service = retrofit.create(SearchService.class); + + // 创建请求对象 LocalModelsSearchRequest + LocalModelsSearchRequest request = new LocalModelsSearchRequest( + queries, // 查询文本列表 + modelName, // 模型名称 + delimiter, // 文本分隔符 + topK, // 返回的结果数 + blockSize, // 文本块大小 + overlapChars // 重叠字符数 + ); + + final CountDownLatch latch = new CountDownLatch(1); // 创建一个 CountDownLatch + final List>[] topKEmbeddings = new List[]{null}; // 使用数组来存储结果(因为 Java 不支持直接修改 List) + + // 发起异步请求 + service.vectorize(request).enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + if (response.isSuccessful()) { + LocalModelsSearchResponse searchResponse = response.body(); + if (searchResponse != null) { + topKEmbeddings[0] = searchResponse.getTopKEmbeddings().get(0); // 获取结果 + log.info("Successfully retrieved embeddings"); + } else { + log.error("Response body is null"); + } + } else { + log.error("Request failed. HTTP error code: " + response.code()); + } + latch.countDown(); // 请求完成,减少计数 + } + + @Override + public void onFailure(Call call, Throwable t) { + t.printStackTrace(); + log.error("Request failed: ", t); + latch.countDown(); // 请求失败,减少计数 + } + }); + + try { + latch.await(); // 等待请求完成 + } catch (InterruptedException e) { + e.printStackTrace(); + } + + return topKEmbeddings[0]; // 返回结果 + } + +// public static void main(String[] args) { +// // 示例调用 +// List queries = Arrays.asList("What is artificial intelligence?", "AI is transforming industries."); +// String modelName = "msmarco-distilbert-base-tas-b"; +// String delimiter = "."; +// int topK = 3; +// int blockSize = 500; +// int overlapChars = 50; +// +// List> topKEmbeddings = getTopKEmbeddings(queries, modelName, delimiter, topK, blockSize, overlapChars); +// +// // 打印结果 +// if (topKEmbeddings != null) { +// System.out.println("Top K embeddings: "); +// for (List embedding : topKEmbeddings) { +// System.out.println(embedding); +// } +// } else { +// System.out.println("No embeddings returned."); +// } +// } + + +// public static void main(String[] args) { +// // 创建 Retrofit 实例 +// Retrofit retrofit = LocalModelsofitClient.getRetrofitInstance(); +// +// // 创建 SearchService 接口 +// SearchService service = retrofit.create(SearchService.class); +// +// // 创建请求对象 LocalModelsSearchRequest +// LocalModelsSearchRequest request = new LocalModelsSearchRequest( +// Arrays.asList("What is artificial intelligence?", "AI is transforming industries."), // 查询文本列表 +// "msmarco-distilbert-base-tas-b", // 模型名称 +// ".", // 分隔符 +// 3, // 返回的结果数 +// 500, // 文本块大小 +// 50 // 重叠字符数 +// ); +// +// // 发起请求 +// service.vectorize(request).enqueue(new Callback() { +// @Override +// public void onResponse(Call call, Response response) { +// if (response.isSuccessful()) { +// LocalModelsSearchResponse searchResponse = response.body(); +// System.out.println("Response Body: " + response.body()); // Print the whole response body for debugging +// +// if (searchResponse != null) { +// // If the response is not null, process it. +// // Example: Extract the embeddings and print them +// List>> topKEmbeddings = searchResponse.getTopKEmbeddings(); +// if (topKEmbeddings != null) { +// // Print the Top K embeddings +// +// } else { +// System.err.println("Top K embeddings are null"); +// } +// +// // If there is more information you want to process, handle it here +// +// } else { +// System.err.println("Response body is null"); +// } +// } else { +// System.err.println("Request failed. HTTP error code: " + response.code()); +// log.error("Failed to retrieve data. HTTP error code: " + response.code()); +// } +// } +// +// @Override +// public void onFailure(Call call, Throwable t) { +// // 请求失败,打印错误 +// t.printStackTrace(); +// log.error("Request failed: ", t); +// } +// }); +// } + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/localModels/SearchService.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/localModels/SearchService.java new file mode 100644 index 0000000..74169e1 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/localModels/SearchService.java @@ -0,0 +1,25 @@ +package org.aibidding.common.chat.localModels; + + + +import org.aibidding.common.chat.entity.models.LocalModelsSearchRequest; +import org.aibidding.common.chat.entity.models.LocalModelsSearchResponse; +import retrofit2.Call; +import retrofit2.http.Body; +import retrofit2.http.POST; +/** + * @program: RUOYIAI + * @ClassName SearchService + * @description: 请求模型 + * @author: hejh + * @create: 2025-03-15 17:27 + * @Version 1.0 + **/ + + +public interface SearchService { + @POST("/vectorize") // 与 Flask 服务中的路由匹配 + Call vectorize(@Body LocalModelsSearchRequest request); +} + + diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/OpenAiApi.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/OpenAiApi.java new file mode 100644 index 0000000..c9a77d1 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/OpenAiApi.java @@ -0,0 +1,355 @@ +package org.aibidding.common.chat.openai; + +import io.reactivex.Single; +import okhttp3.MultipartBody; +import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import org.aibidding.common.chat.entity.Tts.TextToSpeech; +import org.aibidding.common.chat.entity.billing.BillingUsage; +import org.aibidding.common.chat.entity.billing.CreditGrantsResponse; +import org.aibidding.common.chat.entity.billing.Subscription; +import org.aibidding.common.chat.entity.chat.ChatCompletion; +import org.aibidding.common.chat.entity.chat.ChatCompletionResponse; +import org.aibidding.common.chat.entity.chat.ChatCompletionWithPicture; +import org.aibidding.common.chat.entity.common.DeleteResponse; +import org.aibidding.common.chat.entity.common.OpenAiResponse; +import org.aibidding.common.chat.entity.completions.Completion; +import org.aibidding.common.chat.entity.completions.CompletionResponse; +import org.aibidding.common.chat.entity.edits.Edit; +import org.aibidding.common.chat.entity.edits.EditResponse; +import org.aibidding.common.chat.entity.embeddings.Embedding; +import org.aibidding.common.chat.entity.embeddings.EmbeddingResponse; +import org.aibidding.common.chat.entity.engines.Engine; +import org.aibidding.common.chat.entity.files.File; +import org.aibidding.common.chat.entity.files.UploadFileResponse; +import org.aibidding.common.chat.entity.fineTune.Event; +import org.aibidding.common.chat.entity.fineTune.FineTune; +import org.aibidding.common.chat.entity.fineTune.FineTuneDeleteResponse; +import org.aibidding.common.chat.entity.fineTune.FineTuneResponse; +import org.aibidding.common.chat.entity.images.Image; +import org.aibidding.common.chat.entity.images.ImageResponse; +import org.aibidding.common.chat.entity.models.Model; +import org.aibidding.common.chat.entity.models.ModelResponse; +import org.aibidding.common.chat.entity.moderations.Moderation; +import org.aibidding.common.chat.entity.moderations.ModerationResponse; +import org.aibidding.common.chat.entity.whisper.WhisperResponse; +import retrofit2.Call; +import retrofit2.http.*; + +import java.time.LocalDate; +import java.util.Map; + +/** + * 描述: open ai官方api接口 + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +public interface OpenAiApi { + + /** + * 模型列表 + * + * @return Single ModelResponse + */ + @GET("v1/models") + Single models(); + + /** + * models 返回的数据id + * + * @param id 模型主键 + * @return Single Model + */ + @GET("v1/models/{id}") + Single model(@Path("id") String id); + + /** + * 文本问答 + * Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position. + * + * @param completion 问答参数 + * @return Single CompletionResponse + */ + @POST("v1/completions") + Single completions(@Body Completion completion); + + /** + * Creates a new edit for the provided input, instruction, and parameters. + * 文本修复 + * + * @param edit 编辑参数 + * @return Single EditResponse + */ + @POST("v1/edits") + Single edits(@Body Edit edit); + + /** + * Creates an image given a prompt. + * 根据描述生成图片 + * + * @param image 图片对象 + * @return Single ImageResponse + */ + @POST("v1/images/generations") + Single genImages(@Body Image image); + + /** + * Creates an edited or extended image given an original image and a prompt. + * 根据描述修改图片 + * + * @param image 图片对象 + * @param mask 图片对象 + * @param requestBodyMap 请求参数 + * @return Single ImageResponse + */ + @Multipart + @POST("v1/images/edits") + Single editImages(@Part() MultipartBody.Part image, + @Part() MultipartBody.Part mask, + @PartMap() Map requestBodyMap + ); + + /** + * Creates a variation of a given image. + * + * @param image 图片对象 + * @param requestBodyMap 请求参数 + * @return Single ImageResponse + */ + @Multipart + @POST("v1/images/variations") + Single variationsImages(@Part() MultipartBody.Part image, + @PartMap() Map requestBodyMap + ); + + /** + * 文本向量计算 + * + * @param embedding 向量参数 + * @return Single EmbeddingResponse + */ + @POST("v1/embeddings") + Single embeddings(@Body Embedding embedding); + + + /** + * Returns a list of files that belong to the user's organization. + * + * @return Single OpenAiResponse File + */ + @GET("/v1/files") + Single> files(); + + /** + * 删除文件 + * + * @param fileId 文件id + * @return Single DeleteResponse + */ + @DELETE("v1/files/{file_id}") + Single deleteFile(@Path("file_id") String fileId); + + /** + * 上传文件 + * + * @param purpose purpose + * @param file 文件对象 + * @return Single UploadFileResponse + */ + @Multipart + @POST("v1/files") + Single uploadFile(@Part MultipartBody.Part file, + @Part("purpose") RequestBody purpose); + + + /** + * 检索文件 + * + * @param fileId 文件id + * @return Single File + */ + @GET("v1/files/{file_id}") + Single retrieveFile(@Path("file_id") String fileId); + + /** + * 检索文件内容 + * ###不对免费用户开放### + * ###不对免费用户开放### + * ###不对免费用户开放### + * + * @param fileId 文件id + * @return Single ResponseBody + */ + @Streaming + @GET("v1/files/{file_id}/content") + Single retrieveFileContent(@Path("file_id") String fileId); + + + /** + * 文本审核 + * + * @param moderation 文本审核参数 + * @return Single ModerationResponse + */ + @POST("v1/moderations") + Single moderations(@Body Moderation moderation); + + + /** + * 创建微调作业 + * + * @param fineTune 微调 + * @return Single FineTuneResponse + */ + @POST("v1/fine-tunes") + Single fineTune(@Body FineTune fineTune); + + /** + * 微调作业集合 + * + * @return Single OpenAiResponse FineTuneResponse + */ + @GET("v1/fine-tunes") + Single> fineTunes(); + + + /** + * 检索微调作业 + * + * @return Single FineTuneResponse + */ + @GET("v1/fine-tunes/{fine_tune_id}") + Single retrieveFineTune(@Path("fine_tune_id") String fineTuneId); + + /** + * 取消微调作业 + * + * @return Single FineTuneResponse + */ + @POST("v1/fine-tunes/{fine_tune_id}/cancel") + Single cancelFineTune(@Path("fine_tune_id") String fineTuneId); + + /** + * 微调作业事件列表 + * + * @return Single OpenAiResponse Event + */ + @GET("v1/fine-tunes/{fine_tune_id}/events") + Single> fineTuneEvents(@Path("fine_tune_id") String fineTuneId); + + /** + * 删除微调作业模型 + * Delete a fine-tuned model. You must have the Owner role in your organization. + * + * @return Single DeleteResponse + */ + @DELETE("v1/models/{model}") + Single deleteFineTuneModel(@Path("model") String model); + + + /** + * 引擎列表 + * 官方已废弃此接口 + * + * @return Single OpenAiResponse Engine + */ + @Deprecated + @GET("v1/engines") + Single> engines(); + + /** + * 检索引擎 + * 官方已废弃此接口 + * + * @param engineId 引擎id + * @return Engine + */ + @Deprecated + @GET("v1/engines/{engine_id}") + Single engine(@Path("engine_id") String engineId); + + + /** + * 最新版的GPT-3.5 chat completion 更加贴近官方网站的问答模型 + * + * @param chatCompletion chat completion + * @return 返回答案 + */ + @POST("v1/chat/completions") + Single chatCompletion(@Body ChatCompletion chatCompletion); + + + /** + * 语音转文字 + * + * @param file 语音文件 + * @param requestBodyMap 参数 + * @return 文本 + */ + @Multipart + @POST("v1/audio/transcriptions") + Single speechToTextTranscriptions(@Part MultipartBody.Part file, + @PartMap() Map requestBodyMap); + + /** + * 语音翻译:目前仅支持翻译为英文 + * + * @param file 语音文件 + * @param requestBodyMap 参数 + * @return 文本 + */ + @Multipart + @POST("v1/audio/translations") + Single speechToTextTranslations(@Part MultipartBody.Part file, + @PartMap() Map requestBodyMap); + + /** + * 余额查询 + * 官方禁止访问此接口 + * + * @return 余额结果 + */ + @GET("dashboard/billing/credit_grants") + @Deprecated + Single creditGrants(); + + /** + * 账户信息查询:里面包含总金额(美元)等信息 + * + * @return 账户信息 + */ + @GET("v1/dashboard/billing/subscription") + Single subscription(); + + /** + * 账户调用接口消耗金额信息查询 + * totalUsage = 账户总使用金额(美分) + * + * @param starDate 开始时间 + * @param endDate 结束时间 + * @return 消耗金额信息 + */ + @GET("v1/dashboard/billing/usage") + Single billingUsage(@Query("start_date") LocalDate starDate, @Query("end_date") LocalDate endDate); + + /** + * 最新版的GPT-4 chat completion 支持图片输入 + * + * @param chatCompletion chat completion + * @return 返回答案 + */ + @POST("v1/chat/completions") + Single chatCompletionWithPicture(@Body ChatCompletionWithPicture chatCompletion); + + /** + * 文本转语音 + * + * @param textToSpeech 参数 + * @return ResponseBody body + * @since 1.1.2 + */ + @POST("v1/audio/speech") + @Streaming + Call textToSpeech(@Body TextToSpeech textToSpeech); +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/OpenAiClient.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/OpenAiClient.java new file mode 100644 index 0000000..67daee7 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/OpenAiClient.java @@ -0,0 +1,890 @@ +package org.aibidding.common.chat.openai; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; +import io.reactivex.Single; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import okhttp3.MediaType; +import okhttp3.MultipartBody; +import okhttp3.OkHttpClient; +import okhttp3.RequestBody; +import org.aibidding.common.chat.constant.OpenAIConst; +import org.aibidding.common.chat.entity.billing.BillingUsage; +import org.aibidding.common.chat.entity.billing.Subscription; +import org.aibidding.common.chat.entity.chat.*; +import org.aibidding.common.chat.entity.common.DeleteResponse; +import org.aibidding.common.chat.entity.common.OpenAiResponse; +import org.aibidding.common.chat.entity.completions.Completion; +import org.aibidding.common.chat.entity.completions.CompletionResponse; +import org.aibidding.common.chat.entity.edits.Edit; +import org.aibidding.common.chat.entity.edits.EditResponse; +import org.aibidding.common.chat.entity.embeddings.Embedding; +import org.aibidding.common.chat.entity.embeddings.EmbeddingResponse; +import org.aibidding.common.chat.entity.engines.Engine; +import org.aibidding.common.chat.entity.files.File; +import org.aibidding.common.chat.entity.files.UploadFileResponse; +import org.aibidding.common.chat.entity.fineTune.Event; +import org.aibidding.common.chat.entity.fineTune.FineTune; +import org.aibidding.common.chat.entity.fineTune.FineTuneDeleteResponse; +import org.aibidding.common.chat.entity.fineTune.FineTuneResponse; +import org.aibidding.common.chat.entity.images.*; +import org.aibidding.common.chat.entity.models.Model; +import org.aibidding.common.chat.entity.models.ModelResponse; +import org.aibidding.common.chat.entity.moderations.Moderation; +import org.aibidding.common.chat.entity.moderations.ModerationResponse; +import org.aibidding.common.chat.entity.whisper.Translations; +import org.aibidding.common.chat.entity.whisper.WhisperResponse; +import org.aibidding.common.chat.openai.exception.CommonError; +import org.aibidding.common.chat.openai.function.KeyRandomStrategy; +import org.aibidding.common.chat.openai.function.KeyStrategyFunction; +import org.aibidding.common.chat.openai.interceptor.DefaultOpenAiAuthInterceptor; +import org.aibidding.common.chat.openai.interceptor.DynamicKeyOpenAiAuthInterceptor; +import org.aibidding.common.chat.openai.interceptor.OpenAiAuthInterceptor; +import org.aibidding.common.chat.openai.plugin.PluginAbstract; +import org.aibidding.common.chat.openai.plugin.PluginParam; +import org.aibidding.common.core.exception.base.BaseException; +import org.jetbrains.annotations.NotNull; +import retrofit2.Retrofit; +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +import retrofit2.converter.jackson.JacksonConverterFactory; + +import java.time.LocalDate; +import java.util.*; +import java.util.concurrent.TimeUnit; + + +/** + * 描述: open ai 客户端 + * + * @author https:www.unfbx.com + * @since 2023-02-11 + */ + +@Slf4j +public class OpenAiClient { + /** + * keys + */ + @Getter + @NotNull + private List apiKey; + /** + * 自定义api host使用builder的方式构造client + */ + @Getter + private String apiHost; + @Getter + private OpenAiApi openAiApi; + /** + * 自定义的okHttpClient + * 如果不自定义 ,就是用sdk默认的OkHttpClient实例 + */ + @Getter + private OkHttpClient okHttpClient; + /** + * api key的获取策略 + */ + @Getter + private KeyStrategyFunction, String> keyStrategy; + + /** + * 自定义鉴权处理拦截器
+ * 可以不设置,默认实现:DefaultOpenAiAuthInterceptor
+ * 如需自定义实现参考:DealKeyWithOpenAiAuthInterceptor + * + * @see DynamicKeyOpenAiAuthInterceptor + * @see DefaultOpenAiAuthInterceptor + */ + @Getter + private OpenAiAuthInterceptor authInterceptor; + + /** + * 构造器 + * + * @return OpenAiClient.Builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * 构造 + * + * @param builder + */ + private OpenAiClient(Builder builder) { + if (CollectionUtil.isEmpty(builder.apiKey)) { + throw new BaseException(CommonError.API_KEYS_NOT_NUL.msg() + ); + } + apiKey = builder.apiKey; + + if (StrUtil.isBlank(builder.apiHost)) { + builder.apiHost = OpenAIConst.OPENAI_HOST; + } + apiHost = builder.apiHost; + + if (Objects.isNull(builder.keyStrategy)) { + builder.keyStrategy = new KeyRandomStrategy(); + } + keyStrategy = builder.keyStrategy; + + if (Objects.isNull(builder.authInterceptor)) { + builder.authInterceptor = new DefaultOpenAiAuthInterceptor(); + } + authInterceptor = builder.authInterceptor; + authInterceptor.setApiKey(this.apiKey); + authInterceptor.setKeyStrategy(this.keyStrategy); + + if (Objects.isNull(builder.okHttpClient)) { + builder.okHttpClient = this.okHttpClient(); + } else { + //自定义的okhttpClient 需要增加api keys + builder.okHttpClient = builder.okHttpClient + .newBuilder() + .addInterceptor(authInterceptor) + .build(); + } + okHttpClient = builder.okHttpClient; + this.openAiApi = new Retrofit.Builder() + .baseUrl(apiHost) + .client(okHttpClient) + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) + .addConverterFactory(JacksonConverterFactory.create()) + .build().create(OpenAiApi.class); + } + + + /** + * 创建默认OkHttpClient + * + * @return + */ + private OkHttpClient okHttpClient() { + if (Objects.isNull(this.authInterceptor)) { + this.authInterceptor = new DefaultOpenAiAuthInterceptor(); + } + this.authInterceptor.setApiKey(this.apiKey); + this.authInterceptor.setKeyStrategy(this.keyStrategy); + return new OkHttpClient + .Builder() + .addInterceptor(this.authInterceptor) + .connectTimeout(30, TimeUnit.SECONDS) + .writeTimeout(30, TimeUnit.SECONDS) + .readTimeout(30, TimeUnit.SECONDS).build(); + } + + /** + * openAi模型列表 + * + * @return Model list + */ + public List models() { + Single models = this.openAiApi.models(); + return models.blockingGet().getData(); + } + + /** + * openAi模型详细信息 + * + * @param id 模型主键 + * @return Model 模型类 + */ + public Model model(String id) { + if (Objects.isNull(id) || "".equals(id)) { + throw new BaseException(CommonError.PARAM_ERROR.msg()); + } + Single model = this.openAiApi.model(id); + return model.blockingGet(); + } + + + /** + * 问答接口 + * + * @param completion 问答参数 + * @return CompletionResponse + */ + public CompletionResponse completions(Completion completion) { + Single completions = this.openAiApi.completions(completion); + return completions.blockingGet(); + } + + /** + * 问答接口-简易版 + * + * @param question 问题描述 + * @return CompletionResponse + */ + public CompletionResponse completions(String question) { + Completion q = Completion.builder() + .prompt(question) + .build(); + Single completions = this.openAiApi.completions(q); + return completions.blockingGet(); + } + + /** + * 文本修改 + * + * @param edit 图片对象 + * @return EditResponse + */ + public EditResponse edit(Edit edit) { + Single edits = this.openAiApi.edits(edit); + return edits.blockingGet(); + } + + /** + * 根据描述生成图片 + * + * @param prompt 描述信息 + * @return ImageResponse + */ + public ImageResponse genImages(String prompt) { + Image image = Image.builder().prompt(prompt).build(); + return this.genImages(image); + } + + /** + * 根据描述生成图片 + * + * @param image 图片参数 + * @return ImageResponse + */ + public ImageResponse genImages(Image image) { + Single edits = this.openAiApi.genImages(image); + return edits.blockingGet(); + } + + /** + * Creates an edited or extended image given an original image and a prompt. + * 根据描述修改图片 + * + * @param image 图片对象 + * @param prompt 描述信息 + * @return Item list + */ + public List editImages(java.io.File image, String prompt) { + ImageEdit imageEdit = ImageEdit.builder().prompt(prompt).build(); + return this.editImages(image, null, imageEdit); + } + + /** + * Creates an edited or extended image given an original image and a prompt. + * 根据描述修改图片 + * + * @param image 图片对象 + * @param imageEdit 图片参数 + * @return Item list + */ + public List editImages(java.io.File image, ImageEdit imageEdit) { + return this.editImages(image, null, imageEdit); + } + + /** + * Creates an edited or extended image given an original image and a prompt. + * 根据描述修改图片 + * + * @param image png格式的图片,最大4MB + * @param mask png格式的图片,最大4MB + * @param imageEdit 图片参数 + * @return Item list + */ + public List editImages(java.io.File image, java.io.File mask, ImageEdit imageEdit) { + checkImage(image); + checkImageFormat(image); + checkImageSize(image); + if (Objects.nonNull(mask)) { + checkImageFormat(image); + checkImageSize(image); + } + // 创建 RequestBody,用于封装构建RequestBody + RequestBody imageBody = RequestBody.create(MediaType.parse("multipart/form-data"), image); + MultipartBody.Part imageMultipartBody = MultipartBody.Part.createFormData("image", image.getName(), imageBody); + MultipartBody.Part maskMultipartBody = null; + if (Objects.nonNull(mask)) { + RequestBody maskBody = RequestBody.create(MediaType.parse("multipart/form-data"), mask); + maskMultipartBody = MultipartBody.Part.createFormData("mask", image.getName(), maskBody); + } + Map requestBodyMap = new HashMap<>(); + requestBodyMap.put("prompt", RequestBody.create(MediaType.parse("multipart/form-data"), imageEdit.getPrompt())); + requestBodyMap.put("n", RequestBody.create(MediaType.parse("multipart/form-data"), imageEdit.getN().toString())); + requestBodyMap.put("size", RequestBody.create(MediaType.parse("multipart/form-data"), imageEdit.getSize())); + requestBodyMap.put("response_format", RequestBody.create(MediaType.parse("multipart/form-data"), imageEdit.getResponseFormat())); + if (!(Objects.isNull(imageEdit.getUser()) || "".equals(imageEdit.getUser()))) { + requestBodyMap.put("user", RequestBody.create(MediaType.parse("multipart/form-data"), imageEdit.getUser())); + } + Single imageResponse = this.openAiApi.editImages( + imageMultipartBody, + maskMultipartBody, + requestBodyMap + ); + return imageResponse.blockingGet().getData(); + } + + /** + * Creates a variation of a given image. + *

+ * 变化图片,类似ai重做图片 + * + * @param image 图片对象 + * @param imageVariations 图片参数 + * @return ImageResponse + */ + public ImageResponse variationsImages(java.io.File image, ImageVariations imageVariations) { + checkImage(image); + checkImageFormat(image); + checkImageSize(image); + RequestBody imageBody = RequestBody.create(MediaType.parse("multipart/form-data"), image); + MultipartBody.Part multipartBody = MultipartBody.Part.createFormData("image", image.getName(), imageBody); + Map requestBodyMap = new HashMap<>(); + requestBodyMap.put("n", RequestBody.create(MediaType.parse("multipart/form-data"), imageVariations.getN().toString())); + requestBodyMap.put("size", RequestBody.create(MediaType.parse("multipart/form-data"), imageVariations.getSize())); + requestBodyMap.put("response_format", RequestBody.create(MediaType.parse("multipart/form-data"), imageVariations.getResponseFormat())); + if (!(Objects.isNull(imageVariations.getUser()) || "".equals(imageVariations.getUser()))) { + requestBodyMap.put("user", RequestBody.create(MediaType.parse("multipart/form-data"), imageVariations.getUser())); + } + Single variationsImages = this.openAiApi.variationsImages( + multipartBody, + requestBodyMap + ); + return variationsImages.blockingGet(); + } + + /** + * Creates a variation of a given image. + * + * @param image 图片对象 + * @return ImageResponse + */ + public ImageResponse variationsImages(java.io.File image) { + checkImage(image); + checkImageFormat(image); + checkImageSize(image); + ImageVariations imageVariations = ImageVariations.builder().build(); + return this.variationsImages(image, imageVariations); + } + + /** + * 校验图片不能为空 + * + * @param image + */ + private void checkImage(java.io.File image) { + if (Objects.isNull(image)) { + log.error("image不能为空"); + throw new BaseException(CommonError.PARAM_ERROR.msg()); + } + } + + /** + * 校验图片格式 + * + * @param image + */ + private void checkImageFormat(java.io.File image) { + if (!(image.getName().endsWith("png") || image.getName().endsWith("PNG"))) { + log.error("image格式错误"); + throw new BaseException(CommonError.PARAM_ERROR.msg()); + } + } + + /** + * 校验图片大小 + * + * @param image + */ + private void checkImageSize(java.io.File image) { + if (image.length() > 4 * 1024 * 1024) { + log.error("image最大支持4MB"); + throw new BaseException(CommonError.PARAM_ERROR.msg()); + } + } + + /** + * 向量计算:单文本 + * + * @param input 单文本 + * @return EmbeddingResponse + */ + public EmbeddingResponse embeddings(String input) { + List inputs = new ArrayList<>(1); + inputs.add(input); + Embedding embedding = Embedding.builder().input(inputs).build(); + return this.embeddings(embedding); + } + + /** + * 向量计算:集合文本 + * + * @param input 文本集合 + * @return EmbeddingResponse + */ + public EmbeddingResponse embeddings(List input) { + Embedding embedding = Embedding.builder().input(input).build(); + return this.embeddings(embedding); + } + + /** + * 文本转换向量 + * + * @param embedding 入参 + * @return EmbeddingResponse + */ + public EmbeddingResponse embeddings(Embedding embedding) { + Single embeddings = this.openAiApi.embeddings(embedding); + return embeddings.blockingGet(); + } + + /** + * 获取文件列表 + * + * @return File list + */ + public List files() { + Single> files = this.openAiApi.files(); + return files.blockingGet().getData(); + } + + /** + * 删除文件 + * + * @param fileId 文件id + * @return DeleteResponse + */ + public DeleteResponse deleteFile(String fileId) { + Single deleteFile = this.openAiApi.deleteFile(fileId); + return deleteFile.blockingGet(); + } + + /** + * 上传文件 + * + * @param purpose purpose + * @param file 文件对象 + * @return UploadFileResponse + */ + public UploadFileResponse uploadFile(String purpose, java.io.File file) { + // 创建 RequestBody,用于封装构建RequestBody + RequestBody fileBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); + MultipartBody.Part multipartBody = MultipartBody.Part.createFormData("file", file.getName(), fileBody); + + RequestBody purposeBody = RequestBody.create(MediaType.parse("multipart/form-data"), purpose); + Single uploadFileResponse = this.openAiApi.uploadFile(multipartBody, purposeBody); + return uploadFileResponse.blockingGet(); + } + + /** + * 上传文件 + * + * @param file 文件 + * @return UploadFileResponse + */ + public UploadFileResponse uploadFile(java.io.File file) { + //purpose 官网示例默认是:fine-tune + return this.uploadFile("fine-tune", file); + } + + /** + * 检索文件 + * + * @param fileId 文件id + * @return File + */ + public File retrieveFile(String fileId) { + Single fileContent = this.openAiApi.retrieveFile(fileId); + return fileContent.blockingGet(); + } + + /** + * 检索文件内容 + * 免费用户无法使用此接口 #未经过测试 + * + * @param fileId + * @return ResponseBody + */ +// public ResponseBody retrieveFileContent(String fileId) { +// Single fileContent = this.openAiApi.retrieveFileContent(fileId); +// return fileContent.blockingGet(); +// } + + /** + * 文本审核 + * + * @param input 待检测数据 + * @return ModerationResponse + */ + public ModerationResponse moderations(String input) { + List content = new ArrayList<>(1); + content.add(input); + Moderation moderation = Moderation.builder().input(content).build(); + return this.moderations(moderation); + } + + /** + * 文本审核 + * + * @param input 待检测数据集合 + * @return ModerationResponse + */ + public ModerationResponse moderations(List input) { + Moderation moderation = Moderation.builder().input(input).build(); + return this.moderations(moderation); + } + + /** + * 文本审核 + * + * @param moderation 审核参数 + * @return ModerationResponse + */ + public ModerationResponse moderations(Moderation moderation) { + Single moderations = this.openAiApi.moderations(moderation); + return moderations.blockingGet(); + } + + /** + * 创建微调模型 + * + * @param fineTune 微调作业id + * @return FineTuneResponse + */ + public FineTuneResponse fineTune(FineTune fineTune) { + Single fineTuneResponse = this.openAiApi.fineTune(fineTune); + return fineTuneResponse.blockingGet(); + } + + /** + * 创建微调模型 + * + * @param trainingFileId 文件id,文件上传返回的id + * @return FineTuneResponse + */ + public FineTuneResponse fineTune(String trainingFileId) { + FineTune fineTune = FineTune.builder().trainingFile(trainingFileId).build(); + return this.fineTune(fineTune); + } + + /** + * 微调模型列表 + * + * @return FineTuneResponse list + */ + public List fineTunes() { + Single> fineTunes = this.openAiApi.fineTunes(); + return fineTunes.blockingGet().getData(); + } + + /** + * 检索微调作业 + * + * @param fineTuneId 微调作业id + * @return FineTuneResponse + */ + public FineTuneResponse retrieveFineTune(String fineTuneId) { + Single fineTune = this.openAiApi.retrieveFineTune(fineTuneId); + return fineTune.blockingGet(); + } + + /** + * 取消微调作业 + * + * @param fineTuneId 主键 + * @return FineTuneResponse + */ + public FineTuneResponse cancelFineTune(String fineTuneId) { + Single fineTune = this.openAiApi.cancelFineTune(fineTuneId); + return fineTune.blockingGet(); + } + + /** + * 微调作业事件列表 + * + * @param fineTuneId 微调作业id + * @return Event List + */ + public List fineTuneEvents(String fineTuneId) { + Single> events = this.openAiApi.fineTuneEvents(fineTuneId); + return events.blockingGet().getData(); + } + + /** + * 删除微调作业模型 + * Delete a fine-tuned model. You must have the Owner role in your organization. + * + * @param model 模型名称 + * @return FineTuneDeleteResponse + */ + public FineTuneDeleteResponse deleteFineTuneModel(String model) { + Single delete = this.openAiApi.deleteFineTuneModel(model); + return delete.blockingGet(); + } + + + /** + * 引擎列表 + * + * @return Engine List + */ + @Deprecated + public List engines() { + Single> engines = this.openAiApi.engines(); + return engines.blockingGet().getData(); + } + + /** + * 引擎详细信息 + * + * @param engineId 引擎id + * @return Engine + */ + @Deprecated + public Engine engine(String engineId) { + Single engine = this.openAiApi.engine(engineId); + return engine.blockingGet(); + } + + /** + * 最新版的GPT-3.5 chat completion 更加贴近官方网站的问答模型 + * + * @param chatCompletion 问答参数 + * @return 答案 + */ + public ChatCompletionResponse chatCompletion(ChatCompletion chatCompletion) { + Single chatCompletionResponse = this.openAiApi.chatCompletion(chatCompletion); + return chatCompletionResponse.blockingGet(); + } + + /** + * 简易版 + * + * @param messages 问答参数 + * @return 答案 + */ + public ChatCompletionResponse chatCompletion(List messages) { + ChatCompletion chatCompletion = ChatCompletion.builder().messages(messages).build(); + return this.chatCompletion(chatCompletion); + } + + /** + * 语音翻译:目前仅支持翻译为英文 + * + * @param translations 参数 + * @param file 语音文件 最大支持25MB mp3, mp4, mpeg, mpga, m4a, wav, webm + * @return 翻译后文本 + */ + public WhisperResponse speechToTextTranslations(java.io.File file, Translations translations) { + //文件 + RequestBody fileBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); + MultipartBody.Part multipartBody = MultipartBody.Part.createFormData("file", file.getName(), fileBody); + //自定义参数 + Map requestBodyMap = new HashMap<>(5,1L); + + if (StrUtil.isNotBlank(translations.getModel())) { + requestBodyMap.put(Translations.Fields.model, RequestBody.create(MediaType.parse("multipart/form-data"), translations.getModel())); + } + if (StrUtil.isNotBlank(translations.getPrompt())) { + requestBodyMap.put(Translations.Fields.prompt, RequestBody.create(MediaType.parse("multipart/form-data"), translations.getPrompt())); + } + if (StrUtil.isNotBlank(translations.getResponseFormat())) { + requestBodyMap.put(Translations.Fields.responseFormat, RequestBody.create(MediaType.parse("multipart/form-data"), translations.getResponseFormat())); + } + requestBodyMap.put(Translations.Fields.temperature, RequestBody.create(MediaType.parse("multipart/form-data"), String.valueOf(translations.getTemperature()))); + Single whisperResponse = this.openAiApi.speechToTextTranslations(multipartBody, requestBodyMap); + return whisperResponse.blockingGet(); + } + + /** + * 插件问答简易版 + * 默认取messages最后一个元素构建插件对话 + * 默认模型:ChatCompletion.Model.GPT_3_5_TURBO_16K_0613 + * + * @param chatCompletion 参数 + * @param plugin 插件 + * @param 插件自定义函数的请求值 + * @param 插件自定义函数的返回值 + * @return ChatCompletionResponse + */ + public ChatCompletionResponse chatCompletionWithPlugin(ChatCompletion chatCompletion, PluginAbstract plugin) { + if (Objects.isNull(plugin)) { + return this.chatCompletion(chatCompletion); + } + if (CollectionUtil.isEmpty(chatCompletion.getMessages())) { + throw new BaseException(CommonError.MESSAGE_NOT_NUL.msg()); + } + List messages = chatCompletion.getMessages(); + Functions functions = Functions.builder() + .name(plugin.getFunction()) + .description(plugin.getDescription()) + .parameters(plugin.getParameters()) + .build(); + //没有值,设置默认值 + if (Objects.isNull(chatCompletion.getFunctionCall())) { + chatCompletion.setFunctionCall("auto"); + } + //tip: 覆盖自己设置的functions参数,使用plugin构造的functions + chatCompletion.setFunctions(Collections.singletonList(functions)); + //调用OpenAi + ChatCompletionResponse functionCallChatCompletionResponse = this.chatCompletion(chatCompletion); + ChatChoice chatChoice = functionCallChatCompletionResponse.getChoices().get(0); + log.debug("构造的方法值:{}", chatChoice.getMessage().getFunctionCall()); + + R realFunctionParam = (R) JSONUtil.toBean(chatChoice.getMessage().getFunctionCall().getArguments(), plugin.getR()); + T tq = plugin.func(realFunctionParam); + + FunctionCall functionCall = FunctionCall.builder() + .arguments(chatChoice.getMessage().getFunctionCall().getArguments()) + .name(plugin.getFunction()) + .build(); + messages.add(Message.builder().role(Message.Role.ASSISTANT).content("function_call").functionCall(functionCall).build()); + messages.add(Message.builder().role(Message.Role.FUNCTION).name(plugin.getFunction()).content(plugin.content(tq)).build()); + //设置第二次,请求的参数 + chatCompletion.setFunctionCall(null); + chatCompletion.setFunctions(null); + + ChatCompletionResponse chatCompletionResponse = this.chatCompletion(chatCompletion); + log.debug("自定义的方法返回值:{}", chatCompletionResponse.getChoices()); + return chatCompletionResponse; + } + + /** + * 插件问答简易版 + * 默认取messages最后一个元素构建插件对话 + * 默认模型:ChatCompletion.Model.GPT_3_5_TURBO_16K_0613 + * + * @param messages 问答参数 + * @param plugin 插件 + * @param 插件自定义函数的请求值 + * @param 插件自定义函数的返回值 + * @return ChatCompletionResponse + */ + public ChatCompletionResponse chatCompletionWithPlugin(List messages, PluginAbstract plugin) { + return chatCompletionWithPlugin(messages, ChatCompletion.Model.GPT_3_5_TURBO_16K_0613.getName(), plugin); + } + + /** + * 插件问答简易版 + * 默认取messages最后一个元素构建插件对话 + * + * @param messages 问答参数 + * @param model 模型 + * @param plugin 插件 + * @param 插件自定义函数的请求值 + * @param 插件自定义函数的返回值 + * @return ChatCompletionResponse + */ + public ChatCompletionResponse chatCompletionWithPlugin(List messages, String model, PluginAbstract plugin) { + ChatCompletion chatCompletion = ChatCompletion.builder().messages(messages).model(model).build(); + return this.chatCompletionWithPlugin(chatCompletion, plugin); + } + + /** + * 简易版 语音翻译:目前仅支持翻译为英文 + * + * @param file 语音文件 最大支持25MB mp3, mp4, mpeg, mpga, m4a, wav, webm + * @return 翻译后文本 + */ + public WhisperResponse speechToTextTranslations(java.io.File file) { + Translations translations = Translations.builder().build(); + return this.speechToTextTranslations(file, translations); + } + + /** + * 校验语音文件大小给出提示,目前官方限制25MB,后续可能会改动所以不报错只做提示 + * + * @param file + */ + private void checkSpeechFileSize(java.io.File file) { + if (file.length() > 25 * 1204 * 1024) { + log.warn("2023-03-02官方文档提示:文件不能超出25MB"); + } + } + + /** + * 账户信息查询:里面包含总金额等信息 + * + * @return 账户信息 + */ + public Subscription subscription() { + Single subscription = this.openAiApi.subscription(); + return subscription.blockingGet(); + } + /** + * 账户调用接口消耗金额信息查询 + * 最多查询100天 + * + * @param starDate 开始时间 + * @param endDate 结束时间 + * @return 消耗金额信息 + */ + public BillingUsage billingUsage(@NotNull LocalDate starDate, @NotNull LocalDate endDate) { + Single billingUsage = this.openAiApi.billingUsage(starDate, endDate); + return billingUsage.blockingGet(); + } + + + public static final class Builder { + /** + * api keys + */ + private @NotNull List apiKey; + /** + * api请求地址,结尾处有斜杠 + * + */ + private String apiHost; + /** + * 自定义OkhttpClient + */ + private OkHttpClient okHttpClient; + + /** + * api key的获取策略 + */ + private KeyStrategyFunction keyStrategy; + + /** + * 自定义鉴权拦截器 + */ + private OpenAiAuthInterceptor authInterceptor; + + public Builder() { + } + + /** + * @param val api请求地址,结尾处有斜杠 + * @return Builder对象 + */ + public Builder apiHost(String val) { + apiHost = val; + return this; + } + + public Builder apiKey(@NotNull List val) { + apiKey = val; + return this; + } + + public Builder keyStrategy(KeyStrategyFunction val) { + keyStrategy = val; + return this; + } + + public Builder okHttpClient(OkHttpClient val) { + okHttpClient = val; + return this; + } + + public Builder authInterceptor(OpenAiAuthInterceptor val) { + authInterceptor = val; + return this; + } + + public OpenAiClient build() { + return new OpenAiClient(this); + } + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/OpenAiStreamClient.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/OpenAiStreamClient.java new file mode 100644 index 0000000..6f68775 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/OpenAiStreamClient.java @@ -0,0 +1,671 @@ +package org.aibidding.common.chat.openai; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.ContentType; +import cn.hutool.json.JSONUtil; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.reactivex.Single; +import lombok.Getter; +import lombok.Setter; +import lombok.extern.slf4j.Slf4j; +import okhttp3.*; +import okhttp3.sse.EventSource; +import okhttp3.sse.EventSourceListener; +import okhttp3.sse.EventSources; +import org.aibidding.common.chat.constant.OpenAIConst; +import org.aibidding.common.chat.entity.Tts.TextToSpeech; +import org.aibidding.common.chat.entity.billing.BillingUsage; +import org.aibidding.common.chat.entity.billing.KeyInfo; +import org.aibidding.common.chat.entity.billing.Subscription; +import org.aibidding.common.chat.entity.chat.*; +import org.aibidding.common.chat.entity.embeddings.Embedding; +import org.aibidding.common.chat.entity.embeddings.EmbeddingResponse; +import org.aibidding.common.chat.entity.files.UploadFileResponse; +import org.aibidding.common.chat.entity.images.Image; +import org.aibidding.common.chat.entity.images.ImageResponse; +import org.aibidding.common.chat.entity.models.Model; +import org.aibidding.common.chat.entity.models.ModelResponse; +import org.aibidding.common.chat.entity.whisper.Transcriptions; +import org.aibidding.common.chat.entity.whisper.WhisperResponse; +import org.aibidding.common.chat.openai.exception.CommonError; +import org.aibidding.common.chat.openai.function.KeyRandomStrategy; +import org.aibidding.common.chat.openai.function.KeyStrategyFunction; +import org.aibidding.common.chat.openai.interceptor.DefaultOpenAiAuthInterceptor; +import org.aibidding.common.chat.openai.interceptor.DynamicKeyOpenAiAuthInterceptor; +import org.aibidding.common.chat.openai.interceptor.OpenAiAuthInterceptor; +import org.aibidding.common.chat.openai.plugin.PluginAbstract; +import org.aibidding.common.chat.openai.plugin.PluginParam; +import org.aibidding.common.chat.sse.DefaultPluginListener; +import org.aibidding.common.chat.sse.PluginListener; +import org.aibidding.common.core.exception.base.BaseException; +import org.jetbrains.annotations.NotNull; +import retrofit2.Call; +import retrofit2.Retrofit; +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +import retrofit2.converter.jackson.JacksonConverterFactory; + +import java.io.IOException; +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.*; +import java.util.concurrent.TimeUnit; + +/** + * 描述: open ai 客户端 + * + * @author https:www.unfbx.com + * 2023-02-28 + */ + +@Getter +@Slf4j +@Setter +public class OpenAiStreamClient { + + @NotNull + private List apiKey; + /** + * 自定义api host使用builder的方式构造client + */ + private String apiHost; + + /** + * 自定义的okHttpClient + * 如果不自定义 ,就是用sdk默认的OkHttpClient实例 + */ + private OkHttpClient okHttpClient; + + /** + * api key的获取策略 + */ + private KeyStrategyFunction, String> keyStrategy; + + private OpenAiApi openAiApi; + + /** + * 自定义鉴权处理拦截器
+ * 可以不设置,默认实现:DefaultOpenAiAuthInterceptor
+ * 如需自定义实现参考:DealKeyWithOpenAiAuthInterceptor + * + * @see DynamicKeyOpenAiAuthInterceptor + * @see DefaultOpenAiAuthInterceptor + */ + private OpenAiAuthInterceptor authInterceptor; + + private static final String DONE_SIGNAL = "[DONE]"; + + /** + * 构造实例对象 + * + * @param builder + */ + private OpenAiStreamClient(Builder builder) { + if (CollectionUtil.isEmpty(builder.apiKey)) { + throw new BaseException(CommonError.API_KEYS_NOT_NUL.msg()); + } + apiKey = builder.apiKey; + + if (StrUtil.isBlank(builder.apiHost)) { + builder.apiHost = OpenAIConst.OPENAI_HOST; + } + apiHost = builder.apiHost; + + if (Objects.isNull(builder.keyStrategy)) { + builder.keyStrategy = new KeyRandomStrategy(); + } + keyStrategy = builder.keyStrategy; + + if (Objects.isNull(builder.authInterceptor)) { + builder.authInterceptor = new DefaultOpenAiAuthInterceptor(); + } + authInterceptor = builder.authInterceptor; + //设置apiKeys和key的获取策略 + authInterceptor.setApiKey(this.apiKey); + authInterceptor.setKeyStrategy(this.keyStrategy); + + if (Objects.isNull(builder.okHttpClient)) { + builder.okHttpClient = this.okHttpClient(); + } else { + //自定义的okhttpClient 需要增加api keys + builder.okHttpClient = builder.okHttpClient + .newBuilder() + .addInterceptor(authInterceptor) + .build(); + } + okHttpClient = builder.okHttpClient; + + this.openAiApi = new Retrofit.Builder() + .baseUrl(apiHost) + .client(okHttpClient) + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) + .addConverterFactory(JacksonConverterFactory.create()) + .build().create(OpenAiApi.class); + } + + /** + * 创建默认的OkHttpClient + */ + private OkHttpClient okHttpClient() { + if (Objects.isNull(this.authInterceptor)) { + this.authInterceptor = new DefaultOpenAiAuthInterceptor(); + } + this.authInterceptor.setApiKey(this.apiKey); + this.authInterceptor.setKeyStrategy(this.keyStrategy); + OkHttpClient okHttpClient = new OkHttpClient + .Builder() + .addInterceptor(this.authInterceptor) + .connectTimeout(10, TimeUnit.SECONDS) + .writeTimeout(50, TimeUnit.SECONDS) + .readTimeout(50, TimeUnit.SECONDS) + .build(); + return okHttpClient; + } + + + /** + * 流式输出,最新版的GPT-3.5 chat completion 更加贴近官方网站的问答模型 + * + * @param chatCompletion 问答参数 + * @param eventSourceListener 监听器 + */ + public void streamChatCompletion(T chatCompletion, EventSourceListener eventSourceListener) { + if (Objects.isNull(eventSourceListener)) { + log.error("参数异常:EventSourceListener不能为空!"); + throw new BaseException(CommonError.PARAM_ERROR.msg()); + } + try { + EventSource.Factory factory = EventSources.createFactory(this.okHttpClient); + ObjectMapper mapper = new ObjectMapper(); + String requestBody = mapper.writeValueAsString(chatCompletion); + Request request = new Request.Builder() + .url(this.apiHost + "v1/chat/completions") + .post(RequestBody.create(MediaType.parse(ContentType.JSON.getValue()), requestBody)) + .build(); + factory.newEventSource(request, eventSourceListener); + } catch (Exception e) { + log.error("请求参数解析异常:{}", e.getMessage()); + } + } + + /** + * 插件问答简易版 + * 默认取messages最后一个元素构建插件对话 + * 默认模型:ChatCompletion.Model.GPT_3_5_TURBO_16K_0613 + * + * @param chatCompletion 参数 + * @param eventSourceListener sse监听器 + * @param pluginEventSourceListener 插件sse监听器,收集function call返回信息 + * @param plugin 插件 + * @param 插件自定义函数的请求值 + * @param 插件自定义函数的返回值 + */ + public void streamChatCompletionWithPlugin(ChatCompletion chatCompletion, EventSourceListener eventSourceListener, PluginListener pluginEventSourceListener, PluginAbstract plugin) { + if (Objects.isNull(plugin)) { + this.streamChatCompletion(chatCompletion, eventSourceListener); + return; + } + if (CollectionUtil.isEmpty(chatCompletion.getMessages())) { + throw new BaseException(CommonError.MESSAGE_NOT_NUL.msg()); + } + Functions functions = Functions.builder() + .name(plugin.getFunction()) + .description(plugin.getDescription()) + .parameters(plugin.getParameters()) + .build(); + //没有值,设置默认值 + if (Objects.isNull(chatCompletion.getFunctionCall())) { + chatCompletion.setFunctionCall("auto"); + } + //tip: 覆盖自己设置的functions参数,使用plugin构造的functions + chatCompletion.setFunctions(Collections.singletonList(functions)); + //调用OpenAi + if (Objects.isNull(pluginEventSourceListener)) { + pluginEventSourceListener = new DefaultPluginListener(this, eventSourceListener, plugin, chatCompletion); + } + this.streamChatCompletion(chatCompletion, pluginEventSourceListener); + } + + + /** + * 插件问答简易版 + * 默认取messages最后一个元素构建插件对话 + * 默认模型:ChatCompletion.Model.GPT_3_5_TURBO_16K_0613 + * + * @param chatCompletion 参数 + * @param eventSourceListener sse监听器 + * @param plugin 插件 + * @param 插件自定义函数的请求值 + * @param 插件自定义函数的返回值 + */ + public void streamChatCompletionWithPlugin(ChatCompletion chatCompletion, EventSourceListener eventSourceListener, PluginAbstract plugin) { + PluginListener pluginEventSourceListener = new DefaultPluginListener(this, eventSourceListener, plugin, chatCompletion); + this.streamChatCompletionWithPlugin(chatCompletion, eventSourceListener, pluginEventSourceListener, plugin); + } + + + /** + * 插件问答简易版 + * 默认取messages最后一个元素构建插件对话 + * 默认模型:ChatCompletion.Model.GPT_3_5_TURBO_16K_0613 + * + * @param messages 问答参数 + * @param eventSourceListener sse监听器 + * @param plugin 插件 + * @param 插件自定义函数的请求值 + * @param 插件自定义函数的返回值 + */ + public void streamChatCompletionWithPlugin(List messages, EventSourceListener eventSourceListener, PluginAbstract plugin) { + this.streamChatCompletionWithPlugin(messages, ChatCompletion.Model.GPT_3_5_TURBO_16K_0613.getName(), eventSourceListener, plugin); + } + + /** + * 插件问答简易版 + * 默认取messages最后一个元素构建插件对话 + * + * @param messages 问答参数 + * @param model 模型 + * @param eventSourceListener eventSourceListener + * @param plugin 插件 + * @param 插件自定义函数的请求值 + * @param 插件自定义函数的返回值 + */ + public void streamChatCompletionWithPlugin(List messages, String model, EventSourceListener eventSourceListener, PluginAbstract plugin) { + ChatCompletion chatCompletion = ChatCompletion.builder().messages(messages).model(model).build(); + this.streamChatCompletionWithPlugin(chatCompletion, eventSourceListener, plugin); + } + + + /** + * 根据描述生成图片 + * + * @param image 图片参数 + * @return ImageResponse + */ + public ImageResponse genImages(Image image) { + Single edits = this.openAiApi.genImages(image); + return edits.blockingGet(); + } + + /** + * 最新版的GPT-3.5 chat completion 更加贴近官方网站的问答模型 + * + * @param chatCompletion 问答参数 + * @return 答案 + */ + public ChatCompletionResponse chatCompletion(T chatCompletion) { + if (chatCompletion instanceof ChatCompletion) { + Single chatCompletionResponse = this.openAiApi.chatCompletion((ChatCompletion) chatCompletion); + return chatCompletionResponse.blockingGet(); + } + Single chatCompletionResponse = this.openAiApi.chatCompletionWithPicture((ChatCompletionWithPicture) chatCompletion); + return chatCompletionResponse.blockingGet(); + } + + /** + * 上传文件 + * + * @param purpose purpose + * @param file 文件对象 + * @return UploadFileResponse + */ + public UploadFileResponse uploadFile(String purpose, java.io.File file) { + // 创建 RequestBody,用于封装构建RequestBody + RequestBody fileBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); + MultipartBody.Part multipartBody = MultipartBody.Part.createFormData("file", file.getName(), fileBody); + + RequestBody purposeBody = RequestBody.create(MediaType.parse("multipart/form-data"), purpose); + Single uploadFileResponse = this.openAiApi.uploadFile(multipartBody, purposeBody); + return uploadFileResponse.blockingGet(); + } + + /** + * 获取openKey账户信息(近90天) + * + * @param key + * @return KeyInfo + * @Date 2023/7/6 + **/ + public KeyInfo getKeyInfo(String key) { + Date now = new Date(); + Date start = new Date(now.getTime() - (long) 90 * 24 * 60 * 60 * 1000); + Date end = new Date(now.getTime() + (long) 24 * 60 * 60 * 1000); + + BillingUsage billingUsage = billingUsage(start.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), end.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()); + double totalUsage = billingUsage.getTotalUsage().doubleValue() / 100; + System.out.println(totalUsage); + Subscription subscription = subscription(); + KeyInfo keyInfo = new KeyInfo(); + String start_key = key.substring(0, 6); + String end_key = key.substring(key.length() - 6); + String mid_key = key.substring(6, key.length() - 6); + mid_key = mid_key.replaceAll(".", "*"); + + keyInfo.setKeyValue(start_key + mid_key + end_key); + keyInfo.setTotalAmount(subscription.getHardLimitUsd()); + keyInfo.setRemaining(subscription.getHardLimitUsd() - totalUsage); + keyInfo.setTotalUsage(totalUsage); + keyInfo.setLimitDate(new Date(subscription.getAccessUntil() * 1000).toInstant().atZone(ZoneId.systemDefault()).toLocalDate()); + keyInfo.setPlanTitle(subscription.getPlan() != null ? subscription.getPlan().getTitle() : "null"); + keyInfo.setIsHasPaymentMethod(subscription.isHasPaymentMethod()); + keyInfo.setModel(getModelName()); + return keyInfo; + } + + /** + * 获取可用模型 + * + * @param + * @return String + * @Date 2023/7/6 + **/ + public String getModelName() { + Single models = this.openAiApi.models(); + List modelList = models.blockingGet().getData(); + for (Model model : modelList) { + if (Objects.equals(model.getId(), "gpt-4")) { + return "GPT-4.0"; + } + } + return "GPT-3.5"; + } + + /** + * 账户调用接口消耗金额信息查询 + * 最多查询100天 + * + * @param starDate 开始时间 + * @param endDate 结束时间 + * @return 消耗金额信息 + */ + public BillingUsage billingUsage(@NotNull LocalDate starDate, @NotNull LocalDate endDate) { + Single billingUsage = this.openAiApi.billingUsage(starDate, endDate); + return billingUsage.blockingGet(); + } + + /** + * 文本转换向量 + * + * @param embedding 入参 + * @return EmbeddingResponse + */ + public EmbeddingResponse embeddings(Embedding embedding) { + Single embeddings = this.openAiApi.embeddings(embedding); + return embeddings.blockingGet(); + } + + /** + * 账户信息查询:里面包含总金额等信息 + * + * @return 账户信息 + */ + public Subscription subscription() { + Single subscription = this.openAiApi.subscription(); + return subscription.blockingGet(); + } + + /** + * 语音转文字 + * + * @param transcriptions 参数 + * @param file 语音文件 最大支持25MB mp3, mp4, mpeg, mpga, m4a, wav, webm + * @return 语音文本 + */ + public WhisperResponse speechToTextTranscriptions(java.io.File file, Transcriptions transcriptions) { + //文件 + RequestBody fileBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); + MultipartBody.Part multipartBody = MultipartBody.Part.createFormData("file", file.getName(), fileBody); + //自定义参数 + Map requestBodyMap = new HashMap<>(10); + if (StrUtil.isNotBlank(transcriptions.getLanguage())) { + requestBodyMap.put(Transcriptions.Fields.language, RequestBody.create(MediaType.parse("multipart/form-data"), transcriptions.getLanguage())); + } + if (StrUtil.isNotBlank(transcriptions.getModel())) { + requestBodyMap.put(Transcriptions.Fields.model, RequestBody.create(MediaType.parse("multipart/form-data"), transcriptions.getModel())); + } + if (StrUtil.isNotBlank(transcriptions.getPrompt())) { + requestBodyMap.put(Transcriptions.Fields.prompt, RequestBody.create(MediaType.parse("multipart/form-data"), transcriptions.getPrompt())); + } + if (StrUtil.isNotBlank(transcriptions.getResponseFormat())) { + requestBodyMap.put(Transcriptions.Fields.responseFormat, RequestBody.create(MediaType.parse("multipart/form-data"), transcriptions.getResponseFormat())); + } + if (Objects.nonNull(transcriptions.getTemperature())) { + requestBodyMap.put(Transcriptions.Fields.temperature, RequestBody.create(MediaType.parse("multipart/form-data"), String.valueOf(transcriptions.getTemperature()))); + } + Single whisperResponse = this.openAiApi.speechToTextTranscriptions(multipartBody, requestBodyMap); + return whisperResponse.blockingGet(); + } + + /** + * 简易版 语音转文字 + * + * @param file 语音文件 最大支持25MB mp3, mp4, mpeg, mpga, m4a, wav, webm + * @return 语音文本 + */ + public WhisperResponse speechToTextTranscriptions(java.io.File file) { + Transcriptions transcriptions = Transcriptions.builder().build(); + return this.speechToTextTranscriptions(file, transcriptions); + } + /** + * 文本转语音(异步) + * + * @param textToSpeech 参数 + * @param callback 返回值接收 + * @since 1.1.2 + */ + public void textToSpeech(TextToSpeech textToSpeech, retrofit2.Callback callback) { + Call responseBody = this.openAiApi.textToSpeech(textToSpeech); + responseBody.enqueue(callback); + } + + /** + * 文本转语音(同步) + * + * @param textToSpeech 参数 + * @since 1.1.3 + */ + public ResponseBody textToSpeech(TextToSpeech textToSpeech){ + Call responseBody = this.openAiApi.textToSpeech(textToSpeech); + try { + return responseBody.execute().body(); + } catch (IOException e) { + throw new BaseException("文本转语音(同步)失败: "+e.getMessage()); + } + } + + /** + * 文本转语音(克隆) + * + * @param textToSpeech + * @return + */ + public ResponseBody textToSpeechClone(TextToSpeech textToSpeech) { + String baseUrl = "http://localhost:8081"; + String spk = "三月七"; + String text = textToSpeech.getInput(); + String lang = "zh"; + + // 创建OkHttpClient实例 + OkHttpClient client = new OkHttpClient(); + + // 构建请求URL + HttpUrl.Builder urlBuilder = HttpUrl.parse(baseUrl).newBuilder(); + urlBuilder.addQueryParameter("spk", spk); + urlBuilder.addQueryParameter("text", text); + urlBuilder.addQueryParameter("lang", lang); + String url = urlBuilder.build().toString(); + + // 创建请求对象 + Request request = new Request.Builder() + .url(url) + .build(); + // 发送请求并处理响应 + try { + return client.newCall(request).execute().body(); + } catch (IOException e) { + throw new BaseException("语音克隆失败!{}",e.getMessage()); + } + } + + /** + * 插件问答简易版 + * 默认取messages最后一个元素构建插件对话 + * 默认模型:ChatCompletion.Model.GPT_3_5_TURBO_16K_0613 + * + * @param chatCompletion 参数 + * @param plugin 插件 + * @param 插件自定义函数的请求值 + * @param 插件自定义函数的返回值 + * @return ChatCompletionResponse + */ + public ChatCompletionResponse chatCompletionWithPlugin(ChatCompletion chatCompletion, PluginAbstract plugin) { + if (Objects.isNull(plugin)) { + return this.chatCompletion(chatCompletion); + } + if (CollectionUtil.isEmpty(chatCompletion.getMessages())) { + throw new BaseException(CommonError.MESSAGE_NOT_NUL.msg()); + } + List messages = chatCompletion.getMessages(); + Functions functions = Functions.builder() + .name(plugin.getFunction()) + .description(plugin.getDescription()) + .parameters(plugin.getParameters()) + .build(); + //没有值,设置默认值 + if (Objects.isNull(chatCompletion.getFunctionCall())) { + chatCompletion.setFunctionCall("auto"); + } + //tip: 覆盖自己设置的functions参数,使用plugin构造的functions + chatCompletion.setFunctions(Collections.singletonList(functions)); + //调用OpenAi + ChatCompletionResponse functionCallChatCompletionResponse = this.chatCompletion(chatCompletion); + ChatChoice chatChoice = functionCallChatCompletionResponse.getChoices().get(0); + log.debug("构造的方法值:{}", chatChoice.getMessage().getFunctionCall()); + + R realFunctionParam = (R) JSONUtil.toBean(chatChoice.getMessage().getFunctionCall().getArguments(), plugin.getR()); + T tq = plugin.func(realFunctionParam); + + FunctionCall functionCall = FunctionCall.builder() + .arguments(chatChoice.getMessage().getFunctionCall().getArguments()) + .name(plugin.getFunction()) + .build(); + messages.add(Message.builder().role(Message.Role.ASSISTANT).content("function_call").functionCall(functionCall).build()); + messages.add(Message.builder().role(Message.Role.FUNCTION).name(plugin.getFunction()).content(plugin.content(tq)).build()); + //设置第二次,请求的参数 + chatCompletion.setFunctionCall(null); + chatCompletion.setFunctions(null); + + ChatCompletionResponse chatCompletionResponse = this.chatCompletion(chatCompletion); + log.debug("自定义的方法返回值:{}", chatCompletionResponse.getChoices()); + return chatCompletionResponse; + } + + /** + * 插件问答简易版 + * 默认取messages最后一个元素构建插件对话 + * 默认模型:ChatCompletion.Model.GPT_3_5_TURBO_16K_0613 + * + * @param messages 问答参数 + * @param plugin 插件 + * @param 插件自定义函数的请求值 + * @param 插件自定义函数的返回值 + * @return ChatCompletionResponse + */ + public ChatCompletionResponse chatCompletionWithPlugin(List messages, PluginAbstract plugin) { + return chatCompletionWithPlugin(messages, ChatCompletion.Model.GPT_3_5_TURBO_16K_0613.getName(), plugin); + } + + /** + * 插件问答简易版 + * 默认取messages最后一个元素构建插件对话 + * + * @param messages 问答参数 + * @param model 模型 + * @param plugin 插件 + * @param 插件自定义函数的请求值 + * @param 插件自定义函数的返回值 + * @return ChatCompletionResponse + */ + public ChatCompletionResponse chatCompletionWithPlugin(List messages, String model, PluginAbstract plugin) { + ChatCompletion chatCompletion = ChatCompletion.builder().messages(messages).model(model).build(); + return this.chatCompletionWithPlugin(chatCompletion, plugin); + } + + + + + + + + /** + * 构造 + * + * @return Builder + */ + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + private @NotNull List apiKey; + /** + * api请求地址,结尾处有斜杠 + * + * @see OpenAIConst + */ + private String apiHost; + + /** + * 自定义OkhttpClient + */ + private OkHttpClient okHttpClient; + + + /** + * api key的获取策略 + */ + private KeyStrategyFunction keyStrategy; + + /** + * 自定义鉴权拦截器 + */ + private OpenAiAuthInterceptor authInterceptor; + + public Builder() { + } + + public Builder apiKey(@NotNull List val) { + apiKey = val; + return this; + } + + /** + * @param val api请求地址,结尾处有斜杠 + * @return Builder + * @see OpenAIConst + */ + public Builder apiHost(String val) { + apiHost = val; + return this; + } + + public Builder keyStrategy(KeyStrategyFunction val) { + keyStrategy = val; + return this; + } + + public Builder okHttpClient(OkHttpClient val) { + okHttpClient = val; + return this; + } + + public Builder authInterceptor(OpenAiAuthInterceptor val) { + authInterceptor = val; + return this; + } + + public OpenAiStreamClient build() { + return new OpenAiStreamClient(this); + } + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/TestOpenAIAPI.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/TestOpenAIAPI.java new file mode 100644 index 0000000..e4f0802 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/TestOpenAIAPI.java @@ -0,0 +1,32 @@ +package org.aibidding.common.chat.openai; + +import okhttp3.*; + +import java.io.IOException; + +public class TestOpenAIAPI { + + private final OkHttpClient client = new OkHttpClient(); + private static final String API_KEY = "sk-Waea254YSRYVg4FZVCz2CDz73B22xRpmKpJ41kbczVgpPxvg"; + private static final String URL = "https://api.gptgod.online/v1/chat/completions"; + + public void getChatGptResponse(String prompt) throws IOException { + RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), + "{\"model\": \"gpt-3.5-turbo\", \"messages\": [{\"role\": \"system\", \"content\": \"You are a helpful assistant.\"}, {\"role\": \"user\", \"content\": \"" + prompt + "\"}]}"); + + Request request = new Request.Builder() + .url(URL) + .post(body) + .addHeader("Authorization", "Bearer " + API_KEY) + .build(); + + try (Response response = client.newCall(request).execute()) { + System.out.println(response.body().string()); + } + } + + public static void main(String[] args) throws IOException { + TestOpenAIAPI api = new TestOpenAIAPI(); + api.getChatGptResponse("Hello, how are you?"); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/exception/CommonError.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/exception/CommonError.java new file mode 100644 index 0000000..850960f --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/exception/CommonError.java @@ -0,0 +1,40 @@ +package org.aibidding.common.chat.openai.exception; + +/** + * 描述: 错误 + * + * @author https:www.unfbx.com + * 2023-02-11 + */ +public enum CommonError implements IError { + MESSAGE_NOT_NUL(500, "Message 不能为空"), + API_KEYS_NOT_NUL(500, "API KEYS 不能为空"), + NO_ACTIVE_API_KEYS(500, "没有可用的API KEYS"), + SYS_ERROR(500, "系统繁忙"), + PARAM_ERROR(501, "参数异常"), + RETRY_ERROR(502, "请求异常,请重试~"), + //官方的错误码列表:https://platform.openai.com/docs/guides/error-codes/api-errors + OPENAI_AUTHENTICATION_ERROR(401, "身份验证无效/提供的 API 密钥不正确/您必须是组织的成员才能使用 API"), + OPENAI_LIMIT_ERROR(429 , "达到请求的速率限制/您超出了当前配额,请检查您的计划和帐单详细信息/发动机当前过载,请稍后重试"), + OPENAI_SERVER_ERROR(500, "服务器在处理您的请求时出错"), + ; + + + private final int code; + private final String msg; + + CommonError(int code, String msg) { + this.code = code; + this.msg = msg; + } + + @Override + public String msg() { + return this.msg; + } + + @Override + public int code() { + return this.code; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/exception/IError.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/exception/IError.java new file mode 100644 index 0000000..ac98961 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/exception/IError.java @@ -0,0 +1,12 @@ +package org.aibidding.common.chat.openai.exception; +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-11 + */ +public interface IError { + String msg(); + + int code(); +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/function/KeyRandomStrategy.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/function/KeyRandomStrategy.java new file mode 100644 index 0000000..a0ee21c --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/function/KeyRandomStrategy.java @@ -0,0 +1,19 @@ +package org.aibidding.common.chat.openai.function; + +import cn.hutool.core.util.RandomUtil; + +import java.util.List; + +/** + * 描述:随机策略 + * + * @author https:www.unfbx.com + * @since 2023-04-03 + */ +public class KeyRandomStrategy implements KeyStrategyFunction, String> { + + @Override + public String apply(List apiKeys) { + return RandomUtil.randomEle(apiKeys); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/function/KeyStrategyFunction.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/function/KeyStrategyFunction.java new file mode 100644 index 0000000..c95283f --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/function/KeyStrategyFunction.java @@ -0,0 +1,24 @@ +package org.aibidding.common.chat.openai.function; + +import java.util.function.Function; + +/** + * 描述:key 的获取策略 + * jdk默认实现 + * @see Function + * + * @author https:www.unfbx.com + * @since 2023-04-03 + */ +@FunctionalInterface +public interface KeyStrategyFunction { + + /** + * Applies this function to the given argument. + * + * @param t the function argument + * @return the function result + */ + R apply(T t); + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/DefaultOpenAiAuthInterceptor.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/DefaultOpenAiAuthInterceptor.java new file mode 100644 index 0000000..5f8f6b8 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/DefaultOpenAiAuthInterceptor.java @@ -0,0 +1,65 @@ +package org.aibidding.common.chat.openai.interceptor; + +import lombok.extern.slf4j.Slf4j; +import okhttp3.Request; +import okhttp3.Response; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * 描述:请求增加header apikey + * + * @author https:www.unfbx.com + * @since 2023-03-23 + */ +@Slf4j +public class DefaultOpenAiAuthInterceptor extends OpenAiAuthInterceptor { + /** + * 请求头处理 + */ + public DefaultOpenAiAuthInterceptor() { + super.setWarringConfig(null); + } + + /** + * 构造方法 + * + * @param warringConfig 所有的key都失效后的告警参数配置 + */ + public DefaultOpenAiAuthInterceptor(Map warringConfig) { + super.setWarringConfig(warringConfig); + } + + /** + * 拦截器鉴权 + * + * @param chain Chain + * @return Response对象 + * @throws IOException io异常 + */ + @Override + public Response intercept(Chain chain) throws IOException { + Request original = chain.request(); + return chain.proceed(auth(super.getKey(), original)); + } + + /** + * key失效或者禁用后的处理逻辑 + * 默认不处理 + * + * @param apiKey 返回新的api keys集合 + * @return 新的apiKey集合 + */ + @Override + protected List onErrorDealApiKeys(String apiKey) { + return super.getApiKey(); + } + + @Override + protected void noHaveActiveKeyWarring() { + log.error("--------> [告警] 没有可用的key!!!"); + return; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/DynamicKeyOpenAiAuthInterceptor.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/DynamicKeyOpenAiAuthInterceptor.java new file mode 100644 index 0000000..2a765a1 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/DynamicKeyOpenAiAuthInterceptor.java @@ -0,0 +1,108 @@ +package org.aibidding.common.chat.openai.interceptor; + +import cn.hutool.json.JSONUtil; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Request; +import okhttp3.Response; +import org.aibidding.common.chat.entity.common.OpenAiResponse; +import org.aibidding.common.chat.openai.exception.CommonError; +import org.aibidding.common.core.exception.base.BaseException; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * 描述:动态处理key的鉴权拦截器 + * + * @author https:www.unfbx.com + * @since 2023-04-25 + */ +@Getter +@Slf4j +public class DynamicKeyOpenAiAuthInterceptor extends OpenAiAuthInterceptor { + /** + * 账号被封了 + */ + private static final String ACCOUNT_DEACTIVATED = "account_deactivated"; + /** + * key不正确 + */ + private static final String INVALID_API_KEY = "invalid_api_key"; + + /** + * 请求头处理 + * + */ + public DynamicKeyOpenAiAuthInterceptor() { + this.setWarringConfig(null); + } + + /** + * 构造方法 + * + * @param warringConfig 所有的key都失效后的告警参数配置 + */ + public DynamicKeyOpenAiAuthInterceptor(Map warringConfig) { + this.setWarringConfig(warringConfig); + } + + @Override + public Response intercept(Chain chain) throws IOException { + String key = getKey(); + Request original = chain.request(); + Request request = this.auth(key, original); + Response response = chain.proceed(request); + if (!response.isSuccessful()) { + String errorMsg = response.body().string(); + if (response.code() == CommonError.OPENAI_AUTHENTICATION_ERROR.code() + || response.code() == CommonError.OPENAI_LIMIT_ERROR.code() + || response.code() == CommonError.OPENAI_SERVER_ERROR.code()) { + OpenAiResponse openAiResponse = JSONUtil.toBean(errorMsg, OpenAiResponse.class); + String errorCode = openAiResponse.getError().getCode(); + log.error("--------> 请求openai异常,错误code:{}", errorCode); + log.error("--------> 请求异常:{}", errorMsg); + //账号被封或者key不正确就移除掉 + if (ACCOUNT_DEACTIVATED.equals(errorCode) || INVALID_API_KEY.equals(errorCode)) { + super.setApiKey(this.onErrorDealApiKeys(key)); + } + throw new BaseException(openAiResponse.getError().getMessage()); + } + //非官方定义的错误code + log.error("--------> 请求异常:{}", errorMsg); + OpenAiResponse openAiResponse = JSONUtil.toBean(errorMsg, OpenAiResponse.class); + if (Objects.nonNull(openAiResponse.getError())) { + log.error(openAiResponse.getError().getMessage()); + throw new BaseException(openAiResponse.getError().getMessage()); + } + throw new BaseException(CommonError.RETRY_ERROR.msg()); + } + return response; + } + + + @Override + protected List onErrorDealApiKeys(String errorKey) { + List apiKey = super.getApiKey().stream().filter(e -> !errorKey.equals(e)).collect(Collectors.toList()); + log.error("--------> 当前ApiKey:[{}] 失效了,移除!", errorKey); + return apiKey; + } + + /** + * 所有的key都失效后,自定义预警配置 + * 不配置直接return + */ + @Override + protected void noHaveActiveKeyWarring() { + log.error("--------> [告警] 没有可用的key!!!"); + return; + } + + @Override + public Request auth(String key, Request original) { + return super.auth(key, original); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/OpenAILogger.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/OpenAILogger.java new file mode 100644 index 0000000..abf0eeb --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/OpenAILogger.java @@ -0,0 +1,18 @@ +package org.aibidding.common.chat.openai.interceptor; + +import lombok.extern.slf4j.Slf4j; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * 描述: 日志 + * + * @author https:www.unfbx.com + * 2023-02-28 + */ +@Slf4j +public class OpenAILogger implements HttpLoggingInterceptor.Logger { + @Override + public void log(String message) { + log.info("OkHttp-------->:{}", message); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/OpenAiAuthInterceptor.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/OpenAiAuthInterceptor.java new file mode 100644 index 0000000..b40682f --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/OpenAiAuthInterceptor.java @@ -0,0 +1,84 @@ +package org.aibidding.common.chat.openai.interceptor; + + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.http.ContentType; +import cn.hutool.http.Header; +import lombok.Getter; +import lombok.Setter; +import okhttp3.Interceptor; +import okhttp3.Request; +import org.aibidding.common.chat.openai.exception.CommonError; +import org.aibidding.common.chat.openai.function.KeyStrategyFunction; +import org.aibidding.common.core.exception.base.BaseException; + +import java.util.List; +import java.util.Map; + +public abstract class OpenAiAuthInterceptor implements Interceptor { + + + /** + * key 集合 + */ + @Getter + @Setter + private List apiKey; + /** + * 自定义的key的使用策略 + */ + @Getter + @Setter + private KeyStrategyFunction, String> keyStrategy; + + /** + * 预警触发参数配置,配置参数实现飞书、钉钉、企业微信、邮箱预警等功能 + */ + @Getter + @Setter + private Map warringConfig; + + /** + * 自定义apiKeys的处理逻辑 + * + * @param errorKey 错误的key + * @return 返回值是新的apiKeys + */ + protected abstract List onErrorDealApiKeys(String errorKey); + + /** + * 所有的key都失效后,自定义预警配置 + * 可以通过warringConfig配置参数实现飞书、钉钉、企业微信、邮箱预警等 + */ + protected abstract void noHaveActiveKeyWarring(); + + + /** + * 获取请求key + * + * @return key + */ + public final String getKey() { + if (CollectionUtil.isEmpty(apiKey)) { + this.noHaveActiveKeyWarring(); + throw new BaseException(CommonError.NO_ACTIVE_API_KEYS.msg()); + } + return keyStrategy.apply(apiKey); + } + + /** + * 默认的鉴权处理方法 + * + * @param key api key + * @param original 源请求体 + * @return 请求体 + */ + public Request auth(String key, Request original) { + Request request = original.newBuilder() + .header(Header.AUTHORIZATION.getValue(), "Bearer " + key) + .header(Header.CONTENT_TYPE.getValue(), ContentType.JSON.getValue()) + .method(original.method(), original.body()) + .build(); + return request; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/OpenAiResponseInterceptor.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/OpenAiResponseInterceptor.java new file mode 100644 index 0000000..0ff2053 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/interceptor/OpenAiResponseInterceptor.java @@ -0,0 +1,47 @@ +package org.aibidding.common.chat.openai.interceptor; + +import cn.hutool.json.JSONUtil; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Interceptor; +import okhttp3.Request; +import okhttp3.Response; +import org.aibidding.common.chat.entity.common.OpenAiResponse; +import org.aibidding.common.chat.openai.exception.CommonError; +import org.aibidding.common.core.exception.base.BaseException; + +import java.io.IOException; +import java.util.Objects; + +/** + * 描述:openai 返回值处理Interceptor + * + * @author https:www.unfbx.com + * @since 2023-03-23 + */ +@Slf4j +public class OpenAiResponseInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + + Request original = chain.request(); + Response response = chain.proceed(original); + if (!response.isSuccessful()) { + if (response.code() == CommonError.OPENAI_AUTHENTICATION_ERROR.code() + || response.code() == CommonError.OPENAI_LIMIT_ERROR.code() + || response.code() == CommonError.OPENAI_SERVER_ERROR.code()) { + OpenAiResponse openAiResponse = JSONUtil.toBean(response.body().string(), OpenAiResponse.class); + log.error(openAiResponse.getError().getMessage()); + throw new BaseException(openAiResponse.getError().getMessage()); + } + String errorMsg = response.body().string(); + log.error("--------> 请求异常:{}", errorMsg); + OpenAiResponse openAiResponse = JSONUtil.toBean(errorMsg, OpenAiResponse.class); + if (Objects.nonNull(openAiResponse.getError())) { + log.error(openAiResponse.getError().getMessage()); + throw new BaseException(openAiResponse.getError().getMessage()); + } + throw new BaseException(CommonError.RETRY_ERROR.msg()); + } + return response; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/plugin/PluginAbstract.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/plugin/PluginAbstract.java new file mode 100644 index 0000000..80af7ce --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/plugin/PluginAbstract.java @@ -0,0 +1,88 @@ +package org.aibidding.common.chat.openai.plugin; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.json.JSONObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import org.aibidding.common.chat.entity.chat.Parameters; + +import java.util.List; +import java.util.stream.Collectors; + +@Data +@AllArgsConstructor +public abstract class PluginAbstract { + + private Class R; + + private String name; + + private String function; + + private String description; + + private List args; + + private List required; + + private Parameters parameters; + + public PluginAbstract(Class r) { + R = r; + } + + public void setRequired(List required) { + if (CollectionUtil.isEmpty(required)) { + this.required = this.getArgs().stream().filter(e -> e.isRequired()).map(Arg::getName).collect(Collectors.toList()); + return; + } + this.required = required; + } + + private void setRequired() { + if (CollectionUtil.isEmpty(required)) { + this.required = this.getArgs().stream().filter(e -> e.isRequired()).map(Arg::getName).collect(Collectors.toList()); + } + } + + private void setParameters() { + JSONObject properties = new JSONObject(); + args.forEach(e -> { + JSONObject param = new JSONObject(); + param.putOpt("type", e.getType()); + param.putOpt("enum", e.getEnumDictValue()); + param.putOpt("description", e.getDescription()); + properties.putOpt(e.getName(), param); + }); + this.parameters = Parameters.builder() + .type("object") + .properties(properties) + .required(this.getRequired()) + .build(); + } + + public void setArgs(List args) { + this.args = args; + setRequired(); + setParameters(); + } + + @Data + public static class Arg { + private String name; + private String type; + private String description; + @JsonIgnore + private boolean enumDict; + @JsonProperty("enum") + private List enumDictValue; + @JsonIgnore + private boolean required; + } + + public abstract T func(R args); + + public abstract String content(T t); +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/plugin/PluginParam.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/plugin/PluginParam.java new file mode 100644 index 0000000..8c5cb20 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/openai/plugin/PluginParam.java @@ -0,0 +1,7 @@ +package org.aibidding.common.chat.openai.plugin; + +import lombok.Data; + +@Data +public class PluginParam { +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/CmdPlugin.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/CmdPlugin.java new file mode 100644 index 0000000..b1e3b41 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/CmdPlugin.java @@ -0,0 +1,36 @@ +package org.aibidding.common.chat.plugin; + +import org.aibidding.common.chat.openai.plugin.PluginAbstract; + +import java.io.IOException; + +public class CmdPlugin extends PluginAbstract { + + public CmdPlugin(Class r) { + super(r); + } + + @Override + public CmdResp func(CmdReq args) { + try { + if("计算器".equals(args.getCmd())){ + Runtime.getRuntime().exec("calc"); + }else if("记事本".equals(args.getCmd())){ + Runtime.getRuntime().exec("notepad"); + }else if("命令行".equals(args.getCmd())){ + String [] cmd={"cmd","/C","start copy exel exe2"}; + Runtime.getRuntime().exec(cmd); + } + } catch (IOException e) { + throw new RuntimeException("指令执行失败"); + } + CmdResp resp = new CmdResp(); + resp.setResult(args.getCmd()+"指令执行成功!"); + return resp; + } + + @Override + public String content(CmdResp resp) { + return resp.getResult(); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/CmdReq.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/CmdReq.java new file mode 100644 index 0000000..f8a980d --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/CmdReq.java @@ -0,0 +1,13 @@ +package org.aibidding.common.chat.plugin; + + +import lombok.Data; +import org.aibidding.common.chat.openai.plugin.PluginParam; + +@Data +public class CmdReq extends PluginParam { + /** + * 指令 + */ + private String cmd; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/CmdResp.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/CmdResp.java new file mode 100644 index 0000000..da302ef --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/CmdResp.java @@ -0,0 +1,12 @@ +package org.aibidding.common.chat.plugin; + +import lombok.Data; + +@Data +public class CmdResp { + + /** + * 返回结果 + */ + private String result; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/SqlPlugin.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/SqlPlugin.java new file mode 100644 index 0000000..0b605b7 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/SqlPlugin.java @@ -0,0 +1,88 @@ +package org.aibidding.common.chat.plugin; + +import org.aibidding.common.chat.openai.plugin.PluginAbstract; + +import java.sql.*; + +/** + * @author ageer + */ +public class SqlPlugin extends PluginAbstract { + + public SqlPlugin(Class r) { + super(r); + } + + + + @Override + public SqlResp func(SqlReq args) { + SqlResp resp = new SqlResp(); + resp.setUserBalance(getBalance(args.getUsername())); + return resp; + } + + @Override + public String content(SqlResp resp) { + return "用户余额:"+resp.getUserBalance(); + } + + + public String getBalance(String userName) { + // MySQL 8.0 以下版本 - JDBC 驱动名及数据库 URL + String JDBC_DRIVER = "com.mysql.cj.jdbc.Driver"; + String DB_URL = "jdbc:mysql://43.139.70.230:3306/ry-vue"; + // 数据库的用户名与密码,需要根据自己的设置 + String USER = "ry-vue"; + String PASS = "BXZiGsY35K523Xfx"; + Connection conn = null; + Statement stmt = null; + String balance = "0.1"; + + try{ + // 注册 JDBC 驱动 + Class.forName(JDBC_DRIVER); + + // 打开链接 + System.out.println("连接数据库..."); + conn = DriverManager.getConnection(DB_URL,USER,PASS); + + // 执行查询 + System.out.println(" 实例化Statement对象..."); + stmt = conn.createStatement(); + String sql; + sql = "SELECT user_balance FROM sys_user where user_name ='" + userName + "'"; + ResultSet rs = stmt.executeQuery(sql); + // 展开结果集数据库 + while(rs.next()){ + // 通过字段检索 + balance = rs.getString("user_balance"); + // 输出数据 + System.out.print("余额: " + balance); + System.out.print("\n"); + } + // 完成后关闭 + rs.close(); + stmt.close(); + conn.close(); + }catch(SQLException se){ + // 处理 JDBC 错误 + se.printStackTrace(); + }catch(Exception e){ + // 处理 Class.forName 错误 + e.printStackTrace(); + }finally{ + // 关闭资源 + try{ + if(stmt!=null) stmt.close(); + }catch(SQLException se2){ + }// 什么都不做 + try{ + if(conn!=null) conn.close(); + }catch(SQLException se){ + se.printStackTrace(); + } + } + return balance; + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/SqlReq.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/SqlReq.java new file mode 100644 index 0000000..5862e7e --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/SqlReq.java @@ -0,0 +1,13 @@ +package org.aibidding.common.chat.plugin; + + +import lombok.Data; +import org.aibidding.common.chat.openai.plugin.PluginParam; + +@Data +public class SqlReq extends PluginParam { + /** + * 用户名称 + */ + private String username; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/SqlResp.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/SqlResp.java new file mode 100644 index 0000000..3f1152d --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/plugin/SqlResp.java @@ -0,0 +1,12 @@ +package org.aibidding.common.chat.plugin; + +import lombok.Data; + +@Data +public class SqlResp { + + /** + * 用户余额 + */ + private String userBalance; +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/request/ChatRequest.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/request/ChatRequest.java new file mode 100644 index 0000000..f4c7dce --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/request/ChatRequest.java @@ -0,0 +1,55 @@ +package org.aibidding.common.chat.request; + +import jakarta.validation.constraints.NotEmpty; +import lombok.Data; +import org.aibidding.common.chat.entity.chat.Content; +import org.aibidding.common.chat.entity.chat.Message; + +import java.util.List; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @sine 2023-04-08 + */ +@Data +public class ChatRequest { + + @NotEmpty(message = "传入的模型不能为空") + private String model; + + @NotEmpty(message = "对话消息不能为空") + List messages; + + List imageContent; + + private String prompt; + + private String userId; + + /** + * 知识库id + */ + private String kid; + + /** + * gpt的默认设置 + */ + private String systemMessage = ""; + + private double top_p = 1; + + private double temperature = 0.2; + + /** + * 上下文的条数 + */ + private Integer contentNumber = 10; + + /** + * 是否携带上下文 + */ + private Boolean usingContext = Boolean.TRUE; + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/request/Dall3Request.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/request/Dall3Request.java new file mode 100644 index 0000000..47cf05a --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/request/Dall3Request.java @@ -0,0 +1,33 @@ +package org.aibidding.common.chat.request; + +import jakarta.validation.constraints.NotEmpty; +import lombok.Data; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @sine 2023-04-08 + */ +@Data +public class Dall3Request { + + @NotEmpty(message = "传入的模型不能为空") + private String model; + + @NotEmpty(message = "提示词不能为空") + private String prompt; + + /** 图片大小 */ + @NotEmpty(message = "图片大小不能为空") + private String size ; + + /** 图片质量 */ + @NotEmpty(message = "图片质量不能为空") + private String quality; + + /** 图片风格 */ + @NotEmpty(message = "图片风格不能为空") + private String style; + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/sse/ConsoleEventSourceListener.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/sse/ConsoleEventSourceListener.java new file mode 100644 index 0000000..4c561ac --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/sse/ConsoleEventSourceListener.java @@ -0,0 +1,56 @@ +package org.aibidding.common.chat.sse; + +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Response; +import okhttp3.ResponseBody; +import okhttp3.sse.EventSource; +import okhttp3.sse.EventSourceListener; + +import java.util.Objects; + +/** + * 描述: sse + * + * @author https:www.unfbx.com + * 2023-02-28 + */ +@Slf4j +public class ConsoleEventSourceListener extends EventSourceListener { + + @Override + public void onOpen(EventSource eventSource, Response response) { + log.info("OpenAI建立sse连接..."); + } + + @Override + public void onEvent(EventSource eventSource, String id, String type, String data) { + log.info("OpenAI返回数据:{}", data); + if ("[DONE]".equals(data)) { + log.info("OpenAI返回数据结束了"); + return; + } + } + + @Override + public void onClosed(EventSource eventSource) { + log.info("OpenAI关闭sse连接..."); + } + + @SneakyThrows + @Override + public void onFailure(EventSource eventSource, Throwable t, Response response) { + if(Objects.isNull(response)){ + log.error("OpenAI sse连接异常:{}", t); + eventSource.cancel(); + return; + } + ResponseBody body = response.body(); + if (Objects.nonNull(body)) { + log.error("OpenAI sse连接异常data:{},异常:{}", body.string(), t); + } else { + log.error("OpenAI sse连接异常data:{},异常:{}", response, t); + } + eventSource.cancel(); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/sse/DefaultPluginListener.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/sse/DefaultPluginListener.java new file mode 100644 index 0000000..ddd0116 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/sse/DefaultPluginListener.java @@ -0,0 +1,22 @@ +package org.aibidding.common.chat.sse; + +import lombok.extern.slf4j.Slf4j; + +import okhttp3.sse.EventSourceListener; +import org.aibidding.common.chat.entity.chat.ChatCompletion; +import org.aibidding.common.chat.openai.OpenAiStreamClient; +import org.aibidding.common.chat.openai.plugin.PluginAbstract; + +/** + * 描述: 插件开发返回信息收集sse监听器 + * + * @author https:www.unfbx.com + * 2023-08-18 + */ +@Slf4j +public class DefaultPluginListener extends PluginListener { + + public DefaultPluginListener(OpenAiStreamClient client, EventSourceListener eventSourceListener, PluginAbstract plugin, ChatCompletion chatCompletion) { + super(client, eventSourceListener, plugin, chatCompletion); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/sse/PluginListener.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/sse/PluginListener.java new file mode 100644 index 0000000..abfadb9 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/sse/PluginListener.java @@ -0,0 +1,125 @@ +package org.aibidding.common.chat.sse; + +import cn.hutool.json.JSONUtil; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Response; +import okhttp3.ResponseBody; +import okhttp3.sse.EventSource; +import okhttp3.sse.EventSourceListener; +import org.jetbrains.annotations.NotNull; +import org.aibidding.common.chat.entity.chat.ChatCompletion; +import org.aibidding.common.chat.entity.chat.ChatCompletionResponse; +import org.aibidding.common.chat.entity.chat.FunctionCall; +import org.aibidding.common.chat.entity.chat.Message; +import org.aibidding.common.chat.openai.OpenAiStreamClient; +import org.aibidding.common.chat.openai.plugin.PluginAbstract; +import org.aibidding.common.chat.openai.plugin.PluginParam; + +import java.util.Objects; + +/** + * 描述: 插件开发返回信息收集sse监听器 + * + * @author https:www.unfbx.com + * 2023-08-18 + */ +@Slf4j +public abstract class PluginListener extends EventSourceListener { + /** + * openAi插件构建的参数 + */ + private String arguments = ""; + + /** + * 获取openAi插件构建的参数 + * + * @return arguments + */ + private String getArguments() { + return this.arguments; + } + + private OpenAiStreamClient client; + private EventSourceListener eventSourceListener; + private PluginAbstract plugin; + private ChatCompletion chatCompletion; + + /** + * 构造方法必备四个元素 + * + * @param client OpenAiStreamClient + * @param eventSourceListener 处理真实第二次sse请求的自定义监听 + * @param plugin 插件信息 + * @param chatCompletion 请求参数 + */ + public PluginListener(OpenAiStreamClient client, EventSourceListener eventSourceListener, PluginAbstract plugin, ChatCompletion chatCompletion) { + this.client = client; + this.eventSourceListener = eventSourceListener; + this.plugin = plugin; + this.chatCompletion = chatCompletion; + } + + /** + * sse关闭后处理,第二次请求方法 + */ + public void onClosedAfter() { + log.debug("构造的方法值:{}", getArguments()); + + R realFunctionParam = (R) JSONUtil.toBean(getArguments(), plugin.getR()); + T tq = plugin.func(realFunctionParam); + + FunctionCall functionCall = FunctionCall.builder() + .arguments(getArguments()) + .name(plugin.getFunction()) + .build(); + chatCompletion.getMessages().add(Message.builder().role(Message.Role.ASSISTANT).content("function_call").functionCall(functionCall).build()); + chatCompletion.getMessages().add(Message.builder().role(Message.Role.FUNCTION).name(plugin.getFunction()).content(plugin.content(tq)).build()); + //设置第二次,请求的参数 + chatCompletion.setFunctionCall(null); + chatCompletion.setFunctions(null); + client.streamChatCompletion(chatCompletion, eventSourceListener); + } + + @SneakyThrows + @Override + public final void onEvent(@NotNull EventSource eventSource, String id, String type, String data) { + log.debug("插件开发返回信息收集sse监听器返回数据:{}", data); + if ("[DONE]".equals(data)) { + log.debug("插件开发返回信息收集sse监听器返回数据结束了"); + return; + } + ChatCompletionResponse chatCompletionResponse = JSONUtil.toBean(data, ChatCompletionResponse.class); + if (Objects.nonNull(chatCompletionResponse.getChoices().get(0).getDelta().getFunctionCall())) { + this.arguments += chatCompletionResponse.getChoices().get(0).getDelta().getFunctionCall().getArguments(); + } + } + + @Override + public final void onClosed(EventSource eventSource) { + log.debug("插件开发返回信息收集sse监听器关闭连接..."); + this.onClosedAfter(); + } + + @Override + public void onOpen(EventSource eventSource, Response response) { + log.debug("插件开发返回信息收集sse监听器建立连接..."); + } + + @SneakyThrows + @Override + public void onFailure(EventSource eventSource, Throwable t, Response response) { + if (Objects.isNull(response)) { + log.error("插件开发返回信息收集sse监听器,连接异常:{}", t); + eventSource.cancel(); + return; + } + ResponseBody body = response.body(); + if (Objects.nonNull(body)) { + log.error("插件开发返回信息收集sse监听器,连接异常data:{},异常:{}", body.string(), t); + } else { + log.error("插件开发返回信息收集sse监听器,连接异常data:{},异常:{}", response, t); + } + eventSource.cancel(); + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/utils/TikTokensUtil.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/utils/TikTokensUtil.java new file mode 100644 index 0000000..558ffe5 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/utils/TikTokensUtil.java @@ -0,0 +1,237 @@ +package org.aibidding.common.chat.utils; + +import cn.hutool.core.util.StrUtil; +import com.knuddels.jtokkit.Encodings; +import com.knuddels.jtokkit.api.Encoding; +import com.knuddels.jtokkit.api.EncodingRegistry; +import com.knuddels.jtokkit.api.EncodingType; +import com.knuddels.jtokkit.api.ModelType; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.chat.entity.chat.ChatCompletion; +import org.aibidding.common.chat.entity.chat.FunctionCall; +import org.aibidding.common.chat.entity.chat.Message; +import org.jetbrains.annotations.NotNull; + +import java.util.*; + +/** + * 描述:token计算工具类 + * + * @author https:www.unfbx.com + * @since 2023-04-04 + */ +@Slf4j +public class TikTokensUtil { + /** + * 模型名称对应Encoding + */ + private static final Map modelMap = new HashMap<>(); + /** + * registry实例 + */ + private static final EncodingRegistry registry = Encodings.newDefaultEncodingRegistry(); + + static { + for (ModelType modelType : ModelType.values()) { + modelMap.put(modelType.getName(), registry.getEncodingForModel(modelType)); + } + modelMap.put(ChatCompletion.Model.GPT_3_5_TURBO_0613.getName(), registry.getEncodingForModel(ModelType.GPT_3_5_TURBO)); + modelMap.put(ChatCompletion.Model.GPT_3_5_TURBO_16K.getName(), registry.getEncodingForModel(ModelType.GPT_3_5_TURBO)); + modelMap.put(ChatCompletion.Model.GPT_3_5_TURBO_16K_0613.getName(), registry.getEncodingForModel(ModelType.GPT_3_5_TURBO)); + modelMap.put(ChatCompletion.Model.GPT_3_5_TURBO_0125.getName(), registry.getEncodingForModel(ModelType.GPT_3_5_TURBO)); + modelMap.put(ChatCompletion.Model.GPT_4_32K.getName(), registry.getEncodingForModel(ModelType.GPT_4)); + modelMap.put(ChatCompletion.Model.GPT_4_0613.getName(), registry.getEncodingForModel(ModelType.GPT_4)); + modelMap.put(ChatCompletion.Model.GPT_4_32K_0613.getName(), registry.getEncodingForModel(ModelType.GPT_4)); + modelMap.put(ChatCompletion.Model.GPT_4_1106_PREVIEW.getName(), registry.getEncodingForModel(ModelType.GPT_4)); + modelMap.put(ChatCompletion.Model.GPT_4_VISION_PREVIEW.getName(), registry.getEncodingForModel(ModelType.GPT_4)); + modelMap.put(ChatCompletion.Model.GPT_4_0125_PREVIEW.getName(), registry.getEncodingForModel(ModelType.GPT_4)); + } + + /** + * 通过Encoding和text获取编码数组 + * + * @param enc Encoding类型 + * @param text 文本信息 + * @return 编码数组 + */ + public static List encode(@NotNull Encoding enc, String text) { + return StrUtil.isBlank(text) ? new ArrayList<>() : enc.encode(text); + } + + /** + * 通过Encoding计算text信息的tokens + * + * @param enc Encoding类型 + * @param text 文本信息 + * @return tokens数量 + */ + public static int tokens(@NotNull Encoding enc, String text) { + return encode(enc, text).size(); + } + + + /** + * 通过Encoding和encoded数组反推text信息 + * + * @param enc Encoding + * @param encoded 编码数组 + * @return 编码数组对应的文本信息 + */ + public static String decode(@NotNull Encoding enc, @NotNull List encoded) { + return enc.decode(encoded); + } + + /** + * 获取一个Encoding对象,通过Encoding类型 + * + * @param encodingType encodingType + * @return Encoding + */ + public static Encoding getEncoding(@NotNull EncodingType encodingType) { + return registry.getEncoding(encodingType); + } + + /** + * 获取encode的编码数组 + * + * @param text 文本信息 + * @return 编码数组 + */ + public static List encode(@NotNull EncodingType encodingType, String text) { + if (StrUtil.isBlank(text)) { + return new ArrayList<>(); + } + Encoding enc = getEncoding(encodingType); + return enc.encode(text); + } + + /** + * 计算指定字符串的tokens,通过EncodingType + * + * @param encodingType encodingType + * @param text 文本信息 + * @return tokens数量 + */ + public static int tokens(@NotNull EncodingType encodingType, String text) { + return encode(encodingType, text).size(); + } + + + /** + * 通过EncodingType和encoded编码数组,反推字符串文本 + * + * @param encodingType encodingType + * @param encoded 编码数组 + * @return 编码数组对应的字符串 + */ + public static String decode(@NotNull EncodingType encodingType, @NotNull List encoded) { + Encoding enc = getEncoding(encodingType); + return enc.decode(encoded); + } + + + /** + * 获取一个Encoding对象,通过模型名称 + * + * @param modelName 模型名称 + * @return Encoding + */ + public static Encoding getEncoding(@NotNull String modelName) { + return modelMap.getOrDefault(modelName, modelMap.get(ChatCompletion.Model.GPT_4_1106_PREVIEW.getName())); + } + + /** + * 获取encode的编码数组,通过模型名称 + * + * @param text 文本信息 + * @return 编码数组 + */ + public static List encode(@NotNull String modelName, String text) { + if (StrUtil.isBlank(text)) { + return new ArrayList<>(); + } + Encoding enc = getEncoding(modelName); + if (Objects.isNull(enc)) { + log.warn("[{}]模型不存在或者暂不支持计算tokens,直接返回tokens==0",modelName); + return new ArrayList<>(); + } + return enc.encode(text); + } + + /** + * 通过模型名称, 计算指定字符串的tokens + * + * @param modelName 模型名称 + * @param text 文本信息 + * @return tokens数量 + */ + public static int tokens(@NotNull String modelName, String text) { + return encode(modelName, text).size(); + } + + + /** + * 通过模型名称计算messages获取编码数组 + * 参考官方的处理逻辑: + * https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb + * + * @param modelName 模型名称 + * @param messages 消息体 + * @return tokens数量 + */ + public static int tokens(@NotNull String modelName, @NotNull List messages) { + Encoding encoding = getEncoding(modelName); + int tokensPerMessage = 0; + int tokensPerName = 0; + if (modelName.equals(ChatCompletion.Model.GPT_3_5_TURBO_0613.getName()) + || modelName.equals(ChatCompletion.Model.GPT_3_5_TURBO_16K_0613.getName()) + || modelName.equals(ChatCompletion.Model.GPT_4_0613.getName()) + || modelName.equals(ChatCompletion.Model.GPT_4_32K_0613.getName()) + || modelName.equals(ChatCompletion.Model.GPT_4_1106_PREVIEW.getName()) + || modelName.equals(ChatCompletion.Model.GPT_4_VISION_PREVIEW.getName()) + ) { + tokensPerMessage = 3; + tokensPerName = 1; + }else if(modelName.contains(ChatCompletion.Model.GPT_3_5_TURBO.getName())){ + //"gpt-3.5-turbo" in model: + log.warn("Warning: gpt-3.5-turbo may update over time. Returning num tokens assuming gpt-3.5-turbo-0613."); + tokensPerMessage = 3; + tokensPerName = 1; + }else if(modelName.contains(ChatCompletion.Model.GPT_4.getName())){ + log.warn("Warning: gpt-4 may update over time. Returning num tokens assuming gpt-4-0613."); + tokensPerMessage = 3; + tokensPerName = 1; + }else { + log.warn("不支持的model {} 按gpt4计算tokens",modelName); + tokensPerMessage = 3; + tokensPerName = 1; + } + int sum = 0; + for (Message msg : messages) { + sum += tokensPerMessage; + sum += tokens(encoding, msg.getContent().toString()); + sum += tokens(encoding, msg.getRole()); + sum += tokens(encoding, msg.getName()); + FunctionCall functionCall = msg.getFunctionCall(); + sum += Objects.isNull(functionCall) ? 0 : tokens(encoding, functionCall.toString()); + if (StrUtil.isNotBlank(msg.getName())) { + sum += tokensPerName; + } + } + sum += 3; + return sum; + } + + /** + * 通过模型名称和encoded编码数组,反推字符串文本 + * + * @param modelName 模型名 + * @param encoded 编码数组 + * @return 返回源文本 + */ + public static String decode(@NotNull String modelName, @NotNull List encoded) { + Encoding enc = getEncoding(modelName); + return enc.decode(encoded); + } + +} diff --git a/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/utils/WebSocketUtils.java b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/utils/WebSocketUtils.java new file mode 100644 index 0000000..24c21e0 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/java/org/aibidding/common/chat/utils/WebSocketUtils.java @@ -0,0 +1,98 @@ +package org.aibidding.common.chat.utils; + +import cn.hutool.core.collection.CollUtil; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.chat.entity.dto.WebSocketMessageDto; +import org.aibidding.common.chat.holder.WebSocketSessionHolder; +import org.aibidding.common.redis.utils.RedisUtils; +import org.springframework.web.socket.PongMessage; +import org.springframework.web.socket.TextMessage; +import org.springframework.web.socket.WebSocketMessage; +import org.springframework.web.socket.WebSocketSession; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; + +import static org.aibidding.common.chat.constant.WebSocketConstants.WEB_SOCKET_TOPIC; + +/** + * 工具类 + * + * @author zendwang + */ +@Slf4j +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class WebSocketUtils { + + /** + * 发送消息 + * + * @param sessionKey session主键 一般为用户id + * @param message 消息文本 + */ + public static void sendMessage(Long sessionKey, String message) { + WebSocketSession session = WebSocketSessionHolder.getSessions(sessionKey); + sendMessage(session, message); + } + + /** + * 订阅消息 + * + * @param consumer 自定义处理 + */ + public static void subscribeMessage(Consumer consumer) { + RedisUtils.subscribe(WEB_SOCKET_TOPIC, WebSocketMessageDto.class, consumer); + } + + /** + * 发布订阅的消息 + * + * @param webSocketMessage 消息对象 + */ + public static void publishMessage(WebSocketMessageDto webSocketMessage) { + List unsentSessionKeys = new ArrayList<>(); + // 当前服务内session,直接发送消息 + for (Long sessionKey : webSocketMessage.getSessionKeys()) { + if (WebSocketSessionHolder.existSession(sessionKey)) { + WebSocketUtils.sendMessage(sessionKey, webSocketMessage.getMessage()); + continue; + } + unsentSessionKeys.add(sessionKey); + } + // 不在当前服务内session,发布订阅消息 + if (CollUtil.isNotEmpty(unsentSessionKeys)) { + WebSocketMessageDto broadcastMessage = new WebSocketMessageDto(); + broadcastMessage.setMessage(webSocketMessage.getMessage()); + broadcastMessage.setSessionKeys(unsentSessionKeys); + RedisUtils.publish(WEB_SOCKET_TOPIC, broadcastMessage, consumer -> { + log.info(" WebSocket发送主题订阅消息topic:{} session keys:{} message:{}", + WEB_SOCKET_TOPIC, unsentSessionKeys, webSocketMessage.getMessage()); + }); + } + } + + public static void sendPongMessage(WebSocketSession session) { + sendMessage(session, new PongMessage()); + } + + public static void sendMessage(WebSocketSession session, String message) { + sendMessage(session, new TextMessage(message)); + } + + private static void sendMessage(WebSocketSession session, WebSocketMessage message) { + if (session == null || !session.isOpen()) { + log.error("[send] session会话已经关闭"); + } else { + try { + // 获取当前会话中的用户 + session.sendMessage(message); + } catch (IOException e) { + log.error("[send] session({}) 发送消息({}) 异常", session, message, e); + } + } + } +} diff --git a/aibidding-common/aibidding-common-chat/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-chat/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..4e9d537 --- /dev/null +++ b/aibidding-common/aibidding-common-chat/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.aibidding.common.chat.config.WebSocketConfig diff --git a/aibidding-common/aibidding-common-core/pom.xml b/aibidding-common/aibidding-common-core/pom.xml new file mode 100644 index 0000000..4935ef0 --- /dev/null +++ b/aibidding-common/aibidding-common-core/pom.xml @@ -0,0 +1,147 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-core + + + ruoyi-common-core 核心模块 + + + + + + org.springframework + spring-context-support + + + + + org.springframework + spring-web + + + + + org.springframework.boot + spring-boot-starter-validation + + + + + org.apache.commons + commons-lang3 + + + + + jakarta.servlet + jakarta.servlet-api + + + + cn.hutool + hutool-core + + + + cn.hutool + hutool-http + + + + cn.hutool + hutool-extra + + + + cn.hutool + hutool-json + provided + + + + org.projectlombok + lombok + + + + com.github.binarywang + weixin-java-cp + ${weixin-java-miniapp.version} + + + + com.github.binarywang + weixin-java-cp + ${weixin-java-cp.version} + + + + + org.springframework.boot + spring-boot-configuration-processor + + + + org.springframework.boot + spring-boot-properties-migrator + runtime + + + + io.github.linpeilie + mapstruct-plus-spring-boot-starter + + + + + org.lionsoul + ip2region + + + + + com.github.binarywang + weixin-java-miniapp + ${weixin-java-miniapp.version} + + + + com.github.binarywang + weixin-java-pay + ${weixin-java-pay.version} + + + + + com.fasterxml.jackson.core + jackson-databind + + + + com.squareup.okhttp3 + okhttp + + + + com.squareup.okhttp3 + okhttp-sse + + + + com.squareup.okhttp3 + logging-interceptor + + + + + diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/ApplicationConfig.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/ApplicationConfig.java new file mode 100644 index 0000000..24bd037 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/ApplicationConfig.java @@ -0,0 +1,16 @@ +package org.aibidding.common.core.config; + +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.context.annotation.EnableAspectJAutoProxy; + +/** + * 程序注解配置 + * + * @author Lion Li + */ +@AutoConfiguration +// 表示通过aop框架暴露该代理对象,AopContext能够访问 +@EnableAspectJAutoProxy(exposeProxy = true) +public class ApplicationConfig { + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/AsyncConfig.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/AsyncConfig.java new file mode 100644 index 0000000..eaed560 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/AsyncConfig.java @@ -0,0 +1,54 @@ +package org.aibidding.common.core.config; + +import cn.hutool.core.util.ArrayUtil; +import org.aibidding.common.core.exception.ServiceException; +import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.scheduling.annotation.AsyncConfigurer; +import org.springframework.scheduling.annotation.EnableAsync; + +import java.util.Arrays; +import java.util.concurrent.Executor; +import java.util.concurrent.ScheduledExecutorService; + +/** + * 异步配置 + * + * @author Lion Li + */ +@EnableAsync(proxyTargetClass = true) +@AutoConfiguration +public class AsyncConfig implements AsyncConfigurer { + + @Autowired + @Qualifier("scheduledExecutorService") + private ScheduledExecutorService scheduledExecutorService; + + /** + * 自定义 @Async 注解使用系统线程池 + */ + @Override + public Executor getAsyncExecutor() { + return scheduledExecutorService; + } + + /** + * 异步执行异常处理 + */ + @Override + public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { + return (throwable, method, objects) -> { + throwable.printStackTrace(); + StringBuilder sb = new StringBuilder(); + sb.append("Exception message - ").append(throwable.getMessage()) + .append(", Method name - ").append(method.getName()); + if (ArrayUtil.isNotEmpty(objects)) { + sb.append(", Parameter value - ").append(Arrays.toString(objects)); + } + throw new ServiceException(sb.toString()); + }; + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/RuoYiConfig.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/RuoYiConfig.java new file mode 100644 index 0000000..cfa7af9 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/RuoYiConfig.java @@ -0,0 +1,49 @@ +package org.aibidding.common.core.config; + +import lombok.Data; +import lombok.Getter; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * 读取项目相关配置 + * + * @author Lion Li + */ + +@Data +@Component +@ConfigurationProperties(prefix = "aibidding") +public class RuoYiConfig { + + /** + * 项目名称 + */ + private String name; + + /** + * 版本 + */ + private String version; + + /** + * 版权年份 + */ + private String copyrightYear; + + /** + * 实例演示开关 + */ + private boolean demoEnabled; + + /** + * 获取地址开关 + */ + @Getter + private static boolean addressEnabled; + + public void setAddressEnabled(boolean addressEnabled) { + RuoYiConfig.addressEnabled = addressEnabled; + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/ThreadPoolConfig.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/ThreadPoolConfig.java new file mode 100644 index 0000000..d9ad41e --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/ThreadPoolConfig.java @@ -0,0 +1,57 @@ +package org.aibidding.common.core.config; + +import org.apache.commons.lang3.concurrent.BasicThreadFactory; +import org.aibidding.common.core.config.properties.ThreadPoolProperties; +import org.aibidding.common.core.utils.Threads; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * 线程池配置 + * + * @author Lion Li + **/ +@AutoConfiguration +@EnableConfigurationProperties(ThreadPoolProperties.class) +public class ThreadPoolConfig { + + /** + * 核心线程数 = cpu 核心数 + 1 + */ + private final int core = Runtime.getRuntime().availableProcessors() + 1; + + @Bean(name = "threadPoolTaskExecutor") + @ConditionalOnProperty(prefix = "thread-pool", name = "enabled", havingValue = "true") + public ThreadPoolTaskExecutor threadPoolTaskExecutor(ThreadPoolProperties threadPoolProperties) { + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor.setCorePoolSize(core); + executor.setMaxPoolSize(core * 2); + executor.setQueueCapacity(threadPoolProperties.getQueueCapacity()); + executor.setKeepAliveSeconds(threadPoolProperties.getKeepAliveSeconds()); + executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); + return executor; + } + + /** + * 执行周期性或定时任务 + */ + @Bean(name = "scheduledExecutorService") + protected ScheduledExecutorService scheduledExecutorService() { + return new ScheduledThreadPoolExecutor(core, + new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build(), + new ThreadPoolExecutor.CallerRunsPolicy()) { + @Override + protected void afterExecute(Runnable r, Throwable t) { + super.afterExecute(r, t); + Threads.printException(r, t); + } + }; + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/ValidatorConfig.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/ValidatorConfig.java new file mode 100644 index 0000000..167599b --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/ValidatorConfig.java @@ -0,0 +1,39 @@ +package org.aibidding.common.core.config; + +import jakarta.validation.Validator; +import org.hibernate.validator.HibernateValidator; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.context.MessageSource; +import org.springframework.context.annotation.Bean; +import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; + +import java.util.Properties; + +/** + * 校验框架配置类 + * + * @author Lion Li + */ +@AutoConfiguration +public class ValidatorConfig { + + /** + * 配置校验框架 快速返回模式 + */ + @Bean + public Validator validator(MessageSource messageSource) { + LocalValidatorFactoryBean factoryBean = new LocalValidatorFactoryBean(); + // 国际化 + factoryBean.setValidationMessageSource(messageSource); + // 设置使用 HibernateValidator 校验器 + factoryBean.setProviderClass(HibernateValidator.class); + Properties properties = new Properties(); + // 设置 快速异常返回 + properties.setProperty("hibernate.validator.fail_fast", "true"); + factoryBean.setValidationProperties(properties); + // 加载配置 + factoryBean.afterPropertiesSet(); + return factoryBean.getValidator(); + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/properties/ThreadPoolProperties.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/properties/ThreadPoolProperties.java new file mode 100644 index 0000000..cfc8802 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/config/properties/ThreadPoolProperties.java @@ -0,0 +1,30 @@ +package org.aibidding.common.core.config.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * 线程池 配置属性 + * + * @author Lion Li + */ +@Data +@ConfigurationProperties(prefix = "thread-pool") +public class ThreadPoolProperties { + + /** + * 是否开启线程池 + */ + private boolean enabled; + + /** + * 队列最大长度 + */ + private int queueCapacity; + + /** + * 线程池维护线程所允许的空闲时间 + */ + private int keepAliveSeconds; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/CacheConstants.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/CacheConstants.java new file mode 100644 index 0000000..9bfe66e --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/CacheConstants.java @@ -0,0 +1,25 @@ +package org.aibidding.common.core.constant; + +/** + * 缓存的key 常量 + * + * @author Lion Li + */ +public interface CacheConstants { + + /** + * 在线用户 redis key + */ + String ONLINE_TOKEN_KEY = "online_tokens:"; + + /** + * 参数管理 cache key + */ + String SYS_CONFIG_KEY = "sys_config:"; + + /** + * 字典管理 cache key + */ + String SYS_DICT_KEY = "sys_dict:"; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/CacheNames.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/CacheNames.java new file mode 100644 index 0000000..376c60d --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/CacheNames.java @@ -0,0 +1,63 @@ +package org.aibidding.common.core.constant; + +/** + * 缓存组名称常量 + *

+ * key 格式为 cacheNames#ttl#maxIdleTime#maxSize + *

+ * ttl 过期时间 如果设置为0则不过期 默认为0 + * maxIdleTime 最大空闲时间 根据LRU算法清理空闲数据 如果设置为0则不检测 默认为0 + * maxSize 组最大长度 根据LRU算法清理溢出数据 如果设置为0则无限长 默认为0 + *

+ * 例子: test#60s、test#0#60s、test#0#1m#1000、test#1h#0#500 + * + * @author Lion Li + */ +public interface CacheNames { + + /** + * 演示案例 + */ + String DEMO_CACHE = "demo:cache#60s#10m#20"; + + /** + * 系统配置 + */ + String SYS_CONFIG = "sys_config"; + + /** + * 数据字典 + */ + String SYS_DICT = "sys_dict"; + + /** + * 租户 + */ + String SYS_TENANT = GlobalConstants.GLOBAL_REDIS_KEY + "sys_tenant#30d"; + + /** + * 用户账户 + */ + String SYS_USER_NAME = "sys_user_name#30d"; + + /** + * 部门 + */ + String SYS_DEPT = "sys_dept#30d"; + + /** + * OSS内容 + */ + String SYS_OSS = "sys_oss#30d"; + + /** + * OSS配置 + */ + String SYS_OSS_CONFIG = "sys_oss_config"; + + /** + * 在线用户 + */ + String ONLINE_TOKEN = "online_tokens"; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/Constants.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/Constants.java new file mode 100644 index 0000000..52f4c64 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/Constants.java @@ -0,0 +1,96 @@ +package org.aibidding.common.core.constant; + +/** + * 通用常量信息 + * + * @author aibidding + */ +public interface Constants { + + /** + * UTF-8 字符集 + */ + String UTF8 = "UTF-8"; + + /** + * GBK 字符集 + */ + String GBK = "GBK"; + + /** + * www主域 + */ + String WWW = "www."; + + /** + * http请求 + */ + String HTTP = "http://"; + + /** + * https请求 + */ + String HTTPS = "https://"; + + /** + * 通用成功标识 + */ + String SUCCESS = "0"; + + /** + * 通用失败标识 + */ + String FAIL = "1"; + + /** + * 登录成功 + */ + String LOGIN_SUCCESS = "Success"; + + /** + * 注销 + */ + String LOGOUT = "Logout"; + + /** + * 注册 + */ + String REGISTER = "Register"; + + /** + * 登录失败 + */ + String LOGIN_FAIL = "Error"; + + /** + * 验证码有效期(分钟) + */ + Integer CAPTCHA_EXPIRATION = 30; + + /** + * 文多多apiToken KEY + */ + String WDD_TOKEN_KEY = "sys_chat:wdd_api_token:"; + + /** + * 文多多apiToken有效期(分钟) + */ + Integer WDD_TOKEN_EXPIRATION = 60 * 2; + + /** + * 令牌 + */ + String TOKEN = "token"; + + /** + * 顶级部门id + */ + Long TOP_PARENT_ID = 0L; + + /** + * 默认租户ID + **/ + String TENANT_ID = "00000"; + +} + diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/GlobalConstants.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/GlobalConstants.java new file mode 100644 index 0000000..07943af --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/GlobalConstants.java @@ -0,0 +1,34 @@ +package org.aibidding.common.core.constant; + +/** + * 全局的key常量 (业务无关的key) + * + * @author Lion Li + */ +public interface GlobalConstants { + + /** + * 全局 redis key (业务无关的key) + */ + String GLOBAL_REDIS_KEY = "global:"; + + /** + * 验证码 redis key + */ + String CAPTCHA_CODE_KEY = GLOBAL_REDIS_KEY + "captcha_codes:"; + + /** + * 防重提交 redis key + */ + String REPEAT_SUBMIT_KEY = GLOBAL_REDIS_KEY + "repeat_submit:"; + + /** + * 限流 redis key + */ + String RATE_LIMIT_KEY = GLOBAL_REDIS_KEY + "rate_limit:"; + + /** + * 登录账户密码错误次数 redis key + */ + String PWD_ERR_CNT_KEY = GLOBAL_REDIS_KEY + "pwd_err_cnt:"; +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/HttpStatus.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/HttpStatus.java new file mode 100644 index 0000000..e10efc9 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/HttpStatus.java @@ -0,0 +1,93 @@ +package org.aibidding.common.core.constant; + +/** + * 返回状态码 + * + * @author Lion Li + */ +public interface HttpStatus { + /** + * 操作成功 + */ + int SUCCESS = 200; + + /** + * 对象创建成功 + */ + int CREATED = 201; + + /** + * 请求已经被接受 + */ + int ACCEPTED = 202; + + /** + * 操作已经执行成功,但是没有返回数据 + */ + int NO_CONTENT = 204; + + /** + * 资源已被移除 + */ + int MOVED_PERM = 301; + + /** + * 重定向 + */ + int SEE_OTHER = 303; + + /** + * 资源没有被修改 + */ + int NOT_MODIFIED = 304; + + /** + * 参数列表错误(缺少,格式不匹配) + */ + int BAD_REQUEST = 400; + + /** + * 未授权 + */ + int UNAUTHORIZED = 401; + + /** + * 访问受限,授权过期 + */ + int FORBIDDEN = 403; + + /** + * 资源,服务未找到 + */ + int NOT_FOUND = 404; + + /** + * 不允许的http方法 + */ + int BAD_METHOD = 405; + + /** + * 资源冲突,或者资源被锁 + */ + int CONFLICT = 409; + + /** + * 不支持的数据,媒体类型 + */ + int UNSUPPORTED_TYPE = 415; + + /** + * 系统内部错误 + */ + int ERROR = 500; + + /** + * 接口未实现 + */ + int NOT_IMPLEMENTED = 501; + + /** + * 系统警告消息 + */ + int WARN = 601; +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/TenantConstants.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/TenantConstants.java new file mode 100644 index 0000000..80a53d2 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/TenantConstants.java @@ -0,0 +1,45 @@ +package org.aibidding.common.core.constant; + +/** + * 租户常量信息 + * + * @author Lion Li + */ +public interface TenantConstants { + + /** + * 租户正常状态 + */ + String NORMAL = "0"; + + /** + * 租户封禁状态 + */ + String DISABLE = "1"; + + /** + * 超级管理员ID + */ + Long SUPER_ADMIN_ID = 1L; + + /** + * 超级管理员角色 roleKey + */ + String SUPER_ADMIN_ROLE_KEY = "superadmin"; + + /** + * 租户管理员角色 roleKey + */ + String TENANT_ADMIN_ROLE_KEY = "admin"; + + /** + * 租户管理员角色名称 + */ + String TENANT_ADMIN_ROLE_NAME = "管理员"; + + /** + * 默认租户ID + */ + String DEFAULT_TENANT_ID = "000000"; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/UserConstants.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/UserConstants.java new file mode 100644 index 0000000..5960b14 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/constant/UserConstants.java @@ -0,0 +1,132 @@ +package org.aibidding.common.core.constant; + +/** + * 用户常量信息 + * + * @author aibidding + */ +public interface UserConstants { + + /** + * 平台内系统用户的唯一标志 + */ + String SYS_USER = "SYS_USER"; + + /** + * 正常状态 + */ + String NORMAL = "0"; + + /** + * 异常状态 + */ + String EXCEPTION = "1"; + + /** + * 用户正常状态 + */ + String USER_NORMAL = "0"; + + /** + * 用户封禁状态 + */ + String USER_DISABLE = "1"; + + /** + * 角色正常状态 + */ + String ROLE_NORMAL = "0"; + + /** + * 角色封禁状态 + */ + String ROLE_DISABLE = "1"; + + /** + * 部门正常状态 + */ + String DEPT_NORMAL = "0"; + + /** + * 部门停用状态 + */ + String DEPT_DISABLE = "1"; + + /** + * 字典正常状态 + */ + String DICT_NORMAL = "0"; + + /** + * 是否为系统默认(是) + */ + String YES = "Y"; + + /** + * 是否菜单外链(是) + */ + String YES_FRAME = "0"; + + /** + * 是否菜单外链(否) + */ + String NO_FRAME = "1"; + + /** + * 菜单正常状态 + */ + String MENU_NORMAL = "0"; + + /** + * 菜单停用状态 + */ + String MENU_DISABLE = "1"; + + /** + * 菜单类型(目录) + */ + String TYPE_DIR = "M"; + + /** + * 菜单类型(菜单) + */ + String TYPE_MENU = "C"; + + /** + * 菜单类型(按钮) + */ + String TYPE_BUTTON = "F"; + + /** + * Layout组件标识 + */ + String LAYOUT = "Layout"; + + /** + * ParentView组件标识 + */ + String PARENT_VIEW = "ParentView"; + + /** + * InnerLink组件标识 + */ + String INNER_LINK = "InnerLink"; + + /** + * 用户名长度限制 + */ + int USERNAME_MIN_LENGTH = 2; + int USERNAME_MAX_LENGTH = 100; + + /** + * 密码长度限制 + */ + int PASSWORD_MIN_LENGTH = 5; + int PASSWORD_MAX_LENGTH = 20; + + /** + * 超级管理员ID + */ + Long SUPER_ADMIN_ID = 1L; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/R.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/R.java new file mode 100644 index 0000000..23869e8 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/R.java @@ -0,0 +1,110 @@ +package org.aibidding.common.core.domain; + +import lombok.Data; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.constant.HttpStatus; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 响应信息主体 + * + * @author Lion Li + */ +@Data +@NoArgsConstructor +public class R implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 成功 + */ + public static final int SUCCESS = 200; + + /** + * 失败 + */ + public static final int FAIL = 500; + + private int code; + + private String msg; + + private T data; + + public static R ok() { + return restResult(null, SUCCESS, "操作成功"); + } + + public static R ok(T data) { + return restResult(data, SUCCESS, "操作成功"); + } + + public static R ok(String msg) { + return restResult(null, SUCCESS, msg); + } + + public static R ok(String msg, T data) { + return restResult(data, SUCCESS, msg); + } + + public static R fail() { + return restResult(null, FAIL, "操作失败"); + } + + public static R fail(String msg) { + return restResult(null, FAIL, msg); + } + + public static R fail(T data) { + return restResult(data, FAIL, "操作失败"); + } + + public static R fail(String msg, T data) { + return restResult(data, FAIL, msg); + } + + public static R fail(int code, String msg) { + return restResult(null, code, msg); + } + + /** + * 返回警告消息 + * + * @param msg 返回内容 + * @return 警告消息 + */ + public static R warn(String msg) { + return restResult(null, HttpStatus.WARN, msg); + } + + /** + * 返回警告消息 + * + * @param msg 返回内容 + * @param data 数据对象 + * @return 警告消息 + */ + public static R warn(String msg, T data) { + return restResult(data, HttpStatus.WARN, msg); + } + + private static R restResult(T data, int code, String msg) { + R r = new R<>(); + r.setCode(code); + r.setData(data); + r.setMsg(msg); + return r; + } + + public static Boolean isError(R ret) { + return !isSuccess(ret); + } + + public static Boolean isSuccess(R ret) { + return R.SUCCESS == ret.getCode(); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/dto/RoleDTO.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/dto/RoleDTO.java new file mode 100644 index 0000000..61afd26 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/dto/RoleDTO.java @@ -0,0 +1,38 @@ +package org.aibidding.common.core.domain.dto; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 角色 + * + * @author Lion Li + */ + +@Data +@NoArgsConstructor +public class RoleDTO implements Serializable { + + /** + * 角色ID + */ + private Long roleId; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色权限 + */ + private String roleKey; + + /** + * 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) + */ + private String dataScope; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/dto/UserOnlineDTO.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/dto/UserOnlineDTO.java new file mode 100644 index 0000000..ad4e419 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/dto/UserOnlineDTO.java @@ -0,0 +1,62 @@ +package org.aibidding.common.core.domain.dto; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 当前在线会话 + * + * @author aibidding + */ + +@Data +@NoArgsConstructor +public class UserOnlineDTO implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 会话编号 + */ + private String tokenId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 用户名称 + */ + private String userName; + + /** + * 登录IP地址 + */ + private String ipaddr; + + /** + * 登录地址 + */ + private String loginLocation; + + /** + * 浏览器类型 + */ + private String browser; + + /** + * 操作系统 + */ + private String os; + + /** + * 登录时间 + */ + private Long loginTime; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/EmailLoginBody.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/EmailLoginBody.java new file mode 100644 index 0000000..a0b6da8 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/EmailLoginBody.java @@ -0,0 +1,35 @@ +package org.aibidding.common.core.domain.model; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +/** + * 短信登录对象 + * + * @author Lion Li + */ + +@Data +public class EmailLoginBody { + + /** + * 租户ID + */ + @NotBlank(message = "{tenant.number.not.blank}") + private String tenantId; + + /** + * 邮箱 + */ + @NotBlank(message = "{user.email.not.blank}") + @Email(message = "{user.email.not.valid}") + private String email; + + /** + * 邮箱code + */ + @NotBlank(message = "{email.code.not.blank}") + private String emailCode; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/LoginBody.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/LoginBody.java new file mode 100644 index 0000000..51f7242 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/LoginBody.java @@ -0,0 +1,44 @@ +package org.aibidding.common.core.domain.model; + +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +/** + * 用户登录对象 + * + * @author Lion Li + */ + +@Data +public class LoginBody { + + /** + * 租户ID + */ + private String tenantId; + + /** + * 用户名 + */ + @NotBlank(message = "{user.username.not.blank}") + // @Length(min = UserConstants.USERNAME_MIN_LENGTH, max = UserConstants.USERNAME_MAX_LENGTH, message = "{user.username.length.valid}") + private String username; + + /** + * 用户密码 + */ + @NotBlank(message = "{user.password.not.blank}") + // @Length(min = UserConstants.PASSWORD_MIN_LENGTH, max = UserConstants.PASSWORD_MAX_LENGTH, message = "{user.password.length.valid}") + private String password; + + /** + * 验证码 + */ + private String code; + + /** + * 唯一标识 + */ + private String uuid; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/LoginUser.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/LoginUser.java new file mode 100644 index 0000000..1b29f70 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/LoginUser.java @@ -0,0 +1,133 @@ +package org.aibidding.common.core.domain.model; + +import lombok.Data; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.domain.dto.RoleDTO; + +import java.io.Serial; +import java.io.Serializable; +import java.util.List; +import java.util.Set; + +/** + * 登录用户身份权限 + * + * @author Lion Li + */ + +@Data +@NoArgsConstructor +public class LoginUser implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 租户ID + */ + private String tenantId; + + /** + * 用户ID + */ + private Long userId; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 部门名 + */ + private String deptName; + + /** + * 用户唯一标识 + */ + private String token; + + /** + * 用户类型 + */ + private String userType; + + /** + * 登录时间 + */ + private Long loginTime; + + /** + * 过期时间 + */ + private Long expireTime; + + /** + * 登录IP地址 + */ + private String ipaddr; + + /** + * 登录地点 + */ + private String loginLocation; + + /** + * 浏览器类型 + */ + private String browser; + + /** + * 操作系统 + */ + private String os; + + /** + * 菜单权限 + */ + private Set menuPermission; + + /** + * 角色权限 + */ + private Set rolePermission; + + /** + * 用户名 + */ + private String username; + + /** + * 用户名 + */ + private String nickName; + + /** + * 微信头像 + */ + private String avatar; + + /** + * 角色对象 + */ + private List roles; + + /** + * 数据权限 当前角色ID + */ + private Long roleId; + + /** + * 获取登录id + */ + public String getLoginId() { + if (userType == null) { + throw new IllegalArgumentException("用户类型不能为空"); + } + if (userId == null) { + throw new IllegalArgumentException("用户ID不能为空"); + } + return userType + ":" + userId; + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/RegisterBody.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/RegisterBody.java new file mode 100644 index 0000000..09c8ed2 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/RegisterBody.java @@ -0,0 +1,22 @@ +package org.aibidding.common.core.domain.model; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户注册对象 + * + * @author Lion Li + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class RegisterBody extends LoginBody { + + private String userType; + + /** + * 注册域名 + */ + private String domainName; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/SmsLoginBody.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/SmsLoginBody.java new file mode 100644 index 0000000..ebb2e4c --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/SmsLoginBody.java @@ -0,0 +1,33 @@ +package org.aibidding.common.core.domain.model; + +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +/** + * 短信登录对象 + * + * @author Lion Li + */ + +@Data +public class SmsLoginBody { + + /** + * 租户ID + */ + @NotBlank(message = "{tenant.number.not.blank}") + private String tenantId; + + /** + * 手机号 + */ + @NotBlank(message = "{user.phonenumber.not.blank}") + private String phonenumber; + + /** + * 短信code + */ + @NotBlank(message = "{sms.code.not.blank}") + private String smsCode; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/VisitorLoginBody.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/VisitorLoginBody.java new file mode 100644 index 0000000..82c6429 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/VisitorLoginBody.java @@ -0,0 +1,25 @@ +package org.aibidding.common.core.domain.model; + +import lombok.Data; + +import java.io.Serial; + +/** + * 游客登录用户身份权限 + * + * @author Lion Li + */ +@Data +public class VisitorLoginBody { + + @Serial + private static final long serialVersionUID = 1L; + + private String code; + + /** + * 登录类型(1.小程序访客 2.pc访客) + */ + private String type; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/VisitorLoginUser.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/VisitorLoginUser.java new file mode 100644 index 0000000..474673f --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/domain/model/VisitorLoginUser.java @@ -0,0 +1,28 @@ +package org.aibidding.common.core.domain.model; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.io.Serial; + +/** + * 小程序登录用户身份权限 + * + * @author Lion Li + */ +@Data +@EqualsAndHashCode(callSuper = true) +@NoArgsConstructor +public class VisitorLoginUser extends LoginUser { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * openid + */ + private String openid; + + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/DeviceType.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/DeviceType.java new file mode 100644 index 0000000..29cf27e --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/DeviceType.java @@ -0,0 +1,32 @@ +package org.aibidding.common.core.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 设备类型 + * 针对一套 用户体系 + * + * @author Lion Li + */ +@Getter +@AllArgsConstructor +public enum DeviceType { + + /** + * pc端 + */ + PC("pc"), + + /** + * app端 + */ + APP("app"), + + /** + * 小程序端 + */ + XCX("xcx"); + + private final String device; +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/LoginType.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/LoginType.java new file mode 100644 index 0000000..fb1c4f0 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/LoginType.java @@ -0,0 +1,44 @@ +package org.aibidding.common.core.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 登录类型 + * + * @author Lion Li + */ +@Getter +@AllArgsConstructor +public enum LoginType { + + /** + * 密码登录 + */ + PASSWORD("user.password.retry.limit.exceed", "user.password.retry.limit.count"), + + /** + * 短信登录 + */ + SMS("sms.code.retry.limit.exceed", "sms.code.retry.limit.count"), + + /** + * 邮箱登录 + */ + EMAIL("email.code.retry.limit.exceed", "email.code.retry.limit.count"), + + /** + * 小程序登录 + */ + XCX("", ""); + + /** + * 登录重试超出限制提示 + */ + final String retryLimitExceed; + + /** + * 登录重试限制计数提示 + */ + final String retryLimitCount; +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/LoginUserType.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/LoginUserType.java new file mode 100644 index 0000000..77d9bf2 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/LoginUserType.java @@ -0,0 +1,21 @@ +package org.aibidding.common.core.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 游客登录类型 + * + * @author Lion Li + */ +@Getter +@AllArgsConstructor +public enum LoginUserType { + + PC("1", "PC端用户"), + + XCX("2", "小程序用户"); + + private final String code; + private final String content; +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/TenantStatus.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/TenantStatus.java new file mode 100644 index 0000000..3ae444a --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/TenantStatus.java @@ -0,0 +1,30 @@ +package org.aibidding.common.core.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 用户状态 + * + * @author LionLi + */ +@Getter +@AllArgsConstructor +public enum TenantStatus { + /** + * 正常 + */ + OK("0", "正常"), + /** + * 停用 + */ + DISABLE("1", "停用"), + /** + * 删除 + */ + DELETED("2", "删除"); + + private final String code; + private final String info; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/UserStatus.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/UserStatus.java new file mode 100644 index 0000000..24a93d9 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/UserStatus.java @@ -0,0 +1,30 @@ +package org.aibidding.common.core.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 用户状态 + * + * @author aibidding + */ +@Getter +@AllArgsConstructor +public enum UserStatus { + /** + * 正常 + */ + OK("0", "正常"), + /** + * 停用 + */ + DISABLE("1", "停用"), + /** + * 删除 + */ + DELETED("2", "删除"); + + private final String code; + private final String info; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/UserType.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/UserType.java new file mode 100644 index 0000000..28c0ba9 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/enums/UserType.java @@ -0,0 +1,37 @@ +package org.aibidding.common.core.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.aibidding.common.core.utils.StringUtils; + +/** + * 设备类型 + * 针对多套 用户体系 + * + * @author Lion Li + */ +@Getter +@AllArgsConstructor +public enum UserType { + + /** + * pc端 + */ + SYS_USER("sys_user"), + + /** + * app端 + */ + APP_USER("app_user"); + + private final String userType; + + public static UserType getUserType(String str) { + for (UserType value : values()) { + if (StringUtils.contains(str, value.getUserType())) { + return value; + } + } + throw new RuntimeException("'UserType' not found By " + str); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/event/ConfigChangeEvent.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/event/ConfigChangeEvent.java new file mode 100644 index 0000000..84c7c2f --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/event/ConfigChangeEvent.java @@ -0,0 +1,15 @@ +package org.aibidding.common.core.event; + +import org.springframework.context.ApplicationEvent; + +/** + * 描述:定义一个事件类,用于通知配置变化 + * + * @author ageerle@163.com + * date 2024/5/19 + */ +public class ConfigChangeEvent extends ApplicationEvent { + public ConfigChangeEvent(Object source) { + super(source); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/AuthException.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/AuthException.java new file mode 100644 index 0000000..2f3d023 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/AuthException.java @@ -0,0 +1,10 @@ +package org.aibidding.common.core.exception; + +public class AuthException extends RuntimeException{ + + private static final long serialVersionUID = 1L; + + public AuthException(String message) { + super(message); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/DemoModeException.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/DemoModeException.java new file mode 100644 index 0000000..a1ec91f --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/DemoModeException.java @@ -0,0 +1,17 @@ +package org.aibidding.common.core.exception; + +import java.io.Serial; + +/** + * 演示模式异常 + * + * @author aibidding + */ +public class DemoModeException extends RuntimeException { + + @Serial + private static final long serialVersionUID = 1L; + + public DemoModeException() { + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/GlobalException.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/GlobalException.java new file mode 100644 index 0000000..74c00e1 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/GlobalException.java @@ -0,0 +1,53 @@ +package org.aibidding.common.core.exception; + +import java.io.Serial; + +/** + * 全局异常 + * + * @author aibidding + */ +public class GlobalException extends RuntimeException { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 错误提示 + */ + private String message; + + /** + * 错误明细,内部调试错误 + */ + private String detailMessage; + + /** + * 空构造方法,避免反序列化问题 + */ + public GlobalException() { + } + + public GlobalException(String message) { + this.message = message; + } + + public String getDetailMessage() { + return detailMessage; + } + + public GlobalException setDetailMessage(String detailMessage) { + this.detailMessage = detailMessage; + return this; + } + + @Override + public String getMessage() { + return message; + } + + public GlobalException setMessage(String message) { + this.message = message; + return this; + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/ServiceException.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/ServiceException.java new file mode 100644 index 0000000..b3aedca --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/ServiceException.java @@ -0,0 +1,67 @@ +package org.aibidding.common.core.exception; + +import java.io.Serial; + +/** + * 业务异常 + * + * @author aibidding + */ +public final class ServiceException extends RuntimeException { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 错误码 + */ + private Integer code; + + /** + * 错误提示 + */ + private String message; + + /** + * 错误明细,内部调试错误 + */ + private String detailMessage; + + /** + * 空构造方法,避免反序列化问题 + */ + public ServiceException() { + } + + public ServiceException(String message) { + this.message = message; + } + + public ServiceException(String message, Integer code) { + this.message = message; + this.code = code; + } + + public String getDetailMessage() { + return detailMessage; + } + + @Override + public String getMessage() { + return message; + } + + public Integer getCode() { + return code; + } + + public ServiceException setMessage(String message) { + this.message = message; + return this; + } + + public ServiceException setDetailMessage(String detailMessage) { + this.detailMessage = detailMessage; + return this; + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/UtilException.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/UtilException.java new file mode 100644 index 0000000..b804229 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/UtilException.java @@ -0,0 +1,26 @@ +package org.aibidding.common.core.exception; + +import java.io.Serial; + +/** + * 工具类异常 + * + * @author aibidding + */ +public class UtilException extends RuntimeException { + + @Serial + private static final long serialVersionUID = 8247610319171014183L; + + public UtilException(Throwable e) { + super(e.getMessage(), e); + } + + public UtilException(String message) { + super(message); + } + + public UtilException(String message, Throwable throwable) { + super(message, throwable); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/base/BaseException.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/base/BaseException.java new file mode 100644 index 0000000..f0fbf7d --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/base/BaseException.java @@ -0,0 +1,79 @@ +package org.aibidding.common.core.exception.base; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.utils.MessageUtils; +import org.aibidding.common.core.utils.StringUtils; + +import java.io.Serial; + +/** + * 基础异常 + * + * @author aibidding + */ +@Data +@EqualsAndHashCode(callSuper = true) +@NoArgsConstructor +public class BaseException extends RuntimeException { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 所属模块 + */ + private String module; + + /** + * 错误码 + */ + private String code; + + /** + * 错误码对应的参数 + */ + private Object[] args; + + /** + * 错误消息 + */ + private String defaultMessage; + + public BaseException(String module, String code, Object[] args, String defaultMessage) { + this.module = module; + this.code = code; + this.args = args; + this.defaultMessage = defaultMessage; + } + + public BaseException(String module, String code, Object[] args) { + this(module, code, args, null); + } + + public BaseException(String module, String defaultMessage) { + this(module, null, null, defaultMessage); + } + + public BaseException(String code, Object[] args) { + this(null, code, args, null); + } + + public BaseException(String defaultMessage) { + this(null, null, null, defaultMessage); + } + + @Override + public String getMessage() { + String message = null; + if (!StringUtils.isEmpty(code)) { + message = MessageUtils.message(code, args); + } + if (message == null) { + message = defaultMessage; + } + return message; + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/file/FileException.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/file/FileException.java new file mode 100644 index 0000000..81fc55f --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/file/FileException.java @@ -0,0 +1,21 @@ +package org.aibidding.common.core.exception.file; + +import org.aibidding.common.core.exception.base.BaseException; + +import java.io.Serial; + +/** + * 文件信息异常类 + * + * @author aibidding + */ +public class FileException extends BaseException { + + @Serial + private static final long serialVersionUID = 1L; + + public FileException(String code, Object[] args) { + super("file", code, args, null); + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/file/FileNameLengthLimitExceededException.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/file/FileNameLengthLimitExceededException.java new file mode 100644 index 0000000..6c004fa --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/file/FileNameLengthLimitExceededException.java @@ -0,0 +1,18 @@ +package org.aibidding.common.core.exception.file; + +import java.io.Serial; + +/** + * 文件名称超长限制异常类 + * + * @author aibidding + */ +public class FileNameLengthLimitExceededException extends FileException { + + @Serial + private static final long serialVersionUID = 1L; + + public FileNameLengthLimitExceededException(int defaultFileNameLength) { + super("upload.filename.exceed.length", new Object[]{defaultFileNameLength}); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/file/FileSizeLimitExceededException.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/file/FileSizeLimitExceededException.java new file mode 100644 index 0000000..a727f56 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/file/FileSizeLimitExceededException.java @@ -0,0 +1,18 @@ +package org.aibidding.common.core.exception.file; + +import java.io.Serial; + +/** + * 文件名大小限制异常类 + * + * @author aibidding + */ +public class FileSizeLimitExceededException extends FileException { + + @Serial + private static final long serialVersionUID = 1L; + + public FileSizeLimitExceededException(long defaultMaxSize) { + super("upload.exceed.maxSize", new Object[]{defaultMaxSize}); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/CaptchaException.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/CaptchaException.java new file mode 100644 index 0000000..3ee4bce --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/CaptchaException.java @@ -0,0 +1,18 @@ +package org.aibidding.common.core.exception.user; + +import java.io.Serial; + +/** + * 验证码错误异常类 + * + * @author aibidding + */ +public class CaptchaException extends UserException { + + @Serial + private static final long serialVersionUID = 1L; + + public CaptchaException() { + super("user.jcaptcha.error"); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/CaptchaExpireException.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/CaptchaExpireException.java new file mode 100644 index 0000000..6505aa6 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/CaptchaExpireException.java @@ -0,0 +1,18 @@ +package org.aibidding.common.core.exception.user; + +import java.io.Serial; + +/** + * 验证码失效异常类 + * + * @author aibidding + */ +public class CaptchaExpireException extends UserException { + + @Serial + private static final long serialVersionUID = 1L; + + public CaptchaExpireException() { + super("user.jcaptcha.expire"); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/UserException.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/UserException.java new file mode 100644 index 0000000..56426fb --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/UserException.java @@ -0,0 +1,20 @@ +package org.aibidding.common.core.exception.user; + +import org.aibidding.common.core.exception.base.BaseException; + +import java.io.Serial; + +/** + * 用户信息异常类 + * + * @author aibidding + */ +public class UserException extends BaseException { + + @Serial + private static final long serialVersionUID = 1L; + + public UserException(String code, Object... args) { + super("user", code, args, null); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/UserPasswordNotMatchException.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/UserPasswordNotMatchException.java new file mode 100644 index 0000000..1d3a309 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/UserPasswordNotMatchException.java @@ -0,0 +1,18 @@ +package org.aibidding.common.core.exception.user; + +import java.io.Serial; + +/** + * 用户密码不正确或不符合规范异常类 + * + * @author aibidding + */ +public class UserPasswordNotMatchException extends UserException { + + @Serial + private static final long serialVersionUID = 1L; + + public UserPasswordNotMatchException() { + super("user.password.not.match"); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/UserPasswordRetryLimitExceedException.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/UserPasswordRetryLimitExceedException.java new file mode 100644 index 0000000..78a9b74 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/exception/user/UserPasswordRetryLimitExceedException.java @@ -0,0 +1,19 @@ +package org.aibidding.common.core.exception.user; + +import java.io.Serial; + +/** + * 用户错误最大次数异常类 + * + * @author aibidding + */ +public class UserPasswordRetryLimitExceedException extends UserException { + + @Serial + private static final long serialVersionUID = 1L; + + public UserPasswordRetryLimitExceedException(int retryLimitCount, int lockTime) { + super("user.password.retry.limit.exceed", retryLimitCount, lockTime); + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/manager/ShutdownManager.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/manager/ShutdownManager.java new file mode 100644 index 0000000..15e1156 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/manager/ShutdownManager.java @@ -0,0 +1,41 @@ +package org.aibidding.common.core.manager; + +import jakarta.annotation.PreDestroy; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.utils.Threads; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Component; + +import java.util.concurrent.ScheduledExecutorService; + +/** + * 确保应用退出时能关闭后台线程 + * + * @author Lion Li + */ +@Slf4j +@Component +public class ShutdownManager { + + @Autowired + @Qualifier("scheduledExecutorService") + private ScheduledExecutorService scheduledExecutorService; + + @PreDestroy + public void destroy() { + shutdownAsyncManager(); + } + + /** + * 停止异步执行任务 + */ + private void shutdownAsyncManager() { + try { + log.info("====关闭后台任务任务线程池===="); + Threads.shutdownAndAwaitTermination(scheduledExecutorService); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/ConfigService.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/ConfigService.java new file mode 100644 index 0000000..28e6e8f --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/ConfigService.java @@ -0,0 +1,20 @@ +package org.aibidding.common.core.service; + + +/** + * 通用 参数配置服务 + */ +public interface ConfigService { + + /** + * 根据配置类型和配置key获取值 + * + * @param category + * @param configKey + * @return + */ + String getConfigValue(String category,String configKey); + + + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/DeptService.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/DeptService.java new file mode 100644 index 0000000..575184a --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/DeptService.java @@ -0,0 +1,18 @@ +package org.aibidding.common.core.service; + +/** + * 通用 部门服务 + * + * @author Lion Li + */ +public interface DeptService { + + /** + * 通过部门ID查询部门名称 + * + * @param deptIds 部门ID串逗号分隔 + * @return 部门名称串逗号分隔 + */ + String selectDeptNameByIds(String deptIds); + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/DictService.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/DictService.java new file mode 100644 index 0000000..8918f18 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/DictService.java @@ -0,0 +1,57 @@ +package org.aibidding.common.core.service; + +/** + * 通用 字典服务 + * + * @author Lion Li + */ +public interface DictService { + + /** + * 分隔符 + */ + String SEPARATOR = ","; + + /** + * 根据字典类型和字典值获取字典标签 + * + * @param dictType 字典类型 + * @param dictValue 字典值 + * @return 字典标签 + */ + default String getDictLabel(String dictType, String dictValue) { + return getDictLabel(dictType, dictValue, SEPARATOR); + } + + /** + * 根据字典类型和字典标签获取字典值 + * + * @param dictType 字典类型 + * @param dictLabel 字典标签 + * @return 字典值 + */ + default String getDictValue(String dictType, String dictLabel) { + return getDictValue(dictType, dictLabel, SEPARATOR); + } + + /** + * 根据字典类型和字典值获取字典标签 + * + * @param dictType 字典类型 + * @param dictValue 字典值 + * @param separator 分隔符 + * @return 字典标签 + */ + String getDictLabel(String dictType, String dictValue, String separator); + + /** + * 根据字典类型和字典标签获取字典值 + * + * @param dictType 字典类型 + * @param dictLabel 字典标签 + * @param separator 分隔符 + * @return 字典值 + */ + String getDictValue(String dictType, String dictLabel, String separator); + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/OssService.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/OssService.java new file mode 100644 index 0000000..ff717c3 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/OssService.java @@ -0,0 +1,18 @@ +package org.aibidding.common.core.service; + +/** + * 通用 OSS服务 + * + * @author Lion Li + */ +public interface OssService { + + /** + * 通过ossId查询对应的url + * + * @param ossIds ossId串逗号分隔 + * @return url串逗号分隔 + */ + String selectUrlByIds(String ossIds); + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/UserService.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/UserService.java new file mode 100644 index 0000000..2e3cd7f --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/service/UserService.java @@ -0,0 +1,25 @@ +package org.aibidding.common.core.service; + +/** + * 通用 用户服务 + * + * @author Lion Li + */ +public interface UserService { + + /** + * 通过用户ID查询用户账户 + * + * @param userId 用户ID + * @return 用户账户 + */ + String selectUserNameById(Long userId); + + /** + * 通过用户名称查询余额 + * + * @param userName + * @return + */ + String selectUserByName(String userName); +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/DateUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/DateUtils.java new file mode 100644 index 0000000..0ecdd1a --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/DateUtils.java @@ -0,0 +1,164 @@ +package org.aibidding.common.core.utils; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.time.DateFormatUtils; + +import java.lang.management.ManagementFactory; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.*; +import java.util.Date; + +/** + * 时间工具类 + * + * @author aibidding + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class DateUtils extends org.apache.commons.lang3.time.DateUtils { + + public static final String YYYY = "yyyy"; + + public static final String YYYY_MM = "yyyy-MM"; + + public static final String YYYY_MM_DD = "yyyy-MM-dd"; + + public static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; + + public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; + + private static final String[] PARSE_PATTERNS = { + "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", + "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM", + "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"}; + + /** + * 获取当前Date型日期 + * + * @return Date() 当前日期 + */ + public static Date getNowDate() { + return new Date(); + } + + /** + * 获取当前日期, 默认格式为yyyy-MM-dd + * + * @return String + */ + public static String getDate() { + return dateTimeNow(YYYY_MM_DD); + } + + public static String getTime() { + return dateTimeNow(YYYY_MM_DD_HH_MM_SS); + } + + public static String dateTimeNow() { + return dateTimeNow(YYYYMMDDHHMMSS); + } + + public static String dateTimeNow(final String format) { + return parseDateToStr(format, new Date()); + } + + public static String dateTime(final Date date) { + return parseDateToStr(YYYY_MM_DD, date); + } + + public static String parseDateToStr(final String format, final Date date) { + return new SimpleDateFormat(format).format(date); + } + + public static Date dateTime(final String format, final String ts) { + try { + return new SimpleDateFormat(format).parse(ts); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * 日期路径 即年/月/日 如2018/08/08 + */ + public static String datePath() { + Date now = new Date(); + return DateFormatUtils.format(now, "yyyy/MM/dd"); + } + + /** + * 日期路径 即年/月/日 如20180808 + */ + public static String dateTime() { + Date now = new Date(); + return DateFormatUtils.format(now, "yyyyMMdd"); + } + + /** + * 日期型字符串转化为日期 格式 + */ + public static Date parseDate(Object str) { + if (str == null) { + return null; + } + try { + return parseDate(str.toString(), PARSE_PATTERNS); + } catch (ParseException e) { + return null; + } + } + + /** + * 获取服务器启动时间 + */ + public static Date getServerStartDate() { + long time = ManagementFactory.getRuntimeMXBean().getStartTime(); + return new Date(time); + } + + /** + * 计算相差天数 + */ + public static int differentDaysByMillisecond(Date date1, Date date2) { + return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24))); + } + + /** + * 计算两个时间差 + */ + public static String getDatePoor(Date endDate, Date nowDate) { + long nd = 1000 * 24 * 60 * 60; + long nh = 1000 * 60 * 60; + long nm = 1000 * 60; + // long ns = 1000; + // 获得两个时间的毫秒时间差异 + long diff = endDate.getTime() - nowDate.getTime(); + // 计算差多少天 + long day = diff / nd; + // 计算差多少小时 + long hour = diff % nd / nh; + // 计算差多少分钟 + long min = diff % nd % nh / nm; + // 计算差多少秒//输出结果 + // long sec = diff % nd % nh % nm / ns; + return day + "天" + hour + "小时" + min + "分钟"; + } + + /** + * 增加 LocalDateTime ==> Date + */ + public static Date toDate(LocalDateTime temporalAccessor) { + ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault()); + return Date.from(zdt.toInstant()); + } + + /** + * 增加 LocalDate ==> Date + */ + public static Date toDate(LocalDate temporalAccessor) { + LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0)); + ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault()); + return Date.from(zdt.toInstant()); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/JsonUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/JsonUtils.java new file mode 100644 index 0000000..48279b8 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/JsonUtils.java @@ -0,0 +1,28 @@ +package org.aibidding.common.core.utils; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +/** + * @author Binary Wang + */ +public class JsonUtils { + private static final ObjectMapper JSON = new ObjectMapper(); + + static { + JSON.setSerializationInclusion(Include.NON_NULL); + JSON.configure(SerializationFeature.INDENT_OUTPUT, Boolean.TRUE); + } + + public static String toJson(Object obj) { + try { + return JSON.writeValueAsString(obj); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + + return null; + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/MapstructUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/MapstructUtils.java new file mode 100644 index 0000000..b2bb556 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/MapstructUtils.java @@ -0,0 +1,92 @@ +package org.aibidding.common.core.utils; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.map.MapUtil; +import cn.hutool.core.util.ObjectUtil; +import io.github.linpeilie.Converter; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +/** + * Mapstruct 工具类 + *

参考文档:mapstruct-plus

+ * + * @author Michelle.Chung + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class MapstructUtils { + + private final static Converter CONVERTER = SpringUtils.getBean(Converter.class); + + /** + * 将 T 类型对象,转换为 desc 类型的对象并返回 + * + * @param source 数据来源实体 + * @param desc 描述对象 转换后的对象 + * @return desc + */ + public static V convert(T source, Class desc) { + if (ObjectUtil.isNull(source)) { + return null; + } + if (ObjectUtil.isNull(desc)) { + return null; + } + return CONVERTER.convert(source, desc); + } + + /** + * 将 T 类型对象,按照配置的映射字段规则,给 desc 类型的对象赋值并返回 desc 对象 + * + * @param source 数据来源实体 + * @param desc 转换后的对象 + * @return desc + */ + public static V convert(T source, V desc) { + if (ObjectUtil.isNull(source)) { + return null; + } + if (ObjectUtil.isNull(desc)) { + return null; + } + return CONVERTER.convert(source, desc); + } + + /** + * 将 T 类型的集合,转换为 desc 类型的集合并返回 + * + * @param sourceList 数据来源实体列表 + * @param desc 描述对象 转换后的对象 + * @return desc + */ + public static List convert(List sourceList, Class desc) { + if (ObjectUtil.isNull(sourceList)) { + return null; + } + if (CollUtil.isEmpty(sourceList)) { + return CollUtil.newArrayList(); + } + return CONVERTER.convert(sourceList, desc); + } + + /** + * 将 Map 转换为 beanClass 类型的集合并返回 + * + * @param map 数据来源 + * @param beanClass bean类 + * @return bean对象 + */ + public static T convert(Map map, Class beanClass) { + if (MapUtil.isEmpty(map)) { + return null; + } + if (ObjectUtil.isNull(beanClass)) { + return null; + } + return CONVERTER.convert(map, beanClass); + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/MessageUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/MessageUtils.java new file mode 100644 index 0000000..cc66d64 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/MessageUtils.java @@ -0,0 +1,28 @@ +package org.aibidding.common.core.utils; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; + +/** + * 获取i18n资源文件 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class MessageUtils { + + private static final MessageSource MESSAGE_SOURCE = SpringUtils.getBean(MessageSource.class); + + /** + * 根据消息键和参数 获取消息 委托给spring messageSource + * + * @param code 消息键 + * @param args 参数 + * @return 获取国际化翻译值 + */ + public static String message(String code, Object... args) { + return MESSAGE_SOURCE.getMessage(code, args, LocaleContextHolder.getLocale()); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/OkHttpUtil.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/OkHttpUtil.java new file mode 100644 index 0000000..f5fb4da --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/OkHttpUtil.java @@ -0,0 +1,55 @@ +package org.aibidding.common.core.utils; + +import lombok.Setter; +import lombok.extern.slf4j.Slf4j; +import okhttp3.*; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.concurrent.TimeUnit; + +@Slf4j +@Component +public class OkHttpUtil { + + @Setter + private String apiHost; + @Setter + private String apiKey; + + private final OkHttpClient client = new OkHttpClient.Builder() + .connectTimeout(3000, TimeUnit.SECONDS) + .writeTimeout(3000, TimeUnit.SECONDS) + .readTimeout(3000, TimeUnit.SECONDS) + .build(); + + public String executeRequest(Request request) { + try (Response response = client.newCall(request).execute()) { + if (!response.isSuccessful()) { + log.error("Request failed: {}", response); + throw new IOException("Unexpected code " + response); + } + return response.body() != null ? response.body().string() : null; + } catch (IOException e) { + log.error("Request execution failed: {}", e.getMessage(), e); + return null; + } + } + + public Request createPostRequest(String url, String json) { + MediaType JSON = MediaType.get("application/json; charset=utf-8"); + RequestBody body = RequestBody.create(json, JSON); + return new Request.Builder() + .url(apiHost + url) + .post(body) + .header("Authorization", apiKey) + .build(); + } + + public Request createGetRequest(String url) { + return new Request.Builder() + .url(apiHost + url) + .header("Authorization", apiKey) + .build(); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/ServletUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/ServletUtils.java new file mode 100644 index 0000000..9c7caa7 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/ServletUtils.java @@ -0,0 +1,193 @@ +package org.aibidding.common.core.utils; + +import cn.hutool.core.convert.Convert; +import cn.hutool.extra.servlet.JakartaServletUtil; +import cn.hutool.http.HttpStatus; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.springframework.http.MediaType; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import java.io.IOException; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * 客户端工具类 + * + * @author aibidding + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class ServletUtils extends JakartaServletUtil { + + /** + * 获取String参数 + */ + public static String getParameter(String name) { + return getRequest().getParameter(name); + } + + /** + * 获取String参数 + */ + public static String getParameter(String name, String defaultValue) { + return Convert.toStr(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name) { + return Convert.toInt(getRequest().getParameter(name)); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name, Integer defaultValue) { + return Convert.toInt(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取Boolean参数 + */ + public static Boolean getParameterToBool(String name) { + return Convert.toBool(getRequest().getParameter(name)); + } + + /** + * 获取Boolean参数 + */ + public static Boolean getParameterToBool(String name, Boolean defaultValue) { + return Convert.toBool(getRequest().getParameter(name), defaultValue); + } + + /** + * 获得所有请求参数 + * + * @param request 请求对象{@link ServletRequest} + * @return Map + */ + public static Map getParams(ServletRequest request) { + final Map map = request.getParameterMap(); + return Collections.unmodifiableMap(map); + } + + /** + * 获得所有请求参数 + * + * @param request 请求对象{@link ServletRequest} + * @return Map + */ + public static Map getParamMap(ServletRequest request) { + Map params = new HashMap<>(); + for (Map.Entry entry : getParams(request).entrySet()) { + params.put(entry.getKey(), StringUtils.join(entry.getValue(), StringUtils.SEPARATOR)); + } + return params; + } + + /** + * 获取request + */ + public static HttpServletRequest getRequest() { + return getRequestAttributes().getRequest(); + } + + /** + * 获取response + */ + public static HttpServletResponse getResponse() { + return getRequestAttributes().getResponse(); + } + + /** + * 获取session + */ + public static HttpSession getSession() { + return getRequest().getSession(); + } + + public static ServletRequestAttributes getRequestAttributes() { + RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); + return (ServletRequestAttributes) attributes; + } + + /** + * 将字符串渲染到客户端 + * + * @param response 渲染对象 + * @param string 待渲染的字符串 + */ + public static void renderString(HttpServletResponse response, String string) { + try { + response.setStatus(HttpStatus.HTTP_OK); + response.setContentType(MediaType.APPLICATION_JSON_VALUE); + response.setCharacterEncoding(StandardCharsets.UTF_8.toString()); + response.getWriter().print(string); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 是否是Ajax异步请求 + * + * @param request + */ + public static boolean isAjaxRequest(HttpServletRequest request) { + + String accept = request.getHeader("accept"); + if (accept != null && accept.contains(MediaType.APPLICATION_JSON_VALUE)) { + return true; + } + + String xRequestedWith = request.getHeader("X-Requested-With"); + if (xRequestedWith != null && xRequestedWith.contains("XMLHttpRequest")) { + return true; + } + + String uri = request.getRequestURI(); + if (StringUtils.equalsAnyIgnoreCase(uri, ".json", ".xml")) { + return true; + } + + String ajax = request.getParameter("__ajax"); + return StringUtils.equalsAnyIgnoreCase(ajax, "json", "xml"); + } + + public static String getClientIP() { + return getClientIP(getRequest()); + } + + /** + * 内容编码 + * + * @param str 内容 + * @return 编码后的内容 + */ + public static String urlEncode(String str) { + return URLEncoder.encode(str, StandardCharsets.UTF_8); + } + + /** + * 内容解码 + * + * @param str 内容 + * @return 解码后的内容 + */ + public static String urlDecode(String str) { + return URLDecoder.decode(str, StandardCharsets.UTF_8); + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/SpringUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/SpringUtils.java new file mode 100644 index 0000000..35fc777 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/SpringUtils.java @@ -0,0 +1,62 @@ +package org.aibidding.common.core.utils; + +import cn.hutool.extra.spring.SpringUtil; +import org.springframework.aop.framework.AopContext; +import org.springframework.beans.factory.NoSuchBeanDefinitionException; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Component; + +/** + * spring工具类 + * + * @author Lion Li + */ +@Component +public final class SpringUtils extends SpringUtil { + + /** + * 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true + */ + public static boolean containsBean(String name) { + return getBeanFactory().containsBean(name); + } + + /** + * 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 + * 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException) + */ + public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException { + return getBeanFactory().isSingleton(name); + } + + /** + * @return Class 注册对象的类型 + */ + public static Class getType(String name) throws NoSuchBeanDefinitionException { + return getBeanFactory().getType(name); + } + + /** + * 如果给定的bean名字在bean定义中有别名,则返回这些别名 + */ + public static String[] getAliases(String name) throws NoSuchBeanDefinitionException { + return getBeanFactory().getAliases(name); + } + + /** + * 获取aop代理对象 + */ + @SuppressWarnings("unchecked") + public static T getAopProxy(T invoker) { + return (T) AopContext.currentProxy(); + } + + + /** + * 获取spring上下文 + */ + public static ApplicationContext context() { + return getApplicationContext(); + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/StreamUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/StreamUtils.java new file mode 100644 index 0000000..0e21010 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/StreamUtils.java @@ -0,0 +1,254 @@ +package org.aibidding.common.core.utils; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.map.MapUtil; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +import java.util.*; +import java.util.function.BiFunction; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +/** + * stream 流工具类 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class StreamUtils { + + /** + * 将collection过滤 + * + * @param collection 需要转化的集合 + * @param function 过滤方法 + * @return 过滤后的list + */ + public static List filter(Collection collection, Predicate function) { + if (CollUtil.isEmpty(collection)) { + return CollUtil.newArrayList(); + } + // 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题 + return collection.stream().filter(function).collect(Collectors.toList()); + } + + /** + * 将collection拼接 + * + * @param collection 需要转化的集合 + * @param function 拼接方法 + * @return 拼接后的list + */ + public static String join(Collection collection, Function function) { + return join(collection, function, StringUtils.SEPARATOR); + } + + /** + * 将collection拼接 + * + * @param collection 需要转化的集合 + * @param function 拼接方法 + * @param delimiter 拼接符 + * @return 拼接后的list + */ + public static String join(Collection collection, Function function, CharSequence delimiter) { + if (CollUtil.isEmpty(collection)) { + return StringUtils.EMPTY; + } + return collection.stream().map(function).filter(Objects::nonNull).collect(Collectors.joining(delimiter)); + } + + /** + * 将collection排序 + * + * @param collection 需要转化的集合 + * @param comparing 排序方法 + * @return 排序后的list + */ + public static List sorted(Collection collection, Comparator comparing) { + if (CollUtil.isEmpty(collection)) { + return CollUtil.newArrayList(); + } + // 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题 + return collection.stream().sorted(comparing).collect(Collectors.toList()); + } + + /** + * 将collection转化为类型不变的map
+ * {@code Collection ----> Map} + * + * @param collection 需要转化的集合 + * @param key V类型转化为K类型的lambda方法 + * @param collection中的泛型 + * @param map中的key类型 + * @return 转化后的map + */ + public static Map toIdentityMap(Collection collection, Function key) { + if (CollUtil.isEmpty(collection)) { + return MapUtil.newHashMap(); + } + return collection.stream().collect(Collectors.toMap(key, Function.identity(), (l, r) -> l)); + } + + /** + * 将Collection转化为map(value类型与collection的泛型不同)
+ * {@code Collection -----> Map } + * + * @param collection 需要转化的集合 + * @param key E类型转化为K类型的lambda方法 + * @param value E类型转化为V类型的lambda方法 + * @param collection中的泛型 + * @param map中的key类型 + * @param map中的value类型 + * @return 转化后的map + */ + public static Map toMap(Collection collection, Function key, Function value) { + if (CollUtil.isEmpty(collection)) { + return MapUtil.newHashMap(); + } + return collection.stream().collect(Collectors.toMap(key, value, (l, r) -> l)); + } + + /** + * 将collection按照规则(比如有相同的班级id)分类成map
+ * {@code Collection -------> Map> } + * + * @param collection 需要分类的集合 + * @param key 分类的规则 + * @param collection中的泛型 + * @param map中的key类型 + * @return 分类后的map + */ + public static Map> groupByKey(Collection collection, Function key) { + if (CollUtil.isEmpty(collection)) { + return MapUtil.newHashMap(); + } + return collection + .stream() + .collect(Collectors.groupingBy(key, LinkedHashMap::new, Collectors.toList())); + } + + /** + * 将collection按照两个规则(比如有相同的年级id,班级id)分类成双层map
+ * {@code Collection ---> Map>> } + * + * @param collection 需要分类的集合 + * @param key1 第一个分类的规则 + * @param key2 第二个分类的规则 + * @param 集合元素类型 + * @param 第一个map中的key类型 + * @param 第二个map中的key类型 + * @return 分类后的map + */ + public static Map>> groupBy2Key(Collection collection, Function key1, Function key2) { + if (CollUtil.isEmpty(collection)) { + return MapUtil.newHashMap(); + } + return collection + .stream() + .collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.groupingBy(key2, LinkedHashMap::new, Collectors.toList()))); + } + + /** + * 将collection按照两个规则(比如有相同的年级id,班级id)分类成双层map
+ * {@code Collection ---> Map> } + * + * @param collection 需要分类的集合 + * @param key1 第一个分类的规则 + * @param key2 第二个分类的规则 + * @param 第一个map中的key类型 + * @param 第二个map中的key类型 + * @param collection中的泛型 + * @return 分类后的map + */ + public static Map> group2Map(Collection collection, Function key1, Function key2) { + if (CollUtil.isEmpty(collection) || key1 == null || key2 == null) { + return MapUtil.newHashMap(); + } + return collection + .stream() + .collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.toMap(key2, Function.identity(), (l, r) -> l))); + } + + /** + * 将collection转化为List集合,但是两者的泛型不同
+ * {@code Collection ------> List } + * + * @param collection 需要转化的集合 + * @param function collection中的泛型转化为list泛型的lambda表达式 + * @param collection中的泛型 + * @param List中的泛型 + * @return 转化后的list + */ + public static List toList(Collection collection, Function function) { + if (CollUtil.isEmpty(collection)) { + return CollUtil.newArrayList(); + } + return collection + .stream() + .map(function) + .filter(Objects::nonNull) + // 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题 + .collect(Collectors.toList()); + } + + /** + * 将collection转化为Set集合,但是两者的泛型不同
+ * {@code Collection ------> Set } + * + * @param collection 需要转化的集合 + * @param function collection中的泛型转化为set泛型的lambda表达式 + * @param collection中的泛型 + * @param Set中的泛型 + * @return 转化后的Set + */ + public static Set toSet(Collection collection, Function function) { + if (CollUtil.isEmpty(collection) || function == null) { + return CollUtil.newHashSet(); + } + return collection + .stream() + .map(function) + .filter(Objects::nonNull) + .collect(Collectors.toSet()); + } + + + /** + * 合并两个相同key类型的map + * + * @param map1 第一个需要合并的 map + * @param map2 第二个需要合并的 map + * @param merge 合并的lambda,将key value1 value2合并成最终的类型,注意value可能为空的情况 + * @param map中的key类型 + * @param 第一个 map的value类型 + * @param 第二个 map的value类型 + * @param 最终map的value类型 + * @return 合并后的map + */ + public static Map merge(Map map1, Map map2, BiFunction merge) { + if (MapUtil.isEmpty(map1) && MapUtil.isEmpty(map2)) { + return MapUtil.newHashMap(); + } else if (MapUtil.isEmpty(map1)) { + map1 = MapUtil.newHashMap(); + } else if (MapUtil.isEmpty(map2)) { + map2 = MapUtil.newHashMap(); + } + Set key = new HashSet<>(); + key.addAll(map1.keySet()); + key.addAll(map2.keySet()); + Map map = new HashMap<>(); + for (K t : key) { + X x = map1.get(t); + Y y = map2.get(t); + V z = merge.apply(x, y); + if (z != null) { + map.put(t, z); + } + } + return map; + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/StringUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/StringUtils.java new file mode 100644 index 0000000..085a55c --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/StringUtils.java @@ -0,0 +1,321 @@ +package org.aibidding.common.core.utils; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.lang.Validator; +import cn.hutool.core.util.StrUtil; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.springframework.util.AntPathMatcher; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 字符串工具类 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class StringUtils extends org.apache.commons.lang3.StringUtils { + + public static final String SEPARATOR = ","; + + /** + * 获取参数不为空值 + * + * @param str defaultValue 要判断的value + * @return value 返回值 + */ + public static String blankToDefault(String str, String defaultValue) { + return StrUtil.blankToDefault(str, defaultValue); + } + + /** + * * 判断一个字符串是否为空串 + * + * @param str String + * @return true:为空 false:非空 + */ + public static boolean isEmpty(String str) { + return StrUtil.isEmpty(str); + } + + /** + * * 判断一个字符串是否为非空串 + * + * @param str String + * @return true:非空串 false:空串 + */ + public static boolean isNotEmpty(String str) { + return !isEmpty(str); + } + + /** + * 去空格 + */ + public static String trim(String str) { + return StrUtil.trim(str); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @return 结果 + */ + public static String substring(final String str, int start) { + return substring(str, start, str.length()); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @param end 结束 + * @return 结果 + */ + public static String substring(final String str, int start, int end) { + return StrUtil.sub(str, start, end); + } + + /** + * 格式化文本, {} 表示占位符
+ * 此方法只是简单将占位符 {} 按照顺序替换为参数
+ * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可
+ * 例:
+ * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
+ * 转义{}: format("this is \\{} for {}", "a", "b") -> this is {} for a
+ * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
+ * + * @param template 文本模板,被替换的部分用 {} 表示 + * @param params 参数值 + * @return 格式化后的文本 + */ + public static String format(String template, Object... params) { + return StrUtil.format(template, params); + } + + /** + * 是否为http(s)://开头 + * + * @param link 链接 + * @return 结果 + */ + public static boolean ishttp(String link) { + return Validator.isUrl(link); + } + + /** + * 字符串转set + * + * @param str 字符串 + * @param sep 分隔符 + * @return set集合 + */ + public static Set str2Set(String str, String sep) { + return new HashSet<>(str2List(str, sep, true, false)); + } + + /** + * 字符串转list + * + * @param str 字符串 + * @param sep 分隔符 + * @param filterBlank 过滤纯空白 + * @param trim 去掉首尾空白 + * @return list集合 + */ + public static List str2List(String str, String sep, boolean filterBlank, boolean trim) { + List list = new ArrayList<>(); + if (isEmpty(str)) { + return list; + } + + // 过滤空白字符串 + if (filterBlank && isBlank(str)) { + return list; + } + String[] split = str.split(sep); + for (String string : split) { + if (filterBlank && isBlank(string)) { + continue; + } + if (trim) { + string = trim(string); + } + list.add(string); + } + + return list; + } + + /** + * 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写 + * + * @param cs 指定字符串 + * @param searchCharSequences 需要检查的字符串数组 + * @return 是否包含任意一个字符串 + */ + public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) { + return StrUtil.containsAnyIgnoreCase(cs, searchCharSequences); + } + + /** + * 驼峰转下划线命名 + */ + public static String toUnderScoreCase(String str) { + return StrUtil.toUnderlineCase(str); + } + + /** + * 是否包含字符串 + * + * @param str 验证字符串 + * @param strs 字符串组 + * @return 包含返回true + */ + public static boolean inStringIgnoreCase(String str, String... strs) { + return StrUtil.equalsAnyIgnoreCase(str, strs); + } + + /** + * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld + * + * @param name 转换前的下划线大写方式命名的字符串 + * @return 转换后的驼峰式命名的字符串 + */ + public static String convertToCamelCase(String name) { + return StrUtil.upperFirst(StrUtil.toCamelCase(name)); + } + + /** + * 驼峰式命名法 例如:user_name->userName + */ + public static String toCamelCase(String s) { + return StrUtil.toCamelCase(s); + } + + /** + * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 + * + * @param str 指定字符串 + * @param strs 需要检查的字符串数组 + * @return 是否匹配 + */ + public static boolean matches(String str, List strs) { + if (isEmpty(str) || CollUtil.isEmpty(strs)) { + return false; + } + for (String pattern : strs) { + if (isMatch(pattern, str)) { + return true; + } + } + return false; + } + + /** + * 判断url是否与规则配置: + * ? 表示单个字符; + * * 表示一层路径内的任意字符串,不可跨层级; + * ** 表示任意层路径; + * + * @param pattern 匹配规则 + * @param url 需要匹配的url + */ + public static boolean isMatch(String pattern, String url) { + AntPathMatcher matcher = new AntPathMatcher(); + return matcher.match(pattern, url); + } + + /** + * 数字左边补齐0,使之达到指定长度。注意,如果数字转换为字符串后,长度大于size,则只保留 最后size个字符。 + * + * @param num 数字对象 + * @param size 字符串指定长度 + * @return 返回数字的字符串格式,该字符串为指定长度。 + */ + public static String padl(final Number num, final int size) { + return padl(num.toString(), size, '0'); + } + + /** + * 字符串左补齐。如果原始字符串s长度大于size,则只保留最后size个字符。 + * + * @param s 原始字符串 + * @param size 字符串指定长度 + * @param c 用于补齐的字符 + * @return 返回指定长度的字符串,由原字符串左补齐或截取得到。 + */ + public static String padl(final String s, final int size, final char c) { + final StringBuilder sb = new StringBuilder(size); + if (s != null) { + final int len = s.length(); + if (s.length() <= size) { + sb.append(String.valueOf(c).repeat(size - len)); + sb.append(s); + } else { + return s.substring(len - size, len); + } + } else { + sb.append(String.valueOf(c).repeat(Math.max(0, size))); + } + return sb.toString(); + } + + /** + * 切分字符串(分隔符默认逗号) + * + * @param str 被切分的字符串 + * @return 分割后的数据列表 + */ + public static List splitList(String str) { + return splitTo(str, Convert::toStr); + } + + /** + * 切分字符串 + * + * @param str 被切分的字符串 + * @param separator 分隔符 + * @return 分割后的数据列表 + */ + public static List splitList(String str, String separator) { + return splitTo(str, separator, Convert::toStr); + } + + /** + * 切分字符串自定义转换(分隔符默认逗号) + * + * @param str 被切分的字符串 + * @param mapper 自定义转换 + * @return 分割后的数据列表 + */ + public static List splitTo(String str, Function mapper) { + return splitTo(str, SEPARATOR, mapper); + } + + /** + * 切分字符串自定义转换 + * + * @param str 被切分的字符串 + * @param separator 分隔符 + * @param mapper 自定义转换 + * @return 分割后的数据列表 + */ + public static List splitTo(String str, String separator, Function mapper) { + if (isBlank(str)) { + return new ArrayList<>(0); + } + return StrUtil.split(str, separator) + .stream() + .filter(Objects::nonNull) + .map(mapper) + .collect(Collectors.toList()); + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/Threads.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/Threads.java new file mode 100644 index 0000000..7a5c78f --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/Threads.java @@ -0,0 +1,75 @@ +package org.aibidding.common.core.utils; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import java.util.concurrent.*; + +/** + * 线程相关工具类. + * + * @author aibidding + */ +@Slf4j +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class Threads { + + /** + * sleep等待,单位为毫秒 + */ + public static void sleep(long milliseconds) { + try { + Thread.sleep(milliseconds); + } catch (InterruptedException e) { + return; + } + } + + /** + * 停止线程池 + * 先使用shutdown, 停止接收新任务并尝试完成所有已存在任务. + * 如果超时, 则调用shutdownNow, 取消在workQueue中Pending的任务,并中断所有阻塞函数. + * 如果仍然超時,則強制退出. + * 另对在shutdown时线程本身被调用中断做了处理. + */ + public static void shutdownAndAwaitTermination(ExecutorService pool) { + if (pool != null && !pool.isShutdown()) { + pool.shutdown(); + try { + if (!pool.awaitTermination(120, TimeUnit.SECONDS)) { + pool.shutdownNow(); + if (!pool.awaitTermination(120, TimeUnit.SECONDS)) { + log.info("Pool did not terminate"); + } + } + } catch (InterruptedException ie) { + pool.shutdownNow(); + Thread.currentThread().interrupt(); + } + } + } + + /** + * 打印线程异常信息 + */ + public static void printException(Runnable r, Throwable t) { + if (t == null && r instanceof Future) { + try { + Future future = (Future) r; + if (future.isDone()) { + future.get(); + } + } catch (CancellationException ce) { + t = ce; + } catch (ExecutionException ee) { + t = ee.getCause(); + } catch (InterruptedException ie) { + Thread.currentThread().interrupt(); + } + } + if (t != null) { + log.error(t.getMessage(), t); + } + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/TreeBuildUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/TreeBuildUtils.java new file mode 100644 index 0000000..5446dfa --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/TreeBuildUtils.java @@ -0,0 +1,35 @@ +package org.aibidding.common.core.utils; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.lang.tree.Tree; +import cn.hutool.core.lang.tree.TreeNodeConfig; +import cn.hutool.core.lang.tree.TreeUtil; +import cn.hutool.core.lang.tree.parser.NodeParser; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.utils.reflect.ReflectUtils; + +import java.util.List; + +/** + * 扩展 hutool TreeUtil 封装系统树构建 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class TreeBuildUtils extends TreeUtil { + + /** + * 根据前端定制差异化字段 + */ + public static final TreeNodeConfig DEFAULT_CONFIG = TreeNodeConfig.DEFAULT_CONFIG.setNameKey("label"); + + public static List> build(List list, NodeParser nodeParser) { + if (CollUtil.isEmpty(list)) { + return null; + } + K k = ReflectUtils.invokeGetter(list.get(0), "parentId"); + return TreeUtil.build(list, k, DEFAULT_CONFIG, nodeParser); + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/ValidatorUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/ValidatorUtils.java new file mode 100644 index 0000000..486c004 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/ValidatorUtils.java @@ -0,0 +1,28 @@ +package org.aibidding.common.core.utils; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import jakarta.validation.Validator; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +import java.util.Set; + +/** + * Validator 校验框架工具 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class ValidatorUtils { + + private static final Validator VALID = SpringUtils.getBean(Validator.class); + + public static void validate(T object, Class... groups) { + Set> validate = VALID.validate(object, groups); + if (!validate.isEmpty()) { + throw new ConstraintViolationException("参数校验异常", validate); + } + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/file/FileUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/file/FileUtils.java new file mode 100644 index 0000000..7a0773e --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/file/FileUtils.java @@ -0,0 +1,83 @@ +package org.aibidding.common.core.utils.file; + +import cn.hutool.core.io.FileUtil; +import jakarta.servlet.http.HttpServletResponse; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; +import org.springframework.web.multipart.MultipartFile; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.UUID; + +/** + * 文件处理工具类 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class FileUtils extends FileUtil { + + private static final String FILE_EXTENTION_SPLIT = "."; + + /** + * 下载文件名重新编码 + * + * @param response 响应对象 + * @param realFileName 真实文件名 + */ + public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) { + String percentEncodedFileName = percentEncode(realFileName); + String contentDispositionValue = "attachment; filename=%s;filename*=utf-8''%s".formatted(percentEncodedFileName, percentEncodedFileName); + response.addHeader("Access-Control-Expose-Headers", "Content-Disposition,download-filename"); + response.setHeader("Content-disposition", contentDispositionValue); + response.setHeader("download-filename", percentEncodedFileName); + } + + /** + * 百分号编码工具方法 + * + * @param s 需要百分号编码的字符串 + * @return 百分号编码后的字符串 + */ + public static String percentEncode(String s) { + String encode = URLEncoder.encode(s, StandardCharsets.UTF_8); + return encode.replaceAll("\\+", "%20"); + } + + /** + * 检查文件扩展名是否符合要求 + * + * @param file + * @return + */ + public static boolean isValidFileExtention(MultipartFile file, String[] ALLOWED_EXTENSIONS) { + if (file == null || file.isEmpty()) { + return false; + } + final String filename = file.getOriginalFilename(); + if (StringUtils.isBlank(filename) || !filename.contains(FILE_EXTENTION_SPLIT)) { + return false; + } + // 获取文件后缀 + String fileExtension = filename.substring(filename.lastIndexOf('.') + 1).toLowerCase(); + + return Arrays.asList(ALLOWED_EXTENSIONS).contains(fileExtension); + } + + /** + * 获取安全的文件路径 + * + * @param originalFilename 原始文件名 + * @param secureFilePath 安全路径 + * @return 安全文件路径 + */ + public static String getSecureFilePathForUpload(final String originalFilename, final String secureFilePath) { + String extension = originalFilename.substring(originalFilename.lastIndexOf(FILE_EXTENTION_SPLIT)); + String newFileName = UUID.randomUUID() + extension; + + return secureFilePath + newFileName; // 预定义安全路径 + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/file/MimeTypeUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/file/MimeTypeUtils.java new file mode 100644 index 0000000..8a4850c --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/file/MimeTypeUtils.java @@ -0,0 +1,46 @@ +package org.aibidding.common.core.utils.file; + +/** + * 媒体类型工具类 + * + * @author aibidding + */ +public class MimeTypeUtils { + public static final String IMAGE_PNG = "image/png"; + + public static final String IMAGE_JPG = "image/jpg"; + + public static final String IMAGE_JPEG = "image/jpeg"; + + public static final String IMAGE_BMP = "image/bmp"; + + public static final String IMAGE_GIF = "image/gif"; + + public static final String[] IMAGE_EXTENSION = {"bmp", "gif", "jpg", "jpeg", "png"}; + + public static final String[] FLASH_EXTENSION = {"swf", "flv"}; + + public static final String[] MEDIA_EXTENSION = {"swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg", + "asf", "rm", "rmvb"}; + + public static final String[] VIDEO_EXTENSION = {"mp4", "avi", "rmvb"}; + /** + * 音频扩展名 + */ + public static final String[] AUDIO__EXTENSION = {"mp3", "mp4", "mpeg", "mpga", "m4a", "wav", "webm"}; + + public static final String[] DEFAULT_ALLOWED_EXTENSION = { + // 图片 + "bmp", "gif", "jpg", "jpeg", "png", + // word excel powerpoint + "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt", + // 压缩文件 + "rar", "zip", "gz", "bz2", + // 视频格式 + "mp4", "avi", "rmvb", + // 音频格式 + "mp3", "mp4", "mpeg", "mpga", "m4a", "wav", "webm", + // pdf + "pdf"}; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/ip/AddressUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/ip/AddressUtils.java new file mode 100644 index 0000000..9c873c2 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/ip/AddressUtils.java @@ -0,0 +1,33 @@ +package org.aibidding.common.core.utils.ip; + +import cn.hutool.core.net.NetUtil; +import cn.hutool.http.HtmlUtil; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.utils.StringUtils; + +/** + * 获取地址类 + * + * @author Lion Li + */ +@Slf4j +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class AddressUtils { + + // 未知地址 + public static final String UNKNOWN = "XX XX"; + + public static String getRealAddressByIP(String ip) { + if (StringUtils.isBlank(ip)) { + return UNKNOWN; + } + // 内网不查询 + ip = "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : HtmlUtil.cleanHtmlTag(ip); + if (NetUtil.isInnerIP(ip)) { + return "内网IP"; + } + return RegionUtils.getCityInfo(ip); + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/ip/RegionUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/ip/RegionUtils.java new file mode 100644 index 0000000..d711bd9 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/ip/RegionUtils.java @@ -0,0 +1,67 @@ +package org.aibidding.common.core.utils.ip; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.resource.ClassPathResource; +import cn.hutool.core.util.ObjectUtil; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.file.FileUtils; +import org.lionsoul.ip2region.xdb.Searcher; + +import java.io.File; + +/** + * 根据ip地址定位工具类,离线方式 + * 参考地址:集成 ip2region 实现离线IP地址定位库 + * + * @author lishuyan + */ +@Slf4j +public class RegionUtils { + + private static final Searcher SEARCHER; + + static { + String fileName = "/ip2region.xdb"; + File existFile = FileUtils.file(FileUtil.getTmpDir() + FileUtil.FILE_SEPARATOR + fileName); + if (!FileUtils.exist(existFile)) { + ClassPathResource fileStream = new ClassPathResource(fileName); + if (ObjectUtil.isEmpty(fileStream.getStream())) { + throw new ServiceException("RegionUtils初始化失败,原因:IP地址库数据不存在!"); + } + FileUtils.writeFromStream(fileStream.getStream(), existFile); + } + + String dbPath = existFile.getPath(); + + // 1、从 dbPath 加载整个 xdb 到内存。 + byte[] cBuff; + try { + cBuff = Searcher.loadContentFromFile(dbPath); + } catch (Exception e) { + throw new ServiceException("RegionUtils初始化失败,原因:从ip2region.xdb文件加载内容失败!" + e.getMessage()); + } + // 2、使用上述的 cBuff 创建一个完全基于内存的查询对象。 + try { + SEARCHER = Searcher.newWithBuffer(cBuff); + } catch (Exception e) { + throw new ServiceException("RegionUtils初始化失败,原因:" + e.getMessage()); + } + } + + /** + * 根据IP地址离线获取城市 + */ + public static String getCityInfo(String ip) { + try { + ip = ip.trim(); + // 3、执行查询 + String region = SEARCHER.search(ip); + return region.replace("0|", "").replace("|0", ""); + } catch (Exception e) { + log.error("IP地址离线获取城市异常 {}", ip); + return "未知"; + } + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/reflect/ReflectUtils.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/reflect/ReflectUtils.java new file mode 100644 index 0000000..fff229e --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/reflect/ReflectUtils.java @@ -0,0 +1,56 @@ +package org.aibidding.common.core.utils.reflect; + +import cn.hutool.core.util.ReflectUtil; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.utils.StringUtils; + +import java.lang.reflect.Method; + +/** + * 反射工具类. 提供调用getter/setter方法, 访问私有变量, 调用私有方法, 获取泛型类型Class, 被AOP过的真实类等工具函数. + * + * @author Lion Li + */ +@SuppressWarnings("rawtypes") +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class ReflectUtils extends ReflectUtil { + + private static final String SETTER_PREFIX = "set"; + + private static final String GETTER_PREFIX = "get"; + + /** + * 调用Getter方法. + * 支持多级,如:对象名.对象名.方法 + */ + @SuppressWarnings("unchecked") + public static E invokeGetter(Object obj, String propertyName) { + Object object = obj; + for (String name : StringUtils.split(propertyName, ".")) { + String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(name); + object = invoke(object, getterMethodName); + } + return (E) object; + } + + /** + * 调用Setter方法, 仅匹配方法名。 + * 支持多级,如:对象名.对象名.方法 + */ + public static void invokeSetter(Object obj, String propertyName, E value) { + Object object = obj; + String[] names = StringUtils.split(propertyName, "."); + for (int i = 0; i < names.length; i++) { + if (i < names.length - 1) { + String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(names[i]); + object = invoke(object, getterMethodName); + } else { + String setterMethodName = SETTER_PREFIX + StringUtils.capitalize(names[i]); + Method method = getMethodByName(object.getClass(), setterMethodName); + invoke(object, method, value); + } + } + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/sql/SqlUtil.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/sql/SqlUtil.java new file mode 100644 index 0000000..5b1f27a --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/utils/sql/SqlUtil.java @@ -0,0 +1,57 @@ +package org.aibidding.common.core.utils.sql; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.exception.UtilException; +import org.aibidding.common.core.utils.StringUtils; + +/** + * sql操作工具类 + * + * @author aibidding + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class SqlUtil { + + /** + * 定义常用的 sql关键字 + */ + public static final String SQL_REGEX = "select |insert |delete |update |drop |count |exec |chr |mid |master |truncate |char |and |declare "; + + /** + * 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序) + */ + public static final String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+"; + + /** + * 检查字符,防止注入绕过 + */ + public static String escapeOrderBySql(String value) { + if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) { + throw new UtilException("参数不符合规范,不能进行查询"); + } + return value; + } + + /** + * 验证 order by 语法是否符合规范 + */ + public static boolean isValidOrderBySql(String value) { + return value.matches(SQL_PATTERN); + } + + /** + * SQL关键字检查 + */ + public static void filterKeyword(String value) { + if (StringUtils.isEmpty(value)) { + return; + } + String[] sqlKeywords = StringUtils.split(SQL_REGEX, "\\|"); + for (String sqlKeyword : sqlKeywords) { + if (StringUtils.indexOfIgnoreCase(value, sqlKeyword) > -1) { + throw new UtilException("参数存在SQL注入风险"); + } + } + } +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/validate/AddGroup.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/validate/AddGroup.java new file mode 100644 index 0000000..a324b54 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/validate/AddGroup.java @@ -0,0 +1,9 @@ +package org.aibidding.common.core.validate; + +/** + * 校验分组 add + * + * @author Lion Li + */ +public interface AddGroup { +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/validate/EditGroup.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/validate/EditGroup.java new file mode 100644 index 0000000..a240295 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/validate/EditGroup.java @@ -0,0 +1,9 @@ +package org.aibidding.common.core.validate; + +/** + * 校验分组 edit + * + * @author Lion Li + */ +public interface EditGroup { +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/validate/QueryGroup.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/validate/QueryGroup.java new file mode 100644 index 0000000..99e9861 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/validate/QueryGroup.java @@ -0,0 +1,9 @@ +package org.aibidding.common.core.validate; + +/** + * 校验分组 query + * + * @author Lion Li + */ +public interface QueryGroup { +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/xss/Xss.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/xss/Xss.java new file mode 100644 index 0000000..b0b0ec5 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/xss/Xss.java @@ -0,0 +1,27 @@ +package org.aibidding.common.core.xss; + +import jakarta.validation.Constraint; +import jakarta.validation.Payload; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 自定义xss校验注解 + * + * @author Lion Li + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(value = {ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.PARAMETER}) +@Constraint(validatedBy = {XssValidator.class}) +public @interface Xss { + + String message() default "不允许任何脚本运行"; + + Class[] groups() default {}; + + Class[] payload() default {}; + +} diff --git a/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/xss/XssValidator.java b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/xss/XssValidator.java new file mode 100644 index 0000000..85ffb61 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/java/org/aibidding/common/core/xss/XssValidator.java @@ -0,0 +1,20 @@ +package org.aibidding.common.core.xss; + +import cn.hutool.core.util.ReUtil; +import cn.hutool.http.HtmlUtil; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; + +/** + * 自定义xss校验注解实现 + * + * @author Lion Li + */ +public class XssValidator implements ConstraintValidator { + + @Override + public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) { + return !ReUtil.contains(HtmlUtil.RE_HTML_MARK, value); + } + +} diff --git a/aibidding-common/aibidding-common-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..a2e4051 --- /dev/null +++ b/aibidding-common/aibidding-common-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,6 @@ +org.aibidding.common.core.config.ApplicationConfig +org.aibidding.common.core.config.AsyncConfig +org.aibidding.common.core.config.RuoYiConfig +org.aibidding.common.core.config.ThreadPoolConfig +org.aibidding.common.core.config.ValidatorConfig +org.aibidding.common.core.utils.SpringUtils diff --git a/aibidding-common/aibidding-common-doc/pom.xml b/aibidding-common/aibidding-common-doc/pom.xml new file mode 100644 index 0000000..f8eeb75 --- /dev/null +++ b/aibidding-common/aibidding-common-doc/pom.xml @@ -0,0 +1,42 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-doc + + + ruoyi-common-doc 系统接口 + + + + + org.ruoyi + aibidding-common-core + + + + org.springdoc + springdoc-openapi-starter-webmvc-api + + + + com.github.therapi + therapi-runtime-javadoc + + + + com.fasterxml.jackson.module + jackson-module-kotlin + + + + + diff --git a/aibidding-common/aibidding-common-doc/src/main/java/org/aibidding/common/doc/config/SwaggerConfig.java b/aibidding-common/aibidding-common-doc/src/main/java/org/aibidding/common/doc/config/SwaggerConfig.java new file mode 100644 index 0000000..69f3ad6 --- /dev/null +++ b/aibidding-common/aibidding-common-doc/src/main/java/org/aibidding/common/doc/config/SwaggerConfig.java @@ -0,0 +1,126 @@ +package org.aibidding.common.doc.config; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Paths; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.doc.config.properties.SwaggerProperties; +import org.aibidding.common.doc.handler.OpenApiHandler; +import org.springdoc.core.configuration.SpringDocConfiguration; +import org.springdoc.core.customizers.OpenApiBuilderCustomizer; +import org.springdoc.core.customizers.OpenApiCustomizer; +import org.springdoc.core.customizers.ServerBaseUrlCustomizer; +import org.springdoc.core.properties.SpringDocConfigProperties; +import org.springdoc.core.providers.JavadocProvider; +import org.springdoc.core.service.OpenAPIService; +import org.springdoc.core.service.SecurityService; +import org.springdoc.core.utils.PropertyResolverUtils; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.web.ServerProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.Set; + +/** + * Swagger 文档配置 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@AutoConfiguration(before = SpringDocConfiguration.class) +@EnableConfigurationProperties(SwaggerProperties.class) +@ConditionalOnProperty(name = "springdoc.api-docs.enabled", havingValue = "true", matchIfMissing = true) +public class SwaggerConfig { + + private final ServerProperties serverProperties; + + @Bean + @ConditionalOnMissingBean(OpenAPI.class) + public OpenAPI openApi(SwaggerProperties swaggerProperties) { + OpenAPI openApi = new OpenAPI(); + // 文档基本信息 + SwaggerProperties.InfoProperties infoProperties = swaggerProperties.getInfo(); + Info info = convertInfo(infoProperties); + openApi.info(info); + // 扩展文档信息 + openApi.externalDocs(swaggerProperties.getExternalDocs()); + openApi.tags(swaggerProperties.getTags()); + openApi.paths(swaggerProperties.getPaths()); + openApi.components(swaggerProperties.getComponents()); + Set keySet = swaggerProperties.getComponents().getSecuritySchemes().keySet(); + List list = new ArrayList<>(); + SecurityRequirement securityRequirement = new SecurityRequirement(); + keySet.forEach(securityRequirement::addList); + list.add(securityRequirement); + openApi.security(list); + + return openApi; + } + + private Info convertInfo(SwaggerProperties.InfoProperties infoProperties) { + Info info = new Info(); + info.setTitle(infoProperties.getTitle()); + info.setDescription(infoProperties.getDescription()); + info.setContact(infoProperties.getContact()); + info.setLicense(infoProperties.getLicense()); + info.setVersion(infoProperties.getVersion()); + return info; + } + + /** + * 自定义 openapi 处理器 + */ + @Bean + public OpenAPIService openApiBuilder(Optional openAPI, + SecurityService securityParser, + SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils, + Optional> openApiBuilderCustomisers, + Optional> serverBaseUrlCustomisers, Optional javadocProvider) { + return new OpenApiHandler(openAPI, securityParser, springDocConfigProperties, propertyResolverUtils, openApiBuilderCustomisers, serverBaseUrlCustomisers, javadocProvider); + } + + /** + * 对已经生成好的 OpenApi 进行自定义操作 + */ + @Bean + public OpenApiCustomizer openApiCustomizer() { + String contextPath = serverProperties.getServlet().getContextPath(); + String finalContextPath; + if (StringUtils.isBlank(contextPath) || "/".equals(contextPath)) { + finalContextPath = ""; + } else { + finalContextPath = contextPath; + } + // 对所有路径增加前置上下文路径 + return openApi -> { + Paths oldPaths = openApi.getPaths(); + if (oldPaths instanceof PlusPaths) { + return; + } + PlusPaths newPaths = new PlusPaths(); + oldPaths.forEach((k, v) -> newPaths.addPathItem(finalContextPath + k, v)); + openApi.setPaths(newPaths); + }; + } + + /** + * 单独使用一个类便于判断 解决springdoc路径拼接重复问题 + * + * @author Lion Li + */ + static class PlusPaths extends Paths { + + public PlusPaths() { + super(); + } + } + +} diff --git a/aibidding-common/aibidding-common-doc/src/main/java/org/aibidding/common/doc/config/properties/SwaggerProperties.java b/aibidding-common/aibidding-common-doc/src/main/java/org/aibidding/common/doc/config/properties/SwaggerProperties.java new file mode 100644 index 0000000..9d87a31 --- /dev/null +++ b/aibidding-common/aibidding-common-doc/src/main/java/org/aibidding/common/doc/config/properties/SwaggerProperties.java @@ -0,0 +1,94 @@ +package org.aibidding.common.doc.config.properties; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.ExternalDocumentation; +import io.swagger.v3.oas.models.Paths; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.tags.Tag; +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; + +import java.util.List; + +/** + * swagger 配置属性 + * + * @author Lion Li + */ +@Data +@ConfigurationProperties(prefix = "swagger") +public class SwaggerProperties { + + /** + * 文档基本信息 + */ + @NestedConfigurationProperty + private InfoProperties info = new InfoProperties(); + + /** + * 扩展文档地址 + */ + @NestedConfigurationProperty + private ExternalDocumentation externalDocs; + + /** + * 标签 + */ + private List tags = null; + + /** + * 路径 + */ + @NestedConfigurationProperty + private Paths paths = null; + + /** + * 组件 + */ + @NestedConfigurationProperty + private Components components = null; + + /** + *

+ * 文档的基础属性信息 + *

+ * + * @see io.swagger.v3.oas.models.info.Info + * + * 为了 springboot 自动生产配置提示信息,所以这里复制一个类出来 + */ + @Data + public static class InfoProperties { + + /** + * 标题 + */ + private String title = null; + + /** + * 描述 + */ + private String description = null; + + /** + * 联系人信息 + */ + @NestedConfigurationProperty + private Contact contact = null; + + /** + * 许可证 + */ + @NestedConfigurationProperty + private License license = null; + + /** + * 版本 + */ + private String version = null; + + } + +} diff --git a/aibidding-common/aibidding-common-doc/src/main/java/org/aibidding/common/doc/handler/OpenApiHandler.java b/aibidding-common/aibidding-common-doc/src/main/java/org/aibidding/common/doc/handler/OpenApiHandler.java new file mode 100644 index 0000000..b456606 --- /dev/null +++ b/aibidding-common/aibidding-common-doc/src/main/java/org/aibidding/common/doc/handler/OpenApiHandler.java @@ -0,0 +1,252 @@ +package org.aibidding.common.doc.handler; + +import cn.hutool.core.io.IoUtil; +import io.swagger.v3.core.jackson.TypeNameResolver; +import io.swagger.v3.core.util.AnnotationsUtils; +import io.swagger.v3.oas.annotations.tags.Tags; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.Paths; +import io.swagger.v3.oas.models.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springdoc.core.customizers.OpenApiBuilderCustomizer; +import org.springdoc.core.customizers.ServerBaseUrlCustomizer; +import org.springdoc.core.properties.SpringDocConfigProperties; +import org.springdoc.core.providers.JavadocProvider; +import org.springdoc.core.service.OpenAPIService; +import org.springdoc.core.service.SecurityService; +import org.springdoc.core.utils.PropertyResolverUtils; +import org.springframework.context.ApplicationContext; +import org.springframework.core.annotation.AnnotatedElementUtils; +import org.springframework.util.CollectionUtils; +import org.springframework.web.method.HandlerMethod; + +import java.io.StringReader; +import java.lang.reflect.Method; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 自定义 openapi 处理器 + * 对源码功能进行修改 增强使用 + */ +@Slf4j +@SuppressWarnings("all") +public class OpenApiHandler extends OpenAPIService { + + /** + * The Basic error controller. + */ + private static Class basicErrorController; + + /** + * The Security parser. + */ + private final SecurityService securityParser; + + /** + * The Mappings map. + */ + private final Map mappingsMap = new HashMap<>(); + + /** + * The Springdoc tags. + */ + private final Map springdocTags = new HashMap<>(); + + /** + * The Open api builder customisers. + */ + private final Optional> openApiBuilderCustomisers; + + /** + * The server base URL customisers. + */ + private final Optional> serverBaseUrlCustomizers; + + /** + * The Spring doc config properties. + */ + private final SpringDocConfigProperties springDocConfigProperties; + + /** + * The Cached open api map. + */ + private final Map cachedOpenAPI = new HashMap<>(); + + /** + * The Property resolver utils. + */ + private final PropertyResolverUtils propertyResolverUtils; + + /** + * The javadoc provider. + */ + private final Optional javadocProvider; + + /** + * The Context. + */ + private ApplicationContext context; + + /** + * The Open api. + */ + private OpenAPI openAPI; + + /** + * The Is servers present. + */ + private boolean isServersPresent; + + /** + * The Server base url. + */ + private String serverBaseUrl; + + /** + * Instantiates a new Open api builder. + * + * @param openAPI the open api + * @param securityParser the security parser + * @param springDocConfigProperties the spring doc config properties + * @param propertyResolverUtils the property resolver utils + * @param openApiBuilderCustomizers the open api builder customisers + * @param serverBaseUrlCustomizers the server base url customizers + * @param javadocProvider the javadoc provider + */ + public OpenApiHandler(Optional openAPI, SecurityService securityParser, + SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils, + Optional> openApiBuilderCustomizers, + Optional> serverBaseUrlCustomizers, + Optional javadocProvider) { + super(openAPI, securityParser, springDocConfigProperties, propertyResolverUtils, openApiBuilderCustomizers, serverBaseUrlCustomizers, javadocProvider); + if (openAPI.isPresent()) { + this.openAPI = openAPI.get(); + if (this.openAPI.getComponents() == null) + this.openAPI.setComponents(new Components()); + if (this.openAPI.getPaths() == null) + this.openAPI.setPaths(new Paths()); + if (!CollectionUtils.isEmpty(this.openAPI.getServers())) + this.isServersPresent = true; + } + this.propertyResolverUtils = propertyResolverUtils; + this.securityParser = securityParser; + this.springDocConfigProperties = springDocConfigProperties; + this.openApiBuilderCustomisers = openApiBuilderCustomizers; + this.serverBaseUrlCustomizers = serverBaseUrlCustomizers; + this.javadocProvider = javadocProvider; + if (springDocConfigProperties.isUseFqn()) + TypeNameResolver.std.setUseFqn(true); + } + + @Override + public Operation buildTags(HandlerMethod handlerMethod, Operation operation, OpenAPI openAPI, Locale locale) { + + Set tags = new HashSet<>(); + Set tagsStr = new HashSet<>(); + + buildTagsFromMethod(handlerMethod.getMethod(), tags, tagsStr, locale); + buildTagsFromClass(handlerMethod.getBeanType(), tags, tagsStr, locale); + + if (!CollectionUtils.isEmpty(tagsStr)) + tagsStr = tagsStr.stream() + .map(str -> propertyResolverUtils.resolve(str, locale)) + .collect(Collectors.toSet()); + + if (springdocTags.containsKey(handlerMethod)) { + Tag tag = springdocTags.get(handlerMethod); + tagsStr.add(tag.getName()); + if (openAPI.getTags() == null || !openAPI.getTags().contains(tag)) { + openAPI.addTagsItem(tag); + } + } + + if (!CollectionUtils.isEmpty(tagsStr)) { + if (CollectionUtils.isEmpty(operation.getTags())) + operation.setTags(new ArrayList<>(tagsStr)); + else { + Set operationTagsSet = new HashSet<>(operation.getTags()); + operationTagsSet.addAll(tagsStr); + operation.getTags().clear(); + operation.getTags().addAll(operationTagsSet); + } + } + + if (isAutoTagClasses(operation)) { + + + if (javadocProvider.isPresent()) { + String description = javadocProvider.get().getClassJavadoc(handlerMethod.getBeanType()); + if (StringUtils.isNotBlank(description)) { + Tag tag = new Tag(); + + // 自定义部分 修改使用java注释当tag名 + List list = IoUtil.readLines(new StringReader(description), new ArrayList<>()); + // tag.setName(tagAutoName); + tag.setName(list.get(0)); + operation.addTagsItem(list.get(0)); + + tag.setDescription(description); + if (openAPI.getTags() == null || !openAPI.getTags().contains(tag)) { + openAPI.addTagsItem(tag); + } + } + } else { + String tagAutoName = splitCamelCase(handlerMethod.getBeanType().getSimpleName()); + operation.addTagsItem(tagAutoName); + } + } + + if (!CollectionUtils.isEmpty(tags)) { + // Existing tags + List openApiTags = openAPI.getTags(); + if (!CollectionUtils.isEmpty(openApiTags)) + tags.addAll(openApiTags); + openAPI.setTags(new ArrayList<>(tags)); + } + + // Handle SecurityRequirement at operation level + io.swagger.v3.oas.annotations.security.SecurityRequirement[] securityRequirements = securityParser + .getSecurityRequirements(handlerMethod); + if (securityRequirements != null) { + if (securityRequirements.length == 0) + operation.setSecurity(Collections.emptyList()); + else + securityParser.buildSecurityRequirement(securityRequirements, operation); + } + + return operation; + } + + private void buildTagsFromMethod(Method method, Set tags, Set tagsStr, Locale locale) { + // method tags + Set tagsSet = AnnotatedElementUtils + .findAllMergedAnnotations(method, Tags.class); + Set methodTags = tagsSet.stream() + .flatMap(x -> Stream.of(x.value())).collect(Collectors.toSet()); + methodTags.addAll(AnnotatedElementUtils.findAllMergedAnnotations(method, io.swagger.v3.oas.annotations.tags.Tag.class)); + if (!CollectionUtils.isEmpty(methodTags)) { + tagsStr.addAll(methodTags.stream().map(tag -> propertyResolverUtils.resolve(tag.name(), locale)).collect(Collectors.toSet())); + List allTags = new ArrayList<>(methodTags); + addTags(allTags, tags, locale); + } + } + + private void addTags(List sourceTags, Set tags, Locale locale) { + Optional> optionalTagSet = AnnotationsUtils + .getTags(sourceTags.toArray(new io.swagger.v3.oas.annotations.tags.Tag[0]), true); + optionalTagSet.ifPresent(tagsSet -> { + tagsSet.forEach(tag -> { + tag.name(propertyResolverUtils.resolve(tag.getName(), locale)); + tag.description(propertyResolverUtils.resolve(tag.getDescription(), locale)); + if (tags.stream().noneMatch(t -> t.getName().equals(tag.getName()))) + tags.add(tag); + }); + }); + } + +} diff --git a/aibidding-common/aibidding-common-doc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-doc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..47b2dd1 --- /dev/null +++ b/aibidding-common/aibidding-common-doc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.aibidding.common.doc.config.SwaggerConfig diff --git a/aibidding-common/aibidding-common-encrypt/pom.xml b/aibidding-common/aibidding-common-encrypt/pom.xml new file mode 100644 index 0000000..0fcab2e --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/pom.xml @@ -0,0 +1,43 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-encrypt + + + ruoyi-common-encrypt 数据加解密模块 + + + + + + org.ruoyi + aibidding-common-core + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + + + + org.bouncycastle + bcprov-jdk15to18 + + + + cn.hutool + hutool-crypto + + + + + diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/annotation/EncryptField.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/annotation/EncryptField.java new file mode 100644 index 0000000..1e9d7b1 --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/annotation/EncryptField.java @@ -0,0 +1,44 @@ +package org.aibidding.common.encrypt.annotation; + +import org.aibidding.common.encrypt.enumd.AlgorithmType; +import org.aibidding.common.encrypt.enumd.EncodeType; + +import java.lang.annotation.*; + +/** + * 字段加密注解 + * + * @author 老马 + */ +@Documented +@Inherited +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface EncryptField { + + /** + * 加密算法 + */ + AlgorithmType algorithm() default AlgorithmType.DEFAULT; + + /** + * 秘钥。AES、SM4需要 + */ + String password() default ""; + + /** + * 公钥。RSA、SM2需要 + */ + String publicKey() default ""; + + /** + * 公钥。RSA、SM2需要 + */ + String privateKey() default ""; + + /** + * 编码方式。对加密算法为BASE64的不起作用 + */ + EncodeType encode() default EncodeType.DEFAULT; + +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/config/EncryptorAutoConfiguration.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/config/EncryptorAutoConfiguration.java new file mode 100644 index 0000000..f513a4d --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/config/EncryptorAutoConfiguration.java @@ -0,0 +1,41 @@ +package org.aibidding.common.encrypt.config; + +import org.aibidding.common.encrypt.core.EncryptorManager; +import org.aibidding.common.encrypt.interceptor.MybatisDecryptInterceptor; +import org.aibidding.common.encrypt.interceptor.MybatisEncryptInterceptor; +import org.aibidding.common.encrypt.properties.EncryptorProperties; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; + +/** + * 加解密配置 + * + * @author 老马 + * @version 4.6.0 + */ +@AutoConfiguration +@EnableConfigurationProperties(EncryptorProperties.class) +@ConditionalOnProperty(value = "mybatis-encryptor.enable", havingValue = "true") +public class EncryptorAutoConfiguration { + + @Autowired + private EncryptorProperties properties; + + @Bean + public EncryptorManager encryptorManager() { + return new EncryptorManager(); + } + + @Bean + public MybatisEncryptInterceptor mybatisEncryptInterceptor(EncryptorManager encryptorManager) { + return new MybatisEncryptInterceptor(encryptorManager, properties); + } + + @Bean + public MybatisDecryptInterceptor mybatisDecryptInterceptor(EncryptorManager encryptorManager) { + return new MybatisDecryptInterceptor(encryptorManager, properties); + } +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/EncryptContext.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/EncryptContext.java new file mode 100644 index 0000000..e8090c5 --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/EncryptContext.java @@ -0,0 +1,41 @@ +package org.aibidding.common.encrypt.core; + +import lombok.Data; +import org.aibidding.common.encrypt.enumd.AlgorithmType; +import org.aibidding.common.encrypt.enumd.EncodeType; + +/** + * 加密上下文 用于encryptor传递必要的参数。 + * + * @author 老马 + * @version 4.6.0 + */ +@Data +public class EncryptContext { + + /** + * 默认算法 + */ + private AlgorithmType algorithm; + + /** + * 安全秘钥 + */ + private String password; + + /** + * 公钥 + */ + private String publicKey; + + /** + * 私钥 + */ + private String privateKey; + + /** + * 编码方式,base64/hex + */ + private EncodeType encode; + +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/EncryptorManager.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/EncryptorManager.java new file mode 100644 index 0000000..5e9bbac --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/EncryptorManager.java @@ -0,0 +1,94 @@ +package org.aibidding.common.encrypt.core; + +import cn.hutool.core.util.ReflectUtil; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.encrypt.annotation.EncryptField; + +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +/** + * 加密管理类 + * + * @author 老马 + * @version 4.6.0 + */ +@Slf4j +public class EncryptorManager { + + /** + * 缓存加密器 + */ + Map encryptorMap = new ConcurrentHashMap<>(); + + /** + * 类加密字段缓存 + */ + Map, Set> fieldCache = new ConcurrentHashMap<>(); + + /** + * 获取类加密字段缓存 + */ + public Set getFieldCache(Class sourceClazz) { + return fieldCache.computeIfAbsent(sourceClazz, clazz -> { + Field[] declaredFields = clazz.getDeclaredFields(); + Set fieldSet = Arrays.stream(declaredFields).filter(field -> + field.isAnnotationPresent(EncryptField.class) && field.getType() == String.class) + .collect(Collectors.toSet()); + for (Field field : fieldSet) { + field.setAccessible(true); + } + return fieldSet; + }); + } + + /** + * 注册加密执行者到缓存 + * + * @param encryptContext 加密执行者需要的相关配置参数 + */ + public IEncryptor registAndGetEncryptor(EncryptContext encryptContext) { + if (encryptorMap.containsKey(encryptContext)) { + return encryptorMap.get(encryptContext); + } + IEncryptor encryptor = ReflectUtil.newInstance(encryptContext.getAlgorithm().getClazz(), encryptContext); + encryptorMap.put(encryptContext, encryptor); + return encryptor; + } + + /** + * 移除缓存中的加密执行者 + * + * @param encryptContext 加密执行者需要的相关配置参数 + */ + public void removeEncryptor(EncryptContext encryptContext) { + this.encryptorMap.remove(encryptContext); + } + + /** + * 根据配置进行加密。会进行本地缓存对应的算法和对应的秘钥信息。 + * + * @param value 待加密的值 + * @param encryptContext 加密相关的配置信息 + */ + public String encrypt(String value, EncryptContext encryptContext) { + IEncryptor encryptor = this.registAndGetEncryptor(encryptContext); + return encryptor.encrypt(value, encryptContext.getEncode()); + } + + /** + * 根据配置进行解密 + * + * @param value 待解密的值 + * @param encryptContext 加密相关的配置信息 + */ + public String decrypt(String value, EncryptContext encryptContext) { + IEncryptor encryptor = this.registAndGetEncryptor(encryptContext); + return encryptor.decrypt(value); + } + +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/IEncryptor.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/IEncryptor.java new file mode 100644 index 0000000..38727b3 --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/IEncryptor.java @@ -0,0 +1,35 @@ +package org.aibidding.common.encrypt.core; + +import org.aibidding.common.encrypt.enumd.AlgorithmType; +import org.aibidding.common.encrypt.enumd.EncodeType; + +/** + * 加解者 + * + * @author 老马 + * @version 4.6.0 + */ +public interface IEncryptor { + + /** + * 获得当前算法 + */ + AlgorithmType algorithm(); + + /** + * 加密 + * + * @param value 待加密字符串 + * @param encodeType 加密后的编码格式 + * @return 加密后的字符串 + */ + String encrypt(String value, EncodeType encodeType); + + /** + * 解密 + * + * @param value 待加密字符串 + * @return 解密后的字符串 + */ + String decrypt(String value); +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/AbstractEncryptor.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/AbstractEncryptor.java new file mode 100644 index 0000000..93dea5d --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/AbstractEncryptor.java @@ -0,0 +1,18 @@ +package org.aibidding.common.encrypt.core.encryptor; + +import org.aibidding.common.encrypt.core.EncryptContext; +import org.aibidding.common.encrypt.core.IEncryptor; + +/** + * 所有加密执行者的基类 + * + * @author 老马 + * @version 4.6.0 + */ +public abstract class AbstractEncryptor implements IEncryptor { + + public AbstractEncryptor(EncryptContext context) { + // 用户配置校验与配置注入 + } + +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/AesEncryptor.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/AesEncryptor.java new file mode 100644 index 0000000..63e0a98 --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/AesEncryptor.java @@ -0,0 +1,69 @@ +package org.aibidding.common.encrypt.core.encryptor; + +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.crypto.SecureUtil; +import cn.hutool.crypto.symmetric.AES; +import org.aibidding.common.encrypt.core.EncryptContext; +import org.aibidding.common.encrypt.enumd.AlgorithmType; +import org.aibidding.common.encrypt.enumd.EncodeType; + +import java.nio.charset.StandardCharsets; + +/** + * AES算法实现 + * + * @author 老马 + * @version 4.6.0 + */ +public class AesEncryptor extends AbstractEncryptor { + + private final AES aes; + + public AesEncryptor(EncryptContext context) { + super(context); + String password = context.getPassword(); + if (StrUtil.isBlank(password)) { + throw new IllegalArgumentException("AES没有获得秘钥信息"); + } + // aes算法的秘钥要求是16位、24位、32位 + int[] array = {16, 24, 32}; + if (!ArrayUtil.contains(array, password.length())) { + throw new IllegalArgumentException("AES秘钥长度应该为16位、24位、32位,实际为" + password.length() + "位"); + } + aes = SecureUtil.aes(context.getPassword().getBytes(StandardCharsets.UTF_8)); + } + + /** + * 获得当前算法 + */ + @Override + public AlgorithmType algorithm() { + return AlgorithmType.AES; + } + + /** + * 加密 + * + * @param value 待加密字符串 + * @param encodeType 加密后的编码格式 + */ + @Override + public String encrypt(String value, EncodeType encodeType) { + if (encodeType == EncodeType.HEX) { + return aes.encryptHex(value); + } else { + return aes.encryptBase64(value); + } + } + + /** + * 解密 + * + * @param value 待加密字符串 + */ + @Override + public String decrypt(String value) { + return this.aes.decryptStr(value); + } +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/Base64Encryptor.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/Base64Encryptor.java new file mode 100644 index 0000000..1dfa145 --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/Base64Encryptor.java @@ -0,0 +1,48 @@ +package org.aibidding.common.encrypt.core.encryptor; + +import cn.hutool.core.codec.Base64; +import org.aibidding.common.encrypt.core.EncryptContext; +import org.aibidding.common.encrypt.enumd.AlgorithmType; +import org.aibidding.common.encrypt.enumd.EncodeType; + +/** + * Base64算法实现 + * + * @author 老马 + * @version 4.6.0 + */ +public class Base64Encryptor extends AbstractEncryptor { + + public Base64Encryptor(EncryptContext context) { + super(context); + } + + /** + * 获得当前算法 + */ + @Override + public AlgorithmType algorithm() { + return AlgorithmType.BASE64; + } + + /** + * 加密 + * + * @param value 待加密字符串 + * @param encodeType 加密后的编码格式 + */ + @Override + public String encrypt(String value, EncodeType encodeType) { + return Base64.encode(value); + } + + /** + * 解密 + * + * @param value 待加密字符串 + */ + @Override + public String decrypt(String value) { + return Base64.decodeStr(value); + } +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/RsaEncryptor.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/RsaEncryptor.java new file mode 100644 index 0000000..0323f0c --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/RsaEncryptor.java @@ -0,0 +1,65 @@ +package org.aibidding.common.encrypt.core.encryptor; + +import cn.hutool.core.codec.Base64; +import cn.hutool.crypto.SecureUtil; +import cn.hutool.crypto.asymmetric.KeyType; +import cn.hutool.crypto.asymmetric.RSA; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.encrypt.core.EncryptContext; +import org.aibidding.common.encrypt.enumd.AlgorithmType; +import org.aibidding.common.encrypt.enumd.EncodeType; + + +/** + * RSA算法实现 + * + * @author 老马 + * @version 4.6.0 + */ +public class RsaEncryptor extends AbstractEncryptor { + + private final RSA rsa; + + public RsaEncryptor(EncryptContext context) { + super(context); + String privateKey = context.getPrivateKey(); + String publicKey = context.getPublicKey(); + if (StringUtils.isAnyEmpty(privateKey, publicKey)) { + throw new IllegalArgumentException("RSA公私钥均需要提供,公钥加密,私钥解密。"); + } + this.rsa = SecureUtil.rsa(Base64.decode(privateKey), Base64.decode(publicKey)); + } + + /** + * 获得当前算法 + */ + @Override + public AlgorithmType algorithm() { + return AlgorithmType.RSA; + } + + /** + * 加密 + * + * @param value 待加密字符串 + * @param encodeType 加密后的编码格式 + */ + @Override + public String encrypt(String value, EncodeType encodeType) { + if (encodeType == EncodeType.HEX) { + return rsa.encryptHex(value, KeyType.PublicKey); + } else { + return rsa.encryptBase64(value, KeyType.PublicKey); + } + } + + /** + * 解密 + * + * @param value 待加密字符串 + */ + @Override + public String decrypt(String value) { + return this.rsa.decryptStr(value, KeyType.PrivateKey); + } +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/Sm2Encryptor.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/Sm2Encryptor.java new file mode 100644 index 0000000..98e7a6f --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/Sm2Encryptor.java @@ -0,0 +1,64 @@ +package org.aibidding.common.encrypt.core.encryptor; + +import cn.hutool.core.codec.Base64; +import cn.hutool.crypto.SmUtil; +import cn.hutool.crypto.asymmetric.KeyType; +import cn.hutool.crypto.asymmetric.SM2; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.encrypt.core.EncryptContext; +import org.aibidding.common.encrypt.enumd.AlgorithmType; +import org.aibidding.common.encrypt.enumd.EncodeType; + +/** + * sm2算法实现 + * + * @author 老马 + * @version 4.6.0 + */ +public class Sm2Encryptor extends AbstractEncryptor { + + private final SM2 sm2; + + public Sm2Encryptor(EncryptContext context) { + super(context); + String privateKey = context.getPrivateKey(); + String publicKey = context.getPublicKey(); + if (StringUtils.isAnyEmpty(privateKey, publicKey)) { + throw new IllegalArgumentException("SM2公私钥均需要提供,公钥加密,私钥解密。"); + } + this.sm2 = SmUtil.sm2(Base64.decode(privateKey), Base64.decode(publicKey)); + } + + /** + * 获得当前算法 + */ + @Override + public AlgorithmType algorithm() { + return AlgorithmType.SM2; + } + + /** + * 加密 + * + * @param value 待加密字符串 + * @param encodeType 加密后的编码格式 + */ + @Override + public String encrypt(String value, EncodeType encodeType) { + if (encodeType == EncodeType.HEX) { + return sm2.encryptHex(value, KeyType.PublicKey); + } else { + return sm2.encryptBase64(value, KeyType.PublicKey); + } + } + + /** + * 解密 + * + * @param value 待加密字符串 + */ + @Override + public String decrypt(String value) { + return this.sm2.decryptStr(value, KeyType.PrivateKey); + } +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/Sm4Encryptor.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/Sm4Encryptor.java new file mode 100644 index 0000000..b677376 --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/core/encryptor/Sm4Encryptor.java @@ -0,0 +1,67 @@ +package org.aibidding.common.encrypt.core.encryptor; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.crypto.SmUtil; +import cn.hutool.crypto.symmetric.SM4; +import org.aibidding.common.encrypt.core.EncryptContext; +import org.aibidding.common.encrypt.enumd.AlgorithmType; +import org.aibidding.common.encrypt.enumd.EncodeType; + +import java.nio.charset.StandardCharsets; + +/** + * sm4算法实现 + * + * @author 老马 + * @version 4.6.0 + */ +public class Sm4Encryptor extends AbstractEncryptor { + + private final SM4 sm4; + + public Sm4Encryptor(EncryptContext context) { + super(context); + String password = context.getPassword(); + if (StrUtil.isBlank(password)) { + throw new IllegalArgumentException("SM4没有获得秘钥信息"); + } + // sm4算法的秘钥要求是16位长度 + if (16 != password.length()) { + throw new IllegalArgumentException("SM4秘钥长度应该为16位,实际为" + password.length() + "位"); + } + this.sm4 = SmUtil.sm4(password.getBytes(StandardCharsets.UTF_8)); + } + + /** + * 获得当前算法 + */ + @Override + public AlgorithmType algorithm() { + return AlgorithmType.SM4; + } + + /** + * 加密 + * + * @param value 待加密字符串 + * @param encodeType 加密后的编码格式 + */ + @Override + public String encrypt(String value, EncodeType encodeType) { + if (encodeType == EncodeType.HEX) { + return sm4.encryptHex(value); + } else { + return sm4.encryptBase64(value); + } + } + + /** + * 解密 + * + * @param value 待加密字符串 + */ + @Override + public String decrypt(String value) { + return this.sm4.decryptStr(value); + } +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/enumd/AlgorithmType.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/enumd/AlgorithmType.java new file mode 100644 index 0000000..27d160a --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/enumd/AlgorithmType.java @@ -0,0 +1,48 @@ +package org.aibidding.common.encrypt.enumd; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.aibidding.common.encrypt.core.encryptor.*; + +/** + * 算法名称 + * + * @author 老马 + * @version 4.6.0 + */ +@Getter +@AllArgsConstructor +public enum AlgorithmType { + + /** + * 默认走yml配置 + */ + DEFAULT(null), + + /** + * base64 + */ + BASE64(Base64Encryptor.class), + + /** + * aes + */ + AES(AesEncryptor.class), + + /** + * rsa + */ + RSA(RsaEncryptor.class), + + /** + * sm2 + */ + SM2(Sm2Encryptor.class), + + /** + * sm4 + */ + SM4(Sm4Encryptor.class); + + private final Class clazz; +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/enumd/EncodeType.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/enumd/EncodeType.java new file mode 100644 index 0000000..2a6ddfd --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/enumd/EncodeType.java @@ -0,0 +1,26 @@ +package org.aibidding.common.encrypt.enumd; + +/** + * 编码类型 + * + * @author 老马 + * @version 4.6.0 + */ +public enum EncodeType { + + /** + * 默认使用yml配置 + */ + DEFAULT, + + /** + * base64编码 + */ + BASE64, + + /** + * 16进制编码 + */ + HEX; + +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/interceptor/MybatisDecryptInterceptor.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/interceptor/MybatisDecryptInterceptor.java new file mode 100644 index 0000000..fe44f2e --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/interceptor/MybatisDecryptInterceptor.java @@ -0,0 +1,115 @@ +package org.aibidding.common.encrypt.interceptor; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.executor.resultset.ResultSetHandler; +import org.apache.ibatis.plugin.*; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.encrypt.annotation.EncryptField; +import org.aibidding.common.encrypt.core.EncryptContext; +import org.aibidding.common.encrypt.core.EncryptorManager; +import org.aibidding.common.encrypt.enumd.AlgorithmType; +import org.aibidding.common.encrypt.enumd.EncodeType; +import org.aibidding.common.encrypt.properties.EncryptorProperties; + +import java.lang.reflect.Field; +import java.sql.Statement; +import java.util.*; + +/** + * 出参解密拦截器 + * + * @author 老马 + * @version 4.6.0 + */ +@Slf4j +@Intercepts({@Signature( + type = ResultSetHandler.class, + method = "handleResultSets", + args = {Statement.class}) +}) +@AllArgsConstructor +public class MybatisDecryptInterceptor implements Interceptor { + + private final EncryptorManager encryptorManager; + private final EncryptorProperties defaultProperties; + + @Override + public Object intercept(Invocation invocation) throws Throwable { + // 获取执行mysql执行结果 + Object result = invocation.proceed(); + if (result == null) { + return null; + } + decryptHandler(result); + return result; + } + + /** + * 解密对象 + * + * @param sourceObject 待加密对象 + */ + private void decryptHandler(Object sourceObject) { + if (ObjectUtil.isNull(sourceObject)) { + return; + } + if (sourceObject instanceof Map map) { + new HashSet<>(map.values()).forEach(this::decryptHandler); + return; + } + if (sourceObject instanceof List list) { + if(CollUtil.isEmpty(list)) { + return; + } + // 判断第一个元素是否含有注解。如果没有直接返回,提高效率 + Object firstItem = list.get(0); + if (ObjectUtil.isNull(firstItem) || CollUtil.isEmpty(encryptorManager.getFieldCache(firstItem.getClass()))) { + return; + } + list.forEach(this::decryptHandler); + return; + } + Set fields = encryptorManager.getFieldCache(sourceObject.getClass()); + try { + for (Field field : fields) { + field.set(sourceObject, this.decryptField(String.valueOf(field.get(sourceObject)), field)); + } + } catch (Exception e) { + log.error("处理解密字段时出错", e); + } + } + + /** + * 字段值进行加密。通过字段的批注注册新的加密算法 + * + * @param value 待加密的值 + * @param field 待加密字段 + * @return 加密后结果 + */ + private String decryptField(String value, Field field) { + if (ObjectUtil.isNull(value)) { + return null; + } + EncryptField encryptField = field.getAnnotation(EncryptField.class); + EncryptContext encryptContext = new EncryptContext(); + encryptContext.setAlgorithm(encryptField.algorithm() == AlgorithmType.DEFAULT ? defaultProperties.getAlgorithm() : encryptField.algorithm()); + encryptContext.setEncode(encryptField.encode() == EncodeType.DEFAULT ? defaultProperties.getEncode() : encryptField.encode()); + encryptContext.setPassword(StringUtils.isBlank(encryptField.password()) ? defaultProperties.getPassword() : encryptField.password()); + encryptContext.setPrivateKey(StringUtils.isBlank(encryptField.privateKey()) ? defaultProperties.getPrivateKey() : encryptField.privateKey()); + encryptContext.setPublicKey(StringUtils.isBlank(encryptField.publicKey()) ? defaultProperties.getPublicKey() : encryptField.publicKey()); + return this.encryptorManager.decrypt(value, encryptContext); + } + + @Override + public Object plugin(Object target) { + return Plugin.wrap(target, this); + } + + @Override + public void setProperties(Properties properties) { + + } +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/interceptor/MybatisEncryptInterceptor.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/interceptor/MybatisEncryptInterceptor.java new file mode 100644 index 0000000..8e1b60d --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/interceptor/MybatisEncryptInterceptor.java @@ -0,0 +1,119 @@ +package org.aibidding.common.encrypt.interceptor; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.executor.parameter.ParameterHandler; +import org.apache.ibatis.plugin.Interceptor; +import org.apache.ibatis.plugin.Intercepts; +import org.apache.ibatis.plugin.Invocation; +import org.apache.ibatis.plugin.Signature; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.encrypt.annotation.EncryptField; +import org.aibidding.common.encrypt.core.EncryptContext; +import org.aibidding.common.encrypt.core.EncryptorManager; +import org.aibidding.common.encrypt.enumd.AlgorithmType; +import org.aibidding.common.encrypt.enumd.EncodeType; +import org.aibidding.common.encrypt.properties.EncryptorProperties; + +import java.lang.reflect.Field; +import java.sql.PreparedStatement; +import java.util.*; + +/** + * 入参加密拦截器 + * + * @author 老马 + * @version 4.6.0 + */ +@Slf4j +@Intercepts({@Signature( + type = ParameterHandler.class, + method = "setParameters", + args = {PreparedStatement.class}) +}) +@AllArgsConstructor +public class MybatisEncryptInterceptor implements Interceptor { + + private final EncryptorManager encryptorManager; + private final EncryptorProperties defaultProperties; + + @Override + public Object intercept(Invocation invocation) throws Throwable { + return invocation; + } + + @Override + public Object plugin(Object target) { + if (target instanceof ParameterHandler parameterHandler) { + // 进行加密操作 + Object parameterObject = parameterHandler.getParameterObject(); + if (ObjectUtil.isNotNull(parameterObject) && !(parameterObject instanceof String)) { + this.encryptHandler(parameterObject); + } + } + return target; + } + + /** + * 加密对象 + * + * @param sourceObject 待加密对象 + */ + private void encryptHandler(Object sourceObject) { + if (ObjectUtil.isNull(sourceObject)) { + return; + } + if (sourceObject instanceof Map map) { + new HashSet<>(map.values()).forEach(this::encryptHandler); + return; + } + if (sourceObject instanceof List list) { + if(CollUtil.isEmpty(list)) { + return; + } + // 判断第一个元素是否含有注解。如果没有直接返回,提高效率 + Object firstItem = list.get(0); + if (ObjectUtil.isNull(firstItem) || CollUtil.isEmpty(encryptorManager.getFieldCache(firstItem.getClass()))) { + return; + } + list.forEach(this::encryptHandler); + return; + } + Set fields = encryptorManager.getFieldCache(sourceObject.getClass()); + try { + for (Field field : fields) { + field.set(sourceObject, this.encryptField(String.valueOf(field.get(sourceObject)), field)); + } + } catch (Exception e) { + log.error("处理加密字段时出错", e); + } + } + + /** + * 字段值进行加密。通过字段的批注注册新的加密算法 + * + * @param value 待加密的值 + * @param field 待加密字段 + * @return 加密后结果 + */ + private String encryptField(String value, Field field) { + if (ObjectUtil.isNull(value)) { + return null; + } + EncryptField encryptField = field.getAnnotation(EncryptField.class); + EncryptContext encryptContext = new EncryptContext(); + encryptContext.setAlgorithm(encryptField.algorithm() == AlgorithmType.DEFAULT ? defaultProperties.getAlgorithm() : encryptField.algorithm()); + encryptContext.setEncode(encryptField.encode() == EncodeType.DEFAULT ? defaultProperties.getEncode() : encryptField.encode()); + encryptContext.setPassword(StringUtils.isBlank(encryptField.password()) ? defaultProperties.getPassword() : encryptField.password()); + encryptContext.setPrivateKey(StringUtils.isBlank(encryptField.privateKey()) ? defaultProperties.getPrivateKey() : encryptField.privateKey()); + encryptContext.setPublicKey(StringUtils.isBlank(encryptField.publicKey()) ? defaultProperties.getPublicKey() : encryptField.publicKey()); + return this.encryptorManager.encrypt(value, encryptContext); + } + + + @Override + public void setProperties(Properties properties) { + } +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/properties/EncryptorProperties.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/properties/EncryptorProperties.java new file mode 100644 index 0000000..3bb2219 --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/properties/EncryptorProperties.java @@ -0,0 +1,48 @@ +package org.aibidding.common.encrypt.properties; + +import lombok.Data; +import org.aibidding.common.encrypt.enumd.AlgorithmType; +import org.aibidding.common.encrypt.enumd.EncodeType; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * 加解密属性配置类 + * + * @author 老马 + * @version 4.6.0 + */ +@Data +@ConfigurationProperties(prefix = "mybatis-encryptor") +public class EncryptorProperties { + + /** + * 过滤开关 + */ + private Boolean enable; + + /** + * 默认算法 + */ + private AlgorithmType algorithm; + + /** + * 安全秘钥 + */ + private String password; + + /** + * 公钥 + */ + private String publicKey; + + /** + * 私钥 + */ + private String privateKey; + + /** + * 编码方式,base64/hex + */ + private EncodeType encode; + +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/utils/EncryptUtils.java b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/utils/EncryptUtils.java new file mode 100644 index 0000000..4fe483e --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/java/org/aibidding/common/encrypt/utils/EncryptUtils.java @@ -0,0 +1,243 @@ +package org.aibidding.common.encrypt.utils; + +import cn.hutool.core.codec.Base64; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.crypto.SecureUtil; +import cn.hutool.crypto.SmUtil; +import cn.hutool.crypto.asymmetric.KeyType; +import cn.hutool.crypto.asymmetric.RSA; +import cn.hutool.crypto.asymmetric.SM2; + +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; + +/** + * 安全相关工具类 + * + * @author 老马 + */ +public class EncryptUtils { + /** + * 公钥 + */ + public static final String PUBLIC_KEY = "publicKey"; + /** + * 私钥 + */ + public static final String PRIVATE_KEY = "privateKey"; + + /** + * Base64加密 + * + * @param data 待加密数据 + * @return 加密后字符串 + */ + public static String encryptByBase64(String data) { + return Base64.encode(data, StandardCharsets.UTF_8); + } + + /** + * Base64解密 + * + * @param data 待解密数据 + * @return 解密后字符串 + */ + public static String decryptByBase64(String data) { + return Base64.decodeStr(data, StandardCharsets.UTF_8); + } + + /** + * AES加密 + * + * @param data 待解密数据 + * @param password 秘钥字符串 + * @return 加密后字符串, 采用Base64编码 + */ + public static String encryptByAes(String data, String password) { + if (StrUtil.isBlank(password)) { + throw new IllegalArgumentException("AES需要传入秘钥信息"); + } + // aes算法的秘钥要求是16位、24位、32位 + int[] array = {16, 24, 32}; + if (!ArrayUtil.contains(array, password.length())) { + throw new IllegalArgumentException("AES秘钥长度要求为16位、24位、32位"); + } + return SecureUtil.aes(password.getBytes(StandardCharsets.UTF_8)).encryptBase64(data, StandardCharsets.UTF_8); + } + + /** + * AES解密 + * + * @param data 待解密数据 + * @param password 秘钥字符串 + * @return 解密后字符串 + */ + public static String decryptByAes(String data, String password) { + if (StrUtil.isBlank(password)) { + throw new IllegalArgumentException("AES需要传入秘钥信息"); + } + // aes算法的秘钥要求是16位、24位、32位 + int[] array = {16, 24, 32}; + if (!ArrayUtil.contains(array, password.length())) { + throw new IllegalArgumentException("AES秘钥长度要求为16位、24位、32位"); + } + return SecureUtil.aes(password.getBytes(StandardCharsets.UTF_8)).decryptStr(data, StandardCharsets.UTF_8); + } + + /** + * sm4加密 + * + * @param data 待加密数据 + * @param password 秘钥字符串 + * @return 加密后字符串, 采用Base64编码 + */ + public static String encryptBySm4(String data, String password) { + if (StrUtil.isBlank(password)) { + throw new IllegalArgumentException("SM4需要传入秘钥信息"); + } + // sm4算法的秘钥要求是16位长度 + int sm4PasswordLength = 16; + if (sm4PasswordLength != password.length()) { + throw new IllegalArgumentException("SM4秘钥长度要求为16位"); + } + return SmUtil.sm4(password.getBytes(StandardCharsets.UTF_8)).encryptBase64(data, StandardCharsets.UTF_8); + } + + /** + * sm4解密 + * + * @param data 待解密数据 + * @param password 秘钥字符串 + * @return 解密后字符串 + */ + public static String decryptBySm4(String data, String password) { + if (StrUtil.isBlank(password)) { + throw new IllegalArgumentException("SM4需要传入秘钥信息"); + } + // sm4算法的秘钥要求是16位长度 + int sm4PasswordLength = 16; + if (sm4PasswordLength != password.length()) { + throw new IllegalArgumentException("SM4秘钥长度要求为16位"); + } + return SmUtil.sm4(password.getBytes(StandardCharsets.UTF_8)).decryptStr(data, StandardCharsets.UTF_8); + } + + /** + * 产生sm2加解密需要的公钥和私钥 + * + * @return 公私钥Map + */ + public static Map generateSm2Key() { + Map keyMap = new HashMap<>(2); + SM2 sm2 = SmUtil.sm2(); + keyMap.put(PRIVATE_KEY, sm2.getPrivateKeyBase64()); + keyMap.put(PUBLIC_KEY, sm2.getPublicKeyBase64()); + return keyMap; + } + + /** + * sm2公钥加密 + * + * @param data 待加密数据 + * @param publicKey 公钥 + * @return 加密后字符串, 采用Base64编码 + */ + public static String encryptBySm2(String data, String publicKey) { + if (StrUtil.isBlank(publicKey)) { + throw new IllegalArgumentException("SM2需要传入公钥进行加密"); + } + SM2 sm2 = SmUtil.sm2(null, publicKey); + return sm2.encryptBase64(data, StandardCharsets.UTF_8, KeyType.PublicKey); + } + + /** + * sm2私钥解密 + * + * @param data 待加密数据 + * @param privateKey 私钥 + * @return 解密后字符串 + */ + public static String decryptBySm2(String data, String privateKey) { + if (StrUtil.isBlank(privateKey)) { + throw new IllegalArgumentException("SM2需要传入私钥进行解密"); + } + SM2 sm2 = SmUtil.sm2(privateKey, null); + return sm2.decryptStr(data, KeyType.PrivateKey, StandardCharsets.UTF_8); + } + + /** + * 产生RSA加解密需要的公钥和私钥 + * + * @return 公私钥Map + */ + public static Map generateRsaKey() { + Map keyMap = new HashMap<>(2); + RSA rsa = SecureUtil.rsa(); + keyMap.put(PRIVATE_KEY, rsa.getPrivateKeyBase64()); + keyMap.put(PUBLIC_KEY, rsa.getPublicKeyBase64()); + return keyMap; + } + + /** + * rsa公钥加密 + * + * @param data 待加密数据 + * @param publicKey 公钥 + * @return 加密后字符串, 采用Base64编码 + */ + public static String encryptByRsa(String data, String publicKey) { + if (StrUtil.isBlank(publicKey)) { + throw new IllegalArgumentException("RSA需要传入公钥进行加密"); + } + RSA rsa = SecureUtil.rsa(null, publicKey); + return rsa.encryptBase64(data, StandardCharsets.UTF_8, KeyType.PublicKey); + } + + /** + * rsa私钥解密 + * + * @param data 待加密数据 + * @param privateKey 私钥 + * @return 解密后字符串 + */ + public static String decryptByRsa(String data, String privateKey) { + if (StrUtil.isBlank(privateKey)) { + throw new IllegalArgumentException("RSA需要传入私钥进行解密"); + } + RSA rsa = SecureUtil.rsa(privateKey, null); + return rsa.decryptStr(data, KeyType.PrivateKey, StandardCharsets.UTF_8); + } + + /** + * md5加密 + * + * @param data 待加密数据 + * @return 加密后字符串, 采用Hex编码 + */ + public static String encryptByMd5(String data) { + return SecureUtil.md5(data); + } + + /** + * sha256加密 + * + * @param data 待加密数据 + * @return 加密后字符串, 采用Hex编码 + */ + public static String encryptBySha256(String data) { + return SecureUtil.sha256(data); + } + + /** + * sm3加密 + * + * @param data 待加密数据 + * @return 加密后字符串, 采用Hex编码 + */ + public static String encryptBySm3(String data) { + return SmUtil.sm3(data); + } + +} diff --git a/aibidding-common/aibidding-common-encrypt/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-encrypt/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..03df7bb --- /dev/null +++ b/aibidding-common/aibidding-common-encrypt/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.aibidding.common.encrypt.config.EncryptorAutoConfiguration diff --git a/aibidding-common/aibidding-common-excel/pom.xml b/aibidding-common/aibidding-common-excel/pom.xml new file mode 100644 index 0000000..ac6e721 --- /dev/null +++ b/aibidding-common/aibidding-common-excel/pom.xml @@ -0,0 +1,31 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-excel + + + ruoyi-common-excel + + + + + org.ruoyi + aibidding-common-json + + + + com.alibaba + easyexcel + + + + diff --git a/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/annotation/CellMerge.java b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/annotation/CellMerge.java new file mode 100644 index 0000000..17d2beb --- /dev/null +++ b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/annotation/CellMerge.java @@ -0,0 +1,24 @@ +package org.aibidding.common.excel.annotation; + +import org.aibidding.common.excel.core.CellMergeStrategy; + +import java.lang.annotation.*; + +/** + * excel 列单元格合并(合并列相同项) + * + * 需搭配 {@link CellMergeStrategy} 策略使用 + * + * @author Lion Li + */ +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface CellMerge { + + /** + * col index + */ + int index() default -1; + +} diff --git a/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/annotation/ExcelDictFormat.java b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/annotation/ExcelDictFormat.java new file mode 100644 index 0000000..2f595e6 --- /dev/null +++ b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/annotation/ExcelDictFormat.java @@ -0,0 +1,32 @@ +package org.aibidding.common.excel.annotation; + +import org.aibidding.common.core.utils.StringUtils; + +import java.lang.annotation.*; + +/** + * 字典格式化 + * + * @author Lion Li + */ +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface ExcelDictFormat { + + /** + * 如果是字典类型,请设置字典的type值 (如: sys_user_sex) + */ + String dictType() default ""; + + /** + * 读取内容转表达式 (如: 0=男,1=女,2=未知) + */ + String readConverterExp() default ""; + + /** + * 分隔符,读取字符串组内容 + */ + String separator() default StringUtils.SEPARATOR; + +} diff --git a/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/annotation/ExcelEnumFormat.java b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/annotation/ExcelEnumFormat.java new file mode 100644 index 0000000..03d2c96 --- /dev/null +++ b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/annotation/ExcelEnumFormat.java @@ -0,0 +1,30 @@ +package org.aibidding.common.excel.annotation; + +import java.lang.annotation.*; + +/** + * 枚举格式化 + * + * @author Liang + */ +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface ExcelEnumFormat { + + /** + * 字典枚举类型 + */ + Class> enumClass(); + + /** + * 字典枚举类中对应的code属性名称,默认为code + */ + String codeField() default "code"; + + /** + * 字典枚举类中对应的text属性名称,默认为text + */ + String textField() default "text"; + +} diff --git a/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/convert/ExcelBigNumberConvert.java b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/convert/ExcelBigNumberConvert.java new file mode 100644 index 0000000..6f3c851 --- /dev/null +++ b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/convert/ExcelBigNumberConvert.java @@ -0,0 +1,52 @@ +package org.aibidding.common.excel.convert; + +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.metadata.property.ExcelContentProperty; +import lombok.extern.slf4j.Slf4j; + +import java.math.BigDecimal; + +/** + * 大数值转换 + * Excel 数值长度位15位 大于15位的数值转换位字符串 + * + * @author Lion Li + */ +@Slf4j +public class ExcelBigNumberConvert implements Converter { + + @Override + public Class supportJavaTypeKey() { + return Long.class; + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + @Override + public Long convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + return Convert.toLong(cellData.getData()); + } + + @Override + public WriteCellData convertToExcelData(Long object, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + if (ObjectUtil.isNotNull(object)) { + String str = Convert.toStr(object); + if (str.length() > 15) { + return new WriteCellData<>(str); + } + } + WriteCellData cellData = new WriteCellData<>(new BigDecimal(object)); + cellData.setType(CellDataTypeEnum.NUMBER); + return cellData; + } + +} diff --git a/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/convert/ExcelDictConvert.java b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/convert/ExcelDictConvert.java new file mode 100644 index 0000000..e2346cd --- /dev/null +++ b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/convert/ExcelDictConvert.java @@ -0,0 +1,73 @@ +package org.aibidding.common.excel.convert; + +import cn.hutool.core.annotation.AnnotationUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.metadata.property.ExcelContentProperty; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.service.DictService; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.excel.annotation.ExcelDictFormat; +import org.aibidding.common.excel.utils.ExcelUtil; + +import java.lang.reflect.Field; + +/** + * 字典格式化转换处理 + * + * @author Lion Li + */ +@Slf4j +public class ExcelDictConvert implements Converter { + + @Override + public Class supportJavaTypeKey() { + return Object.class; + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return null; + } + + @Override + public Object convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + ExcelDictFormat anno = getAnnotation(contentProperty.getField()); + String type = anno.dictType(); + String label = cellData.getStringValue(); + String value; + if (StringUtils.isBlank(type)) { + value = ExcelUtil.reverseByExp(label, anno.readConverterExp(), anno.separator()); + } else { + value = SpringUtils.getBean(DictService.class).getDictValue(type, label, anno.separator()); + } + return Convert.convert(contentProperty.getField().getType(), value); + } + + @Override + public WriteCellData convertToExcelData(Object object, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + if (ObjectUtil.isNull(object)) { + return new WriteCellData<>(""); + } + ExcelDictFormat anno = getAnnotation(contentProperty.getField()); + String type = anno.dictType(); + String value = Convert.toStr(object); + String label; + if (StringUtils.isBlank(type)) { + label = ExcelUtil.convertByExp(value, anno.readConverterExp(), anno.separator()); + } else { + label = SpringUtils.getBean(DictService.class).getDictLabel(type, value, anno.separator()); + } + return new WriteCellData<>(label); + } + + private ExcelDictFormat getAnnotation(Field field) { + return AnnotationUtil.getAnnotation(field, ExcelDictFormat.class); + } +} diff --git a/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/convert/ExcelEnumConvert.java b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/convert/ExcelEnumConvert.java new file mode 100644 index 0000000..1057467 --- /dev/null +++ b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/convert/ExcelEnumConvert.java @@ -0,0 +1,75 @@ +package org.aibidding.common.excel.convert; + +import cn.hutool.core.annotation.AnnotationUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.metadata.property.ExcelContentProperty; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.utils.reflect.ReflectUtils; +import org.aibidding.common.excel.annotation.ExcelEnumFormat; + +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; + +/** + * 枚举格式化转换处理 + * + * @author Liang + */ +@Slf4j +public class ExcelEnumConvert implements Converter { + + @Override + public Class supportJavaTypeKey() { + return Object.class; + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return null; + } + + @Override + public Object convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + Object codeValue = cellData.getData(); + // 如果是空值 + if (ObjectUtil.isNull(codeValue)) { + return null; + } + Map enumValueMap = beforeConvert(contentProperty); + String textValue = enumValueMap.get(codeValue); + return Convert.convert(contentProperty.getField().getType(), textValue); + } + + @Override + public WriteCellData convertToExcelData(Object object, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + if (ObjectUtil.isNull(object)) { + return new WriteCellData<>(""); + } + Map enumValueMap = beforeConvert(contentProperty); + String value = Convert.toStr(enumValueMap.get(object), ""); + return new WriteCellData<>(value); + } + + private Map beforeConvert(ExcelContentProperty contentProperty) { + ExcelEnumFormat anno = getAnnotation(contentProperty.getField()); + Map enumValueMap = new HashMap<>(); + Enum[] enumConstants = anno.enumClass().getEnumConstants(); + for (Enum enumConstant : enumConstants) { + Object codeValue = ReflectUtils.invokeGetter(enumConstant, anno.codeField()); + String textValue = ReflectUtils.invokeGetter(enumConstant, anno.textField()); + enumValueMap.put(codeValue, textValue); + } + return enumValueMap; + } + + private ExcelEnumFormat getAnnotation(Field field) { + return AnnotationUtil.getAnnotation(field, ExcelEnumFormat.class); + } +} diff --git a/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/CellMergeStrategy.java b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/CellMergeStrategy.java new file mode 100644 index 0000000..ad3cc36 --- /dev/null +++ b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/CellMergeStrategy.java @@ -0,0 +1,122 @@ +package org.aibidding.common.excel.core; + +import cn.hutool.core.collection.CollUtil; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.metadata.Head; +import com.alibaba.excel.write.merge.AbstractMergeStrategy; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.util.CellRangeAddress; +import org.aibidding.common.core.utils.reflect.ReflectUtils; +import org.aibidding.common.excel.annotation.CellMerge; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 列值重复合并策略 + * + * @author Lion Li + */ +@Slf4j +public class CellMergeStrategy extends AbstractMergeStrategy { + + private final List list; + private final boolean hasTitle; + private int rowIndex; + + public CellMergeStrategy(List list, boolean hasTitle) { + this.list = list; + this.hasTitle = hasTitle; + // 行合并开始下标 + this.rowIndex = hasTitle ? 1 : 0; + } + + @Override + protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) { + List cellList = handle(list, hasTitle); + // judge the list is not null + if (CollUtil.isNotEmpty(cellList)) { + // the judge is necessary + if (cell.getRowIndex() == rowIndex && cell.getColumnIndex() == 0) { + for (CellRangeAddress item : cellList) { + sheet.addMergedRegion(item); + } + } + } + } + + @SneakyThrows + private List handle(List list, boolean hasTitle) { + List cellList = new ArrayList<>(); + if (CollUtil.isEmpty(list)) { + return cellList; + } + Field[] fields = ReflectUtils.getFields(list.get(0).getClass(), field -> !"serialVersionUID".equals(field.getName())); + + // 有注解的字段 + List mergeFields = new ArrayList<>(); + List mergeFieldsIndex = new ArrayList<>(); + for (int i = 0; i < fields.length; i++) { + Field field = fields[i]; + if (field.isAnnotationPresent(CellMerge.class)) { + CellMerge cm = field.getAnnotation(CellMerge.class); + mergeFields.add(field); + mergeFieldsIndex.add(cm.index() == -1 ? i : cm.index()); + if (hasTitle) { + ExcelProperty property = field.getAnnotation(ExcelProperty.class); + rowIndex = Math.max(rowIndex, property.value().length); + } + } + } + + Map map = new HashMap<>(); + // 生成两两合并单元格 + for (int i = 0; i < list.size(); i++) { + for (int j = 0; j < mergeFields.size(); j++) { + Field field = mergeFields.get(j); + Object val = ReflectUtils.invokeGetter(list.get(i), field.getName()); + + int colNum = mergeFieldsIndex.get(j); + if (!map.containsKey(field)) { + map.put(field, new RepeatCell(val, i)); + } else { + RepeatCell repeatCell = map.get(field); + Object cellValue = repeatCell.getValue(); + if (cellValue == null || "".equals(cellValue)) { + // 空值跳过不合并 + continue; + } + if (!cellValue.equals(val)) { + if (i - repeatCell.getCurrent() > 1) { + cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum)); + } + map.put(field, new RepeatCell(val, i)); + } else if (i == list.size() - 1) { + if (i > repeatCell.getCurrent()) { + cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex, colNum, colNum)); + } + } + } + } + } + return cellList; + } + + @Data + @AllArgsConstructor + static class RepeatCell { + + private Object value; + + private int current; + + } +} diff --git a/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/DefaultExcelListener.java b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/DefaultExcelListener.java new file mode 100644 index 0000000..0691122 --- /dev/null +++ b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/DefaultExcelListener.java @@ -0,0 +1,104 @@ +package org.aibidding.common.excel.core; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.excel.exception.ExcelAnalysisException; +import com.alibaba.excel.exception.ExcelDataConvertException; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.utils.StreamUtils; +import org.aibidding.common.core.utils.ValidatorUtils; +import org.aibidding.common.json.utils.JsonUtils; + +import java.util.Map; +import java.util.Set; + +/** + * Excel 导入监听 + * + * @author Yjoioooo + * @author Lion Li + */ +@Slf4j +@NoArgsConstructor +public class DefaultExcelListener extends AnalysisEventListener implements ExcelListener { + + /** + * 是否Validator检验,默认为是 + */ + private Boolean isValidate = Boolean.TRUE; + + /** + * excel 表头数据 + */ + private Map headMap; + + /** + * 导入回执 + */ + private ExcelResult excelResult; + + public DefaultExcelListener(boolean isValidate) { + this.excelResult = new DefaultExcelResult<>(); + this.isValidate = isValidate; + } + + /** + * 处理异常 + * + * @param exception ExcelDataConvertException + * @param context Excel 上下文 + */ + @Override + public void onException(Exception exception, AnalysisContext context) throws Exception { + String errMsg = null; + if (exception instanceof ExcelDataConvertException excelDataConvertException) { + // 如果是某一个单元格的转换异常 能获取到具体行号 + Integer rowIndex = excelDataConvertException.getRowIndex(); + Integer columnIndex = excelDataConvertException.getColumnIndex(); + errMsg = StrUtil.format("第{}行-第{}列-表头{}: 解析异常
", + rowIndex + 1, columnIndex + 1, headMap.get(columnIndex)); + if (log.isDebugEnabled()) { + log.error(errMsg); + } + } + if (exception instanceof ConstraintViolationException constraintViolationException) { + Set> constraintViolations = constraintViolationException.getConstraintViolations(); + String constraintViolationsMsg = StreamUtils.join(constraintViolations, ConstraintViolation::getMessage, ", "); + errMsg = StrUtil.format("第{}行数据校验异常: {}", context.readRowHolder().getRowIndex() + 1, constraintViolationsMsg); + if (log.isDebugEnabled()) { + log.error(errMsg); + } + } + excelResult.getErrorList().add(errMsg); + throw new ExcelAnalysisException(errMsg); + } + + @Override + public void invokeHeadMap(Map headMap, AnalysisContext context) { + this.headMap = headMap; + log.debug("解析到一条表头数据: {}", JsonUtils.toJsonString(headMap)); + } + + @Override + public void invoke(T data, AnalysisContext context) { + if (isValidate) { + ValidatorUtils.validate(data); + } + excelResult.getList().add(data); + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + log.debug("所有数据解析完成!"); + } + + @Override + public ExcelResult getExcelResult() { + return excelResult; + } + +} diff --git a/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/DefaultExcelResult.java b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/DefaultExcelResult.java new file mode 100644 index 0000000..53d809c --- /dev/null +++ b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/DefaultExcelResult.java @@ -0,0 +1,73 @@ +package org.aibidding.common.excel.core; + +import cn.hutool.core.util.StrUtil; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * 默认excel返回对象 + * + * @author Yjoioooo + * @author Lion Li + */ +public class DefaultExcelResult implements ExcelResult { + + /** + * 数据对象list + */ + @Setter + private List list; + + /** + * 错误信息列表 + */ + @Setter + private List errorList; + + public DefaultExcelResult() { + this.list = new ArrayList<>(); + this.errorList = new ArrayList<>(); + } + + public DefaultExcelResult(List list, List errorList) { + this.list = list; + this.errorList = errorList; + } + + public DefaultExcelResult(ExcelResult excelResult) { + this.list = excelResult.getList(); + this.errorList = excelResult.getErrorList(); + } + + @Override + public List getList() { + return list; + } + + @Override + public List getErrorList() { + return errorList; + } + + /** + * 获取导入回执 + * + * @return 导入回执 + */ + @Override + public String getAnalysis() { + int successCount = list.size(); + int errorCount = errorList.size(); + if (successCount == 0) { + return "读取失败,未解析到数据"; + } else { + if (errorCount == 0) { + return StrUtil.format("恭喜您,全部读取成功!共{}条", successCount); + } else { + return ""; + } + } + } +} diff --git a/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/ExcelListener.java b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/ExcelListener.java new file mode 100644 index 0000000..b18c863 --- /dev/null +++ b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/ExcelListener.java @@ -0,0 +1,14 @@ +package org.aibidding.common.excel.core; + +import com.alibaba.excel.read.listener.ReadListener; + +/** + * Excel 导入监听 + * + * @author Lion Li + */ +public interface ExcelListener extends ReadListener { + + ExcelResult getExcelResult(); + +} diff --git a/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/ExcelResult.java b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/ExcelResult.java new file mode 100644 index 0000000..aec3777 --- /dev/null +++ b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/core/ExcelResult.java @@ -0,0 +1,26 @@ +package org.aibidding.common.excel.core; + +import java.util.List; + +/** + * excel返回对象 + * + * @author Lion Li + */ +public interface ExcelResult { + + /** + * 对象列表 + */ + List getList(); + + /** + * 错误列表 + */ + List getErrorList(); + + /** + * 导入回执 + */ + String getAnalysis(); +} diff --git a/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/utils/ExcelUtil.java b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/utils/ExcelUtil.java new file mode 100644 index 0000000..bb2e279 --- /dev/null +++ b/aibidding-common/aibidding-common-excel/src/main/java/org/aibidding/common/excel/utils/ExcelUtil.java @@ -0,0 +1,327 @@ +package org.aibidding.common.excel.utils; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.io.resource.ClassPathResource; +import cn.hutool.core.util.IdUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.excel.write.metadata.fill.FillConfig; +import com.alibaba.excel.write.metadata.fill.FillWrapper; +import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.http.HttpServletResponse; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.core.utils.file.FileUtils; +import org.aibidding.common.excel.convert.ExcelBigNumberConvert; +import org.aibidding.common.excel.core.CellMergeStrategy; +import org.aibidding.common.excel.core.DefaultExcelListener; +import org.aibidding.common.excel.core.ExcelListener; +import org.aibidding.common.excel.core.ExcelResult; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * Excel相关处理 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class ExcelUtil { + + /** + * 同步导入(适用于小数据量) + * + * @param is 输入流 + * @return 转换后集合 + */ + public static List importExcel(InputStream is, Class clazz) { + return EasyExcel.read(is).head(clazz).autoCloseStream(false).sheet().doReadSync(); + } + + + /** + * 使用校验监听器 异步导入 同步返回 + * + * @param is 输入流 + * @param clazz 对象类型 + * @param isValidate 是否 Validator 检验 默认为是 + * @return 转换后集合 + */ + public static ExcelResult importExcel(InputStream is, Class clazz, boolean isValidate) { + DefaultExcelListener listener = new DefaultExcelListener<>(isValidate); + EasyExcel.read(is, clazz, listener).sheet().doRead(); + return listener.getExcelResult(); + } + + /** + * 使用自定义监听器 异步导入 自定义返回 + * + * @param is 输入流 + * @param clazz 对象类型 + * @param listener 自定义监听器 + * @return 转换后集合 + */ + public static ExcelResult importExcel(InputStream is, Class clazz, ExcelListener listener) { + EasyExcel.read(is, clazz, listener).sheet().doRead(); + return listener.getExcelResult(); + } + + /** + * 导出excel + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @param clazz 实体类 + * @param response 响应体 + */ + public static void exportExcel(List list, String sheetName, Class clazz, HttpServletResponse response) { + try { + resetResponse(sheetName, response); + ServletOutputStream os = response.getOutputStream(); + exportExcel(list, sheetName, clazz, false, os); + } catch (IOException e) { + throw new RuntimeException("导出Excel异常"); + } + } + + /** + * 导出excel + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @param clazz 实体类 + * @param merge 是否合并单元格 + * @param response 响应体 + */ + public static void exportExcel(List list, String sheetName, Class clazz, boolean merge, HttpServletResponse response) { + try { + resetResponse(sheetName, response); + ServletOutputStream os = response.getOutputStream(); + exportExcel(list, sheetName, clazz, merge, os); + } catch (IOException e) { + throw new RuntimeException("导出Excel异常"); + } + } + + /** + * 导出excel + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @param clazz 实体类 + * @param os 输出流 + */ + public static void exportExcel(List list, String sheetName, Class clazz, OutputStream os) { + exportExcel(list, sheetName, clazz, false, os); + } + + /** + * 导出excel + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @param clazz 实体类 + * @param merge 是否合并单元格 + * @param os 输出流 + */ + public static void exportExcel(List list, String sheetName, Class clazz, boolean merge, OutputStream os) { + ExcelWriterSheetBuilder builder = EasyExcel.write(os, clazz) + .autoCloseStream(false) + // 自动适配 + .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) + // 大数值自动转换 防止失真 + .registerConverter(new ExcelBigNumberConvert()) + .sheet(sheetName); + if (merge) { + // 合并处理器 + builder.registerWriteHandler(new CellMergeStrategy(list, true)); + } + builder.doWrite(list); + } + + /** + * 单表多数据模板导出 模板格式为 {.属性} + * + * @param filename 文件名 + * @param templatePath 模板路径 resource 目录下的路径包括模板文件名 + * 例如: excel/temp.xlsx + * 重点: 模板文件必须放置到启动类对应的 resource 目录下 + * @param data 模板需要的数据 + * @param response 响应体 + */ + public static void exportTemplate(List data, String filename, String templatePath, HttpServletResponse response) { + try { + resetResponse(filename, response); + ServletOutputStream os = response.getOutputStream(); + exportTemplate(data, templatePath, os); + } catch (IOException e) { + throw new RuntimeException("导出Excel异常"); + } + } + + /** + * 单表多数据模板导出 模板格式为 {.属性} + * + * @param templatePath 模板路径 resource 目录下的路径包括模板文件名 + * 例如: excel/temp.xlsx + * 重点: 模板文件必须放置到启动类对应的 resource 目录下 + * @param data 模板需要的数据 + * @param os 输出流 + */ + public static void exportTemplate(List data, String templatePath, OutputStream os) { + ClassPathResource templateResource = new ClassPathResource(templatePath); + ExcelWriter excelWriter = EasyExcel.write(os) + .withTemplate(templateResource.getStream()) + .autoCloseStream(false) + // 大数值自动转换 防止失真 + .registerConverter(new ExcelBigNumberConvert()) + .build(); + WriteSheet writeSheet = EasyExcel.writerSheet().build(); + if (CollUtil.isEmpty(data)) { + throw new IllegalArgumentException("数据为空"); + } + // 单表多数据导出 模板格式为 {.属性} + for (Object d : data) { + excelWriter.fill(d, writeSheet); + } + excelWriter.finish(); + } + + /** + * 多表多数据模板导出 模板格式为 {key.属性} + * + * @param filename 文件名 + * @param templatePath 模板路径 resource 目录下的路径包括模板文件名 + * 例如: excel/temp.xlsx + * 重点: 模板文件必须放置到启动类对应的 resource 目录下 + * @param data 模板需要的数据 + * @param response 响应体 + */ + public static void exportTemplateMultiList(Map data, String filename, String templatePath, HttpServletResponse response) { + try { + resetResponse(filename, response); + ServletOutputStream os = response.getOutputStream(); + exportTemplateMultiList(data, templatePath, os); + } catch (IOException e) { + throw new RuntimeException("导出Excel异常"); + } + } + + /** + * 多表多数据模板导出 模板格式为 {key.属性} + * + * @param templatePath 模板路径 resource 目录下的路径包括模板文件名 + * 例如: excel/temp.xlsx + * 重点: 模板文件必须放置到启动类对应的 resource 目录下 + * @param data 模板需要的数据 + * @param os 输出流 + */ + public static void exportTemplateMultiList(Map data, String templatePath, OutputStream os) { + ClassPathResource templateResource = new ClassPathResource(templatePath); + ExcelWriter excelWriter = EasyExcel.write(os) + .withTemplate(templateResource.getStream()) + .autoCloseStream(false) + // 大数值自动转换 防止失真 + .registerConverter(new ExcelBigNumberConvert()) + .build(); + WriteSheet writeSheet = EasyExcel.writerSheet().build(); + if (CollUtil.isEmpty(data)) { + throw new IllegalArgumentException("数据为空"); + } + for (Map.Entry map : data.entrySet()) { + // 设置列表后续还有数据 + FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); + if (map.getValue() instanceof Collection) { + // 多表导出必须使用 FillWrapper + excelWriter.fill(new FillWrapper(map.getKey(), (Collection) map.getValue()), fillConfig, writeSheet); + } else { + excelWriter.fill(map.getValue(), writeSheet); + } + } + excelWriter.finish(); + } + + /** + * 重置响应体 + */ + private static void resetResponse(String sheetName, HttpServletResponse response) { + String filename = encodingFilename(sheetName); + FileUtils.setAttachmentResponseHeader(response, filename); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"); + } + + /** + * 解析导出值 0=男,1=女,2=未知 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @param separator 分隔符 + * @return 解析后值 + */ + public static String convertByExp(String propertyValue, String converterExp, String separator) { + StringBuilder propertyString = new StringBuilder(); + String[] convertSource = converterExp.split(StringUtils.SEPARATOR); + for (String item : convertSource) { + String[] itemArray = item.split("="); + if (StringUtils.containsAny(propertyValue, separator)) { + for (String value : propertyValue.split(separator)) { + if (itemArray[0].equals(value)) { + propertyString.append(itemArray[1]).append(separator); + break; + } + } + } else { + if (itemArray[0].equals(propertyValue)) { + return itemArray[1]; + } + } + } + return StringUtils.stripEnd(propertyString.toString(), separator); + } + + /** + * 反向解析值 男=0,女=1,未知=2 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @param separator 分隔符 + * @return 解析后值 + */ + public static String reverseByExp(String propertyValue, String converterExp, String separator) { + StringBuilder propertyString = new StringBuilder(); + String[] convertSource = converterExp.split(StringUtils.SEPARATOR); + for (String item : convertSource) { + String[] itemArray = item.split("="); + if (StringUtils.containsAny(propertyValue, separator)) { + for (String value : propertyValue.split(separator)) { + if (itemArray[1].equals(value)) { + propertyString.append(itemArray[0]).append(separator); + break; + } + } + } else { + if (itemArray[1].equals(propertyValue)) { + return itemArray[0]; + } + } + } + return StringUtils.stripEnd(propertyString.toString(), separator); + } + + /** + * 编码文件名 + */ + public static String encodingFilename(String filename) { + return IdUtil.fastSimpleUUID() + "_" + filename + ".xlsx"; + } + +} diff --git a/aibidding-common/aibidding-common-idempotent/pom.xml b/aibidding-common/aibidding-common-idempotent/pom.xml new file mode 100644 index 0000000..32a474b --- /dev/null +++ b/aibidding-common/aibidding-common-idempotent/pom.xml @@ -0,0 +1,42 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-idempotent + + + ruoyi-common-idempotent 幂等功能 + + + + + org.ruoyi + aibidding-common-json + + + + org.ruoyi + aibidding-common-redis + + + + cn.hutool + hutool-crypto + + + + cn.dev33 + sa-token-core + + + + + diff --git a/aibidding-common/aibidding-common-idempotent/src/main/java/org/aibidding/common/idempotent/annotation/RepeatSubmit.java b/aibidding-common/aibidding-common-idempotent/src/main/java/org/aibidding/common/idempotent/annotation/RepeatSubmit.java new file mode 100644 index 0000000..ff79c25 --- /dev/null +++ b/aibidding-common/aibidding-common-idempotent/src/main/java/org/aibidding/common/idempotent/annotation/RepeatSubmit.java @@ -0,0 +1,29 @@ +package org.aibidding.common.idempotent.annotation; + +import java.lang.annotation.*; +import java.util.concurrent.TimeUnit; + +/** + * 自定义注解防止表单重复提交 + * + * @author Lion Li + */ +@Inherited +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface RepeatSubmit { + + /** + * 间隔时间(ms),小于此时间视为重复提交 + */ + int interval() default 5000; + + TimeUnit timeUnit() default TimeUnit.MILLISECONDS; + + /** + * 提示消息 支持国际化 格式为 {code} + */ + String message() default "{repeat.submit.message}"; + +} diff --git a/aibidding-common/aibidding-common-idempotent/src/main/java/org/aibidding/common/idempotent/aspectj/RepeatSubmitAspect.java b/aibidding-common/aibidding-common-idempotent/src/main/java/org/aibidding/common/idempotent/aspectj/RepeatSubmitAspect.java new file mode 100644 index 0000000..acdbece --- /dev/null +++ b/aibidding-common/aibidding-common-idempotent/src/main/java/org/aibidding/common/idempotent/aspectj/RepeatSubmitAspect.java @@ -0,0 +1,152 @@ +package org.aibidding.common.idempotent.aspectj; + +import cn.dev33.satoken.SaManager; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.crypto.SecureUtil; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aibidding.common.core.constant.GlobalConstants; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.MessageUtils; +import org.aibidding.common.core.utils.ServletUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.json.utils.JsonUtils; +import org.aibidding.common.redis.utils.RedisUtils; +import org.springframework.validation.BindingResult; +import org.springframework.web.multipart.MultipartFile; + +import java.time.Duration; +import java.util.Collection; +import java.util.Map; + +/** + * 防止重复提交(参考美团GTIS防重系统) + * + * @author Lion Li + */ +@Aspect +public class RepeatSubmitAspect { + + private static final ThreadLocal KEY_CACHE = new ThreadLocal<>(); + + @Before("@annotation(repeatSubmit)") + public void doBefore(JoinPoint point, RepeatSubmit repeatSubmit) throws Throwable { + // 如果注解不为0 则使用注解数值 + long interval = 0; + if (repeatSubmit.interval() > 0) { + interval = repeatSubmit.timeUnit().toMillis(repeatSubmit.interval()); + } + if (interval < 1000) { + throw new ServiceException("重复提交间隔时间不能小于'1'秒"); + } + HttpServletRequest request = ServletUtils.getRequest(); + String nowParams = argsArrayToString(point.getArgs()); + + // 请求地址(作为存放cache的key值) + String url = request.getRequestURI(); + + // 唯一值(没有消息头则使用请求地址) + String submitKey = StringUtils.trimToEmpty(request.getHeader(SaManager.getConfig().getTokenName())); + + submitKey = SecureUtil.md5(submitKey + ":" + nowParams); + // 唯一标识(指定key + url + 消息头) + String cacheRepeatKey = GlobalConstants.REPEAT_SUBMIT_KEY + url + submitKey; + String key = RedisUtils.getCacheObject(cacheRepeatKey); + if (key == null) { + RedisUtils.setCacheObject(cacheRepeatKey, "", Duration.ofMillis(interval)); + KEY_CACHE.set(cacheRepeatKey); + } else { + String message = repeatSubmit.message(); + if (StringUtils.startsWith(message, "{") && StringUtils.endsWith(message, "}")) { + message = MessageUtils.message(StringUtils.substring(message, 1, message.length() - 1)); + } + throw new ServiceException(message); + } + } + + /** + * 处理完请求后执行 + * + * @param joinPoint 切点 + */ + @AfterReturning(pointcut = "@annotation(repeatSubmit)", returning = "jsonResult") + public void doAfterReturning(JoinPoint joinPoint, RepeatSubmit repeatSubmit, Object jsonResult) { + if (jsonResult instanceof R r) { + try { + // 成功则不删除redis数据 保证在有效时间内无法重复提交 + if (r.getCode() == R.SUCCESS) { + return; + } + RedisUtils.deleteObject(KEY_CACHE.get()); + } finally { + KEY_CACHE.remove(); + } + } + } + + /** + * 拦截异常操作 + * + * @param joinPoint 切点 + * @param e 异常 + */ + @AfterThrowing(value = "@annotation(repeatSubmit)", throwing = "e") + public void doAfterThrowing(JoinPoint joinPoint, RepeatSubmit repeatSubmit, Exception e) { + RedisUtils.deleteObject(KEY_CACHE.get()); + KEY_CACHE.remove(); + } + + /** + * 参数拼装 + */ + private String argsArrayToString(Object[] paramsArray) { + StringBuilder params = new StringBuilder(); + if (paramsArray != null && paramsArray.length > 0) { + for (Object o : paramsArray) { + if (ObjectUtil.isNotNull(o) && !isFilterObject(o)) { + try { + params.append(JsonUtils.toJsonString(o)).append(" "); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + return params.toString().trim(); + } + + /** + * 判断是否需要过滤的对象。 + * + * @param o 对象信息。 + * @return 如果是需要过滤的对象,则返回true;否则返回false。 + */ + @SuppressWarnings("rawtypes") + public boolean isFilterObject(final Object o) { + Class clazz = o.getClass(); + if (clazz.isArray()) { + return clazz.getComponentType().isAssignableFrom(MultipartFile.class); + } else if (Collection.class.isAssignableFrom(clazz)) { + Collection collection = (Collection) o; + for (Object value : collection) { + return value instanceof MultipartFile; + } + } else if (Map.class.isAssignableFrom(clazz)) { + Map map = (Map) o; + for (Object value : map.entrySet()) { + Map.Entry entry = (Map.Entry) value; + return entry.getValue() instanceof MultipartFile; + } + } + return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse + || o instanceof BindingResult; + } + +} diff --git a/aibidding-common/aibidding-common-idempotent/src/main/java/org/aibidding/common/idempotent/config/IdempotentConfig.java b/aibidding-common/aibidding-common-idempotent/src/main/java/org/aibidding/common/idempotent/config/IdempotentConfig.java new file mode 100644 index 0000000..010d6bb --- /dev/null +++ b/aibidding-common/aibidding-common-idempotent/src/main/java/org/aibidding/common/idempotent/config/IdempotentConfig.java @@ -0,0 +1,21 @@ +package org.aibidding.common.idempotent.config; + +import org.aibidding.common.idempotent.aspectj.RepeatSubmitAspect; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.data.redis.connection.RedisConfiguration; + +/** + * 幂等功能配置 + * + * @author Lion Li + */ +@AutoConfiguration(after = RedisConfiguration.class) +public class IdempotentConfig { + + @Bean + public RepeatSubmitAspect repeatSubmitAspect() { + return new RepeatSubmitAspect(); + } + +} diff --git a/aibidding-common/aibidding-common-idempotent/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-idempotent/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..da23773 --- /dev/null +++ b/aibidding-common/aibidding-common-idempotent/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.aibidding.common.idempotent.config.IdempotentConfig diff --git a/aibidding-common/aibidding-common-json/pom.xml b/aibidding-common/aibidding-common-json/pom.xml new file mode 100644 index 0000000..8126901 --- /dev/null +++ b/aibidding-common/aibidding-common-json/pom.xml @@ -0,0 +1,44 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-json + + + ruoyi-common-json 序列化模块 + + + + + org.ruoyi + aibidding-common-core + + + + + com.fasterxml.jackson.core + jackson-databind + + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + + com.alibaba + fastjson + 2.0.32 + + + + + diff --git a/aibidding-common/aibidding-common-json/src/main/java/org/aibidding/common/json/config/JacksonConfig.java b/aibidding-common/aibidding-common-json/src/main/java/org/aibidding/common/json/config/JacksonConfig.java new file mode 100644 index 0000000..e8f273b --- /dev/null +++ b/aibidding-common/aibidding-common-json/src/main/java/org/aibidding/common/json/config/JacksonConfig.java @@ -0,0 +1,47 @@ +package org.aibidding.common.json.config; + +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.json.handler.BigNumberSerializer; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; +import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; +import org.springframework.context.annotation.Bean; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.TimeZone; + +/** + * jackson 配置 + * + * @author Lion Li + */ +@Slf4j +@AutoConfiguration(before = JacksonAutoConfiguration.class) +public class JacksonConfig { + + @Bean + public Jackson2ObjectMapperBuilderCustomizer customizer() { + return builder -> { + // 全局配置序列化返回 JSON 处理 + JavaTimeModule javaTimeModule = new JavaTimeModule(); + javaTimeModule.addSerializer(Long.class, BigNumberSerializer.INSTANCE); + javaTimeModule.addSerializer(Long.TYPE, BigNumberSerializer.INSTANCE); + javaTimeModule.addSerializer(BigInteger.class, BigNumberSerializer.INSTANCE); + javaTimeModule.addSerializer(BigDecimal.class, ToStringSerializer.instance); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(formatter)); + javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(formatter)); + builder.modules(javaTimeModule); + builder.timeZone(TimeZone.getDefault()); + log.info("初始化 jackson 配置"); + }; + } + +} diff --git a/aibidding-common/aibidding-common-json/src/main/java/org/aibidding/common/json/handler/BigNumberSerializer.java b/aibidding-common/aibidding-common-json/src/main/java/org/aibidding/common/json/handler/BigNumberSerializer.java new file mode 100644 index 0000000..8677b6a --- /dev/null +++ b/aibidding-common/aibidding-common-json/src/main/java/org/aibidding/common/json/handler/BigNumberSerializer.java @@ -0,0 +1,42 @@ +package org.aibidding.common.json.handler; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JacksonStdImpl; +import com.fasterxml.jackson.databind.ser.std.NumberSerializer; + +import java.io.IOException; + +/** + * 超出 JS 最大最小值 处理 + * + * @author Lion Li + */ +@JacksonStdImpl +public class BigNumberSerializer extends NumberSerializer { + + /** + * 根据 JS Number.MAX_SAFE_INTEGER 与 Number.MIN_SAFE_INTEGER 得来 + */ + private static final long MAX_SAFE_INTEGER = 9007199254740991L; + private static final long MIN_SAFE_INTEGER = -9007199254740991L; + + /** + * 提供实例 + */ + public static final BigNumberSerializer INSTANCE = new BigNumberSerializer(Number.class); + + public BigNumberSerializer(Class rawType) { + super(rawType); + } + + @Override + public void serialize(Number value, JsonGenerator gen, SerializerProvider provider) throws IOException { + // 超出范围 序列化位字符串 + if (value.longValue() > MIN_SAFE_INTEGER && value.longValue() < MAX_SAFE_INTEGER) { + super.serialize(value, gen, provider); + } else { + gen.writeString(value.toString()); + } + } +} diff --git a/aibidding-common/aibidding-common-json/src/main/java/org/aibidding/common/json/utils/JsonUtils.java b/aibidding-common/aibidding-common-json/src/main/java/org/aibidding/common/json/utils/JsonUtils.java new file mode 100644 index 0000000..d2bc8f1 --- /dev/null +++ b/aibidding-common/aibidding-common-json/src/main/java/org/aibidding/common/json/utils/JsonUtils.java @@ -0,0 +1,113 @@ +package org.aibidding.common.json.utils; + +import cn.hutool.core.lang.Dict; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ObjectUtil; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.exc.MismatchedInputException; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.core.utils.StringUtils; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * JSON 工具类 + * + * @author 芋道源码 + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class JsonUtils { + + private static final ObjectMapper OBJECT_MAPPER = SpringUtils.getBean(ObjectMapper.class); + + public static ObjectMapper getObjectMapper() { + return OBJECT_MAPPER; + } + + public static String toJsonString(Object object) { + if (ObjectUtil.isNull(object)) { + return null; + } + try { + return OBJECT_MAPPER.writeValueAsString(object); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + public static T parseObject(String text, Class clazz) { + if (StringUtils.isEmpty(text)) { + return null; + } + try { + return OBJECT_MAPPER.readValue(text, clazz); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public static T parseObject(byte[] bytes, Class clazz) { + if (ArrayUtil.isEmpty(bytes)) { + return null; + } + try { + return OBJECT_MAPPER.readValue(bytes, clazz); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public static T parseObject(String text, TypeReference typeReference) { + if (StringUtils.isBlank(text)) { + return null; + } + try { + return OBJECT_MAPPER.readValue(text, typeReference); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public static Dict parseMap(String text) { + if (StringUtils.isBlank(text)) { + return null; + } + try { + return OBJECT_MAPPER.readValue(text, OBJECT_MAPPER.getTypeFactory().constructType(Dict.class)); + } catch (MismatchedInputException e) { + // 类型不匹配说明不是json + return null; + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public static List parseArrayMap(String text) { + if (StringUtils.isBlank(text)) { + return null; + } + try { + return OBJECT_MAPPER.readValue(text, OBJECT_MAPPER.getTypeFactory().constructCollectionType(List.class, Dict.class)); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public static List parseArray(String text, Class clazz) { + if (StringUtils.isEmpty(text)) { + return new ArrayList<>(); + } + try { + return OBJECT_MAPPER.readValue(text, OBJECT_MAPPER.getTypeFactory().constructCollectionType(List.class, clazz)); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/aibidding-common/aibidding-common-json/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-json/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..4a46ea2 --- /dev/null +++ b/aibidding-common/aibidding-common-json/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.aibidding.common.json.config.JacksonConfig diff --git a/aibidding-common/aibidding-common-log/pom.xml b/aibidding-common/aibidding-common-log/pom.xml new file mode 100644 index 0000000..878afd3 --- /dev/null +++ b/aibidding-common/aibidding-common-log/pom.xml @@ -0,0 +1,38 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-log + + + ruoyi-common-log 日志记录 + + + + + + org.ruoyi + aibidding-common-satoken + + + + org.ruoyi + aibidding-common-json + + + + com.alibaba + transmittable-thread-local + + + + + diff --git a/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/annotation/Log.java b/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/annotation/Log.java new file mode 100644 index 0000000..5be29de --- /dev/null +++ b/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/annotation/Log.java @@ -0,0 +1,48 @@ +package org.aibidding.common.log.annotation; + +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.log.enums.OperatorType; + +import java.lang.annotation.*; + +/** + * 自定义操作日志记录注解 + * + * @author aibidding + */ +@Target({ElementType.PARAMETER, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Log { + /** + * 模块 + */ + String title() default ""; + + /** + * 功能 + */ + BusinessType businessType() default BusinessType.OTHER; + + /** + * 操作人类别 + */ + OperatorType operatorType() default OperatorType.MANAGE; + + /** + * 是否保存请求的参数 + */ + boolean isSaveRequestData() default true; + + /** + * 是否保存响应的参数 + */ + boolean isSaveResponseData() default true; + + + /** + * 排除指定的请求参数 + */ + String[] excludeParamNames() default {}; + +} diff --git a/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/aspect/LogAspect.java b/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/aspect/LogAspect.java new file mode 100644 index 0000000..4162036 --- /dev/null +++ b/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/aspect/LogAspect.java @@ -0,0 +1,221 @@ +package org.aibidding.common.log.aspect; + +import cn.hutool.core.lang.Dict; +import cn.hutool.core.map.MapUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.ttl.TransmittableThreadLocal; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.time.StopWatch; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aibidding.common.core.utils.ServletUtils; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.json.utils.JsonUtils; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessStatus; +import org.aibidding.common.log.event.OperLogEvent; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.http.HttpMethod; +import org.springframework.validation.BindingResult; +import org.springframework.web.multipart.MultipartFile; + +import java.util.Collection; +import java.util.Map; + +/** + * 操作日志记录处理 + * + * @author Lion Li + */ +@Slf4j +@Aspect +@AutoConfiguration +public class LogAspect { + + /** + * 排除敏感属性字段 + */ + public static final String[] EXCLUDE_PROPERTIES = { "password", "oldPassword", "newPassword", "confirmPassword" }; + + + /** + * 计算操作消耗时间 + */ + private static final ThreadLocal TIME_THREADLOCAL = new TransmittableThreadLocal<>(); + + /** + * 处理请求前执行 + */ + @Before(value = "@annotation(controllerLog)") + public void boBefore(JoinPoint joinPoint, Log controllerLog) { + StopWatch stopWatch = new StopWatch(); + TIME_THREADLOCAL.set(stopWatch); + stopWatch.start(); + } + + /** + * 处理完请求后执行 + * + * @param joinPoint 切点 + */ + @AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult") + public void doAfterReturning(JoinPoint joinPoint, Log controllerLog, Object jsonResult) { + handleLog(joinPoint, controllerLog, null, jsonResult); + } + + /** + * 拦截异常操作 + * + * @param joinPoint 切点 + * @param e 异常 + */ + @AfterThrowing(value = "@annotation(controllerLog)", throwing = "e") + public void doAfterThrowing(JoinPoint joinPoint, Log controllerLog, Exception e) { + handleLog(joinPoint, controllerLog, e, null); + } + + protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult) { + try { + + // *========数据库日志=========*// + OperLogEvent operLog = new OperLogEvent(); + operLog.setTenantId(LoginHelper.getTenantId()); + operLog.setStatus(BusinessStatus.SUCCESS.ordinal()); + // 请求的地址 + String ip = ServletUtils.getClientIP(); + operLog.setOperIp(ip); + operLog.setOperUrl(StringUtils.substring(ServletUtils.getRequest().getRequestURI(), 0, 255)); + operLog.setOperName(LoginHelper.getUsername()); + + if (e != null) { + operLog.setStatus(BusinessStatus.FAIL.ordinal()); + operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000)); + } + // 设置方法名称 + String className = joinPoint.getTarget().getClass().getName(); + String methodName = joinPoint.getSignature().getName(); + operLog.setMethod(className + "." + methodName + "()"); + // 设置请求方式 + operLog.setRequestMethod(ServletUtils.getRequest().getMethod()); + // 处理设置注解上的参数 + getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult); + // 设置消耗时间 + StopWatch stopWatch = TIME_THREADLOCAL.get(); + stopWatch.stop(); + operLog.setCostTime(stopWatch.getTime()); + // 发布事件保存数据库 + SpringUtils.context().publishEvent(operLog); + } catch (Exception exp) { + // 记录本地异常日志 + log.error("异常信息:{}", exp.getMessage()); + exp.printStackTrace(); + } finally { + TIME_THREADLOCAL.remove(); + } + } + + /** + * 获取注解中对方法的描述信息 用于Controller层注解 + * + * @param log 日志 + * @param operLog 操作日志 + * @throws Exception + */ + public void getControllerMethodDescription(JoinPoint joinPoint, Log log, OperLogEvent operLog, Object jsonResult) throws Exception { + // 设置action动作 + operLog.setBusinessType(log.businessType().ordinal()); + // 设置标题 + operLog.setTitle(log.title()); + // 设置操作人类别 + operLog.setOperatorType(log.operatorType().ordinal()); + // 是否需要保存request,参数和值 + if (log.isSaveRequestData()) { + // 获取参数的信息,传入到数据库中。 + setRequestValue(joinPoint, operLog, log.excludeParamNames()); + } + // 是否需要保存response,参数和值 + if (log.isSaveResponseData() && ObjectUtil.isNotNull(jsonResult)) { + operLog.setJsonResult(StringUtils.substring(JsonUtils.toJsonString(jsonResult), 0, 2000)); + } + } + + /** + * 获取请求的参数,放到log中 + * + * @param operLog 操作日志 + * @throws Exception 异常 + */ + private void setRequestValue(JoinPoint joinPoint, OperLogEvent operLog, String[] excludeParamNames) throws Exception { + Map paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest()); + String requestMethod = operLog.getRequestMethod(); + if (MapUtil.isEmpty(paramsMap) + && HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) { + String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames); + operLog.setOperParam(StringUtils.substring(params, 0, 2000)); + } else { + MapUtil.removeAny(paramsMap, EXCLUDE_PROPERTIES); + MapUtil.removeAny(paramsMap, excludeParamNames); + operLog.setOperParam(StringUtils.substring(JsonUtils.toJsonString(paramsMap), 0, 2000)); + } + } + + /** + * 参数拼装 + */ + private String argsArrayToString(Object[] paramsArray, String[] excludeParamNames) { + StringBuilder params = new StringBuilder(); + if (paramsArray != null && paramsArray.length > 0) { + for (Object o : paramsArray) { + if (ObjectUtil.isNotNull(o) && !isFilterObject(o)) { + try { + String str = JsonUtils.toJsonString(o); + Dict dict = JsonUtils.parseMap(str); + if (MapUtil.isNotEmpty(dict)) { + MapUtil.removeAny(dict, EXCLUDE_PROPERTIES); + MapUtil.removeAny(dict, excludeParamNames); + str = JsonUtils.toJsonString(dict); + } + params.append(str).append(" "); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + return params.toString().trim(); + } + + /** + * 判断是否需要过滤的对象。 + * + * @param o 对象信息。 + * @return 如果是需要过滤的对象,则返回true;否则返回false。 + */ + @SuppressWarnings("rawtypes") + public boolean isFilterObject(final Object o) { + Class clazz = o.getClass(); + if (clazz.isArray()) { + return clazz.getComponentType().isAssignableFrom(MultipartFile.class); + } else if (Collection.class.isAssignableFrom(clazz)) { + Collection collection = (Collection) o; + for (Object value : collection) { + return value instanceof MultipartFile; + } + } else if (Map.class.isAssignableFrom(clazz)) { + Map map = (Map) o; + for (Object value : map.entrySet()) { + Map.Entry entry = (Map.Entry) value; + return entry.getValue() instanceof MultipartFile; + } + } + return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse + || o instanceof BindingResult; + } +} diff --git a/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/enums/BusinessStatus.java b/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/enums/BusinessStatus.java new file mode 100644 index 0000000..c05a4f3 --- /dev/null +++ b/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/enums/BusinessStatus.java @@ -0,0 +1,18 @@ +package org.aibidding.common.log.enums; + +/** + * 操作状态 + * + * @author aibidding + */ +public enum BusinessStatus { + /** + * 成功 + */ + SUCCESS, + + /** + * 失败 + */ + FAIL, +} diff --git a/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/enums/BusinessType.java b/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/enums/BusinessType.java new file mode 100644 index 0000000..7a15ecd --- /dev/null +++ b/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/enums/BusinessType.java @@ -0,0 +1,58 @@ +package org.aibidding.common.log.enums; + +/** + * 业务操作类型 + * + * @author aibidding + */ +public enum BusinessType { + /** + * 其它 + */ + OTHER, + + /** + * 新增 + */ + INSERT, + + /** + * 修改 + */ + UPDATE, + + /** + * 删除 + */ + DELETE, + + /** + * 授权 + */ + GRANT, + + /** + * 导出 + */ + EXPORT, + + /** + * 导入 + */ + IMPORT, + + /** + * 强退 + */ + FORCE, + + /** + * 生成代码 + */ + GENCODE, + + /** + * 清空数据 + */ + CLEAN, +} diff --git a/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/enums/OperatorType.java b/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/enums/OperatorType.java new file mode 100644 index 0000000..d4d82aa --- /dev/null +++ b/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/enums/OperatorType.java @@ -0,0 +1,23 @@ +package org.aibidding.common.log.enums; + +/** + * 操作人类别 + * + * @author aibidding + */ +public enum OperatorType { + /** + * 其它 + */ + OTHER, + + /** + * 后台用户 + */ + MANAGE, + + /** + * 手机端用户 + */ + MOBILE +} diff --git a/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/event/LogininforEvent.java b/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/event/LogininforEvent.java new file mode 100644 index 0000000..fac853d --- /dev/null +++ b/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/event/LogininforEvent.java @@ -0,0 +1,51 @@ +package org.aibidding.common.log.event; + +import jakarta.servlet.http.HttpServletRequest; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 登录事件 + * + * @author Lion Li + */ + +@Data +public class LogininforEvent implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 租户ID + */ + private String tenantId; + + /** + * 用户账号 + */ + private String username; + + /** + * 登录状态 0成功 1失败 + */ + private String status; + + /** + * 提示消息 + */ + private String message; + + /** + * 请求体 + */ + private HttpServletRequest request; + + /** + * 其他参数 + */ + private Object[] args; + +} diff --git a/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/event/OperLogEvent.java b/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/event/OperLogEvent.java new file mode 100644 index 0000000..3b6b796 --- /dev/null +++ b/aibidding-common/aibidding-common-log/src/main/java/org/aibidding/common/log/event/OperLogEvent.java @@ -0,0 +1,115 @@ +package org.aibidding.common.log.event; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +/** + * 操作日志事件 + * + * @author Lion Li + */ + +@Data +public class OperLogEvent implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 日志主键 + */ + private Long operId; + + /** + * 租户ID + */ + private String tenantId; + + /** + * 操作模块 + */ + private String title; + + /** + * 业务类型(0其它 1新增 2修改 3删除) + */ + private Integer businessType; + + /** + * 业务类型数组 + */ + private Integer[] businessTypes; + + /** + * 请求方法 + */ + private String method; + + /** + * 请求方式 + */ + private String requestMethod; + + /** + * 操作类别(0其它 1后台用户 2手机端用户) + */ + private Integer operatorType; + + /** + * 操作人员 + */ + private String operName; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 请求url + */ + private String operUrl; + + /** + * 操作地址 + */ + private String operIp; + + /** + * 操作地点 + */ + private String operLocation; + + /** + * 请求参数 + */ + private String operParam; + + /** + * 返回参数 + */ + private String jsonResult; + + /** + * 操作状态(0正常 1异常) + */ + private Integer status; + + /** + * 错误消息 + */ + private String errorMsg; + + /** + * 操作时间 + */ + private Date operTime; + + /** + * 消耗时间 + */ + private Long costTime; +} diff --git a/aibidding-common/aibidding-common-log/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-log/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..33423a8 --- /dev/null +++ b/aibidding-common/aibidding-common-log/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.aibidding.common.log.aspect.LogAspect diff --git a/aibidding-common/aibidding-common-mail/pom.xml b/aibidding-common/aibidding-common-mail/pom.xml new file mode 100644 index 0000000..59480df --- /dev/null +++ b/aibidding-common/aibidding-common-mail/pom.xml @@ -0,0 +1,35 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-mail + + + ruoyi-common-mail 邮件模块 + + + + + org.ruoyi + aibidding-common-core + + + + jakarta.mail + jakarta.mail-api + + + org.eclipse.angus + jakarta.mail + + + + diff --git a/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/config/MailConfig.java b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/config/MailConfig.java new file mode 100644 index 0000000..0da293c --- /dev/null +++ b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/config/MailConfig.java @@ -0,0 +1,55 @@ +package org.aibidding.common.mail.config; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.math.NumberUtils; +import org.aibidding.common.core.service.ConfigService; +import org.aibidding.common.mail.utils.MailAccount; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Scope; +import org.springframework.scheduling.annotation.Scheduled; + +/** + * JavaMail 配置 + * + * @author Michelle.Chung + */ + +@RequiredArgsConstructor +@Configuration +@Slf4j +public class MailConfig { + + private final ConfigService configService; + private MailAccount account; // 缓存MailAccount实例 + + @Bean + @Scope("singleton") + public MailAccount mailAccount() { + if (account == null) { + account = new MailAccount(); + updateMailAccount(); + } + return account; + } + + @Scheduled(fixedDelay = 10000) // 每10秒检查一次 + public void updateMailAccount() { + account.setHost(getKey("host")); + account.setPort(NumberUtils.toInt(getKey("port"), 465)); + account.setAuth(true); + account.setFrom(getKey("from")); + account.setUser(getKey("user")); + account.setPass(getKey("pass")); + account.setSocketFactoryPort(NumberUtils.toInt(getKey("port"), 465)); + account.setStarttlsEnable(true); + account.setSslEnable(true); + account.setTimeout(0); + account.setConnectionTimeout(0); + } + + public String getKey(String key){ + return configService.getConfigValue("mail", key); + } +} diff --git a/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/config/properties/MailProperties.java b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/config/properties/MailProperties.java new file mode 100644 index 0000000..f1397f6 --- /dev/null +++ b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/config/properties/MailProperties.java @@ -0,0 +1,67 @@ +package org.aibidding.common.mail.config.properties; + +import lombok.Data; + +/** + * JavaMail 配置属性 + * + * @author Michelle.Chung + */ +@Data +public class MailProperties { + + /** + * 过滤开关 + */ + private Boolean enabled; + + /** + * SMTP服务器域名 + */ + private String host; + + /** + * SMTP服务端口 + */ + private Integer port; + + /** + * 是否需要用户名密码验证 + */ + private Boolean auth; + + /** + * 用户名 + */ + private String user; + + /** + * 密码 + */ + private String pass; + + /** + * 发送方,遵循RFC-822标准 + */ + private String from; + + /** + * 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。它将纯文本连接升级为加密连接(TLS或SSL), 而不是使用一个单独的加密通信端口。 + */ + private Boolean starttlsEnable; + + /** + * 使用 SSL安全连接 + */ + private Boolean sslEnable; + + /** + * SMTP超时时长,单位毫秒,缺省值不超时 + */ + private Long timeout; + + /** + * Socket连接超时值,单位毫秒,缺省值不超时 + */ + private Long connectionTimeout; +} diff --git a/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/GlobalMailAccount.java b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/GlobalMailAccount.java new file mode 100644 index 0000000..3696866 --- /dev/null +++ b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/GlobalMailAccount.java @@ -0,0 +1,46 @@ +package org.aibidding.common.mail.utils; + +import cn.hutool.core.io.IORuntimeException; + +/** + * 全局邮件帐户,依赖于邮件配置文件{@link MailAccount#MAIL_SETTING_PATHS} + * + * @author looly + */ +public enum GlobalMailAccount { + INSTANCE; + + private final MailAccount mailAccount; + + /** + * 构造 + */ + GlobalMailAccount() { + mailAccount = createDefaultAccount(); + } + + /** + * 获得邮件帐户 + * + * @return 邮件帐户 + */ + public MailAccount getAccount() { + return this.mailAccount; + } + + /** + * 创建默认帐户 + * + * @return MailAccount + */ + private MailAccount createDefaultAccount() { + for (String mailSettingPath : MailAccount.MAIL_SETTING_PATHS) { + try { + return new MailAccount(mailSettingPath); + } catch (IORuntimeException ignore) { + //ignore + } + } + return null; + } +} diff --git a/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/InternalMailUtil.java b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/InternalMailUtil.java new file mode 100644 index 0000000..f3b0fcc --- /dev/null +++ b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/InternalMailUtil.java @@ -0,0 +1,108 @@ +package org.aibidding.common.mail.utils; + +import cn.hutool.core.util.ArrayUtil; +import jakarta.mail.internet.AddressException; +import jakarta.mail.internet.InternetAddress; +import jakarta.mail.internet.MimeUtility; + +import java.io.UnsupportedEncodingException; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * 邮件内部工具类 + * + * @author looly + * @since 3.2.3 + */ +public class InternalMailUtil { + + /** + * 将多个字符串邮件地址转为{@link InternetAddress}列表
+ * 单个字符串地址可以是多个地址合并的字符串 + * + * @param addrStrs 地址数组 + * @param charset 编码(主要用于中文用户名的编码) + * @return 地址数组 + * @since 4.0.3 + */ + public static InternetAddress[] parseAddressFromStrs(String[] addrStrs, Charset charset) { + final List resultList = new ArrayList<>(addrStrs.length); + InternetAddress[] addrs; + for (String addrStr : addrStrs) { + addrs = parseAddress(addrStr, charset); + if (ArrayUtil.isNotEmpty(addrs)) { + Collections.addAll(resultList, addrs); + } + } + return resultList.toArray(new InternetAddress[0]); + } + + /** + * 解析第一个地址 + * + * @param address 地址字符串 + * @param charset 编码,{@code null}表示使用系统属性定义的编码或系统编码 + * @return 地址列表 + */ + public static InternetAddress parseFirstAddress(String address, Charset charset) { + final InternetAddress[] internetAddresses = parseAddress(address, charset); + if (ArrayUtil.isEmpty(internetAddresses)) { + try { + return new InternetAddress(address); + } catch (AddressException e) { + throw new MailException(e); + } + } + return internetAddresses[0]; + } + + /** + * 将一个地址字符串解析为多个地址
+ * 地址间使用" "、","、";"分隔 + * + * @param address 地址字符串 + * @param charset 编码,{@code null}表示使用系统属性定义的编码或系统编码 + * @return 地址列表 + */ + public static InternetAddress[] parseAddress(String address, Charset charset) { + InternetAddress[] addresses; + try { + addresses = InternetAddress.parse(address); + } catch (AddressException e) { + throw new MailException(e); + } + //编码用户名 + if (ArrayUtil.isNotEmpty(addresses)) { + final String charsetStr = null == charset ? null : charset.name(); + for (InternetAddress internetAddress : addresses) { + try { + internetAddress.setPersonal(internetAddress.getPersonal(), charsetStr); + } catch (UnsupportedEncodingException e) { + throw new MailException(e); + } + } + } + + return addresses; + } + + /** + * 编码中文字符
+ * 编码失败返回原字符串 + * + * @param text 被编码的文本 + * @param charset 编码 + * @return 编码后的结果 + */ + public static String encodeText(String text, Charset charset) { + try { + return MimeUtility.encodeText(text, charset.name(), null); + } catch (UnsupportedEncodingException e) { + // ignore + } + return text; + } +} diff --git a/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/Mail.java b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/Mail.java new file mode 100644 index 0000000..1358e34 --- /dev/null +++ b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/Mail.java @@ -0,0 +1,483 @@ +package org.aibidding.common.mail.utils; + +import cn.hutool.core.builder.Builder; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.IORuntimeException; +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import jakarta.activation.DataHandler; +import jakarta.activation.DataSource; +import jakarta.activation.FileDataSource; +import jakarta.activation.FileTypeMap; +import jakarta.mail.*; +import jakarta.mail.internet.MimeBodyPart; +import jakarta.mail.internet.MimeMessage; +import jakarta.mail.internet.MimeMultipart; +import jakarta.mail.internet.MimeUtility; +import jakarta.mail.util.ByteArrayDataSource; + +import java.io.*; +import java.nio.charset.Charset; +import java.util.Date; + +/** + * 邮件发送客户端 + * + * @author looly + * @since 3.2.0 + */ +public class Mail implements Builder { + @Serial + private static final long serialVersionUID = 1L; + + /** + * 邮箱帐户信息以及一些客户端配置信息 + */ + private final MailAccount mailAccount; + /** + * 收件人列表 + */ + private String[] tos; + /** + * 抄送人列表(carbon copy) + */ + private String[] ccs; + /** + * 密送人列表(blind carbon copy) + */ + private String[] bccs; + /** + * 回复地址(reply-to) + */ + private String[] reply; + /** + * 标题 + */ + private String title; + /** + * 内容 + */ + private String content; + /** + * 是否为HTML + */ + private boolean isHtml; + /** + * 正文、附件和图片的混合部分 + */ + private final Multipart multipart = new MimeMultipart(); + /** + * 是否使用全局会话,默认为false + */ + private boolean useGlobalSession = false; + + /** + * debug输出位置,可以自定义debug日志 + */ + private PrintStream debugOutput; + + /** + * 创建邮件客户端 + * + * @param mailAccount 邮件帐号 + * @return Mail + */ + public static Mail create(MailAccount mailAccount) { + return new Mail(mailAccount); + } + + /** + * 创建邮件客户端,使用全局邮件帐户 + * + * @return Mail + */ + public static Mail create() { + return new Mail(); + } + + // --------------------------------------------------------------- Constructor start + + /** + * 构造,使用全局邮件帐户 + */ + public Mail() { + this(GlobalMailAccount.INSTANCE.getAccount()); + } + + /** + * 构造 + * + * @param mailAccount 邮件帐户,如果为null使用默认配置文件的全局邮件配置 + */ + public Mail(MailAccount mailAccount) { + mailAccount = (null != mailAccount) ? mailAccount : GlobalMailAccount.INSTANCE.getAccount(); + this.mailAccount = mailAccount.defaultIfEmpty(); + } + // --------------------------------------------------------------- Constructor end + + // --------------------------------------------------------------- Getters and Setters start + + /** + * 设置收件人 + * + * @param tos 收件人列表 + * @return this + * @see #setTos(String...) + */ + public Mail to(String... tos) { + return setTos(tos); + } + + /** + * 设置多个收件人 + * + * @param tos 收件人列表 + * @return this + */ + public Mail setTos(String... tos) { + this.tos = tos; + return this; + } + + /** + * 设置多个抄送人(carbon copy) + * + * @param ccs 抄送人列表 + * @return this + * @since 4.0.3 + */ + public Mail setCcs(String... ccs) { + this.ccs = ccs; + return this; + } + + /** + * 设置多个密送人(blind carbon copy) + * + * @param bccs 密送人列表 + * @return this + * @since 4.0.3 + */ + public Mail setBccs(String... bccs) { + this.bccs = bccs; + return this; + } + + /** + * 设置多个回复地址(reply-to) + * + * @param reply 回复地址(reply-to)列表 + * @return this + * @since 4.6.0 + */ + public Mail setReply(String... reply) { + this.reply = reply; + return this; + } + + /** + * 设置标题 + * + * @param title 标题 + * @return this + */ + public Mail setTitle(String title) { + this.title = title; + return this; + } + + /** + * 设置正文
+ * 正文可以是普通文本也可以是HTML(默认普通文本),可以通过调用{@link #setHtml(boolean)} 设置是否为HTML + * + * @param content 正文 + * @return this + */ + public Mail setContent(String content) { + this.content = content; + return this; + } + + /** + * 设置是否是HTML + * + * @param isHtml 是否为HTML + * @return this + */ + public Mail setHtml(boolean isHtml) { + this.isHtml = isHtml; + return this; + } + + /** + * 设置正文 + * + * @param content 正文内容 + * @param isHtml 是否为HTML + * @return this + */ + public Mail setContent(String content, boolean isHtml) { + setContent(content); + return setHtml(isHtml); + } + + /** + * 设置文件类型附件,文件可以是图片文件,此时自动设置cid(正文中引用图片),默认cid为文件名 + * + * @param files 附件文件列表 + * @return this + */ + public Mail setFiles(File... files) { + if (ArrayUtil.isEmpty(files)) { + return this; + } + + final DataSource[] attachments = new DataSource[files.length]; + for (int i = 0; i < files.length; i++) { + attachments[i] = new FileDataSource(files[i]); + } + return setAttachments(attachments); + } + + /** + * 增加附件或图片,附件使用{@link DataSource} 形式表示,可以使用{@link FileDataSource}包装文件表示文件附件 + * + * @param attachments 附件列表 + * @return this + * @since 4.0.9 + */ + public Mail setAttachments(DataSource... attachments) { + if (ArrayUtil.isNotEmpty(attachments)) { + final Charset charset = this.mailAccount.getCharset(); + MimeBodyPart bodyPart; + String nameEncoded; + try { + for (DataSource attachment : attachments) { + bodyPart = new MimeBodyPart(); + bodyPart.setDataHandler(new DataHandler(attachment)); + nameEncoded = attachment.getName(); + if (this.mailAccount.isEncodefilename()) { + nameEncoded = InternalMailUtil.encodeText(nameEncoded, charset); + } + // 普通附件文件名 + bodyPart.setFileName(nameEncoded); + if (StrUtil.startWith(attachment.getContentType(), "image/")) { + // 图片附件,用于正文中引用图片 + bodyPart.setContentID(nameEncoded); + } + this.multipart.addBodyPart(bodyPart); + } + } catch (MessagingException e) { + throw new MailException(e); + } + } + return this; + } + + /** + * 增加图片,图片的键对应到邮件模板中的占位字符串,图片类型默认为"image/jpeg" + * + * @param cid 图片与占位符,占位符格式为cid:${cid} + * @param imageStream 图片文件 + * @return this + * @since 4.6.3 + */ + public Mail addImage(String cid, InputStream imageStream) { + return addImage(cid, imageStream, null); + } + + /** + * 增加图片,图片的键对应到邮件模板中的占位字符串 + * + * @param cid 图片与占位符,占位符格式为cid:${cid} + * @param imageStream 图片流,不关闭 + * @param contentType 图片类型,null赋值默认的"image/jpeg" + * @return this + * @since 4.6.3 + */ + public Mail addImage(String cid, InputStream imageStream, String contentType) { + ByteArrayDataSource imgSource; + try { + imgSource = new ByteArrayDataSource(imageStream, ObjectUtil.defaultIfNull(contentType, "image/jpeg")); + } catch (IOException e) { + throw new IORuntimeException(e); + } + imgSource.setName(cid); + return setAttachments(imgSource); + } + + /** + * 增加图片,图片的键对应到邮件模板中的占位字符串 + * + * @param cid 图片与占位符,占位符格式为cid:${cid} + * @param imageFile 图片文件 + * @return this + * @since 4.6.3 + */ + public Mail addImage(String cid, File imageFile) { + InputStream in = null; + try { + in = FileUtil.getInputStream(imageFile); + return addImage(cid, in, FileTypeMap.getDefaultFileTypeMap().getContentType(imageFile)); + } finally { + IoUtil.close(in); + } + } + + /** + * 设置字符集编码 + * + * @param charset 字符集编码 + * @return this + * @see MailAccount#setCharset(Charset) + */ + public Mail setCharset(Charset charset) { + this.mailAccount.setCharset(charset); + return this; + } + + /** + * 设置是否使用全局会话,默认为true + * + * @param isUseGlobalSession 是否使用全局会话,默认为true + * @return this + * @since 4.0.2 + */ + public Mail setUseGlobalSession(boolean isUseGlobalSession) { + this.useGlobalSession = isUseGlobalSession; + return this; + } + + /** + * 设置debug输出位置,可以自定义debug日志 + * + * @param debugOutput debug输出位置 + * @return this + * @since 5.5.6 + */ + public Mail setDebugOutput(PrintStream debugOutput) { + this.debugOutput = debugOutput; + return this; + } + // --------------------------------------------------------------- Getters and Setters end + + @Override + public MimeMessage build() { + try { + return buildMsg(); + } catch (MessagingException e) { + throw new MailException(e); + } + } + + /** + * 发送 + * + * @return message-id + * @throws MailException 邮件发送异常 + */ + public String send() throws MailException { + try { + return doSend(); + } catch (MessagingException e) { + if (e instanceof SendFailedException) { + // 当地址无效时,显示更加详细的无效地址信息 + final Address[] invalidAddresses = ((SendFailedException) e).getInvalidAddresses(); + final String msg = StrUtil.format("Invalid Addresses: {}", ArrayUtil.toString(invalidAddresses)); + throw new MailException(msg, e); + } + throw new MailException(e); + } + } + + // --------------------------------------------------------------- Private method start + + /** + * 执行发送 + * + * @return message-id + * @throws MessagingException 发送异常 + */ + private String doSend() throws MessagingException { + final MimeMessage mimeMessage = buildMsg(); + Transport.send(mimeMessage); + return mimeMessage.getMessageID(); + } + + /** + * 构建消息 + * + * @return {@link MimeMessage}消息 + * @throws MessagingException 消息异常 + */ + private MimeMessage buildMsg() throws MessagingException { + final Charset charset = this.mailAccount.getCharset(); + final MimeMessage msg = new MimeMessage(getSession()); + // 发件人 + final String from = this.mailAccount.getFrom(); + if (StrUtil.isEmpty(from)) { + // 用户未提供发送方,则从Session中自动获取 + msg.setFrom(); + } else { + msg.setFrom(InternalMailUtil.parseFirstAddress(from, charset)); + } + // 标题 + msg.setSubject(this.title, (null == charset) ? null : charset.name()); + // 发送时间 + msg.setSentDate(new Date()); + // 内容和附件 + msg.setContent(buildContent(charset)); + // 收件人 + msg.setRecipients(MimeMessage.RecipientType.TO, InternalMailUtil.parseAddressFromStrs(this.tos, charset)); + // 抄送人 + if (ArrayUtil.isNotEmpty(this.ccs)) { + msg.setRecipients(MimeMessage.RecipientType.CC, InternalMailUtil.parseAddressFromStrs(this.ccs, charset)); + } + // 密送人 + if (ArrayUtil.isNotEmpty(this.bccs)) { + msg.setRecipients(MimeMessage.RecipientType.BCC, InternalMailUtil.parseAddressFromStrs(this.bccs, charset)); + } + // 回复地址(reply-to) + if (ArrayUtil.isNotEmpty(this.reply)) { + msg.setReplyTo(InternalMailUtil.parseAddressFromStrs(this.reply, charset)); + } + + return msg; + } + + /** + * 构建邮件信息主体 + * + * @param charset 编码,{@code null}则使用{@link MimeUtility#getDefaultJavaCharset()} + * @return 邮件信息主体 + * @throws MessagingException 消息异常 + */ + private Multipart buildContent(Charset charset) throws MessagingException { + final String charsetStr = null != charset ? charset.name() : MimeUtility.getDefaultJavaCharset(); + // 正文 + final MimeBodyPart body = new MimeBodyPart(); + body.setContent(content, StrUtil.format("text/{}; charset={}", isHtml ? "html" : "plain", charsetStr)); + this.multipart.addBodyPart(body); + + return this.multipart; + } + + /** + * 获取默认邮件会话
+ * 如果为全局单例的会话,则全局只允许一个邮件帐号,否则每次发送邮件会新建一个新的会话 + * + * @return 邮件会话 {@link Session} + */ + private Session getSession() { + final Session session = MailUtils.getSession(this.mailAccount, this.useGlobalSession); + + if (null != this.debugOutput) { + session.setDebugOut(debugOutput); + } + + return session; + } + // --------------------------------------------------------------- Private method end +} diff --git a/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/MailAccount.java b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/MailAccount.java new file mode 100644 index 0000000..5a51532 --- /dev/null +++ b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/MailAccount.java @@ -0,0 +1,659 @@ +package org.aibidding.common.mail.utils; + +import cn.hutool.core.util.CharsetUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.setting.Setting; + +import java.io.Serial; +import java.io.Serializable; +import java.nio.charset.Charset; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +/** + * 邮件账户对象 + * + * @author Luxiaolei + */ +public class MailAccount implements Serializable { + @Serial + private static final long serialVersionUID = -6937313421815719204L; + + private static final String MAIL_PROTOCOL = "mail.transport.protocol"; + private static final String SMTP_HOST = "mail.smtp.host"; + private static final String SMTP_PORT = "mail.smtp.port"; + private static final String SMTP_AUTH = "mail.smtp.auth"; + private static final String SMTP_TIMEOUT = "mail.smtp.timeout"; + private static final String SMTP_CONNECTION_TIMEOUT = "mail.smtp.connectiontimeout"; + private static final String SMTP_WRITE_TIMEOUT = "mail.smtp.writetimeout"; + + // SSL + private static final String STARTTLS_ENABLE = "mail.smtp.starttls.enable"; + private static final String SSL_ENABLE = "mail.smtp.ssl.enable"; + private static final String SSL_PROTOCOLS = "mail.smtp.ssl.protocols"; + private static final String SOCKET_FACTORY = "mail.smtp.socketFactory.class"; + private static final String SOCKET_FACTORY_FALLBACK = "mail.smtp.socketFactory.fallback"; + private static final String SOCKET_FACTORY_PORT = "smtp.socketFactory.port"; + + // System Properties + private static final String SPLIT_LONG_PARAMS = "mail.mime.splitlongparameters"; + //private static final String ENCODE_FILE_NAME = "mail.mime.encodefilename"; + //private static final String CHARSET = "mail.mime.charset"; + + // 其他 + private static final String MAIL_DEBUG = "mail.debug"; + + public static final String[] MAIL_SETTING_PATHS = new String[]{"config/mail.setting", "config/mailAccount.setting", "mail.setting"}; + + /** + * SMTP服务器域名 + */ + private String host; + /** + * SMTP服务端口 + */ + private Integer port; + /** + * 是否需要用户名密码验证 + */ + private Boolean auth; + /** + * 用户名 + */ + private String user; + /** + * 密码 + */ + private String pass; + /** + * 发送方,遵循RFC-822标准 + */ + private String from; + + /** + * 是否打开调试模式,调试模式会显示与邮件服务器通信过程,默认不开启 + */ + private boolean debug; + /** + * 编码用于编码邮件正文和发送人、收件人等中文 + */ + private Charset charset = CharsetUtil.CHARSET_UTF_8; + /** + * 对于超长参数是否切分为多份,默认为false(国内邮箱附件不支持切分的附件名) + */ + private boolean splitlongparameters = false; + /** + * 对于文件名是否使用{@link #charset}编码,默认为 {@code true} + */ + private boolean encodefilename = true; + + /** + * 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。它将纯文本连接升级为加密连接(TLS或SSL), 而不是使用一个单独的加密通信端口。 + */ + private boolean starttlsEnable = false; + /** + * 使用 SSL安全连接 + */ + private Boolean sslEnable; + + /** + * SSL协议,多个协议用空格分隔 + */ + private String sslProtocols; + + /** + * 指定实现javax.net.SocketFactory接口的类的名称,这个类将被用于创建SMTP的套接字 + */ + private String socketFactoryClass = "javax.net.ssl.SSLSocketFactory"; + /** + * 如果设置为true,未能创建一个套接字使用指定的套接字工厂类将导致使用java.net.Socket创建的套接字类, 默认值为true + */ + private boolean socketFactoryFallback; + /** + * 指定的端口连接到在使用指定的套接字工厂。如果没有设置,将使用默认端口 + */ + private int socketFactoryPort = 465; + + /** + * SMTP超时时长,单位毫秒,缺省值不超时 + */ + private long timeout; + /** + * Socket连接超时值,单位毫秒,缺省值不超时 + */ + private long connectionTimeout; + /** + * Socket写出超时值,单位毫秒,缺省值不超时 + */ + private long writeTimeout; + + /** + * 自定义的其他属性,此自定义属性会覆盖默认属性 + */ + private final Map customProperty = new HashMap<>(); + + // -------------------------------------------------------------- Constructor start + + /** + * 构造,所有参数需自行定义或保持默认值 + */ + public MailAccount() { + } + + /** + * 构造 + * + * @param settingPath 配置文件路径 + */ + public MailAccount(String settingPath) { + this(new Setting(settingPath)); + } + + /** + * 构造 + * + * @param setting 配置文件 + */ + public MailAccount(Setting setting) { + setting.toBean(this); + } + + // -------------------------------------------------------------- Constructor end + + /** + * 获得SMTP服务器域名 + * + * @return SMTP服务器域名 + */ + public String getHost() { + return host; + } + + /** + * 设置SMTP服务器域名 + * + * @param host SMTP服务器域名 + * @return this + */ + public MailAccount setHost(String host) { + this.host = host; + return this; + } + + /** + * 获得SMTP服务端口 + * + * @return SMTP服务端口 + */ + public Integer getPort() { + return port; + } + + /** + * 设置SMTP服务端口 + * + * @param port SMTP服务端口 + * @return this + */ + public MailAccount setPort(Integer port) { + this.port = port; + return this; + } + + /** + * 是否需要用户名密码验证 + * + * @return 是否需要用户名密码验证 + */ + public Boolean isAuth() { + return auth; + } + + /** + * 设置是否需要用户名密码验证 + * + * @param isAuth 是否需要用户名密码验证 + * @return this + */ + public MailAccount setAuth(boolean isAuth) { + this.auth = isAuth; + return this; + } + + /** + * 获取用户名 + * + * @return 用户名 + */ + public String getUser() { + return user; + } + + /** + * 设置用户名 + * + * @param user 用户名 + * @return this + */ + public MailAccount setUser(String user) { + this.user = user; + return this; + } + + /** + * 获取密码 + * + * @return 密码 + */ + public String getPass() { + return pass; + } + + /** + * 设置密码 + * + * @param pass 密码 + * @return this + */ + public MailAccount setPass(String pass) { + this.pass = pass; + return this; + } + + /** + * 获取发送方,遵循RFC-822标准 + * + * @return 发送方,遵循RFC-822标准 + */ + public String getFrom() { + return from; + } + + /** + * 设置发送方,遵循RFC-822标准
+ * 发件人可以是以下形式: + * + *
+     * 1. user@xxx.xx
+     * 2.  name <user@xxx.xx>
+     * 
+ * + * @param from 发送方,遵循RFC-822标准 + * @return this + */ + public MailAccount setFrom(String from) { + this.from = from; + return this; + } + + /** + * 是否打开调试模式,调试模式会显示与邮件服务器通信过程,默认不开启 + * + * @return 是否打开调试模式,调试模式会显示与邮件服务器通信过程,默认不开启 + * @since 4.0.2 + */ + public boolean isDebug() { + return debug; + } + + /** + * 设置是否打开调试模式,调试模式会显示与邮件服务器通信过程,默认不开启 + * + * @param debug 是否打开调试模式,调试模式会显示与邮件服务器通信过程,默认不开启 + * @return this + * @since 4.0.2 + */ + public MailAccount setDebug(boolean debug) { + this.debug = debug; + return this; + } + + /** + * 获取字符集编码 + * + * @return 编码,可能为{@code null} + */ + public Charset getCharset() { + return charset; + } + + /** + * 设置字符集编码,此选项不会修改全局配置,若修改全局配置,请设置此项为{@code null}并设置: + *
+     * 	System.setProperty("mail.mime.charset", charset);
+     * 
+ * + * @param charset 字符集编码,{@code null} 则表示使用全局设置的默认编码,全局编码为mail.mime.charset系统属性 + * @return this + */ + public MailAccount setCharset(Charset charset) { + this.charset = charset; + return this; + } + + /** + * 对于超长参数是否切分为多份,默认为false(国内邮箱附件不支持切分的附件名) + * + * @return 对于超长参数是否切分为多份 + */ + public boolean isSplitlongparameters() { + return splitlongparameters; + } + + /** + * 设置对于超长参数是否切分为多份,默认为false(国内邮箱附件不支持切分的附件名)
+ * 注意此项为全局设置,此项会调用 + *
+     * System.setProperty("mail.mime.splitlongparameters", true)
+     * 
+ * + * @param splitlongparameters 对于超长参数是否切分为多份 + */ + public void setSplitlongparameters(boolean splitlongparameters) { + this.splitlongparameters = splitlongparameters; + } + + /** + * 对于文件名是否使用{@link #charset}编码,默认为 {@code true} + * + * @return 对于文件名是否使用{@link #charset}编码,默认为 {@code true} + * @since 5.7.16 + */ + public boolean isEncodefilename() { + + return encodefilename; + } + + /** + * 设置对于文件名是否使用{@link #charset}编码,此选项不会修改全局配置
+ * 如果此选项设置为{@code false},则是否编码取决于两个系统属性: + *
    + *
  • mail.mime.encodefilename 是否编码附件文件名
  • + *
  • mail.mime.charset 编码文件名的编码
  • + *
+ * + * @param encodefilename 对于文件名是否使用{@link #charset}编码 + * @since 5.7.16 + */ + public void setEncodefilename(boolean encodefilename) { + this.encodefilename = encodefilename; + } + + /** + * 是否使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。它将纯文本连接升级为加密连接(TLS或SSL), 而不是使用一个单独的加密通信端口。 + * + * @return 是否使用 STARTTLS安全连接 + */ + public boolean isStarttlsEnable() { + return this.starttlsEnable; + } + + /** + * 设置是否使用STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。它将纯文本连接升级为加密连接(TLS或SSL), 而不是使用一个单独的加密通信端口。 + * + * @param startttlsEnable 是否使用STARTTLS安全连接 + * @return this + */ + public MailAccount setStarttlsEnable(boolean startttlsEnable) { + this.starttlsEnable = startttlsEnable; + return this; + } + + /** + * 是否使用 SSL安全连接 + * + * @return 是否使用 SSL安全连接 + */ + public Boolean isSslEnable() { + return this.sslEnable; + } + + /** + * 设置是否使用SSL安全连接 + * + * @param sslEnable 是否使用SSL安全连接 + * @return this + */ + public MailAccount setSslEnable(Boolean sslEnable) { + this.sslEnable = sslEnable; + return this; + } + + /** + * 获取SSL协议,多个协议用空格分隔 + * + * @return SSL协议,多个协议用空格分隔 + * @since 5.5.7 + */ + public String getSslProtocols() { + return sslProtocols; + } + + /** + * 设置SSL协议,多个协议用空格分隔 + * + * @param sslProtocols SSL协议,多个协议用空格分隔 + * @since 5.5.7 + */ + public void setSslProtocols(String sslProtocols) { + this.sslProtocols = sslProtocols; + } + + /** + * 获取指定实现javax.net.SocketFactory接口的类的名称,这个类将被用于创建SMTP的套接字 + * + * @return 指定实现javax.net.SocketFactory接口的类的名称, 这个类将被用于创建SMTP的套接字 + */ + public String getSocketFactoryClass() { + return socketFactoryClass; + } + + /** + * 设置指定实现javax.net.SocketFactory接口的类的名称,这个类将被用于创建SMTP的套接字 + * + * @param socketFactoryClass 指定实现javax.net.SocketFactory接口的类的名称,这个类将被用于创建SMTP的套接字 + * @return this + */ + public MailAccount setSocketFactoryClass(String socketFactoryClass) { + this.socketFactoryClass = socketFactoryClass; + return this; + } + + /** + * 如果设置为true,未能创建一个套接字使用指定的套接字工厂类将导致使用java.net.Socket创建的套接字类, 默认值为true + * + * @return 如果设置为true, 未能创建一个套接字使用指定的套接字工厂类将导致使用java.net.Socket创建的套接字类, 默认值为true + */ + public boolean isSocketFactoryFallback() { + return socketFactoryFallback; + } + + /** + * 如果设置为true,未能创建一个套接字使用指定的套接字工厂类将导致使用java.net.Socket创建的套接字类, 默认值为true + * + * @param socketFactoryFallback 如果设置为true,未能创建一个套接字使用指定的套接字工厂类将导致使用java.net.Socket创建的套接字类, 默认值为true + * @return this + */ + public MailAccount setSocketFactoryFallback(boolean socketFactoryFallback) { + this.socketFactoryFallback = socketFactoryFallback; + return this; + } + + /** + * 获取指定的端口连接到在使用指定的套接字工厂。如果没有设置,将使用默认端口 + * + * @return 指定的端口连接到在使用指定的套接字工厂。如果没有设置,将使用默认端口 + */ + public int getSocketFactoryPort() { + return socketFactoryPort; + } + + /** + * 指定的端口连接到在使用指定的套接字工厂。如果没有设置,将使用默认端口 + * + * @param socketFactoryPort 指定的端口连接到在使用指定的套接字工厂。如果没有设置,将使用默认端口 + * @return this + */ + public MailAccount setSocketFactoryPort(int socketFactoryPort) { + this.socketFactoryPort = socketFactoryPort; + return this; + } + + /** + * 设置SMTP超时时长,单位毫秒,缺省值不超时 + * + * @param timeout SMTP超时时长,单位毫秒,缺省值不超时 + * @return this + * @since 4.1.17 + */ + public MailAccount setTimeout(long timeout) { + this.timeout = timeout; + return this; + } + + /** + * 设置Socket连接超时值,单位毫秒,缺省值不超时 + * + * @param connectionTimeout Socket连接超时值,单位毫秒,缺省值不超时 + * @return this + * @since 4.1.17 + */ + public MailAccount setConnectionTimeout(long connectionTimeout) { + this.connectionTimeout = connectionTimeout; + return this; + } + + /** + * 设置Socket写出超时值,单位毫秒,缺省值不超时 + * + * @param writeTimeout Socket写出超时值,单位毫秒,缺省值不超时 + * @return this + * @since 5.8.3 + */ + public MailAccount setWriteTimeout(long writeTimeout) { + this.writeTimeout = writeTimeout; + return this; + } + + /** + * 获取自定义属性列表 + * + * @return 自定义参数列表 + * @since 5.6.4 + */ + public Map getCustomProperty() { + return customProperty; + } + + /** + * 设置自定义属性,如mail.smtp.ssl.socketFactory + * + * @param key 属性名,空白被忽略 + * @param value 属性值, null被忽略 + * @return this + * @since 5.6.4 + */ + public MailAccount setCustomProperty(String key, Object value) { + if (StrUtil.isNotBlank(key) && ObjectUtil.isNotNull(value)) { + this.customProperty.put(key, value); + } + return this; + } + + /** + * 获得SMTP相关信息 + * + * @return {@link Properties} + */ + public Properties getSmtpProps() { + //全局系统参数 + System.setProperty(SPLIT_LONG_PARAMS, String.valueOf(this.splitlongparameters)); + + final Properties p = new Properties(); + p.put(MAIL_PROTOCOL, "smtp"); + p.put(SMTP_HOST, this.host); + p.put(SMTP_PORT, String.valueOf(this.port)); + p.put(SMTP_AUTH, String.valueOf(this.auth)); + if (this.timeout > 0) { + p.put(SMTP_TIMEOUT, String.valueOf(this.timeout)); + } + if (this.connectionTimeout > 0) { + p.put(SMTP_CONNECTION_TIMEOUT, String.valueOf(this.connectionTimeout)); + } + // issue#2355 + if (this.writeTimeout > 0) { + p.put(SMTP_WRITE_TIMEOUT, String.valueOf(this.writeTimeout)); + } + + p.put(MAIL_DEBUG, String.valueOf(this.debug)); + + if (this.starttlsEnable) { + //STARTTLS是对纯文本通信协议的扩展。它将纯文本连接升级为加密连接(TLS或SSL), 而不是使用一个单独的加密通信端口。 + p.put(STARTTLS_ENABLE, "true"); + + if (null == this.sslEnable) { + //为了兼容旧版本,当用户没有此项配置时,按照starttlsEnable开启状态时对待 + this.sslEnable = true; + } + } + + // SSL + if (null != this.sslEnable && this.sslEnable) { + p.put(SSL_ENABLE, "true"); + p.put(SOCKET_FACTORY, socketFactoryClass); + p.put(SOCKET_FACTORY_FALLBACK, String.valueOf(this.socketFactoryFallback)); + p.put(SOCKET_FACTORY_PORT, String.valueOf(this.socketFactoryPort)); + // issue#IZN95@Gitee,在Linux下需自定义SSL协议版本 + if (StrUtil.isNotBlank(this.sslProtocols)) { + p.put(SSL_PROTOCOLS, this.sslProtocols); + } + } + + // 补充自定义属性,允许自定属性覆盖已经设置的值 + p.putAll(this.customProperty); + + return p; + } + + /** + * 如果某些值为null,使用默认值 + * + * @return this + */ + public MailAccount defaultIfEmpty() { + // 去掉发件人的姓名部分 + final String fromAddress = InternalMailUtil.parseFirstAddress(this.from, this.charset).getAddress(); + + if (StrUtil.isBlank(this.host)) { + // 如果SMTP地址为空,默认使用smtp.<发件人邮箱后缀> + this.host = StrUtil.format("smtp.{}", StrUtil.subSuf(fromAddress, fromAddress.indexOf('@') + 1)); + } + if (StrUtil.isBlank(user)) { + // 如果用户名为空,默认为发件人(issue#I4FYVY@Gitee) + //this.user = StrUtil.subPre(fromAddress, fromAddress.indexOf('@')); + this.user = fromAddress; + } + if (null == this.auth) { + // 如果密码非空白,则使用认证模式 + this.auth = (false == StrUtil.isBlank(this.pass)); + } + if (null == this.port) { + // 端口在SSL状态下默认与socketFactoryPort一致,非SSL状态下默认为25 + this.port = (null != this.sslEnable && this.sslEnable) ? this.socketFactoryPort : 25; + } + if (null == this.charset) { + // 默认UTF-8编码 + this.charset = CharsetUtil.CHARSET_UTF_8; + } + + return this; + } + + @Override + public String toString() { + return "MailAccount [host=" + host + ", port=" + port + ", auth=" + auth + ", user=" + user + ", pass=" + (StrUtil.isEmpty(this.pass) ? "" : "******") + ", from=" + from + ", startttlsEnable=" + + starttlsEnable + ", socketFactoryClass=" + socketFactoryClass + ", socketFactoryFallback=" + socketFactoryFallback + ", socketFactoryPort=" + socketFactoryPort + "]"; + } +} diff --git a/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/MailException.java b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/MailException.java new file mode 100644 index 0000000..614d95a --- /dev/null +++ b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/MailException.java @@ -0,0 +1,40 @@ +package org.aibidding.common.mail.utils; + +import cn.hutool.core.exceptions.ExceptionUtil; +import cn.hutool.core.util.StrUtil; + +import java.io.Serial; + +/** + * 邮件异常 + * + * @author xiaoleilu + */ +public class MailException extends RuntimeException { + @Serial + private static final long serialVersionUID = 8247610319171014183L; + + public MailException(Throwable e) { + super(ExceptionUtil.getMessage(e), e); + } + + public MailException(String message) { + super(message); + } + + public MailException(String messageTemplate, Object... params) { + super(StrUtil.format(messageTemplate, params)); + } + + public MailException(String message, Throwable throwable) { + super(message, throwable); + } + + public MailException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) { + super(message, throwable, enableSuppression, writableStackTrace); + } + + public MailException(Throwable throwable, String messageTemplate, Object... params) { + super(StrUtil.format(messageTemplate, params), throwable); + } +} diff --git a/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/MailUtils.java b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/MailUtils.java new file mode 100644 index 0000000..2fb3f95 --- /dev/null +++ b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/MailUtils.java @@ -0,0 +1,468 @@ +package org.aibidding.common.mail.utils; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.map.MapUtil; +import cn.hutool.core.util.CharUtil; +import cn.hutool.core.util.StrUtil; +import jakarta.mail.Authenticator; +import jakarta.mail.Session; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.core.utils.StringUtils; + +import java.io.File; +import java.io.InputStream; +import java.util.Collection; +import java.util.List; +import java.util.Map; + + +/** + * 邮件工具类 + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class MailUtils { + + private static final MailAccount ACCOUNT = SpringUtils.getBean(MailAccount.class); + + /** + * 获取邮件发送实例 + */ + public static MailAccount getMailAccount() { + return ACCOUNT; + } + + /** + * 获取邮件发送实例 (自定义发送人以及授权码) + * + * @param user 发送人 + * @param pass 授权码 + */ + public static MailAccount getMailAccount(String from, String user, String pass) { + ACCOUNT.setFrom(StringUtils.blankToDefault(from, ACCOUNT.getFrom())); + ACCOUNT.setUser(StringUtils.blankToDefault(user, ACCOUNT.getUser())); + ACCOUNT.setPass(StringUtils.blankToDefault(pass, ACCOUNT.getPass())); + return ACCOUNT; + } + + /** + * 使用配置文件中设置的账户发送文本邮件,发送给单个或多个收件人
+ * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * + * @param to 收件人 + * @param subject 标题 + * @param content 正文 + * @param files 附件列表 + * @return message-id + * @since 3.2.0 + */ + public static String sendText(String to, String subject, String content, File... files) { + return send(to, subject, content, false, files); + } + + /** + * 使用配置文件中设置的账户发送HTML邮件,发送给单个或多个收件人
+ * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * + * @param to 收件人 + * @param subject 标题 + * @param content 正文 + * @param files 附件列表 + * @return message-id + * @since 3.2.0 + */ + public static String sendHtml(String to, String subject, String content, File... files) { + return send(to, subject, content, true, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送单个或多个收件人
+ * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * + * @param to 收件人 + * @param subject 标题 + * @param content 正文 + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + */ + public static String send(String to, String subject, String content, boolean isHtml, File... files) { + return send(splitAddress(to), subject, content, isHtml, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送单个或多个收件人
+ * 多个收件人、抄送人、密送人可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * + * @param to 收件人,可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * @param cc 抄送人,可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * @param bcc 密送人,可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * @param subject 标题 + * @param content 正文 + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + * @since 4.0.3 + */ + public static String send(String to, String cc, String bcc, String subject, String content, boolean isHtml, File... files) { + return send(splitAddress(to), splitAddress(cc), splitAddress(bcc), subject, content, isHtml, files); + } + + /** + * 使用配置文件中设置的账户发送文本邮件,发送给多人 + * + * @param tos 收件人列表 + * @param subject 标题 + * @param content 正文 + * @param files 附件列表 + * @return message-id + */ + public static String sendText(Collection tos, String subject, String content, File... files) { + return send(tos, subject, content, false, files); + } + + /** + * 使用配置文件中设置的账户发送HTML邮件,发送给多人 + * + * @param tos 收件人列表 + * @param subject 标题 + * @param content 正文 + * @param files 附件列表 + * @return message-id + * @since 3.2.0 + */ + public static String sendHtml(Collection tos, String subject, String content, File... files) { + return send(tos, subject, content, true, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送给多人 + * + * @param tos 收件人列表 + * @param subject 标题 + * @param content 正文 + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + */ + public static String send(Collection tos, String subject, String content, boolean isHtml, File... files) { + return send(tos, null, null, subject, content, isHtml, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送给多人 + * + * @param tos 收件人列表 + * @param ccs 抄送人列表,可以为null或空 + * @param bccs 密送人列表,可以为null或空 + * @param subject 标题 + * @param content 正文 + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + * @since 4.0.3 + */ + public static String send(Collection tos, Collection ccs, Collection bccs, String subject, String content, boolean isHtml, File... files) { + return send(getMailAccount(), true, tos, ccs, bccs, subject, content, null, isHtml, files); + } + + // ------------------------------------------------------------------------------------------------------------------------------- Custom MailAccount + + /** + * 发送邮件给多人 + * + * @param mailAccount 邮件认证对象 + * @param to 收件人,多个收件人逗号或者分号隔开 + * @param subject 标题 + * @param content 正文 + * @param isHtml 是否为HTML格式 + * @param files 附件列表 + * @return message-id + * @since 3.2.0 + */ + public static String send(MailAccount mailAccount, String to, String subject, String content, boolean isHtml, File... files) { + return send(mailAccount, splitAddress(to), subject, content, isHtml, files); + } + + /** + * 发送邮件给多人 + * + * @param mailAccount 邮件帐户信息 + * @param tos 收件人列表 + * @param subject 标题 + * @param content 正文 + * @param isHtml 是否为HTML格式 + * @param files 附件列表 + * @return message-id + */ + public static String send(MailAccount mailAccount, Collection tos, String subject, String content, boolean isHtml, File... files) { + return send(mailAccount, tos, null, null, subject, content, isHtml, files); + } + + /** + * 发送邮件给多人 + * + * @param mailAccount 邮件帐户信息 + * @param tos 收件人列表 + * @param ccs 抄送人列表,可以为null或空 + * @param bccs 密送人列表,可以为null或空 + * @param subject 标题 + * @param content 正文 + * @param isHtml 是否为HTML格式 + * @param files 附件列表 + * @return message-id + * @since 4.0.3 + */ + public static String send(MailAccount mailAccount, Collection tos, Collection ccs, Collection bccs, String subject, String content, boolean isHtml, File... files) { + return send(mailAccount, false, tos, ccs, bccs, subject, content, null, isHtml, files); + } + + /** + * 使用配置文件中设置的账户发送HTML邮件,发送给单个或多个收件人
+ * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * + * @param to 收件人 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param files 附件列表 + * @return message-id + * @since 3.2.0 + */ + public static String sendHtml(String to, String subject, String content, Map imageMap, File... files) { + return send(to, subject, content, imageMap, true, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送单个或多个收件人
+ * 多个收件人可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * + * @param to 收件人 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + */ + public static String send(String to, String subject, String content, Map imageMap, boolean isHtml, File... files) { + return send(splitAddress(to), subject, content, imageMap, isHtml, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送单个或多个收件人
+ * 多个收件人、抄送人、密送人可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * + * @param to 收件人,可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * @param cc 抄送人,可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * @param bcc 密送人,可以使用逗号“,”分隔,也可以通过分号“;”分隔 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + * @since 4.0.3 + */ + public static String send(String to, String cc, String bcc, String subject, String content, Map imageMap, boolean isHtml, File... files) { + return send(splitAddress(to), splitAddress(cc), splitAddress(bcc), subject, content, imageMap, isHtml, files); + } + + /** + * 使用配置文件中设置的账户发送HTML邮件,发送给多人 + * + * @param tos 收件人列表 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param files 附件列表 + * @return message-id + * @since 3.2.0 + */ + public static String sendHtml(Collection tos, String subject, String content, Map imageMap, File... files) { + return send(tos, subject, content, imageMap, true, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送给多人 + * + * @param tos 收件人列表 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + */ + public static String send(Collection tos, String subject, String content, Map imageMap, boolean isHtml, File... files) { + return send(tos, null, null, subject, content, imageMap, isHtml, files); + } + + /** + * 使用配置文件中设置的账户发送邮件,发送给多人 + * + * @param tos 收件人列表 + * @param ccs 抄送人列表,可以为null或空 + * @param bccs 密送人列表,可以为null或空 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param isHtml 是否为HTML + * @param files 附件列表 + * @return message-id + * @since 4.0.3 + */ + public static String send(Collection tos, Collection ccs, Collection bccs, String subject, String content, Map imageMap, boolean isHtml, File... files) { + return send(getMailAccount(), true, tos, ccs, bccs, subject, content, imageMap, isHtml, files); + } + + // ------------------------------------------------------------------------------------------------------------------------------- Custom MailAccount + + /** + * 发送邮件给多人 + * + * @param mailAccount 邮件认证对象 + * @param to 收件人,多个收件人逗号或者分号隔开 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param isHtml 是否为HTML格式 + * @param files 附件列表 + * @return message-id + * @since 3.2.0 + */ + public static String send(MailAccount mailAccount, String to, String subject, String content, Map imageMap, boolean isHtml, File... files) { + return send(mailAccount, splitAddress(to), subject, content, imageMap, isHtml, files); + } + + /** + * 发送邮件给多人 + * + * @param mailAccount 邮件帐户信息 + * @param tos 收件人列表 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param isHtml 是否为HTML格式 + * @param files 附件列表 + * @return message-id + * @since 4.6.3 + */ + public static String send(MailAccount mailAccount, Collection tos, String subject, String content, Map imageMap, boolean isHtml, File... files) { + return send(mailAccount, tos, null, null, subject, content, imageMap, isHtml, files); + } + + /** + * 发送邮件给多人 + * + * @param mailAccount 邮件帐户信息 + * @param tos 收件人列表 + * @param ccs 抄送人列表,可以为null或空 + * @param bccs 密送人列表,可以为null或空 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:$IMAGE_PLACEHOLDER + * @param isHtml 是否为HTML格式 + * @param files 附件列表 + * @return message-id + * @since 4.6.3 + */ + public static String send(MailAccount mailAccount, Collection tos, Collection ccs, Collection bccs, String subject, String content, Map imageMap, + boolean isHtml, File... files) { + return send(mailAccount, false, tos, ccs, bccs, subject, content, imageMap, isHtml, files); + } + + /** + * 根据配置文件,获取邮件客户端会话 + * + * @param mailAccount 邮件账户配置 + * @param isSingleton 是否单例(全局共享会话) + * @return {@link Session} + * @since 5.5.7 + */ + public static Session getSession(MailAccount mailAccount, boolean isSingleton) { + Authenticator authenticator = null; + if (mailAccount.isAuth()) { + authenticator = new UserPassAuthenticator(mailAccount.getUser(), mailAccount.getPass()); + } + + return isSingleton ? Session.getDefaultInstance(mailAccount.getSmtpProps(), authenticator) // + : Session.getInstance(mailAccount.getSmtpProps(), authenticator); + } + + // ------------------------------------------------------------------------------------------------------------------------ Private method start + + /** + * 发送邮件给多人 + * + * @param mailAccount 邮件帐户信息 + * @param useGlobalSession 是否全局共享Session + * @param tos 收件人列表 + * @param ccs 抄送人列表,可以为null或空 + * @param bccs 密送人列表,可以为null或空 + * @param subject 标题 + * @param content 正文 + * @param imageMap 图片与占位符,占位符格式为cid:${cid} + * @param isHtml 是否为HTML格式 + * @param files 附件列表 + * @return message-id + * @since 4.6.3 + */ + private static String send(MailAccount mailAccount, boolean useGlobalSession, Collection tos, Collection ccs, Collection bccs, String subject, String content, + Map imageMap, boolean isHtml, File... files) { + final Mail mail = Mail.create(mailAccount).setUseGlobalSession(useGlobalSession); + + // 可选抄送人 + if (CollUtil.isNotEmpty(ccs)) { + mail.setCcs(ccs.toArray(new String[0])); + } + // 可选密送人 + if (CollUtil.isNotEmpty(bccs)) { + mail.setBccs(bccs.toArray(new String[0])); + } + + mail.setTos(tos.toArray(new String[0])); + mail.setTitle(subject); + mail.setContent(content); + mail.setHtml(isHtml); + mail.setFiles(files); + + // 图片 + if (MapUtil.isNotEmpty(imageMap)) { + for (Map.Entry entry : imageMap.entrySet()) { + mail.addImage(entry.getKey(), entry.getValue()); + // 关闭流 + IoUtil.close(entry.getValue()); + } + } + + return mail.send(); + } + + /** + * 将多个联系人转为列表,分隔符为逗号或者分号 + * + * @param addresses 多个联系人,如果为空返回null + * @return 联系人列表 + */ + private static List splitAddress(String addresses) { + if (StrUtil.isBlank(addresses)) { + return null; + } + + List result; + if (StrUtil.contains(addresses, CharUtil.COMMA)) { + result = StrUtil.splitTrim(addresses, CharUtil.COMMA); + } else if (StrUtil.contains(addresses, ';')) { + result = StrUtil.splitTrim(addresses, ';'); + } else { + result = CollUtil.newArrayList(addresses); + } + return result; + } + + // ------------------------------------------------------------------------------------------------------------------------ Private method end + +} diff --git a/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/UserPassAuthenticator.java b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/UserPassAuthenticator.java new file mode 100644 index 0000000..cd66174 --- /dev/null +++ b/aibidding-common/aibidding-common-mail/src/main/java/org/aibidding/common/mail/utils/UserPassAuthenticator.java @@ -0,0 +1,33 @@ +package org.aibidding.common.mail.utils; + +import jakarta.mail.Authenticator; +import jakarta.mail.PasswordAuthentication; + +/** + * 用户名密码验证器 + * + * @author looly + * @since 3.1.2 + */ +public class UserPassAuthenticator extends Authenticator { + + private final String user; + private final String pass; + + /** + * 构造 + * + * @param user 用户名 + * @param pass 密码 + */ + public UserPassAuthenticator(String user, String pass) { + this.user = user; + this.pass = pass; + } + + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(this.user, this.pass); + } + +} diff --git a/aibidding-common/aibidding-common-mail/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-mail/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..418f786 --- /dev/null +++ b/aibidding-common/aibidding-common-mail/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.aibidding.common.mail.config.MailConfig diff --git a/aibidding-common/aibidding-common-mybatis/pom.xml b/aibidding-common/aibidding-common-mybatis/pom.xml new file mode 100644 index 0000000..32e903d --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/pom.xml @@ -0,0 +1,48 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-mybatis + + + ruoyi-common-mybatis 数据库服务 + + + + + org.ruoyi + aibidding-common-core + + + + org.ruoyi + aibidding-common-satoken + + + + + com.baomidou + dynamic-datasource-spring-boot-starter + + + + com.baomidou + mybatis-plus-boot-starter + + + + + p6spy + p6spy + + + + diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/com/baomidou/dynamic/datasource/processor/jakarta/DsJakartaHeaderProcessor.java b/aibidding-common/aibidding-common-mybatis/src/main/java/com/baomidou/dynamic/datasource/processor/jakarta/DsJakartaHeaderProcessor.java new file mode 100644 index 0000000..f0a50a2 --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/com/baomidou/dynamic/datasource/processor/jakarta/DsJakartaHeaderProcessor.java @@ -0,0 +1,45 @@ +/* + * Copyright © 2018 organization baomidou + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.baomidou.dynamic.datasource.processor.jakarta; + +import com.baomidou.dynamic.datasource.processor.DsProcessor; +import jakarta.servlet.http.HttpServletRequest; +import org.aopalliance.intercept.MethodInvocation; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +/** + * @author TaoYu + * @since 3.6.0 + */ +public class DsJakartaHeaderProcessor extends DsProcessor { + + /** + * header prefix + */ + private static final String HEADER_PREFIX = "#header"; + + @Override + public boolean matches(String key) { + return key.startsWith(HEADER_PREFIX); + } + + @Override + public String doDetermineDatasource(MethodInvocation invocation, String key) { + HttpServletRequest request = (HttpServletRequest) ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + return request.getHeader(key.substring(8)); + } +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/com/baomidou/dynamic/datasource/processor/jakarta/DsJakartaSessionProcessor.java b/aibidding-common/aibidding-common-mybatis/src/main/java/com/baomidou/dynamic/datasource/processor/jakarta/DsJakartaSessionProcessor.java new file mode 100644 index 0000000..0ea8a13 --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/com/baomidou/dynamic/datasource/processor/jakarta/DsJakartaSessionProcessor.java @@ -0,0 +1,46 @@ +/* + * Copyright © 2018 organization baomidou + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.baomidou.dynamic.datasource.processor.jakarta; + +import com.baomidou.dynamic.datasource.processor.DsProcessor; +import jakarta.servlet.http.HttpServletRequest; +import org.aopalliance.intercept.MethodInvocation; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + + +/** + * @author TaoYu + * @since 3.6.0 + */ +public class DsJakartaSessionProcessor extends DsProcessor { + + /** + * session开头 + */ + private static final String SESSION_PREFIX = "#session"; + + @Override + public boolean matches(String key) { + return key.startsWith(SESSION_PREFIX); + } + + @Override + public String doDetermineDatasource(MethodInvocation invocation, String key) { + HttpServletRequest request = (HttpServletRequest) ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + return request.getSession().getAttribute(key.substring(9)).toString(); + } +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/annotation/DataColumn.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/annotation/DataColumn.java new file mode 100644 index 0000000..2b748ca --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/annotation/DataColumn.java @@ -0,0 +1,28 @@ +package org.aibidding.common.mybatis.annotation; + +import java.lang.annotation.*; + +/** + * 数据权限 + * + * 一个注解只能对应一个模板 + * + * @author Lion Li + * @version 3.5.0 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface DataColumn { + + /** + * 占位符关键字 + */ + String[] key() default "deptName"; + + /** + * 占位符替换值 + */ + String[] value() default "dept_id"; + +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/annotation/DataPermission.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/annotation/DataPermission.java new file mode 100644 index 0000000..1850925 --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/annotation/DataPermission.java @@ -0,0 +1,18 @@ +package org.aibidding.common.mybatis.annotation; + +import java.lang.annotation.*; + +/** + * 数据权限组 + * + * @author Lion Li + * @version 3.5.0 + */ +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface DataPermission { + + DataColumn[] value(); + +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/config/MybatisPlusConfig.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/config/MybatisPlusConfig.java new file mode 100644 index 0000000..e52bfcf --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/config/MybatisPlusConfig.java @@ -0,0 +1,102 @@ +package org.aibidding.common.mybatis.config; + +import cn.hutool.core.net.NetUtil; +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator; +import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.aibidding.common.mybatis.handler.InjectionMetaObjectHandler; +import org.aibidding.common.mybatis.interceptor.PlusDataPermissionInterceptor; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +/** + * mybatis-plus配置类(下方注释有插件介绍) + * + * @author Lion Li + */ +@EnableTransactionManagement(proxyTargetClass = true) +@AutoConfiguration +@MapperScan("${mybatis-plus.mapperPackage}") +public class MybatisPlusConfig { + + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + // 数据权限处理 + interceptor.addInnerInterceptor(dataPermissionInterceptor()); + // 分页插件 + interceptor.addInnerInterceptor(paginationInnerInterceptor()); + // 乐观锁插件 + interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor()); + return interceptor; + } + + /** + * 数据权限拦截器 + */ + public PlusDataPermissionInterceptor dataPermissionInterceptor() { + return new PlusDataPermissionInterceptor(); + } + + /** + * 分页插件,自动识别数据库类型 + */ + public PaginationInnerInterceptor paginationInnerInterceptor() { + PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(); + // 设置最大单页限制数量,默认 500 条,-1 不受限制 + paginationInnerInterceptor.setMaxLimit(-1L); + // 分页合理化 + paginationInnerInterceptor.setOverflow(true); + return paginationInnerInterceptor; + } + + /** + * 乐观锁插件 + */ + public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor() { + return new OptimisticLockerInnerInterceptor(); + } + + /** + * 元对象字段填充控制器 + */ + @Bean + public MetaObjectHandler metaObjectHandler() { + return new InjectionMetaObjectHandler(); + } + + /** + * 使用网卡信息绑定雪花生成器 + * 防止集群雪花ID重复 + */ + @Bean + public IdentifierGenerator idGenerator() { + return new DefaultIdentifierGenerator(NetUtil.getLocalhost()); + } + + /** + * PaginationInnerInterceptor 分页插件,自动识别数据库类型 + * https://baomidou.com/pages/97710a/ + * OptimisticLockerInnerInterceptor 乐观锁插件 + * https://baomidou.com/pages/0d93c0/ + * MetaObjectHandler 元对象字段填充控制器 + * https://baomidou.com/pages/4c6bcf/ + * ISqlInjector sql注入器 + * https://baomidou.com/pages/42ea4a/ + * BlockAttackInnerInterceptor 如果是对全表的删除或更新操作,就会终止该操作 + * https://baomidou.com/pages/f9a237/ + * IllegalSQLInnerInterceptor sql性能规范插件(垃圾SQL拦截) + * IdentifierGenerator 自定义主键策略 + * https://baomidou.com/pages/568eb2/ + * TenantLineInnerInterceptor 多租户插件 + * https://baomidou.com/pages/aef2f2/ + * DynamicTableNameInnerInterceptor 动态表名插件 + * https://baomidou.com/pages/2a45ff/ + */ + +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/core/domain/BaseEntity.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/core/domain/BaseEntity.java new file mode 100644 index 0000000..4e069c0 --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/core/domain/BaseEntity.java @@ -0,0 +1,71 @@ +package org.aibidding.common.mybatis.core.domain; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * Entity基类 + * + * @author Lion Li + */ + +@Data +public class BaseEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 搜索值 + */ + @JsonIgnore + @TableField(exist = false) + private String searchValue; + + /** + * 创建部门 + */ + @TableField(fill = FieldFill.INSERT) + private Long createDept; + + /** + * 创建者 + */ + @TableField(fill = FieldFill.INSERT) + private Long createBy; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updateBy; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + /** + * 请求参数 + */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @TableField(exist = false) + private Map params = new HashMap<>(); + +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/core/mapper/BaseMapperPlus.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/core/mapper/BaseMapperPlus.java new file mode 100644 index 0000000..672f808 --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/core/mapper/BaseMapperPlus.java @@ -0,0 +1,198 @@ +package org.aibidding.common.mybatis.core.mapper; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.ReflectionKit; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.toolkit.Db; +import org.apache.ibatis.logging.Log; +import org.apache.ibatis.logging.LogFactory; +import org.aibidding.common.core.utils.MapstructUtils; + +import java.io.Serializable; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 自定义 Mapper 接口, 实现 自定义扩展 + * + * @param table 泛型 + * @param vo 泛型 + * @author Lion Li + * @since 2021-05-13 + */ +@SuppressWarnings("unchecked") +public interface BaseMapperPlus extends BaseMapper { + + Log log = LogFactory.getLog(BaseMapperPlus.class); + + default Class currentVoClass() { + return (Class) ReflectionKit.getSuperClassGenericType(this.getClass(), BaseMapperPlus.class, 1); + } + + default Class currentModelClass() { + return (Class) ReflectionKit.getSuperClassGenericType(this.getClass(), BaseMapperPlus.class, 0); + } + + default List selectList() { + return this.selectList(new QueryWrapper<>()); + } + + /** + * 批量插入 + */ + default boolean insertBatch(Collection entityList) { + return Db.saveBatch(entityList); + } + + /** + * 批量更新 + */ + default boolean updateBatchById(Collection entityList) { + return Db.updateBatchById(entityList); + } + + /** + * 批量插入或更新 + */ + default boolean insertOrUpdateBatch(Collection entityList) { + return Db.saveOrUpdateBatch(entityList); + } + + /** + * 批量插入(包含限制条数) + */ + default boolean insertBatch(Collection entityList, int batchSize) { + return Db.saveBatch(entityList, batchSize); + } + + /** + * 批量更新(包含限制条数) + */ + default boolean updateBatchById(Collection entityList, int batchSize) { + return Db.updateBatchById(entityList, batchSize); + } + + /** + * 批量插入或更新(包含限制条数) + */ + default boolean insertOrUpdateBatch(Collection entityList, int batchSize) { + return Db.saveOrUpdateBatch(entityList, batchSize); + } + + /** + * 插入或更新(包含限制条数) + */ + default boolean insertOrUpdate(T entity) { + return Db.saveOrUpdate(entity); + } + + default V selectVoById(Serializable id) { + return selectVoById(id, this.currentVoClass()); + } + + /** + * 根据 ID 查询 + */ + default C selectVoById(Serializable id, Class voClass) { + T obj = this.selectById(id); + if (ObjectUtil.isNull(obj)) { + return null; + } + return MapstructUtils.convert(obj, voClass); + } + + default List selectVoBatchIds(Collection idList) { + return selectVoBatchIds(idList, this.currentVoClass()); + } + + /** + * 查询(根据ID 批量查询) + */ + default List selectVoBatchIds(Collection idList, Class voClass) { + List list = this.selectBatchIds(idList); + if (CollUtil.isEmpty(list)) { + return CollUtil.newArrayList(); + } + return MapstructUtils.convert(list, voClass); + } + + default List selectVoByMap(Map map) { + return selectVoByMap(map, this.currentVoClass()); + } + + /** + * 查询(根据 columnMap 条件) + */ + default List selectVoByMap(Map map, Class voClass) { + List list = this.selectByMap(map); + if (CollUtil.isEmpty(list)) { + return CollUtil.newArrayList(); + } + return MapstructUtils.convert(list, voClass); + } + + default V selectVoOne(Wrapper wrapper) { + return selectVoOne(wrapper, this.currentVoClass()); + } + + /** + * 根据 entity 条件,查询一条记录 + */ + default C selectVoOne(Wrapper wrapper, Class voClass) { + T obj = this.selectOne(wrapper); + if (ObjectUtil.isNull(obj)) { + return null; + } + return MapstructUtils.convert(obj, voClass); + } + + default List selectVoList() { + return selectVoList(new QueryWrapper<>(), this.currentVoClass()); + } + + default List selectVoList(Wrapper wrapper) { + return selectVoList(wrapper, this.currentVoClass()); + } + + /** + * 根据 entity 条件,查询全部记录 + */ + default List selectVoList(Wrapper wrapper, Class voClass) { + List list = this.selectList(wrapper); + if (CollUtil.isEmpty(list)) { + return CollUtil.newArrayList(); + } + return MapstructUtils.convert(list, voClass); + } + + default

> P selectVoPage(IPage page, Wrapper wrapper) { + return selectVoPage(page, wrapper, this.currentVoClass()); + } + + /** + * 分页查询VO + */ + default > P selectVoPage(IPage page, Wrapper wrapper, Class voClass) { + IPage pageData = this.selectPage(page, wrapper); + IPage voPage = new Page<>(pageData.getCurrent(), pageData.getSize(), pageData.getTotal()); + if (CollUtil.isEmpty(pageData.getRecords())) { + return (P) voPage; + } + voPage.setRecords(MapstructUtils.convert(pageData.getRecords(), voClass)); + return (P) voPage; + } + + default List selectObjs(Wrapper wrapper, Function mapper) { + return this.selectObjs(wrapper).stream().filter(Objects::nonNull).map(mapper).collect(Collectors.toList()); + } + +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/core/page/PageQuery.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/core/page/PageQuery.java new file mode 100644 index 0000000..712fcfc --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/core/page/PageQuery.java @@ -0,0 +1,114 @@ +package org.aibidding.common.mybatis.core.page; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.Data; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.core.utils.sql.SqlUtil; + +import java.io.Serial; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 分页查询实体类 + * + * @author Lion Li + */ + +@Data +public class PageQuery implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 分页大小 + */ + private Integer pageSize; + + /** + * 当前页数 + */ + private Integer pageNum; + + /** + * 排序列 + */ + private String orderByColumn; + + /** + * 排序的方向desc或者asc + */ + private String isAsc; + + /** + * 当前记录起始索引 默认值 + */ + public static final int DEFAULT_PAGE_NUM = 1; + + /** + * 每页显示记录数 默认值 默认查全部 + */ + public static final int DEFAULT_PAGE_SIZE = Integer.MAX_VALUE; + + public Page build() { + Integer pageNum = ObjectUtil.defaultIfNull(getPageNum(), DEFAULT_PAGE_NUM); + Integer pageSize = ObjectUtil.defaultIfNull(getPageSize(), DEFAULT_PAGE_SIZE); + if (pageNum <= 0) { + pageNum = DEFAULT_PAGE_NUM; + } + Page page = new Page<>(pageNum, pageSize); + List orderItems = buildOrderItem(); + if (CollUtil.isNotEmpty(orderItems)) { + page.addOrder(orderItems); + } + return page; + } + + /** + * 构建排序 + * + * 支持的用法如下: + * {isAsc:"asc",orderByColumn:"id"} order by id asc + * {isAsc:"asc",orderByColumn:"id,createTime"} order by id asc,create_time asc + * {isAsc:"desc",orderByColumn:"id,createTime"} order by id desc,create_time desc + * {isAsc:"asc,desc",orderByColumn:"id,createTime"} order by id asc,create_time desc + */ + private List buildOrderItem() { + if (StringUtils.isBlank(orderByColumn) || StringUtils.isBlank(isAsc)) { + return null; + } + String orderBy = SqlUtil.escapeOrderBySql(orderByColumn); + orderBy = StringUtils.toUnderScoreCase(orderBy); + + // 兼容前端排序类型 + isAsc = StringUtils.replaceEach(isAsc, new String[]{"ascending", "descending"}, new String[]{"asc", "desc"}); + + String[] orderByArr = orderBy.split(StringUtils.SEPARATOR); + String[] isAscArr = isAsc.split(StringUtils.SEPARATOR); + if (isAscArr.length != 1 && isAscArr.length != orderByArr.length) { + throw new ServiceException("排序参数有误"); + } + + List list = new ArrayList<>(); + // 每个字段各自排序 + for (int i = 0; i < orderByArr.length; i++) { + String orderByStr = orderByArr[i]; + String isAscStr = isAscArr.length == 1 ? isAscArr[0] : isAscArr[i]; + if ("asc".equals(isAscStr)) { + list.add(OrderItem.asc(orderByStr)); + } else if ("desc".equals(isAscStr)) { + list.add(OrderItem.desc(orderByStr)); + } else { + throw new ServiceException("排序参数有误"); + } + } + return list; + } + +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/core/page/TableDataInfo.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/core/page/TableDataInfo.java new file mode 100644 index 0000000..a6f2683 --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/core/page/TableDataInfo.java @@ -0,0 +1,81 @@ +package org.aibidding.common.mybatis.core.page; + +import cn.hutool.http.HttpStatus; +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serial; +import java.io.Serializable; +import java.util.List; + +/** + * 表格分页数据对象 + * + * @author Lion Li + */ + +@Data +@NoArgsConstructor +public class TableDataInfo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 总记录数 + */ + private long total; + + /** + * 列表数据 + */ + private List rows; + + /** + * 消息状态码 + */ + private int code; + + /** + * 消息内容 + */ + private String msg; + + /** + * 分页 + * + * @param list 列表数据 + * @param total 总记录数 + */ + public TableDataInfo(List list, long total) { + this.rows = list; + this.total = total; + } + + public static TableDataInfo build(IPage page) { + TableDataInfo rspData = new TableDataInfo<>(); + rspData.setCode(HttpStatus.HTTP_OK); + rspData.setMsg("查询成功"); + rspData.setRows(page.getRecords()); + rspData.setTotal(page.getTotal()); + return rspData; + } + + public static TableDataInfo build(List list) { + TableDataInfo rspData = new TableDataInfo<>(); + rspData.setCode(HttpStatus.HTTP_OK); + rspData.setMsg("查询成功"); + rspData.setRows(list); + rspData.setTotal(list.size()); + return rspData; + } + + public static TableDataInfo build() { + TableDataInfo rspData = new TableDataInfo<>(); + rspData.setCode(HttpStatus.HTTP_OK); + rspData.setMsg("查询成功"); + return rspData; + } + +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/enums/DataBaseType.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/enums/DataBaseType.java new file mode 100644 index 0000000..d801083 --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/enums/DataBaseType.java @@ -0,0 +1,49 @@ +package org.aibidding.common.mybatis.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.aibidding.common.core.utils.StringUtils; + +/** + * 数据库类型 + * + * @author Lion Li + */ +@Getter +@AllArgsConstructor +public enum DataBaseType { + + /** + * MySQL + */ + MY_SQL("MySQL"), + + /** + * Oracle + */ + ORACLE("Oracle"), + + /** + * PostgreSQL + */ + POSTGRE_SQL("PostgreSQL"), + + /** + * SQL Server + */ + SQL_SERVER("Microsoft SQL Server"); + + private final String type; + + public static DataBaseType find(String databaseProductName) { + if (StringUtils.isBlank(databaseProductName)) { + return null; + } + for (DataBaseType type : values()) { + if (type.getType().equals(databaseProductName)) { + return type; + } + } + return null; + } +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/enums/DataScopeType.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/enums/DataScopeType.java new file mode 100644 index 0000000..dc83bfd --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/enums/DataScopeType.java @@ -0,0 +1,73 @@ +package org.aibidding.common.mybatis.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.helper.DataPermissionHelper; + +/** + * 数据权限类型 + *

+ * 语法支持 spel 模板表达式 + *

+ * 内置数据 user 当前用户 内容参考 LoginUser + * 如需扩展数据 可使用 {@link DataPermissionHelper} 操作 + * 内置服务 sdss 系统数据权限服务 内容参考 SysDataScopeService + * 如需扩展更多自定义服务 可以参考 sdss 自行编写 + * + * @author Lion Li + * @version 3.5.0 + */ +@Getter +@AllArgsConstructor +public enum DataScopeType { + + /** + * 全部数据权限 + */ + ALL("1", "", ""), + + /** + * 自定数据权限 + */ + CUSTOM("2", " #{#deptName} IN ( #{@sdss.getRoleCustom( #user.roleId )} ) ", ""), + + /** + * 部门数据权限 + */ + DEPT("3", " #{#deptName} = #{#user.deptId} ", ""), + + /** + * 部门及以下数据权限 + */ + DEPT_AND_CHILD("4", " #{#deptName} IN ( #{@sdss.getDeptAndChild( #user.deptId )} )", ""), + + /** + * 仅本人数据权限 + */ + SELF("5", " #{#userName} = #{#user.userId} ", " 1 = 0 "); + + private final String code; + + /** + * 语法 采用 spel 模板表达式 + */ + private final String sqlTemplate; + + /** + * 不满足 sqlTemplate 则填充 + */ + private final String elseSql; + + public static DataScopeType findCode(String code) { + if (StringUtils.isBlank(code)) { + return null; + } + for (DataScopeType type : values()) { + if (type.getCode().equals(code)) { + return type; + } + } + return null; + } +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/handler/InjectionMetaObjectHandler.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/handler/InjectionMetaObjectHandler.java new file mode 100644 index 0000000..5bada6d --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/handler/InjectionMetaObjectHandler.java @@ -0,0 +1,81 @@ +package org.aibidding.common.mybatis.handler; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.http.HttpStatus; +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.reflection.MetaObject; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.common.satoken.utils.LoginHelper; + +import java.util.Date; + +/** + * MP注入处理器 + * + * @author Lion Li + * @date 2021/4/25 + */ +@Slf4j +public class InjectionMetaObjectHandler implements MetaObjectHandler { + + @Override + public void insertFill(MetaObject metaObject) { + try { + if (ObjectUtil.isNotNull(metaObject) && metaObject.getOriginalObject() instanceof BaseEntity baseEntity) { + Date current = ObjectUtil.isNotNull(baseEntity.getCreateTime()) + ? baseEntity.getCreateTime() : new Date(); + baseEntity.setCreateTime(current); + baseEntity.setUpdateTime(current); + LoginUser loginUser = getLoginUser(); + if (ObjectUtil.isNotNull(loginUser)) { + Long userId = ObjectUtil.isNotNull(baseEntity.getCreateBy()) + ? baseEntity.getCreateBy() : loginUser.getUserId(); + // 当前已登录 且 创建人为空 则填充 + baseEntity.setCreateBy(userId); + // 当前已登录 且 更新人为空 则填充 + baseEntity.setUpdateBy(userId); + baseEntity.setCreateDept(ObjectUtil.isNotNull(baseEntity.getCreateDept()) + ? baseEntity.getCreateDept() : loginUser.getDeptId()); + } + } + } catch (Exception e) { + throw new ServiceException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED); + } + } + + @Override + public void updateFill(MetaObject metaObject) { + try { + if (ObjectUtil.isNotNull(metaObject) && metaObject.getOriginalObject() instanceof BaseEntity baseEntity) { + Date current = new Date(); + // 更新时间填充(不管为不为空) + baseEntity.setUpdateTime(current); + LoginUser loginUser = getLoginUser(); + // 当前已登录 更新人填充(不管为不为空) + if (ObjectUtil.isNotNull(loginUser)) { + baseEntity.setUpdateBy(loginUser.getUserId()); + } + } + } catch (Exception e) { + throw new ServiceException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED); + } + } + + /** + * 获取登录用户名 + */ + private LoginUser getLoginUser() { + LoginUser loginUser; + try { + loginUser = LoginHelper.getLoginUser(); + } catch (Exception e) { + log.warn("自动注入警告 => 用户未登录"); + return null; + } + return loginUser; + } + +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/handler/MybatisExceptionHandler.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/handler/MybatisExceptionHandler.java new file mode 100644 index 0000000..2497107 --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/handler/MybatisExceptionHandler.java @@ -0,0 +1,45 @@ +package org.aibidding.common.mybatis.handler; + +import jakarta.servlet.http.HttpServletRequest; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.domain.R; +import org.mybatis.spring.MyBatisSystemException; +import org.springframework.dao.DuplicateKeyException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * Mybatis异常处理器 + * + * @author Lion Li + */ +@Slf4j +@RestControllerAdvice +public class MybatisExceptionHandler { + + /** + * 主键或UNIQUE索引,数据重复异常 + */ + @ExceptionHandler(DuplicateKeyException.class) + public R handleDuplicateKeyException(DuplicateKeyException e, HttpServletRequest request) { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',数据库中已存在记录'{}'", requestURI, e.getMessage()); + return R.fail("数据库中已存在该记录,请联系管理员确认"); + } + + /** + * Mybatis系统异常 通用处理 + */ + @ExceptionHandler(MyBatisSystemException.class) + public R handleCannotFindDataSourceException(MyBatisSystemException e, HttpServletRequest request) { + String requestURI = request.getRequestURI(); + String message = e.getMessage(); + if (message.contains("CannotFindDataSourceException")) { + log.error("请求地址'{}', 未找到数据源", requestURI); + return R.fail("未找到数据源,请联系管理员确认"); + } + log.error("请求地址'{}', Mybatis系统异常", requestURI, e); + return R.fail(message); + } + +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/handler/PlusDataPermissionHandler.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/handler/PlusDataPermissionHandler.java new file mode 100644 index 0000000..c5304fb --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/handler/PlusDataPermissionHandler.java @@ -0,0 +1,198 @@ +package org.aibidding.common.mybatis.handler; + +import cn.hutool.core.annotation.AnnotationUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ConcurrentHashSet; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ClassUtil; +import cn.hutool.core.util.ObjectUtil; +import lombok.extern.slf4j.Slf4j; +import net.sf.jsqlparser.JSQLParserException; +import net.sf.jsqlparser.expression.Expression; +import net.sf.jsqlparser.expression.Parenthesis; +import net.sf.jsqlparser.expression.operators.conditional.AndExpression; +import net.sf.jsqlparser.parser.CCJSqlParserUtil; +import org.aibidding.common.core.domain.dto.RoleDTO; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.core.utils.StreamUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.annotation.DataColumn; +import org.aibidding.common.mybatis.annotation.DataPermission; +import org.aibidding.common.mybatis.enums.DataScopeType; +import org.aibidding.common.mybatis.helper.DataPermissionHelper; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.springframework.context.expression.BeanFactoryResolver; +import org.springframework.expression.BeanResolver; +import org.springframework.expression.ExpressionParser; +import org.springframework.expression.ParserContext; +import org.springframework.expression.common.TemplateParserContext; +import org.springframework.expression.spel.standard.SpelExpressionParser; +import org.springframework.expression.spel.support.StandardEvaluationContext; + +import java.lang.reflect.Method; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; + +/** + * 数据权限过滤 + * + * @author Lion Li + * @version 3.5.0 + */ +@Slf4j +public class PlusDataPermissionHandler { + + /** + * 方法或类(名称) 与 注解的映射关系缓存 + */ + private final Map dataPermissionCacheMap = new ConcurrentHashMap<>(); + + /** + * 无效注解方法缓存用于快速返回 + */ + private final Set invalidCacheSet = new ConcurrentHashSet<>(); + + /** + * spel 解析器 + */ + private final ExpressionParser parser = new SpelExpressionParser(); + private final ParserContext parserContext = new TemplateParserContext(); + /** + * bean解析器 用于处理 spel 表达式中对 bean 的调用 + */ + private final BeanResolver beanResolver = new BeanFactoryResolver(SpringUtils.getBeanFactory()); + + + public Expression getSqlSegment(Expression where, String mappedStatementId, boolean isSelect) { + DataColumn[] dataColumns = findAnnotation(mappedStatementId); + if (ArrayUtil.isEmpty(dataColumns)) { + invalidCacheSet.add(mappedStatementId); + return where; + } + LoginUser currentUser = DataPermissionHelper.getVariable("user"); + if (ObjectUtil.isNull(currentUser)) { + currentUser = LoginHelper.getLoginUser(); + DataPermissionHelper.setVariable("user", currentUser); + } + // 如果是超级管理员或租户管理员,则不过滤数据 + if (LoginHelper.isSuperAdmin() || LoginHelper.isTenantAdmin()) { + return where; + } + String dataFilterSql = buildDataFilter(dataColumns, isSelect); + if (StringUtils.isBlank(dataFilterSql)) { + return where; + } + try { + Expression expression = CCJSqlParserUtil.parseExpression(dataFilterSql); + // 数据权限使用单独的括号 防止与其他条件冲突 + Parenthesis parenthesis = new Parenthesis(expression); + if (ObjectUtil.isNotNull(where)) { + return new AndExpression(where, parenthesis); + } else { + return parenthesis; + } + } catch (JSQLParserException e) { + throw new ServiceException("数据权限解析异常 => " + e.getMessage()); + } + } + + /** + * 构造数据过滤sql + */ + private String buildDataFilter(DataColumn[] dataColumns, boolean isSelect) { + // 更新或删除需满足所有条件 + String joinStr = isSelect ? " OR " : " AND "; + LoginUser user = DataPermissionHelper.getVariable("user"); + StandardEvaluationContext context = new StandardEvaluationContext(); + context.setBeanResolver(beanResolver); + DataPermissionHelper.getContext().forEach(context::setVariable); + Set conditions = new HashSet<>(); + for (RoleDTO role : user.getRoles()) { + user.setRoleId(role.getRoleId()); + // 获取角色权限泛型 + DataScopeType type = DataScopeType.findCode(role.getDataScope()); + if (ObjectUtil.isNull(type)) { + throw new ServiceException("角色数据范围异常 => " + role.getDataScope()); + } + // 全部数据权限直接返回 + if (type == DataScopeType.ALL) { + return ""; + } + boolean isSuccess = false; + for (DataColumn dataColumn : dataColumns) { + if (dataColumn.key().length != dataColumn.value().length) { + throw new ServiceException("角色数据范围异常 => key与value长度不匹配"); + } + // 不包含 key 变量 则不处理 + if (!StringUtils.containsAny(type.getSqlTemplate(), + Arrays.stream(dataColumn.key()).map(key -> "#" + key).toArray(String[]::new) + )) { + continue; + } + // 设置注解变量 key 为表达式变量 value 为变量值 + for (int i = 0; i < dataColumn.key().length; i++) { + context.setVariable(dataColumn.key()[i], dataColumn.value()[i]); + } + + // 解析sql模板并填充 + String sql = parser.parseExpression(type.getSqlTemplate(), parserContext).getValue(context, String.class); + conditions.add(joinStr + sql); + isSuccess = true; + } + // 未处理成功则填充兜底方案 + if (!isSuccess && StringUtils.isNotBlank(type.getElseSql())) { + conditions.add(joinStr + type.getElseSql()); + } + } + + if (CollUtil.isNotEmpty(conditions)) { + String sql = StreamUtils.join(conditions, Function.identity(), ""); + return sql.substring(joinStr.length()); + } + return ""; + } + + private DataColumn[] findAnnotation(String mappedStatementId) { + StringBuilder sb = new StringBuilder(mappedStatementId); + int index = sb.lastIndexOf("."); + String clazzName = sb.substring(0, index); + String methodName = sb.substring(index + 1, sb.length()); + Class clazz = ClassUtil.loadClass(clazzName); + List methods = Arrays.stream(ClassUtil.getDeclaredMethods(clazz)) + .filter(method -> method.getName().equals(methodName)).toList(); + DataPermission dataPermission; + // 获取方法注解 + for (Method method : methods) { + dataPermission = dataPermissionCacheMap.get(mappedStatementId); + if (ObjectUtil.isNotNull(dataPermission)) { + return dataPermission.value(); + } + if (AnnotationUtil.hasAnnotation(method, DataPermission.class)) { + dataPermission = AnnotationUtil.getAnnotation(method, DataPermission.class); + dataPermissionCacheMap.put(mappedStatementId, dataPermission); + return dataPermission.value(); + } + } + dataPermission = dataPermissionCacheMap.get(clazz.getName()); + if (ObjectUtil.isNotNull(dataPermission)) { + return dataPermission.value(); + } + // 获取类注解 + if (AnnotationUtil.hasAnnotation(clazz, DataPermission.class)) { + dataPermission = AnnotationUtil.getAnnotation(clazz, DataPermission.class); + dataPermissionCacheMap.put(clazz.getName(), dataPermission); + return dataPermission.value(); + } + return null; + } + + /** + * 是否为无效方法 无数据权限 + */ + public boolean isInvalid(String mappedStatementId) { + return invalidCacheSet.contains(mappedStatementId); + } +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/helper/DataBaseHelper.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/helper/DataBaseHelper.java new file mode 100644 index 0000000..27275e7 --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/helper/DataBaseHelper.java @@ -0,0 +1,72 @@ +package org.aibidding.common.mybatis.helper; + +import cn.hutool.core.convert.Convert; +import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.mybatis.enums.DataBaseType; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.SQLException; + +/** + * 数据库助手 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class DataBaseHelper { + + private static final DynamicRoutingDataSource DS = SpringUtils.getBean(DynamicRoutingDataSource.class); + + /** + * 获取当前数据库类型 + */ + public static DataBaseType getDataBaseType() { + DataSource dataSource = DS.determineDataSource(); + try (Connection conn = dataSource.getConnection()) { + DatabaseMetaData metaData = conn.getMetaData(); + String databaseProductName = metaData.getDatabaseProductName(); + return DataBaseType.find(databaseProductName); + } catch (SQLException e) { + throw new ServiceException(e.getMessage()); + } + } + + public static boolean isMySql() { + return DataBaseType.MY_SQL == getDataBaseType(); + } + + public static boolean isOracle() { + return DataBaseType.ORACLE == getDataBaseType(); + } + + public static boolean isPostgerSql() { + return DataBaseType.POSTGRE_SQL == getDataBaseType(); + } + + public static boolean isSqlServer() { + return DataBaseType.SQL_SERVER == getDataBaseType(); + } + + public static String findInSet(Object var1, String var2) { + DataBaseType dataBasyType = getDataBaseType(); + String var = Convert.toStr(var1); + if (dataBasyType == DataBaseType.SQL_SERVER) { + // charindex(',100,' , ',0,100,101,') <> 0 + return "charindex(',%s,' , ','+%s+',') <> 0".formatted(var, var2); + } else if (dataBasyType == DataBaseType.POSTGRE_SQL) { + // (select position(',100,' in ',0,100,101,')) <> 0 + return "(select position(',%s,' in ','||%s||',')) <> 0".formatted(var, var2); + } else if (dataBasyType == DataBaseType.ORACLE) { + // instr(',0,100,101,' , ',100,') <> 0 + return "instr(','||%s||',' , ',%s,') <> 0".formatted(var2, var); + } + // find_in_set(100 , '0,100,101') + return "find_in_set('%s' , %s) <> 0".formatted(var, var2); + } +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/helper/DataPermissionHelper.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/helper/DataPermissionHelper.java new file mode 100644 index 0000000..9092357 --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/helper/DataPermissionHelper.java @@ -0,0 +1,93 @@ +package org.aibidding.common.mybatis.helper; + +import cn.dev33.satoken.context.SaHolder; +import cn.dev33.satoken.context.model.SaStorage; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.plugins.IgnoreStrategy; +import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Supplier; + +/** + * 数据权限助手 + * + * @author Lion Li + * @version 3.5.0 + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@SuppressWarnings("unchecked cast") +public class DataPermissionHelper { + + private static final String DATA_PERMISSION_KEY = "data:permission"; + + public static T getVariable(String key) { + Map context = getContext(); + return (T) context.get(key); + } + + + public static void setVariable(String key, Object value) { + Map context = getContext(); + context.put(key, value); + } + + public static Map getContext() { + SaStorage saStorage = SaHolder.getStorage(); + Object attribute = saStorage.get(DATA_PERMISSION_KEY); + if (ObjectUtil.isNull(attribute)) { + saStorage.set(DATA_PERMISSION_KEY, new HashMap<>()); + attribute = saStorage.get(DATA_PERMISSION_KEY); + } + if (attribute instanceof Map map) { + return map; + } + throw new NullPointerException("data permission context type exception"); + } + + /** + * 开启忽略数据权限(开启后需手动调用 {@link #disableIgnore()} 关闭) + */ + public static void enableIgnore() { + InterceptorIgnoreHelper.handle(IgnoreStrategy.builder().dataPermission(true).build()); + } + + /** + * 关闭忽略数据权限 + */ + public static void disableIgnore() { + InterceptorIgnoreHelper.clearIgnoreStrategy(); + } + + /** + * 在忽略数据权限中执行 + * + * @param handle 处理执行方法 + */ + public static void ignore(Runnable handle) { + enableIgnore(); + try { + handle.run(); + } finally { + disableIgnore(); + } + } + + /** + * 在忽略数据权限中执行 + * + * @param handle 处理执行方法 + */ + public static T ignore(Supplier handle) { + enableIgnore(); + try { + return handle.get(); + } finally { + disableIgnore(); + } + } + +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/interceptor/PlusDataPermissionInterceptor.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/interceptor/PlusDataPermissionInterceptor.java new file mode 100644 index 0000000..1a01c0e --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/interceptor/PlusDataPermissionInterceptor.java @@ -0,0 +1,107 @@ +package org.aibidding.common.mybatis.interceptor; + +import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper; +import com.baomidou.mybatisplus.core.toolkit.PluginUtils; +import com.baomidou.mybatisplus.extension.parser.JsqlParserSupport; +import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor; +import net.sf.jsqlparser.expression.Expression; +import net.sf.jsqlparser.statement.delete.Delete; +import net.sf.jsqlparser.statement.select.PlainSelect; +import net.sf.jsqlparser.statement.select.Select; +import net.sf.jsqlparser.statement.select.SelectBody; +import net.sf.jsqlparser.statement.select.SetOperationList; +import net.sf.jsqlparser.statement.update.Update; +import org.apache.ibatis.executor.Executor; +import org.apache.ibatis.executor.statement.StatementHandler; +import org.apache.ibatis.mapping.BoundSql; +import org.apache.ibatis.mapping.MappedStatement; +import org.apache.ibatis.mapping.SqlCommandType; +import org.apache.ibatis.session.ResultHandler; +import org.apache.ibatis.session.RowBounds; +import org.aibidding.common.mybatis.handler.PlusDataPermissionHandler; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.List; + +/** + * 数据权限拦截器 + * + * @author Lion Li + * @version 3.5.0 + */ +public class PlusDataPermissionInterceptor extends JsqlParserSupport implements InnerInterceptor { + + private final PlusDataPermissionHandler dataPermissionHandler = new PlusDataPermissionHandler(); + + @Override + public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException { + // 检查忽略注解 + if (InterceptorIgnoreHelper.willIgnoreDataPermission(ms.getId())) { + return; + } + // 检查是否无效 无数据权限注解 + if (dataPermissionHandler.isInvalid(ms.getId())) { + return; + } + // 解析 sql 分配对应方法 + PluginUtils.MPBoundSql mpBs = PluginUtils.mpBoundSql(boundSql); + mpBs.sql(parserSingle(mpBs.sql(), ms.getId())); + } + + @Override + public void beforePrepare(StatementHandler sh, Connection connection, Integer transactionTimeout) { + PluginUtils.MPStatementHandler mpSh = PluginUtils.mpStatementHandler(sh); + MappedStatement ms = mpSh.mappedStatement(); + SqlCommandType sct = ms.getSqlCommandType(); + if (sct == SqlCommandType.UPDATE || sct == SqlCommandType.DELETE) { + if (InterceptorIgnoreHelper.willIgnoreDataPermission(ms.getId())) { + return; + } + PluginUtils.MPBoundSql mpBs = mpSh.mPBoundSql(); + mpBs.sql(parserMulti(mpBs.sql(), ms.getId())); + } + } + + @Override + protected void processSelect(Select select, int index, String sql, Object obj) { + SelectBody selectBody = select.getSelectBody(); + if (selectBody instanceof PlainSelect plainSelect) { + this.setWhere(plainSelect, (String) obj); + } else if (selectBody instanceof SetOperationList setOperationList) { + List selectBodyList = setOperationList.getSelects(); + selectBodyList.forEach(s -> this.setWhere((PlainSelect) s, (String) obj)); + } + } + + @Override + protected void processUpdate(Update update, int index, String sql, Object obj) { + Expression sqlSegment = dataPermissionHandler.getSqlSegment(update.getWhere(), (String) obj, false); + if (null != sqlSegment) { + update.setWhere(sqlSegment); + } + } + + @Override + protected void processDelete(Delete delete, int index, String sql, Object obj) { + Expression sqlSegment = dataPermissionHandler.getSqlSegment(delete.getWhere(), (String) obj, false); + if (null != sqlSegment) { + delete.setWhere(sqlSegment); + } + } + + /** + * 设置 where 条件 + * + * @param plainSelect 查询对象 + * @param mappedStatementId 执行方法id + */ + protected void setWhere(PlainSelect plainSelect, String mappedStatementId) { + Expression sqlSegment = dataPermissionHandler.getSqlSegment(plainSelect.getWhere(), mappedStatementId, true); + if (null != sqlSegment) { + plainSelect.setWhere(sqlSegment); + } + } + +} + diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/jakarta/DsJakartaHeaderProcessor.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/jakarta/DsJakartaHeaderProcessor.java new file mode 100644 index 0000000..e581353 --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/jakarta/DsJakartaHeaderProcessor.java @@ -0,0 +1,45 @@ +/* + * Copyright © 2018 organization baomidou + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.aibidding.common.mybatis.jakarta; + +import com.baomidou.dynamic.datasource.processor.DsProcessor; +import jakarta.servlet.http.HttpServletRequest; +import org.aopalliance.intercept.MethodInvocation; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +/** + * @author TaoYu + * @since 3.6.0 + */ +public class DsJakartaHeaderProcessor extends DsProcessor { + + /** + * header prefix + */ + private static final String HEADER_PREFIX = "#header"; + + @Override + public boolean matches(String key) { + return key.startsWith(HEADER_PREFIX); + } + + @Override + public String doDetermineDatasource(MethodInvocation invocation, String key) { + HttpServletRequest request = (HttpServletRequest) ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + return request.getHeader(key.substring(8)); + } +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/jakarta/DsJakartaSessionProcessor.java b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/jakarta/DsJakartaSessionProcessor.java new file mode 100644 index 0000000..230c5b5 --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/java/org/aibidding/common/mybatis/jakarta/DsJakartaSessionProcessor.java @@ -0,0 +1,46 @@ +/* + * Copyright © 2018 organization baomidou + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.aibidding.common.mybatis.jakarta; + +import com.baomidou.dynamic.datasource.processor.DsProcessor; +import jakarta.servlet.http.HttpServletRequest; +import org.aopalliance.intercept.MethodInvocation; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + + +/** + * @author TaoYu + * @since 3.6.0 + */ +public class DsJakartaSessionProcessor extends DsProcessor { + + /** + * session开头 + */ + private static final String SESSION_PREFIX = "#session"; + + @Override + public boolean matches(String key) { + return key.startsWith(SESSION_PREFIX); + } + + @Override + public String doDetermineDatasource(MethodInvocation invocation, String key) { + HttpServletRequest request = (HttpServletRequest) ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + return request.getSession().getAttribute(key.substring(9)).toString(); + } +} diff --git a/aibidding-common/aibidding-common-mybatis/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-mybatis/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..82d4625 --- /dev/null +++ b/aibidding-common/aibidding-common-mybatis/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.aibidding.common.mybatis.config.MybatisPlusConfig diff --git a/aibidding-common/aibidding-common-oss/pom.xml b/aibidding-common/aibidding-common-oss/pom.xml new file mode 100644 index 0000000..17349fe --- /dev/null +++ b/aibidding-common/aibidding-common-oss/pom.xml @@ -0,0 +1,42 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-oss + + + ruoyi-common-oss oss服务 + + + + + org.ruoyi + aibidding-common-json + + + + org.ruoyi + aibidding-common-redis + + + + com.amazonaws + aws-java-sdk-s3 + + + + com.qcloud + cos_api + 5.6.75 + + + + diff --git a/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/constant/OssConstant.java b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/constant/OssConstant.java new file mode 100644 index 0000000..7da2869 --- /dev/null +++ b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/constant/OssConstant.java @@ -0,0 +1,38 @@ +package org.aibidding.common.oss.constant; + +import java.util.Arrays; +import java.util.List; + +/** + * 对象存储常量 + * + * @author Lion Li + */ +public interface OssConstant { + + /** + * 默认配置KEY + */ + String DEFAULT_CONFIG_KEY = "sys_oss:default_config"; + + /** + * 预览列表资源开关Key + */ + String PEREVIEW_LIST_RESOURCE_KEY = "sys.oss.previewListResource"; + + /** + * 系统数据ids + */ + List SYSTEM_DATA_IDS = Arrays.asList(1L, 2L, 3L, 4L); + + /** + * 云服务商 + */ + String[] CLOUD_SERVICE = new String[] {"aliyun", "qcloud", "qiniu", "obs"}; + + /** + * https 状态 + */ + String IS_HTTPS = "Y"; + +} diff --git a/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/core/OssClient.java b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/core/OssClient.java new file mode 100644 index 0000000..43d48ec --- /dev/null +++ b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/core/OssClient.java @@ -0,0 +1,245 @@ +package org.aibidding.common.oss.core; + +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.util.IdUtil; +import com.amazonaws.ClientConfiguration; +import com.amazonaws.HttpMethod; +import com.amazonaws.Protocol; +import com.amazonaws.auth.AWSCredentials; +import com.amazonaws.auth.AWSCredentialsProvider; +import com.amazonaws.auth.AWSStaticCredentialsProvider; +import com.amazonaws.auth.BasicAWSCredentials; +import com.amazonaws.client.builder.AwsClientBuilder; +import com.amazonaws.services.s3.AmazonS3; +import com.amazonaws.services.s3.AmazonS3Client; +import com.amazonaws.services.s3.AmazonS3ClientBuilder; +import com.amazonaws.services.s3.model.*; +import org.aibidding.common.core.utils.DateUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.oss.constant.OssConstant; +import org.aibidding.common.oss.entity.UploadResult; +import org.aibidding.common.oss.enumd.AccessPolicyType; +import org.aibidding.common.oss.enumd.PolicyType; +import org.aibidding.common.oss.exception.OssException; +import org.aibidding.common.oss.properties.OssProperties; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.net.URL; +import java.util.Date; + +/** + * S3 存储协议 所有兼容S3协议的云厂商均支持 + * 阿里云 腾讯云 七牛云 minio + * + * @author Lion Li + */ +public class OssClient { + + private final String configKey; + + private final OssProperties properties; + + private final AmazonS3 client; + + public OssClient(String configKey, OssProperties ossProperties) { + this.configKey = configKey; + this.properties = ossProperties; + try { + AwsClientBuilder.EndpointConfiguration endpointConfig = + new AwsClientBuilder.EndpointConfiguration(properties.getEndpoint(), properties.getRegion()); + + AWSCredentials credentials = new BasicAWSCredentials(properties.getAccessKey(), properties.getSecretKey()); + AWSCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(credentials); + ClientConfiguration clientConfig = new ClientConfiguration(); + if (OssConstant.IS_HTTPS.equals(properties.getIsHttps())) { + clientConfig.setProtocol(Protocol.HTTPS); + } else { + clientConfig.setProtocol(Protocol.HTTP); + } + AmazonS3ClientBuilder build = AmazonS3Client.builder() + .withEndpointConfiguration(endpointConfig) + .withClientConfiguration(clientConfig) + .withCredentials(credentialsProvider) + .disableChunkedEncoding(); + if (!StringUtils.containsAny(properties.getEndpoint(), OssConstant.CLOUD_SERVICE)) { + // minio 使用https限制使用域名访问 需要此配置 站点填域名 + build.enablePathStyleAccess(); + } + this.client = build.build(); + + createBucket(); + } catch (Exception e) { + if (e instanceof OssException) { + throw e; + } + throw new OssException("配置错误! 请检查系统配置:[" + e.getMessage() + "]"); + } + } + + public void createBucket() { + try { + String bucketName = properties.getBucketName(); + if (client.doesBucketExistV2(bucketName)) { + return; + } + CreateBucketRequest createBucketRequest = new CreateBucketRequest(bucketName); + AccessPolicyType accessPolicy = getAccessPolicy(); + createBucketRequest.setCannedAcl(accessPolicy.getAcl()); + client.createBucket(createBucketRequest); + client.setBucketPolicy(bucketName, getPolicy(bucketName, accessPolicy.getPolicyType())); + } catch (Exception e) { + throw new OssException("创建Bucket失败, 请核对配置信息:[" + e.getMessage() + "]"); + } + } + + public UploadResult upload(byte[] data, String path, String contentType) { + return upload(new ByteArrayInputStream(data), path, contentType); + } + + public UploadResult upload(InputStream inputStream, String path, String contentType) { + if (!(inputStream instanceof ByteArrayInputStream)) { + inputStream = new ByteArrayInputStream(IoUtil.readBytes(inputStream)); + } + try { + ObjectMetadata metadata = new ObjectMetadata(); + metadata.setContentType(contentType); + metadata.setContentLength(inputStream.available()); + PutObjectRequest putObjectRequest = new PutObjectRequest(properties.getBucketName(), path, inputStream, metadata); + // 设置上传对象的 Acl 为公共读 + putObjectRequest.setCannedAcl(getAccessPolicy().getAcl()); + client.putObject(putObjectRequest); + } catch (Exception e) { + throw new OssException("上传文件失败,请检查配置信息:[" + e.getMessage() + "]"); + } + return UploadResult.builder().url(getUrl() + "/" + path).filename(path).build(); + } + + public void delete(String path) { + path = path.replace(getUrl() + "/", ""); + try { + client.deleteObject(properties.getBucketName(), path); + } catch (Exception e) { + throw new OssException("删除文件失败,请检查配置信息:[" + e.getMessage() + "]"); + } + } + + public UploadResult uploadSuffix(byte[] data, String suffix, String contentType) { + return upload(data, getPath(properties.getPrefix(), suffix), contentType); + } + + public UploadResult uploadSuffix(InputStream inputStream, String suffix, String contentType) { + return upload(inputStream, getPath(properties.getPrefix(), suffix), contentType); + } + + /** + * 获取文件元数据 + * + * @param path 完整文件路径 + */ + public ObjectMetadata getObjectMetadata(String path) { + path = path.replace(getUrl() + "/", ""); + S3Object object = client.getObject(properties.getBucketName(), path); + return object.getObjectMetadata(); + } + + public InputStream getObjectContent(String path) { + path = path.replace(getUrl() + "/", ""); + S3Object object = client.getObject(properties.getBucketName(), path); + return object.getObjectContent(); + } + + public String getUrl() { + String domain = properties.getDomain(); + String endpoint = properties.getEndpoint(); + String header = OssConstant.IS_HTTPS.equals(properties.getIsHttps()) ? "https://" : "http://"; + // 云服务商直接返回 + if (StringUtils.containsAny(endpoint, OssConstant.CLOUD_SERVICE)) { + if (StringUtils.isNotBlank(domain)) { + return header + domain; + } + return header + properties.getBucketName() + "." + endpoint; + } + // minio 单独处理 + if (StringUtils.isNotBlank(domain)) { + return header + domain + "/" + properties.getBucketName(); + } + return header + endpoint + "/" + properties.getBucketName(); + } + + public String getPath(String prefix, String suffix) { + // 生成uuid + String uuid = IdUtil.fastSimpleUUID(); + // 文件路径 + String path = DateUtils.datePath() + "/" + uuid; + if (StringUtils.isNotBlank(prefix)) { + path = prefix + "/" + path; + } + return path + suffix; + } + + + public String getConfigKey() { + return configKey; + } + + /** + * 获取私有URL链接 + * + * @param objectKey 对象KEY + * @param second 授权时间 + */ + public String getPrivateUrl(String objectKey, Integer second) { + GeneratePresignedUrlRequest generatePresignedUrlRequest = + new GeneratePresignedUrlRequest(properties.getBucketName(), objectKey) + .withMethod(HttpMethod.GET) + .withExpiration(new Date(System.currentTimeMillis() + 1000L * second)); + URL url = client.generatePresignedUrl(generatePresignedUrlRequest); + return url.toString(); + } + + /** + * 检查配置是否相同 + */ + public boolean checkPropertiesSame(OssProperties properties) { + return this.properties.equals(properties); + } + + /** + * 获取当前桶权限类型 + * + * @return 当前桶权限类型code + */ + public AccessPolicyType getAccessPolicy() { + return AccessPolicyType.getByType(properties.getAccessPolicy()); + } + + private static String getPolicy(String bucketName, PolicyType policyType) { + StringBuilder builder = new StringBuilder(); + builder.append("{\n\"Statement\": [\n{\n\"Action\": [\n"); + builder.append(switch (policyType) { + case WRITE -> "\"s3:GetBucketLocation\",\n\"s3:ListBucketMultipartUploads\"\n"; + case READ_WRITE -> "\"s3:GetBucketLocation\",\n\"s3:ListBucket\",\n\"s3:ListBucketMultipartUploads\"\n"; + default -> "\"s3:GetBucketLocation\"\n"; + }); + builder.append("],\n\"Effect\": \"Allow\",\n\"Principal\": \"*\",\n\"Resource\": \"arn:aws:s3:::"); + builder.append(bucketName); + builder.append("\"\n},\n"); + if (policyType == PolicyType.READ) { + builder.append("{\n\"Action\": [\n\"s3:ListBucket\"\n],\n\"Effect\": \"Deny\",\n\"Principal\": \"*\",\n\"Resource\": \"arn:aws:s3:::"); + builder.append(bucketName); + builder.append("\"\n},\n"); + } + builder.append("{\n\"Action\": "); + builder.append(switch (policyType) { + case WRITE -> "[\n\"s3:AbortMultipartUpload\",\n\"s3:DeleteObject\",\n\"s3:ListMultipartUploadParts\",\n\"s3:PutObject\"\n],\n"; + case READ_WRITE -> "[\n\"s3:AbortMultipartUpload\",\n\"s3:DeleteObject\",\n\"s3:GetObject\",\n\"s3:ListMultipartUploadParts\",\n\"s3:PutObject\"\n],\n"; + default -> "\"s3:GetObject\",\n"; + }); + builder.append("\"Effect\": \"Allow\",\n\"Principal\": \"*\",\n\"Resource\": \"arn:aws:s3:::"); + builder.append(bucketName); + builder.append("/*\"\n}\n],\n\"Version\": \"2012-10-17\"\n}\n"); + return builder.toString(); + } + +} diff --git a/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/entity/UploadResult.java b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/entity/UploadResult.java new file mode 100644 index 0000000..5c31d4e --- /dev/null +++ b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/entity/UploadResult.java @@ -0,0 +1,24 @@ +package org.aibidding.common.oss.entity; + +import lombok.Builder; +import lombok.Data; + +/** + * 上传返回体 + * + * @author Lion Li + */ +@Data +@Builder +public class UploadResult { + + /** + * 文件路径 + */ + private String url; + + /** + * 文件名 + */ + private String filename; +} diff --git a/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/enumd/AccessPolicyType.java b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/enumd/AccessPolicyType.java new file mode 100644 index 0000000..507fe61 --- /dev/null +++ b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/enumd/AccessPolicyType.java @@ -0,0 +1,55 @@ +package org.aibidding.common.oss.enumd; + +import com.amazonaws.services.s3.model.CannedAccessControlList; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 桶访问策略配置 + * + * @author 陈賝 + */ +@Getter +@AllArgsConstructor +public enum AccessPolicyType { + + /** + * private + */ + PRIVATE("0", CannedAccessControlList.Private, PolicyType.WRITE), + + /** + * public + */ + PUBLIC("1", CannedAccessControlList.PublicRead, PolicyType.READ), + + /** + * custom + */ + CUSTOM("2",CannedAccessControlList.PublicRead, PolicyType.READ); + + /** + * 桶 权限类型 + */ + private final String type; + + /** + * 文件对象 权限类型 + */ + private final CannedAccessControlList acl; + + /** + * 桶策略类型 + */ + private final PolicyType policyType; + + public static AccessPolicyType getByType(String type) { + for (AccessPolicyType value : values()) { + if (value.getType().equals(type)) { + return value; + } + } + throw new RuntimeException("'type' not found By " + type); + } + +} diff --git a/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/enumd/PolicyType.java b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/enumd/PolicyType.java new file mode 100644 index 0000000..4ceba34 --- /dev/null +++ b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/enumd/PolicyType.java @@ -0,0 +1,35 @@ +package org.aibidding.common.oss.enumd; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * minio策略配置 + * + * @author Lion Li + */ +@Getter +@AllArgsConstructor +public enum PolicyType { + + /** + * 只读 + */ + READ("read-only"), + + /** + * 只写 + */ + WRITE("write-only"), + + /** + * 读写 + */ + READ_WRITE("read-write"); + + /** + * 类型 + */ + private final String type; + +} diff --git a/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/exception/OssException.java b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/exception/OssException.java new file mode 100644 index 0000000..1d7f64d --- /dev/null +++ b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/exception/OssException.java @@ -0,0 +1,19 @@ +package org.aibidding.common.oss.exception; + +import java.io.Serial; + +/** + * OSS异常类 + * + * @author Lion Li + */ +public class OssException extends RuntimeException { + + @Serial + private static final long serialVersionUID = 1L; + + public OssException(String msg) { + super(msg); + } + +} diff --git a/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/factory/OssFactory.java b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/factory/OssFactory.java new file mode 100644 index 0000000..6348af2 --- /dev/null +++ b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/factory/OssFactory.java @@ -0,0 +1,63 @@ +package org.aibidding.common.oss.factory; + +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.constant.CacheNames; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.json.utils.JsonUtils; +import org.aibidding.common.oss.constant.OssConstant; +import org.aibidding.common.oss.core.OssClient; +import org.aibidding.common.oss.exception.OssException; +import org.aibidding.common.oss.properties.OssProperties; +import org.aibidding.common.redis.utils.CacheUtils; +import org.aibidding.common.redis.utils.RedisUtils; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 文件上传Factory + * + * @author Lion Li + */ +@Slf4j +public class OssFactory { + + private static final Map CLIENT_CACHE = new ConcurrentHashMap<>(); + + /** + * 获取默认实例 + */ + public static OssClient instance() { + // 获取redis 默认类型 + String configKey = RedisUtils.getCacheObject(OssConstant.DEFAULT_CONFIG_KEY); + if (StringUtils.isEmpty(configKey)) { + throw new OssException("文件存储服务类型无法找到!"); + } + return instance(configKey); + } + + /** + * 根据类型获取实例 + */ + public static OssClient instance(String configKey) { + String json = CacheUtils.get(CacheNames.SYS_OSS_CONFIG, configKey); + if (json == null) { + throw new OssException("系统异常, '" + configKey + "'配置信息不存在!"); + } + OssProperties properties = JsonUtils.parseObject(json, OssProperties.class); + OssClient client = CLIENT_CACHE.get(configKey); + if (client == null) { + CLIENT_CACHE.put(configKey, new OssClient(configKey, properties)); + log.info("创建OSS实例 key => {}", configKey); + return CLIENT_CACHE.get(configKey); + } + // 配置不相同则重新构建 + if (!client.checkPropertiesSame(properties)) { + CLIENT_CACHE.put(configKey, new OssClient(configKey, properties)); + log.info("重载OSS实例 key => {}", configKey); + return CLIENT_CACHE.get(configKey); + } + return client; + } + +} diff --git a/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/properties/OssProperties.java b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/properties/OssProperties.java new file mode 100644 index 0000000..6796bf0 --- /dev/null +++ b/aibidding-common/aibidding-common-oss/src/main/java/org/aibidding/common/oss/properties/OssProperties.java @@ -0,0 +1,58 @@ +package org.aibidding.common.oss.properties; + +import lombok.Data; + +/** + * OSS对象存储 配置属性 + * + * @author Lion Li + */ +@Data +public class OssProperties { + + /** + * 访问站点 + */ + private String endpoint; + + /** + * 自定义域名 + */ + private String domain; + + /** + * 前缀 + */ + private String prefix; + + /** + * ACCESS_KEY + */ + private String accessKey; + + /** + * SECRET_KEY + */ + private String secretKey; + + /** + * 存储空间名 + */ + private String bucketName; + + /** + * 存储区域 + */ + private String region; + + /** + * 是否https(Y=是,N=否) + */ + private String isHttps; + + /** + * 桶权限类型(0private 1public 2custom) + */ + private String accessPolicy; + +} diff --git a/aibidding-common/aibidding-common-pay/pom.xml b/aibidding-common/aibidding-common-pay/pom.xml new file mode 100644 index 0000000..4525830 --- /dev/null +++ b/aibidding-common/aibidding-common-pay/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + + aibidding-common-pay + + + org.ruoyi + aibidding-common-web + + + com.google.zxing + core + 3.3.3 + + + org.springframework.boot + spring-boot-starter-test + test + + + + com.stripe + stripe-java + 22.5.1 + + + + cn.hutool + hutool-all + 5.8.12 + + + + 17 + 17 + UTF-8 + + + diff --git a/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/config/PayConfig.java b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/config/PayConfig.java new file mode 100644 index 0000000..7fb66ee --- /dev/null +++ b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/config/PayConfig.java @@ -0,0 +1,53 @@ +package org.aibidding.common.config; + +import lombok.Data; + +/** + * 支付配置信息 + * + * @author Admin + */ +@Data +public class PayConfig { + + /** + * 商户ID + */ + private String pid; + + /** + * 接口地址 + */ + private String payUrl; + + /** + * 私钥 + */ + private String key ; + + /** + * 服务器异步通知地址 + */ + private String notify_url; + + /** + * 页面跳转通知地址 + */ + private String return_url; + + /** + * 支付方式 + */ + private String type; + + /** + * 设备类型 + */ + private String device; + + /** + * 加密方式默认MD5 + */ + private String sign_type; + +} diff --git a/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/config/PayInit.java b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/config/PayInit.java new file mode 100644 index 0000000..96cb1a5 --- /dev/null +++ b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/config/PayInit.java @@ -0,0 +1,51 @@ +package org.aibidding.common.config; + +import org.aibidding.common.core.service.ConfigService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Scope; +import org.springframework.scheduling.annotation.Scheduled; + +/** + * 支付配置信息 + * + * @author Admin + */ +@RequiredArgsConstructor +@Configuration +@Slf4j +public class PayInit { + + private final ConfigService configService; + + private PayConfig payConfig; + + @Bean + @Scope("singleton") + public PayConfig payConfig() { + if (payConfig == null) { + payConfig = new PayConfig(); + updatePayConfig(); + } + return payConfig; + } + + @Scheduled(fixedDelay = 10000) // 每10秒检查一次 + public void updatePayConfig() { + payConfig.setType("wxpay"); + payConfig.setDevice("pc"); + payConfig.setSign_type("MD5"); + payConfig.setPid(getKey("pid")); + payConfig.setKey(getKey("key")); + payConfig.setPayUrl(getKey("payUrl")); + payConfig.setNotify_url(getKey("notify_url")); + payConfig.setReturn_url(getKey("return_url")); + } + + public String getKey(String key){ + return configService.getConfigValue("pay", key); + } + +} diff --git a/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/config/WxPayConfiguration.java b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/config/WxPayConfiguration.java new file mode 100644 index 0000000..7b2e3c6 --- /dev/null +++ b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/config/WxPayConfiguration.java @@ -0,0 +1,47 @@ +package org.aibidding.common.config; + +import com.github.binarywang.wxpay.config.WxPayConfig; +import com.github.binarywang.wxpay.service.WxPayService; +import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl; + +import org.aibidding.common.core.service.ConfigService; +import jakarta.annotation.PostConstruct; +import lombok.RequiredArgsConstructor; +import org.apache.commons.lang3.StringUtils; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author Binary Wang + */ +@Configuration +@RequiredArgsConstructor +public class WxPayConfiguration { + + private final ConfigService configService; + + private WxPayService wxPayService; + + @PostConstruct + public void init() { + WxPayConfig payConfig = new WxPayConfig(); + payConfig.setAppId(StringUtils.trimToNull(getKey("appId"))); + payConfig.setMchId(StringUtils.trimToNull(getKey("mchId"))); + payConfig.setMchKey(StringUtils.trimToNull(getKey("appSecret"))); + payConfig.setUseSandboxEnv(false); + wxPayService = new WxPayServiceImpl(); + wxPayService.setConfig(payConfig); + } + + @Bean + @ConditionalOnMissingBean + public WxPayService wxService() { + return wxPayService; + } + + public String getKey(String key) { + return configService.getConfigValue("weixin", key); + } + +} diff --git a/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/listener/ConfigChangeListener.java b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/listener/ConfigChangeListener.java new file mode 100644 index 0000000..5f78c01 --- /dev/null +++ b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/listener/ConfigChangeListener.java @@ -0,0 +1,37 @@ +package org.aibidding.common.listener; + +import com.github.binarywang.wxpay.config.WxPayConfig; +import com.github.binarywang.wxpay.service.WxPayService; +import org.aibidding.common.core.event.ConfigChangeEvent; +import org.aibidding.common.core.service.ConfigService; +import org.aibidding.common.core.utils.StringUtils; +import org.jetbrains.annotations.NotNull; +import org.springframework.context.ApplicationListener; +import org.springframework.stereotype.Component; + +/** + * 描述:创建一个监听器,用于处理配置变化事件 + * + * @author ageerle@163.com + * date 2024/5/19 + */ +@Component +public class ConfigChangeListener implements ApplicationListener { + private final WxPayService wxPayService; + private final ConfigService configService; + + public ConfigChangeListener(WxPayService wxPayService, ConfigService configService) { + this.wxPayService = wxPayService; + this.configService = configService; + } + + @Override + public void onApplicationEvent(@NotNull ConfigChangeEvent event) { + WxPayConfig newConfig = new WxPayConfig(); + newConfig.setAppId(StringUtils.trimToNull(configService.getConfigValue("weixin", "appId"))); + newConfig.setMchId(StringUtils.trimToNull(configService.getConfigValue("weixin", "mchId"))); + newConfig.setMchKey(StringUtils.trimToNull(configService.getConfigValue("weixin", "mchKey"))); + newConfig.setUseSandboxEnv(false); + wxPayService.setConfig(newConfig); + } +} diff --git a/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/response/PayResponse.java b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/response/PayResponse.java new file mode 100644 index 0000000..6b014ee --- /dev/null +++ b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/response/PayResponse.java @@ -0,0 +1,70 @@ +package org.aibidding.common.response; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +/** + * 支付结果响应 + * + * @author: wangle + * @date: 2023/7/3 + */ +@Data +public class PayResponse { + + /** + * 商户ID + */ + private String pid; + + /** + * 易支付订单号 + */ + + @JsonProperty("trade_no") + private String trade_no; + + /** + * 商户订单号 + */ + @JsonProperty("out_trade_no") + private String out_trade_no; + + /** + * 支付方式 + */ + private String type; + + /** + * 商品名称 + */ + private String name; + + /** + * 商品金额 + */ + private String money; + + /** + * 支付状态 + */ + @JsonProperty("trade_status") + private String trade_status; + + /** + * 业务扩展参数 + */ + private String param; + + /** + * 签名字符串 + */ + private String sign; + + /** + * 签名类型 + */ + @JsonProperty("sign_type") + private String signType; + +} diff --git a/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/service/PayService.java b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/service/PayService.java new file mode 100644 index 0000000..137f0de --- /dev/null +++ b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/service/PayService.java @@ -0,0 +1,23 @@ +package org.aibidding.common.service; + +/** + * 支付服务 + * + * @author: wangle + * @date: 2023/7/3 + */ +public interface PayService { + + /** + * 获取支付地址 + * + * @Date 2023/7/3 + * @param orderNo + * @param name + * @param money + * @param clientIp + * @return String + **/ + String getPayUrl(String orderNo, String name, double money, String clientIp); + +} diff --git a/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/service/impl/PayServiceImpl.java b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/service/impl/PayServiceImpl.java new file mode 100644 index 0000000..f271d53 --- /dev/null +++ b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/service/impl/PayServiceImpl.java @@ -0,0 +1,53 @@ +package org.aibidding.common.service.impl; + +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONObject; + +import org.aibidding.common.config.PayConfig; +import org.aibidding.common.service.PayService; +import org.aibidding.common.utils.MD5Util; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.Map; + +/** + * 支付服务 + * @author Admin + */ +@Service +@RequiredArgsConstructor +@Slf4j +public class PayServiceImpl implements PayService { + + private final PayConfig payConfig; + + @Override + public String getPayUrl(String orderNo, String name, double money, String clientIp) { + String out_trade_no = orderNo, sign = ""; + //封装请求参数 + String mdString = "clientip=" + clientIp + "&device=" + payConfig.getDevice() + "&money=" + money + "&name=" + name + "&" + + "notify_url=" + payConfig.getNotify_url() + "&out_trade_no=" + out_trade_no + "&pid=" + payConfig.getPid() + "&return_url=" + payConfig.getReturn_url() + + "&type=" + payConfig.getType() + payConfig.getKey(); + sign = MD5Util.GetMD5Code(mdString); + Map map = new HashMap<>(10); + map.put("clientip", clientIp); + map.put("device", payConfig.getDevice()); + map.put("money", money); + map.put("name", name); + map.put("notify_url", payConfig.getNotify_url()); + map.put("out_trade_no", out_trade_no); + map.put("pid", payConfig.getPid()); + map.put("return_url", payConfig.getReturn_url()); + map.put("sign_type", payConfig.getSign_type()); + map.put("type", payConfig.getType()); + map.put("sign", sign); + String body = HttpUtil.post(payConfig.getPayUrl(), map); + log.info("支付返回信息:{},配置信息: {}",body,payConfig); + JSONObject jsonObject = new JSONObject(body); + return (String) jsonObject.get("qrcode"); + } + +} diff --git a/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/utils/MD5Util.java b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/utils/MD5Util.java new file mode 100644 index 0000000..6bdb129 --- /dev/null +++ b/aibidding-common/aibidding-common-pay/src/main/java/org/aibidding/common/utils/MD5Util.java @@ -0,0 +1,106 @@ +package org.aibidding.common.utils; + +import cn.hutool.core.util.StrUtil; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Map; +import java.util.TreeMap; + +/** + * MD5 算法 + * + * @author Admin + */ +public class MD5Util { + + /** + * 全局数组 + */ + public final static String[] strDigits = { "0", "1", "2", "3", "4", "5", + "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; + + public MD5Util() { + } + + /** + * 返回形式为数字跟字符串 + * + * @Date 2023/7/3 + * @param bByte + * @return String + **/ + public static String byteToArrayString(byte bByte) { + int iRet = bByte; + if (iRet < 0) { + iRet += 256; + } + int iD1 = iRet / 16; + int iD2 = iRet % 16; + return strDigits[iD1] + strDigits[iD2]; + } + + /** + * 转换字节数组为16进制字串 + * + * @Date 2023/7/3 + * @param bByte + * @return String + **/ + public static String byteToString(byte[] bByte) { + StringBuffer sBuffer = new StringBuffer(); + for (int i = 0; i < bByte.length; i++) { + sBuffer.append(byteToArrayString(bByte[i])); + } + return sBuffer.toString(); + } + + /** + * 生成md5代码 + * + * @Date 2023/7/3 + * @param strObj + * @return String + **/ + public static String GetMD5Code(String strObj) { + String resultString = null; + try { + resultString = new String(strObj); + MessageDigest md = MessageDigest.getInstance("MD5"); + resultString = byteToString(md.digest(strObj.getBytes())); + } catch (NoSuchAlgorithmException ex) { + ex.printStackTrace(); + } + return resultString; + } + + /** + * 组装签名的字段 + * + * @param params 参数 + * @param urlEncoder 是否urlEncoder + * @return {String} + */ + public static String packageSign(Map params, boolean urlEncoder) { + // 先将参数以其参数名的字典序升序进行排序 + TreeMap sortedParams = new TreeMap(params); + // 遍历排序后的字典,将所有参数按"key=value"格式拼接在一起 + StringBuilder sb = new StringBuilder(); + boolean first = true; + for (Map.Entry param : sortedParams.entrySet()) { + String value = String.valueOf(param.getValue()); + if (StrUtil.isBlank(value)) { + continue; + } + if (first) { + first = false; + } else { + sb.append("&"); + } + sb.append(param.getKey()).append("="); + sb.append(value); + } + return sb.toString(); + } + +} diff --git a/aibidding-common/aibidding-common-ratelimiter/pom.xml b/aibidding-common/aibidding-common-ratelimiter/pom.xml new file mode 100644 index 0000000..9371f58 --- /dev/null +++ b/aibidding-common/aibidding-common-ratelimiter/pom.xml @@ -0,0 +1,31 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-ratelimiter + + + ruoyi-common-ratelimiter 限流功能 + + + + + org.ruoyi + aibidding-common-core + + + + org.ruoyi + aibidding-common-redis + + + + diff --git a/aibidding-common/aibidding-common-ratelimiter/src/main/java/org/aibidding/common/ratelimiter/annotation/RateLimiter.java b/aibidding-common/aibidding-common-ratelimiter/src/main/java/org/aibidding/common/ratelimiter/annotation/RateLimiter.java new file mode 100644 index 0000000..e047130 --- /dev/null +++ b/aibidding-common/aibidding-common-ratelimiter/src/main/java/org/aibidding/common/ratelimiter/annotation/RateLimiter.java @@ -0,0 +1,41 @@ +package org.aibidding.common.ratelimiter.annotation; + +import org.aibidding.common.ratelimiter.enums.LimitType; + +import java.lang.annotation.*; + +/** + * 限流注解 + * + * @author Lion Li + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface RateLimiter { + /** + * 限流key,支持使用Spring el表达式来动态获取方法上的参数值 + * 格式类似于 #code.id #{#code} + */ + String key() default ""; + + /** + * 限流时间,单位秒 + */ + int time() default 60; + + /** + * 限流次数 + */ + int count() default 100; + + /** + * 限流类型 + */ + LimitType limitType() default LimitType.DEFAULT; + + /** + * 提示消息 支持国际化 格式为 {code} + */ + String message() default "{rate.limiter.message}"; +} diff --git a/aibidding-common/aibidding-common-ratelimiter/src/main/java/org/aibidding/common/ratelimiter/aspectj/RateLimiterAspect.java b/aibidding-common/aibidding-common-ratelimiter/src/main/java/org/aibidding/common/ratelimiter/aspectj/RateLimiterAspect.java new file mode 100644 index 0000000..c430e50 --- /dev/null +++ b/aibidding-common/aibidding-common-ratelimiter/src/main/java/org/aibidding/common/ratelimiter/aspectj/RateLimiterAspect.java @@ -0,0 +1,127 @@ +package org.aibidding.common.ratelimiter.aspectj; + +import cn.hutool.core.util.ArrayUtil; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.reflect.MethodSignature; +import org.aibidding.common.core.constant.GlobalConstants; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.MessageUtils; +import org.aibidding.common.core.utils.ServletUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.ratelimiter.annotation.RateLimiter; +import org.aibidding.common.ratelimiter.enums.LimitType; +import org.aibidding.common.redis.utils.RedisUtils; +import org.redisson.api.RateType; +import org.springframework.core.DefaultParameterNameDiscoverer; +import org.springframework.core.ParameterNameDiscoverer; +import org.springframework.expression.EvaluationContext; +import org.springframework.expression.Expression; +import org.springframework.expression.ExpressionParser; +import org.springframework.expression.ParserContext; +import org.springframework.expression.common.TemplateParserContext; +import org.springframework.expression.spel.standard.SpelExpressionParser; +import org.springframework.expression.spel.support.StandardEvaluationContext; + +import java.lang.reflect.Method; + +/** + * 限流处理 + * + * @author Lion Li + */ +@Slf4j +@Aspect +public class RateLimiterAspect { + + /** + * 定义spel表达式解析器 + */ + private final ExpressionParser parser = new SpelExpressionParser(); + /** + * 定义spel解析模版 + */ + private final ParserContext parserContext = new TemplateParserContext(); + /** + * 定义spel上下文对象进行解析 + */ + private final EvaluationContext context = new StandardEvaluationContext(); + /** + * 方法参数解析器 + */ + private final ParameterNameDiscoverer pnd = new DefaultParameterNameDiscoverer(); + + @Before("@annotation(rateLimiter)") + public void doBefore(JoinPoint point, RateLimiter rateLimiter) throws Throwable { + int time = rateLimiter.time(); + int count = rateLimiter.count(); + String combineKey = getCombineKey(rateLimiter, point); + try { + RateType rateType = RateType.OVERALL; + if (rateLimiter.limitType() == LimitType.CLUSTER) { + rateType = RateType.PER_CLIENT; + } + long number = RedisUtils.rateLimiter(combineKey, rateType, count, time); + if (number == -1) { + String message = rateLimiter.message(); + if (StringUtils.startsWith(message, "{") && StringUtils.endsWith(message, "}")) { + message = MessageUtils.message(StringUtils.substring(message, 1, message.length() - 1)); + } + throw new ServiceException(message); + } + log.info("限制令牌 => {}, 剩余令牌 => {}, 缓存key => '{}'", count, number, combineKey); + } catch (Exception e) { + if (e instanceof ServiceException) { + throw e; + } else { + throw new RuntimeException("服务器限流异常,请稍候再试"); + } + } + } + + public String getCombineKey(RateLimiter rateLimiter, JoinPoint point) { + String key = rateLimiter.key(); + // 获取方法(通过方法签名来获取) + MethodSignature signature = (MethodSignature) point.getSignature(); + Method method = signature.getMethod(); + Class targetClass = method.getDeclaringClass(); + // 判断是否是spel格式 + if (StringUtils.containsAny(key, "#")) { + // 获取参数值 + Object[] args = point.getArgs(); + // 获取方法上参数的名称 + String[] parameterNames = pnd.getParameterNames(method); + if (ArrayUtil.isEmpty(parameterNames)) { + throw new ServiceException("限流key解析异常!请联系管理员!"); + } + for (int i = 0; i < parameterNames.length; i++) { + context.setVariable(parameterNames[i], args[i]); + } + // 解析返回给key + try { + Expression expression; + if (StringUtils.startsWith(key, parserContext.getExpressionPrefix()) + && StringUtils.endsWith(key, parserContext.getExpressionSuffix())) { + expression = parser.parseExpression(key, parserContext); + } else { + expression = parser.parseExpression(key); + } + key = expression.getValue(context, String.class) + ":"; + } catch (Exception e) { + throw new ServiceException("限流key解析异常!请联系管理员!"); + } + } + StringBuilder stringBuffer = new StringBuilder(GlobalConstants.RATE_LIMIT_KEY); + stringBuffer.append(ServletUtils.getRequest().getRequestURI()).append(":"); + if (rateLimiter.limitType() == LimitType.IP) { + // 获取请求ip + stringBuffer.append(ServletUtils.getClientIP()).append(":"); + } else if (rateLimiter.limitType() == LimitType.CLUSTER) { + // 获取客户端实例id + stringBuffer.append(RedisUtils.getClient().getId()).append(":"); + } + return stringBuffer.append(key).toString(); + } +} diff --git a/aibidding-common/aibidding-common-ratelimiter/src/main/java/org/aibidding/common/ratelimiter/config/RateLimiterConfig.java b/aibidding-common/aibidding-common-ratelimiter/src/main/java/org/aibidding/common/ratelimiter/config/RateLimiterConfig.java new file mode 100644 index 0000000..d964d7b --- /dev/null +++ b/aibidding-common/aibidding-common-ratelimiter/src/main/java/org/aibidding/common/ratelimiter/config/RateLimiterConfig.java @@ -0,0 +1,20 @@ +package org.aibidding.common.ratelimiter.config; + +import org.aibidding.common.ratelimiter.aspectj.RateLimiterAspect; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.data.redis.connection.RedisConfiguration; + +/** + * @author guangxin + * @date 2023/1/18 + */ +@AutoConfiguration(after = RedisConfiguration.class) +public class RateLimiterConfig { + + @Bean + public RateLimiterAspect rateLimiterAspect() { + return new RateLimiterAspect(); + } + +} diff --git a/aibidding-common/aibidding-common-ratelimiter/src/main/java/org/aibidding/common/ratelimiter/enums/LimitType.java b/aibidding-common/aibidding-common-ratelimiter/src/main/java/org/aibidding/common/ratelimiter/enums/LimitType.java new file mode 100644 index 0000000..63355b6 --- /dev/null +++ b/aibidding-common/aibidding-common-ratelimiter/src/main/java/org/aibidding/common/ratelimiter/enums/LimitType.java @@ -0,0 +1,24 @@ +package org.aibidding.common.ratelimiter.enums; + +/** + * 限流类型 + * + * @author aibidding + */ + +public enum LimitType { + /** + * 默认策略全局限流 + */ + DEFAULT, + + /** + * 根据请求者IP进行限流 + */ + IP, + + /** + * 实例限流(集群多后端实例) + */ + CLUSTER +} diff --git a/aibidding-common/aibidding-common-ratelimiter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-ratelimiter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..4adcdfd --- /dev/null +++ b/aibidding-common/aibidding-common-ratelimiter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.aibidding.common.ratelimiter.config.RateLimiterConfig diff --git a/aibidding-common/aibidding-common-redis/pom.xml b/aibidding-common/aibidding-common-redis/pom.xml new file mode 100644 index 0000000..5c87f12 --- /dev/null +++ b/aibidding-common/aibidding-common-redis/pom.xml @@ -0,0 +1,38 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-redis + + + ruoyi-common-redis 缓存服务 + + + + + + org.ruoyi + aibidding-common-core + + + + + org.redisson + redisson-spring-boot-starter + + + + com.baomidou + lock4j-redisson-spring-boot-starter + + + + diff --git a/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/config/RedisConfig.java b/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/config/RedisConfig.java new file mode 100644 index 0000000..cd137f4 --- /dev/null +++ b/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/config/RedisConfig.java @@ -0,0 +1,130 @@ +package org.aibidding.common.redis.config; + +import cn.hutool.core.util.ObjectUtil; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.aibidding.common.redis.config.properties.RedissonProperties; +import org.aibidding.common.redis.handler.KeyPrefixHandler; +import org.aibidding.common.redis.manager.PlusSpringCacheManager; +import lombok.extern.slf4j.Slf4j; +import org.redisson.codec.JsonJacksonCodec; +import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; + +/** + * redis配置 + * + * @author Lion Li + */ +@Slf4j +@AutoConfiguration +@EnableCaching +@EnableConfigurationProperties(RedissonProperties.class) +public class RedisConfig { + + @Autowired + private RedissonProperties redissonProperties; + + @Autowired + private ObjectMapper objectMapper; + + @Bean + public RedissonAutoConfigurationCustomizer redissonCustomizer() { + return config -> { + config.setThreads(redissonProperties.getThreads()) + .setNettyThreads(redissonProperties.getNettyThreads()) + .setCodec(new JsonJacksonCodec(objectMapper)); + RedissonProperties.SingleServerConfig singleServerConfig = redissonProperties.getSingleServerConfig(); + if (ObjectUtil.isNotNull(singleServerConfig)) { + // 使用单机模式 + config.useSingleServer() + //设置redis key前缀 + .setNameMapper(new KeyPrefixHandler(redissonProperties.getKeyPrefix())) + .setTimeout(singleServerConfig.getTimeout()) + .setClientName(singleServerConfig.getClientName()) + .setIdleConnectionTimeout(singleServerConfig.getIdleConnectionTimeout()) + .setSubscriptionConnectionPoolSize(singleServerConfig.getSubscriptionConnectionPoolSize()) + .setConnectionMinimumIdleSize(singleServerConfig.getConnectionMinimumIdleSize()) + .setConnectionPoolSize(singleServerConfig.getConnectionPoolSize()); + } + // 集群配置方式 参考下方注释 + RedissonProperties.ClusterServersConfig clusterServersConfig = redissonProperties.getClusterServersConfig(); + if (ObjectUtil.isNotNull(clusterServersConfig)) { + config.useClusterServers() + //设置redis key前缀 + .setNameMapper(new KeyPrefixHandler(redissonProperties.getKeyPrefix())) + .setTimeout(clusterServersConfig.getTimeout()) + .setClientName(clusterServersConfig.getClientName()) + .setIdleConnectionTimeout(clusterServersConfig.getIdleConnectionTimeout()) + .setSubscriptionConnectionPoolSize(clusterServersConfig.getSubscriptionConnectionPoolSize()) + .setMasterConnectionMinimumIdleSize(clusterServersConfig.getMasterConnectionMinimumIdleSize()) + .setMasterConnectionPoolSize(clusterServersConfig.getMasterConnectionPoolSize()) + .setSlaveConnectionMinimumIdleSize(clusterServersConfig.getSlaveConnectionMinimumIdleSize()) + .setSlaveConnectionPoolSize(clusterServersConfig.getSlaveConnectionPoolSize()) + .setReadMode(clusterServersConfig.getReadMode()) + .setSubscriptionMode(clusterServersConfig.getSubscriptionMode()); + } + log.info("初始化 redis 配置"); + }; + } + + /** + * 自定义缓存管理器 整合spring-cache + */ + @Bean + public CacheManager cacheManager() { + return new PlusSpringCacheManager(); + } + + /** + * redis集群配置 yml + * + * --- # redis 集群配置(单机与集群只能开启一个另一个需要注释掉) + * spring: + * redis: + * cluster: + * nodes: + * - 192.168.0.100:6379 + * - 192.168.0.101:6379 + * - 192.168.0.102:6379 + * # 密码 + * password: + * # 连接超时时间 + * timeout: 10s + * # 是否开启ssl + * ssl: false + * + * redisson: + * # 线程池数量 + * threads: 16 + * # Netty线程池数量 + * nettyThreads: 32 + * # 集群配置 + * clusterServersConfig: + * # 客户端名称 + * clientName: ${aibidding.name} + * # master最小空闲连接数 + * masterConnectionMinimumIdleSize: 32 + * # master连接池大小 + * masterConnectionPoolSize: 64 + * # slave最小空闲连接数 + * slaveConnectionMinimumIdleSize: 32 + * # slave连接池大小 + * slaveConnectionPoolSize: 64 + * # 连接空闲超时,单位:毫秒 + * idleConnectionTimeout: 10000 + * # 命令等待超时,单位:毫秒 + * timeout: 3000 + * # 发布和订阅连接池大小 + * subscriptionConnectionPoolSize: 50 + * # 读取模式 + * readMode: "SLAVE" + * # 订阅模式 + * subscriptionMode: "MASTER" + */ + +} diff --git a/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/config/properties/RedissonProperties.java b/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/config/properties/RedissonProperties.java new file mode 100644 index 0000000..aa285a9 --- /dev/null +++ b/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/config/properties/RedissonProperties.java @@ -0,0 +1,135 @@ +package org.aibidding.common.redis.config.properties; + +import lombok.Data; +import lombok.NoArgsConstructor; +import org.redisson.config.ReadMode; +import org.redisson.config.SubscriptionMode; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Redisson 配置属性 + * + * @author Lion Li + */ +@Data +@ConfigurationProperties(prefix = "redisson") +public class RedissonProperties { + + /** + * redis缓存key前缀 + */ + private String keyPrefix; + + /** + * 线程池数量,默认值 = 当前处理核数量 * 2 + */ + private int threads; + + /** + * Netty线程池数量,默认值 = 当前处理核数量 * 2 + */ + private int nettyThreads; + + /** + * 单机服务配置 + */ + private SingleServerConfig singleServerConfig; + + /** + * 集群服务配置 + */ + private ClusterServersConfig clusterServersConfig; + + @Data + @NoArgsConstructor + public static class SingleServerConfig { + + /** + * 客户端名称 + */ + private String clientName; + + /** + * 最小空闲连接数 + */ + private int connectionMinimumIdleSize; + + /** + * 连接池大小 + */ + private int connectionPoolSize; + + /** + * 连接空闲超时,单位:毫秒 + */ + private int idleConnectionTimeout; + + /** + * 命令等待超时,单位:毫秒 + */ + private int timeout; + + /** + * 发布和订阅连接池大小 + */ + private int subscriptionConnectionPoolSize; + + } + + @Data + @NoArgsConstructor + public static class ClusterServersConfig { + + /** + * 客户端名称 + */ + private String clientName; + + /** + * master最小空闲连接数 + */ + private int masterConnectionMinimumIdleSize; + + /** + * master连接池大小 + */ + private int masterConnectionPoolSize; + + /** + * slave最小空闲连接数 + */ + private int slaveConnectionMinimumIdleSize; + + /** + * slave连接池大小 + */ + private int slaveConnectionPoolSize; + + /** + * 连接空闲超时,单位:毫秒 + */ + private int idleConnectionTimeout; + + /** + * 命令等待超时,单位:毫秒 + */ + private int timeout; + + /** + * 发布和订阅连接池大小 + */ + private int subscriptionConnectionPoolSize; + + /** + * 读取模式 + */ + private ReadMode readMode; + + /** + * 订阅模式 + */ + private SubscriptionMode subscriptionMode; + + } + +} diff --git a/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/handler/KeyPrefixHandler.java b/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/handler/KeyPrefixHandler.java new file mode 100644 index 0000000..eac0ba8 --- /dev/null +++ b/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/handler/KeyPrefixHandler.java @@ -0,0 +1,50 @@ +package org.aibidding.common.redis.handler; + +import org.aibidding.common.core.utils.StringUtils; +import org.redisson.api.NameMapper; + +/** + * redis缓存key前缀处理 + * + * @author ye + * @date 2022/7/14 17:44 + * @since 4.3.0 + */ +public class KeyPrefixHandler implements NameMapper { + + private final String keyPrefix; + + public KeyPrefixHandler(String keyPrefix) { + //前缀为空 则返回空前缀 + this.keyPrefix = StringUtils.isBlank(keyPrefix) ? "" : keyPrefix + ":"; + } + + /** + * 增加前缀 + */ + @Override + public String map(String name) { + if (StringUtils.isBlank(name)) { + return null; + } + if (StringUtils.isNotBlank(keyPrefix) && !name.startsWith(keyPrefix)) { + return keyPrefix + name; + } + return name; + } + + /** + * 去除前缀 + */ + @Override + public String unmap(String name) { + if (StringUtils.isBlank(name)) { + return null; + } + if (StringUtils.isNotBlank(keyPrefix) && name.startsWith(keyPrefix)) { + return name.substring(keyPrefix.length()); + } + return name; + } + +} diff --git a/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/manager/PlusSpringCacheManager.java b/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/manager/PlusSpringCacheManager.java new file mode 100644 index 0000000..dc4ef48 --- /dev/null +++ b/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/manager/PlusSpringCacheManager.java @@ -0,0 +1,191 @@ +/** + * Copyright (c) 2013-2021 Nikita Koksharov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.aibidding.common.redis.manager; + +import org.aibidding.common.redis.utils.RedisUtils; +import org.redisson.api.RMap; +import org.redisson.api.RMapCache; +import org.redisson.spring.cache.CacheConfig; +import org.redisson.spring.cache.RedissonCache; +import org.springframework.boot.convert.DurationStyle; +import org.springframework.cache.Cache; +import org.springframework.cache.CacheManager; +import org.springframework.cache.transaction.TransactionAwareCacheDecorator; +import org.springframework.util.StringUtils; + +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +/** + * A {@link CacheManager} implementation + * backed by Redisson instance. + *

+ * 修改 RedissonSpringCacheManager 源码 + * 重写 cacheName 处理方法 支持多参数 + * + * @author Nikita Koksharov + * + */ +@SuppressWarnings("unchecked") +public class PlusSpringCacheManager implements CacheManager { + + private boolean dynamic = true; + + private boolean allowNullValues = true; + + private boolean transactionAware = true; + + Map configMap = new ConcurrentHashMap<>(); + ConcurrentMap instanceMap = new ConcurrentHashMap<>(); + + /** + * Creates CacheManager supplied by Redisson instance + */ + public PlusSpringCacheManager() { + } + + + /** + * Defines possibility of storing {@code null} values. + *

+ * Default is true + * + * @param allowNullValues stores if true + */ + public void setAllowNullValues(boolean allowNullValues) { + this.allowNullValues = allowNullValues; + } + + /** + * Defines if cache aware of Spring-managed transactions. + * If {@code true} put/evict operations are executed only for successful transaction in after-commit phase. + *

+ * Default is false + * + * @param transactionAware cache is transaction aware if true + */ + public void setTransactionAware(boolean transactionAware) { + this.transactionAware = transactionAware; + } + + /** + * Defines 'fixed' cache names. + * A new cache instance will not be created in dynamic for non-defined names. + *

+ * `null` parameter setups dynamic mode + * + * @param names of caches + */ + public void setCacheNames(Collection names) { + if (names != null) { + for (String name : names) { + getCache(name); + } + dynamic = false; + } else { + dynamic = true; + } + } + + /** + * Set cache config mapped by cache name + * + * @param config object + */ + public void setConfig(Map config) { + this.configMap = (Map) config; + } + + protected CacheConfig createDefaultConfig() { + return new CacheConfig(); + } + + @Override + public Cache getCache(String name) { + Cache cache = instanceMap.get(name); + if (cache != null) { + return cache; + } + if (!dynamic) { + return cache; + } + + CacheConfig config = configMap.get(name); + if (config == null) { + config = createDefaultConfig(); + configMap.put(name, config); + } + + // 重写 cacheName 支持多参数 + String[] array = StringUtils.delimitedListToStringArray(name, "#"); + name = array[0]; + if (array.length > 1) { + config.setTTL(DurationStyle.detectAndParse(array[1]).toMillis()); + } + if (array.length > 2) { + config.setMaxIdleTime(DurationStyle.detectAndParse(array[2]).toMillis()); + } + if (array.length > 3) { + config.setMaxSize(Integer.parseInt(array[3])); + } + + if (config.getMaxIdleTime() == 0 && config.getTTL() == 0 && config.getMaxSize() == 0) { + return createMap(name, config); + } + + return createMapCache(name, config); + } + + private Cache createMap(String name, CacheConfig config) { + RMap map = RedisUtils.getClient().getMap(name); + + Cache cache = new RedissonCache(map, allowNullValues); + if (transactionAware) { + cache = new TransactionAwareCacheDecorator(cache); + } + Cache oldCache = instanceMap.putIfAbsent(name, cache); + if (oldCache != null) { + cache = oldCache; + } + return cache; + } + + private Cache createMapCache(String name, CacheConfig config) { + RMapCache map = RedisUtils.getClient().getMapCache(name); + + Cache cache = new RedissonCache(map, config, allowNullValues); + if (transactionAware) { + cache = new TransactionAwareCacheDecorator(cache); + } + Cache oldCache = instanceMap.putIfAbsent(name, cache); + if (oldCache != null) { + cache = oldCache; + } else { + map.setMaxSize(config.getMaxSize()); + } + return cache; + } + + @Override + public Collection getCacheNames() { + return Collections.unmodifiableSet(configMap.keySet()); + } + + +} diff --git a/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/utils/CacheUtils.java b/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/utils/CacheUtils.java new file mode 100644 index 0000000..9c97a83 --- /dev/null +++ b/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/utils/CacheUtils.java @@ -0,0 +1,75 @@ +package org.aibidding.common.redis.utils; + +import org.aibidding.common.core.utils.SpringUtils; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.redisson.api.RMap; +import org.springframework.cache.Cache; +import org.springframework.cache.CacheManager; + +import java.util.Set; + +/** + * 缓存操作工具类 {@link } + * + * @author Michelle.Chung + * @date 2022/8/13 + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@SuppressWarnings(value = {"unchecked"}) +public class CacheUtils { + + private static final CacheManager CACHE_MANAGER = SpringUtils.getBean(CacheManager.class); + + /** + * 获取缓存组内所有的KEY + * + * @param cacheNames 缓存组名称 + */ + public static Set keys(String cacheNames) { + RMap rmap = (RMap) CACHE_MANAGER.getCache(cacheNames).getNativeCache(); + return rmap.keySet(); + } + + /** + * 获取缓存值 + * + * @param cacheNames 缓存组名称 + * @param key 缓存key + */ + public static T get(String cacheNames, Object key) { + Cache.ValueWrapper wrapper = CACHE_MANAGER.getCache(cacheNames).get(key); + return wrapper != null ? (T) wrapper.get() : null; + } + + /** + * 保存缓存值 + * + * @param cacheNames 缓存组名称 + * @param key 缓存key + * @param value 缓存值 + */ + public static void put(String cacheNames, Object key, Object value) { + CACHE_MANAGER.getCache(cacheNames).put(key, value); + } + + /** + * 删除缓存值 + * + * @param cacheNames 缓存组名称 + * @param key 缓存key + */ + public static void evict(String cacheNames, Object key) { + CACHE_MANAGER.getCache(cacheNames).evict(key); + } + + /** + * 清空缓存值 + * + * @param cacheNames 缓存组名称 + */ + public static void clear(String cacheNames) { + CACHE_MANAGER.getCache(cacheNames).clear(); + } + +} diff --git a/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/utils/QueueUtils.java b/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/utils/QueueUtils.java new file mode 100644 index 0000000..033e26d --- /dev/null +++ b/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/utils/QueueUtils.java @@ -0,0 +1,180 @@ +package org.aibidding.common.redis.utils; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.utils.SpringUtils; +import org.redisson.api.*; + +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; + +/** + * 分布式队列工具 + * 轻量级队列 重量级数据量 请使用 MQ + * 要求 redis 5.X 以上 + * + * @author Lion Li + * @version 3.6.0 新增 + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class QueueUtils { + + private static final RedissonClient CLIENT = SpringUtils.getBean(RedissonClient.class); + + + /** + * 获取客户端实例 + */ + public static RedissonClient getClient() { + return CLIENT; + } + + /** + * 添加普通队列数据 + * + * @param queueName 队列名 + * @param data 数据 + */ + public static boolean addQueueObject(String queueName, T data) { + RBlockingQueue queue = CLIENT.getBlockingQueue(queueName); + return queue.offer(data); + } + + /** + * 通用获取一个队列数据 没有数据返回 null(不支持延迟队列) + * + * @param queueName 队列名 + */ + public static T getQueueObject(String queueName) { + RBlockingQueue queue = CLIENT.getBlockingQueue(queueName); + return queue.poll(); + } + + /** + * 通用删除队列数据(不支持延迟队列) + */ + public static boolean removeQueueObject(String queueName, T data) { + RBlockingQueue queue = CLIENT.getBlockingQueue(queueName); + return queue.remove(data); + } + + /** + * 通用销毁队列 所有阻塞监听 报错(不支持延迟队列) + */ + public static boolean destroyQueue(String queueName) { + RBlockingQueue queue = CLIENT.getBlockingQueue(queueName); + return queue.delete(); + } + + /** + * 添加延迟队列数据 默认毫秒 + * + * @param queueName 队列名 + * @param data 数据 + * @param time 延迟时间 + */ + public static void addDelayedQueueObject(String queueName, T data, long time) { + addDelayedQueueObject(queueName, data, time, TimeUnit.MILLISECONDS); + } + + /** + * 添加延迟队列数据 + * + * @param queueName 队列名 + * @param data 数据 + * @param time 延迟时间 + * @param timeUnit 单位 + */ + public static void addDelayedQueueObject(String queueName, T data, long time, TimeUnit timeUnit) { + RBlockingQueue queue = CLIENT.getBlockingQueue(queueName); + RDelayedQueue delayedQueue = CLIENT.getDelayedQueue(queue); + delayedQueue.offer(data, time, timeUnit); + } + + /** + * 获取一个延迟队列数据 没有数据返回 null + * + * @param queueName 队列名 + */ + public static T getDelayedQueueObject(String queueName) { + RBlockingQueue queue = CLIENT.getBlockingQueue(queueName); + RDelayedQueue delayedQueue = CLIENT.getDelayedQueue(queue); + return delayedQueue.poll(); + } + + /** + * 删除延迟队列数据 + */ + public static boolean removeDelayedQueueObject(String queueName, T data) { + RBlockingQueue queue = CLIENT.getBlockingQueue(queueName); + RDelayedQueue delayedQueue = CLIENT.getDelayedQueue(queue); + return delayedQueue.remove(data); + } + + /** + * 销毁延迟队列 所有阻塞监听 报错 + */ + public static void destroyDelayedQueue(String queueName) { + RBlockingQueue queue = CLIENT.getBlockingQueue(queueName); + RDelayedQueue delayedQueue = CLIENT.getDelayedQueue(queue); + delayedQueue.destroy(); + } + + /** + * 添加优先队列数据 + * + * @param queueName 队列名 + * @param data 数据 + */ + public static boolean addPriorityQueueObject(String queueName, T data) { + RPriorityBlockingQueue priorityBlockingQueue = CLIENT.getPriorityBlockingQueue(queueName); + return priorityBlockingQueue.offer(data); + } + + /** + * 尝试设置 有界队列 容量 用于限制数量 + * + * @param queueName 队列名 + * @param capacity 容量 + */ + public static boolean trySetBoundedQueueCapacity(String queueName, int capacity) { + RBoundedBlockingQueue boundedBlockingQueue = CLIENT.getBoundedBlockingQueue(queueName); + return boundedBlockingQueue.trySetCapacity(capacity); + } + + /** + * 尝试设置 有界队列 容量 用于限制数量 + * + * @param queueName 队列名 + * @param capacity 容量 + * @param destroy 已存在是否销毁 + */ + public static boolean trySetBoundedQueueCapacity(String queueName, int capacity, boolean destroy) { + RBoundedBlockingQueue boundedBlockingQueue = CLIENT.getBoundedBlockingQueue(queueName); + if (boundedBlockingQueue.isExists() && destroy) { + destroyQueue(queueName); + } + return boundedBlockingQueue.trySetCapacity(capacity); + } + + /** + * 添加有界队列数据 + * + * @param queueName 队列名 + * @param data 数据 + * @return 添加成功 true 已达到界限 false + */ + public static boolean addBoundedQueueObject(String queueName, T data) { + RBoundedBlockingQueue boundedBlockingQueue = CLIENT.getBoundedBlockingQueue(queueName); + return boundedBlockingQueue.offer(data); + } + + /** + * 订阅阻塞队列(可订阅所有实现类 例如: 延迟 优先 有界 等) + */ + public static void subscribeBlockingQueue(String queueName, Consumer consumer) { + RBlockingQueue queue = CLIENT.getBlockingQueue(queueName); + queue.subscribeOnElements(consumer); + } + +} diff --git a/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/utils/RedisUtils.java b/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/utils/RedisUtils.java new file mode 100644 index 0000000..99152ca --- /dev/null +++ b/aibidding-common/aibidding-common-redis/src/main/java/org/aibidding/common/redis/utils/RedisUtils.java @@ -0,0 +1,462 @@ +package org.aibidding.common.redis.utils; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.utils.SpringUtils; +import org.redisson.api.*; + +import java.time.Duration; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * redis 工具类 + * + * @author Lion Li + * @version 3.1.0 新增 + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@SuppressWarnings(value = {"unchecked", "rawtypes"}) +public class RedisUtils { + + private static final RedissonClient CLIENT = SpringUtils.getBean(RedissonClient.class); + + /** + * 限流 + * + * @param key 限流key + * @param rateType 限流类型 + * @param rate 速率 + * @param rateInterval 速率间隔 + * @return -1 表示失败 + */ + public static long rateLimiter(String key, RateType rateType, int rate, int rateInterval) { + RRateLimiter rateLimiter = CLIENT.getRateLimiter(key); + rateLimiter.trySetRate(rateType, rate, rateInterval, RateIntervalUnit.SECONDS); + if (rateLimiter.tryAcquire()) { + return rateLimiter.availablePermits(); + } else { + return -1L; + } + } + + /** + * 获取客户端实例 + */ + public static RedissonClient getClient() { + return CLIENT; + } + + /** + * 发布通道消息 + * + * @param channelKey 通道key + * @param msg 发送数据 + * @param consumer 自定义处理 + */ + public static void publish(String channelKey, T msg, Consumer consumer) { + RTopic topic = CLIENT.getTopic(channelKey); + topic.publish(msg); + consumer.accept(msg); + } + + public static void publish(String channelKey, T msg) { + RTopic topic = CLIENT.getTopic(channelKey); + topic.publish(msg); + } + + /** + * 订阅通道接收消息 + * + * @param channelKey 通道key + * @param clazz 消息类型 + * @param consumer 自定义处理 + */ + public static void subscribe(String channelKey, Class clazz, Consumer consumer) { + RTopic topic = CLIENT.getTopic(channelKey); + topic.addListener(clazz, (channel, msg) -> consumer.accept(msg)); + } + + /** + * 缓存基本的对象,Integer、String、实体类等 + * + * @param key 缓存的键值 + * @param value 缓存的值 + */ + public static void setCacheObject(final String key, final T value) { + setCacheObject(key, value, false); + } + + /** + * 缓存基本的对象,保留当前对象 TTL 有效期 + * + * @param key 缓存的键值 + * @param value 缓存的值 + * @param isSaveTtl 是否保留TTL有效期(例如: set之前ttl剩余90 set之后还是为90) + * @since Redis 6.X 以上使用 setAndKeepTTL 兼容 5.X 方案 + */ + public static void setCacheObject(final String key, final T value, final boolean isSaveTtl) { + RBucket bucket = CLIENT.getBucket(key); + if (isSaveTtl) { + try { + bucket.setAndKeepTTL(value); + } catch (Exception e) { + long timeToLive = bucket.remainTimeToLive(); + setCacheObject(key, value, Duration.ofMillis(timeToLive)); + } + } else { + bucket.set(value); + } + } + + /** + * 缓存基本的对象,Integer、String、实体类等 + * + * @param key 缓存的键值 + * @param value 缓存的值 + * @param duration 时间 + */ + public static void setCacheObject(final String key, final T value, final Duration duration) { + RBatch batch = CLIENT.createBatch(); + RBucketAsync bucket = batch.getBucket(key); + bucket.setAsync(value); + bucket.expireAsync(duration); + batch.execute(); + } + + /** + * 注册对象监听器 + *

+ * key 监听器需开启 `notify-keyspace-events` 等 redis 相关配置 + * + * @param key 缓存的键值 + * @param listener 监听器配置 + */ + public static void addObjectListener(final String key, final ObjectListener listener) { + RBucket result = CLIENT.getBucket(key); + result.addListener(listener); + } + + /** + * 设置有效时间 + * + * @param key Redis键 + * @param timeout 超时时间 + * @return true=设置成功;false=设置失败 + */ + public static boolean expire(final String key, final long timeout) { + return expire(key, Duration.ofSeconds(timeout)); + } + + /** + * 设置有效时间 + * + * @param key Redis键 + * @param duration 超时时间 + * @return true=设置成功;false=设置失败 + */ + public static boolean expire(final String key, final Duration duration) { + RBucket rBucket = CLIENT.getBucket(key); + return rBucket.expire(duration); + } + + /** + * 获得缓存的基本对象。 + * + * @param key 缓存键值 + * @return 缓存键值对应的数据 + */ + public static T getCacheObject(final String key) { + RBucket rBucket = CLIENT.getBucket(key); + return rBucket.get(); + } + + /** + * 获得key剩余存活时间 + * + * @param key 缓存键值 + * @return 剩余存活时间 + */ + public static long getTimeToLive(final String key) { + RBucket rBucket = CLIENT.getBucket(key); + return rBucket.remainTimeToLive(); + } + + /** + * 删除单个对象 + * + * @param key 缓存的键值 + */ + public static boolean deleteObject(final String key) { + return CLIENT.getBucket(key).delete(); + } + + /** + * 删除集合对象 + * + * @param collection 多个对象 + */ + public static void deleteObject(final Collection collection) { + RBatch batch = CLIENT.createBatch(); + collection.forEach(t -> { + batch.getBucket(t.toString()).deleteAsync(); + }); + batch.execute(); + } + + /** + * 检查缓存对象是否存在 + * + * @param key 缓存的键值 + */ + public static boolean isExistsObject(final String key) { + return CLIENT.getBucket(key).isExists(); + } + + /** + * 缓存List数据 + * + * @param key 缓存的键值 + * @param dataList 待缓存的List数据 + * @return 缓存的对象 + */ + public static boolean setCacheList(final String key, final List dataList) { + RList rList = CLIENT.getList(key); + return rList.addAll(dataList); + } + + /** + * 注册List监听器 + *

+ * key 监听器需开启 `notify-keyspace-events` 等 redis 相关配置 + * + * @param key 缓存的键值 + * @param listener 监听器配置 + */ + public static void addListListener(final String key, final ObjectListener listener) { + RList rList = CLIENT.getList(key); + rList.addListener(listener); + } + + /** + * 获得缓存的list对象 + * + * @param key 缓存的键值 + * @return 缓存键值对应的数据 + */ + public static List getCacheList(final String key) { + RList rList = CLIENT.getList(key); + return rList.readAll(); + } + + /** + * 缓存Set + * + * @param key 缓存键值 + * @param dataSet 缓存的数据 + * @return 缓存数据的对象 + */ + public static boolean setCacheSet(final String key, final Set dataSet) { + RSet rSet = CLIENT.getSet(key); + return rSet.addAll(dataSet); + } + + /** + * 注册Set监听器 + *

+ * key 监听器需开启 `notify-keyspace-events` 等 redis 相关配置 + * + * @param key 缓存的键值 + * @param listener 监听器配置 + */ + public static void addSetListener(final String key, final ObjectListener listener) { + RSet rSet = CLIENT.getSet(key); + rSet.addListener(listener); + } + + /** + * 获得缓存的set + * + * @param key 缓存的key + * @return set对象 + */ + public static Set getCacheSet(final String key) { + RSet rSet = CLIENT.getSet(key); + return rSet.readAll(); + } + + /** + * 缓存Map + * + * @param key 缓存的键值 + * @param dataMap 缓存的数据 + */ + public static void setCacheMap(final String key, final Map dataMap) { + if (dataMap != null) { + RMap rMap = CLIENT.getMap(key); + rMap.putAll(dataMap); + } + } + + /** + * 注册Map监听器 + *

+ * key 监听器需开启 `notify-keyspace-events` 等 redis 相关配置 + * + * @param key 缓存的键值 + * @param listener 监听器配置 + */ + public static void addMapListener(final String key, final ObjectListener listener) { + RMap rMap = CLIENT.getMap(key); + rMap.addListener(listener); + } + + /** + * 获得缓存的Map + * + * @param key 缓存的键值 + * @return map对象 + */ + public static Map getCacheMap(final String key) { + RMap rMap = CLIENT.getMap(key); + return rMap.getAll(rMap.keySet()); + } + + /** + * 获得缓存Map的key列表 + * + * @param key 缓存的键值 + * @return key列表 + */ + public static Set getCacheMapKeySet(final String key) { + RMap rMap = CLIENT.getMap(key); + return rMap.keySet(); + } + + /** + * 往Hash中存入数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @param value 值 + */ + public static void setCacheMapValue(final String key, final String hKey, final T value) { + RMap rMap = CLIENT.getMap(key); + rMap.put(hKey, value); + } + + /** + * 获取Hash中的数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @return Hash中的对象 + */ + public static T getCacheMapValue(final String key, final String hKey) { + RMap rMap = CLIENT.getMap(key); + return rMap.get(hKey); + } + + /** + * 删除Hash中的数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @return Hash中的对象 + */ + public static T delCacheMapValue(final String key, final String hKey) { + RMap rMap = CLIENT.getMap(key); + return rMap.remove(hKey); + } + + /** + * 获取多个Hash中的数据 + * + * @param key Redis键 + * @param hKeys Hash键集合 + * @return Hash对象集合 + */ + public static Map getMultiCacheMapValue(final String key, final Set hKeys) { + RMap rMap = CLIENT.getMap(key); + return rMap.getAll(hKeys); + } + + /** + * 设置原子值 + * + * @param key Redis键 + * @param value 值 + */ + public static void setAtomicValue(String key, long value) { + RAtomicLong atomic = CLIENT.getAtomicLong(key); + atomic.set(value); + } + + /** + * 获取原子值 + * + * @param key Redis键 + * @return 当前值 + */ + public static long getAtomicValue(String key) { + RAtomicLong atomic = CLIENT.getAtomicLong(key); + return atomic.get(); + } + + /** + * 递增原子值 + * + * @param key Redis键 + * @return 当前值 + */ + public static long incrAtomicValue(String key) { + RAtomicLong atomic = CLIENT.getAtomicLong(key); + return atomic.incrementAndGet(); + } + + /** + * 递减原子值 + * + * @param key Redis键 + * @return 当前值 + */ + public static long decrAtomicValue(String key) { + RAtomicLong atomic = CLIENT.getAtomicLong(key); + return atomic.decrementAndGet(); + } + + /** + * 获得缓存的基本对象列表 + * + * @param pattern 字符串前缀 + * @return 对象列表 + */ + public static Collection keys(final String pattern) { + Stream stream = CLIENT.getKeys().getKeysStreamByPattern(pattern); + return stream.collect(Collectors.toList()); + } + + /** + * 删除缓存的基本对象列表 + * + * @param pattern 字符串前缀 + */ + public static void deleteKeys(final String pattern) { + CLIENT.getKeys().deleteByPattern(pattern); + } + + /** + * 检查redis中是否存在key + * + * @param key 键 + */ + public static Boolean hasKey(String key) { + RKeys rKeys = CLIENT.getKeys(); + return rKeys.countExists(key) > 0; + } +} diff --git a/aibidding-common/aibidding-common-redis/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-redis/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..3d014fa --- /dev/null +++ b/aibidding-common/aibidding-common-redis/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.aibidding.common.redis.config.RedisConfig diff --git a/aibidding-common/aibidding-common-satoken/pom.xml b/aibidding-common/aibidding-common-satoken/pom.xml new file mode 100644 index 0000000..4e8e46b --- /dev/null +++ b/aibidding-common/aibidding-common-satoken/pom.xml @@ -0,0 +1,42 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-satoken + + + + + org.ruoyi + aibidding-common-core + + + + + org.ruoyi + aibidding-common-redis + + + + + cn.dev33 + sa-token-spring-boot3-starter + + + + + cn.dev33 + sa-token-jwt + + + + + diff --git a/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/config/SaTokenConfig.java b/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/config/SaTokenConfig.java new file mode 100644 index 0000000..fbdb8ac --- /dev/null +++ b/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/config/SaTokenConfig.java @@ -0,0 +1,43 @@ +package org.aibidding.common.satoken.config; + +import cn.dev33.satoken.dao.SaTokenDao; +import cn.dev33.satoken.jwt.StpLogicJwtForSimple; +import cn.dev33.satoken.stp.StpInterface; +import cn.dev33.satoken.stp.StpLogic; +import org.aibidding.common.satoken.core.dao.PlusSaTokenDao; +import org.aibidding.common.satoken.core.service.SaPermissionImpl; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * sa-token 配置 + * + * @author Lion Li + */ +@AutoConfiguration +public class SaTokenConfig implements WebMvcConfigurer { + + @Bean + public StpLogic getStpLogicJwt() { + // Sa-Token 整合 jwt (简单模式) + return new StpLogicJwtForSimple(); + } + + /** + * 权限接口实现(使用bean注入方便用户替换) + */ + @Bean + public StpInterface stpInterface() { + return new SaPermissionImpl(); + } + + /** + * 自定义dao层存储 + */ + @Bean + public SaTokenDao saTokenDao() { + return new PlusSaTokenDao(); + } + +} diff --git a/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/core/dao/PlusSaTokenDao.java b/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/core/dao/PlusSaTokenDao.java new file mode 100644 index 0000000..84f584e --- /dev/null +++ b/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/core/dao/PlusSaTokenDao.java @@ -0,0 +1,176 @@ +package org.aibidding.common.satoken.core.dao; + +import cn.dev33.satoken.dao.SaTokenDao; +import cn.dev33.satoken.util.SaFoxUtil; +import org.aibidding.common.redis.utils.RedisUtils; + +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** + * Sa-Token持久层接口(使用框架自带RedisUtils实现 协议统一) + * + * @author Lion Li + */ +public class PlusSaTokenDao implements SaTokenDao { + + /** + * 获取Value,如无返空 + */ + @Override + public String get(String key) { + return RedisUtils.getCacheObject(key); + } + + /** + * 写入Value,并设定存活时间 (单位: 秒) + */ + @Override + public void set(String key, String value, long timeout) { + if (timeout == 0 || timeout <= NOT_VALUE_EXPIRE) { + return; + } + // 判断是否为永不过期 + if (timeout == NEVER_EXPIRE) { + RedisUtils.setCacheObject(key, value); + } else { + RedisUtils.setCacheObject(key, value, Duration.ofSeconds(timeout)); + } + } + + /** + * 修修改指定key-value键值对 (过期时间不变) + */ + @Override + public void update(String key, String value) { + long expire = getTimeout(key); + // -2 = 无此键 + if (expire == NOT_VALUE_EXPIRE) { + return; + } + this.set(key, value, expire); + } + + /** + * 删除Value + */ + @Override + public void delete(String key) { + RedisUtils.deleteObject(key); + } + + /** + * 获取Value的剩余存活时间 (单位: 秒) + */ + @Override + public long getTimeout(String key) { + long timeout = RedisUtils.getTimeToLive(key); + return timeout < 0 ? timeout : timeout / 1000; + } + + /** + * 修改Value的剩余存活时间 (单位: 秒) + */ + @Override + public void updateTimeout(String key, long timeout) { + // 判断是否想要设置为永久 + if (timeout == NEVER_EXPIRE) { + long expire = getTimeout(key); + if (expire == NEVER_EXPIRE) { + // 如果其已经被设置为永久,则不作任何处理 + } else { + // 如果尚未被设置为永久,那么再次set一次 + this.set(key, this.get(key), timeout); + } + return; + } + RedisUtils.expire(key, Duration.ofSeconds(timeout)); + } + + + /** + * 获取Object,如无返空 + */ + @Override + public Object getObject(String key) { + return RedisUtils.getCacheObject(key); + } + + /** + * 写入Object,并设定存活时间 (单位: 秒) + */ + @Override + public void setObject(String key, Object object, long timeout) { + if (timeout == 0 || timeout <= NOT_VALUE_EXPIRE) { + return; + } + // 判断是否为永不过期 + if (timeout == NEVER_EXPIRE) { + RedisUtils.setCacheObject(key, object); + } else { + RedisUtils.setCacheObject(key, object, Duration.ofSeconds(timeout)); + } + } + + /** + * 更新Object (过期时间不变) + */ + @Override + public void updateObject(String key, Object object) { + long expire = getObjectTimeout(key); + // -2 = 无此键 + if (expire == NOT_VALUE_EXPIRE) { + return; + } + this.setObject(key, object, expire); + } + + /** + * 删除Object + */ + @Override + public void deleteObject(String key) { + RedisUtils.deleteObject(key); + } + + /** + * 获取Object的剩余存活时间 (单位: 秒) + */ + @Override + public long getObjectTimeout(String key) { + long timeout = RedisUtils.getTimeToLive(key); + return timeout < 0 ? timeout : timeout / 1000; + } + + /** + * 修改Object的剩余存活时间 (单位: 秒) + */ + @Override + public void updateObjectTimeout(String key, long timeout) { + // 判断是否想要设置为永久 + if (timeout == NEVER_EXPIRE) { + long expire = getObjectTimeout(key); + if (expire == NEVER_EXPIRE) { + // 如果其已经被设置为永久,则不作任何处理 + } else { + // 如果尚未被设置为永久,那么再次set一次 + this.setObject(key, this.getObject(key), timeout); + } + return; + } + RedisUtils.expire(key, Duration.ofSeconds(timeout)); + } + + + /** + * 搜索数据 + */ + @Override + public List searchData(String prefix, String keyword, int start, int size, boolean sortType) { + Collection keys = RedisUtils.keys(prefix + "*" + keyword + "*"); + List list = new ArrayList<>(keys); + return SaFoxUtil.searchList(list, start, size, sortType); + } +} diff --git a/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/core/service/SaPermissionImpl.java b/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/core/service/SaPermissionImpl.java new file mode 100644 index 0000000..2c2702a --- /dev/null +++ b/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/core/service/SaPermissionImpl.java @@ -0,0 +1,47 @@ +package org.aibidding.common.satoken.core.service; + +import cn.dev33.satoken.stp.StpInterface; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.enums.UserType; +import org.aibidding.common.satoken.utils.LoginHelper; + +import java.util.ArrayList; +import java.util.List; + +/** + * sa-token 权限管理实现类 + * + * @author Lion Li + */ +public class SaPermissionImpl implements StpInterface { + + /** + * 获取菜单权限列表 + */ + @Override + public List getPermissionList(Object loginId, String loginType) { + LoginUser loginUser = LoginHelper.getLoginUser(); + UserType userType = UserType.getUserType(loginUser.getUserType()); + if (userType == UserType.SYS_USER) { + return new ArrayList<>(loginUser.getMenuPermission()); + } else if (userType == UserType.APP_USER) { + // 其他端 自行根据业务编写 + } + return new ArrayList<>(); + } + + /** + * 获取角色权限列表 + */ + @Override + public List getRoleList(Object loginId, String loginType) { + LoginUser loginUser = LoginHelper.getLoginUser(); + UserType userType = UserType.getUserType(loginUser.getUserType()); + if (userType == UserType.SYS_USER) { + return new ArrayList<>(loginUser.getRolePermission()); + } else if (userType == UserType.APP_USER) { + // 其他端 自行根据业务编写 + } + return new ArrayList<>(); + } +} diff --git a/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/listener/UserActionListener.java b/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/listener/UserActionListener.java new file mode 100644 index 0000000..96105e4 --- /dev/null +++ b/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/listener/UserActionListener.java @@ -0,0 +1,138 @@ +package org.aibidding.common.satoken.listener; + +import cn.dev33.satoken.config.SaTokenConfig; +import cn.dev33.satoken.listener.SaTokenListener; +import cn.dev33.satoken.stp.SaLoginModel; +import cn.hutool.http.useragent.UserAgent; +import cn.hutool.http.useragent.UserAgentUtil; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.constant.CacheConstants; +import org.aibidding.common.core.domain.dto.UserOnlineDTO; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.enums.UserType; +import org.aibidding.common.core.utils.ServletUtils; +import org.aibidding.common.redis.utils.RedisUtils; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.springframework.stereotype.Component; + +import java.time.Duration; + +/** + * 用户行为 侦听器的实现 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Component +@Slf4j +public class UserActionListener implements SaTokenListener { + + private final SaTokenConfig tokenConfig; + + /** + * 每次登录时触发 + */ + @Override + public void doLogin(String loginType, Object loginId, String tokenValue, SaLoginModel loginModel) { + UserType userType = UserType.getUserType(loginId.toString()); + if (userType == UserType.SYS_USER) { + UserAgent userAgent = UserAgentUtil.parse(ServletUtils.getRequest().getHeader("User-Agent")); + String ip = ServletUtils.getClientIP(); + LoginUser user = LoginHelper.getLoginUser(); + UserOnlineDTO dto = new UserOnlineDTO(); + dto.setIpaddr(ip); + // dto.setLoginLocation(AddressUtils.getRealAddressByIP(ip)); + dto.setBrowser(userAgent.getBrowser().getName()); + dto.setOs(userAgent.getOs().getName()); + dto.setLoginTime(System.currentTimeMillis()); + dto.setTokenId(tokenValue); + dto.setUserName(user.getUsername()); + dto.setDeptName(user.getDeptName()); + if(tokenConfig.getTimeout() == -1) { + RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto); + } else { + RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto, Duration.ofSeconds(tokenConfig.getTimeout())); + } + log.info("user doLogin, userId:{}, token:{}", loginId, tokenValue); + } else if (userType == UserType.APP_USER) { + // app端 自行根据业务编写 + } + } + + /** + * 每次注销时触发 + */ + @Override + public void doLogout(String loginType, Object loginId, String tokenValue) { + RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue); + log.info("user doLogout, userId:{}, token:{}", loginId, tokenValue); + } + + /** + * 每次被踢下线时触发 + */ + @Override + public void doKickout(String loginType, Object loginId, String tokenValue) { + RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue); + log.info("user doKickout, userId:{}, token:{}", loginId, tokenValue); + } + + /** + * 每次被顶下线时触发 + */ + @Override + public void doReplaced(String loginType, Object loginId, String tokenValue) { + RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue); + log.info("user doReplaced, userId:{}, token:{}", loginId, tokenValue); + } + + /** + * 每次被封禁时触发 + */ + @Override + public void doDisable(String loginType, Object loginId, String service, int level, long disableTime) { + } + + /** + * 每次被解封时触发 + */ + @Override + public void doUntieDisable(String loginType, Object loginId, String service) { + } + + /** + * 每次打开二级认证时触发 + */ + @Override + public void doOpenSafe(String loginType, String tokenValue, String service, long safeTime) { + } + + /** + * 每次创建Session时触发 + */ + @Override + public void doCloseSafe(String loginType, String tokenValue, String service) { + } + + /** + * 每次创建Session时触发 + */ + @Override + public void doCreateSession(String id) { + } + + /** + * 每次注销Session时触发 + */ + @Override + public void doLogoutSession(String id) { + } + + /** + * 每次Token续期时触发 + */ + @Override + public void doRenewTimeout(String tokenValue, Object loginId, long timeout) { + } +} diff --git a/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/utils/LoginHelper.java b/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/utils/LoginHelper.java new file mode 100644 index 0000000..e928196 --- /dev/null +++ b/aibidding-common/aibidding-common-satoken/src/main/java/org/aibidding/common/satoken/utils/LoginHelper.java @@ -0,0 +1,165 @@ +package org.aibidding.common.satoken.utils; + +import cn.dev33.satoken.context.SaHolder; +import cn.dev33.satoken.context.model.SaStorage; +import cn.dev33.satoken.stp.SaLoginModel; +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.ObjectUtil; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.constant.TenantConstants; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.enums.DeviceType; +import org.aibidding.common.core.enums.UserType; + +import java.util.Set; + +/** + * 登录鉴权助手 + *

+ * user_type 为 用户类型 同一个用户表 可以有多种用户类型 例如 pc,app + * deivce 为 设备类型 同一个用户类型 可以有 多种设备类型 例如 web,ios + * 可以组成 用户类型与设备类型多对多的 权限灵活控制 + *

+ * 多用户体系 针对 多种用户类型 但权限控制不一致 + * 可以组成 多用户类型表与多设备类型 分别控制权限 + * + * @author Lion Li + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class LoginHelper { + + public static final String LOGIN_USER_KEY = "loginUser"; + public static final String TENANT_KEY = "tenantId"; + public static final String USER_KEY = "userId"; + + /** + * 登录系统 + * + * @param loginUser 登录用户信息 + */ + public static void login(LoginUser loginUser) { + loginByDevice(loginUser, null); + } + + /** + * 登录系统 基于 设备类型 + * 针对相同用户体系不同设备 + * + * @param loginUser 登录用户信息 + */ + public static void loginByDevice(LoginUser loginUser, DeviceType deviceType) { + SaStorage storage = SaHolder.getStorage(); + storage.set(LOGIN_USER_KEY, loginUser); + storage.set(TENANT_KEY, loginUser.getTenantId()); + storage.set(USER_KEY, loginUser.getUserId()); + SaLoginModel model = new SaLoginModel(); + if (ObjectUtil.isNotNull(deviceType)) { + model.setDevice(deviceType.getDevice()); + } + StpUtil.login(loginUser.getLoginId(), + model.setExtra(TENANT_KEY, loginUser.getTenantId()) + .setExtra(USER_KEY, loginUser.getUserId())); + StpUtil.getTokenSession().set(LOGIN_USER_KEY, loginUser); + } + + /** + * 获取用户(多级缓存) + */ + public static LoginUser getLoginUser() { + LoginUser loginUser = (LoginUser) SaHolder.getStorage().get(LOGIN_USER_KEY); + if (loginUser != null) { + return loginUser; + } + loginUser = (LoginUser) StpUtil.getTokenSession().get(LOGIN_USER_KEY); + SaHolder.getStorage().set(LOGIN_USER_KEY, loginUser); + return loginUser; + } + + /** + * 获取用户id + */ + public static Long getUserId() { + Long userId; + try { + userId = Convert.toLong(SaHolder.getStorage().get(USER_KEY)); + if (ObjectUtil.isNull(userId)) { + userId = Convert.toLong(StpUtil.getExtra(USER_KEY)); + SaHolder.getStorage().set(USER_KEY, userId); + } + } catch (Exception e) { + return null; + } + return userId; + } + + /** + * 获取租户ID + */ + public static String getTenantId() { + String tenantId; + try { + tenantId = (String) SaHolder.getStorage().get(TENANT_KEY); + if (ObjectUtil.isNull(tenantId)) { + tenantId = (String) StpUtil.getExtra(TENANT_KEY); + SaHolder.getStorage().set(TENANT_KEY, tenantId); + } + } catch (Exception e) { + return null; + } + return tenantId; + } + + /** + * 获取部门ID + */ + public static Long getDeptId() { + return getLoginUser().getDeptId(); + } + + /** + * 获取用户账户 + */ + public static String getUsername() { + return getLoginUser().getUsername(); + } + + /** + * 获取用户类型 + */ + public static UserType getUserType() { + String loginId = StpUtil.getLoginIdAsString(); + return UserType.getUserType(loginId); + } + + /** + * 是否为超级管理员 + * + * @param userId 用户ID + * @return 结果 + */ + public static boolean isSuperAdmin(Long userId) { + return UserConstants.SUPER_ADMIN_ID.equals(userId); + } + + public static boolean isSuperAdmin() { + return isSuperAdmin(getUserId()); + } + + /** + * 是否为超级管理员 + * + * @param rolePermission 角色权限标识组 + * @return 结果 + */ + public static boolean isTenantAdmin(Set rolePermission) { + return rolePermission.contains(TenantConstants.TENANT_ADMIN_ROLE_KEY); + } + + public static boolean isTenantAdmin() { + return isTenantAdmin(getLoginUser().getRolePermission()); + } + +} diff --git a/aibidding-common/aibidding-common-satoken/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-satoken/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..ccd8db3 --- /dev/null +++ b/aibidding-common/aibidding-common-satoken/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.aibidding.common.satoken.config.SaTokenConfig diff --git a/aibidding-common/aibidding-common-security/pom.xml b/aibidding-common/aibidding-common-security/pom.xml new file mode 100644 index 0000000..595eaa4 --- /dev/null +++ b/aibidding-common/aibidding-common-security/pom.xml @@ -0,0 +1,27 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-security + + + ruoyi-common-security 安全模块 + + + + + org.ruoyi + aibidding-common-satoken + + + + + diff --git a/aibidding-common/aibidding-common-security/src/main/java/org/aibidding/common/security/config/SecurityConfig.java b/aibidding-common/aibidding-common-security/src/main/java/org/aibidding/common/security/config/SecurityConfig.java new file mode 100644 index 0000000..d2d6629 --- /dev/null +++ b/aibidding-common/aibidding-common-security/src/main/java/org/aibidding/common/security/config/SecurityConfig.java @@ -0,0 +1,59 @@ +package org.aibidding.common.security.config; + +import cn.dev33.satoken.interceptor.SaInterceptor; +import cn.dev33.satoken.router.SaRouter; +import cn.dev33.satoken.stp.StpUtil; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.security.config.properties.SecurityProperties; +import org.aibidding.common.security.handler.AllUrlHandler; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * 权限安全配置 + * + * @author Lion Li + */ + +@Slf4j +@AutoConfiguration +@EnableConfigurationProperties(SecurityProperties.class) +@RequiredArgsConstructor +public class SecurityConfig implements WebMvcConfigurer { + + private final SecurityProperties securityProperties; + + /** + * 注册sa-token的拦截器 + */ + @Override + public void addInterceptors(InterceptorRegistry registry) { + // 注册路由拦截器,自定义验证规则 + registry.addInterceptor(new SaInterceptor(handler -> { + AllUrlHandler allUrlHandler = SpringUtils.getBean(AllUrlHandler.class); + // 登录验证 -- 排除多个路径 + SaRouter + // 获取所有的 + .match(allUrlHandler.getUrls()) + // 对未排除的路径进行检查 + .check(() -> { + // 检查是否登录 是否有token + StpUtil.checkLogin(); + + // 有效率影响 用于临时测试 + // if (log.isDebugEnabled()) { + // log.debug("剩余有效时间: {}", StpUtil.getTokenTimeout()); + // log.debug("临时有效时间: {}", StpUtil.getTokenActivityTimeout()); + // } + + }); + })).addPathPatterns("/**") + // 排除不需要拦截的路径 + .excludePathPatterns(securityProperties.getExcludes()); + } + +} diff --git a/aibidding-common/aibidding-common-security/src/main/java/org/aibidding/common/security/config/properties/SecurityProperties.java b/aibidding-common/aibidding-common-security/src/main/java/org/aibidding/common/security/config/properties/SecurityProperties.java new file mode 100644 index 0000000..65f981b --- /dev/null +++ b/aibidding-common/aibidding-common-security/src/main/java/org/aibidding/common/security/config/properties/SecurityProperties.java @@ -0,0 +1,21 @@ +package org.aibidding.common.security.config.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Security 配置属性 + * + * @author Lion Li + */ +@Data +@ConfigurationProperties(prefix = "security") +public class SecurityProperties { + + /** + * 排除路径 + */ + private String[] excludes; + + +} diff --git a/aibidding-common/aibidding-common-security/src/main/java/org/aibidding/common/security/handler/AllUrlHandler.java b/aibidding-common/aibidding-common-security/src/main/java/org/aibidding/common/security/handler/AllUrlHandler.java new file mode 100644 index 0000000..f774d1f --- /dev/null +++ b/aibidding-common/aibidding-common-security/src/main/java/org/aibidding/common/security/handler/AllUrlHandler.java @@ -0,0 +1,41 @@ +package org.aibidding.common.security.handler; + +import cn.hutool.core.util.ReUtil; +import lombok.Data; +import org.aibidding.common.core.utils.SpringUtils; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.mvc.method.RequestMappingInfo; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +import java.util.*; +import java.util.regex.Pattern; + +/** + * 获取所有Url配置 + * + * @author Lion Li + */ +@Data +public class AllUrlHandler implements InitializingBean { + + private static final Pattern PATTERN = Pattern.compile("\\{(.*?)\\}"); + + private List urls = new ArrayList<>(); + + @Override + public void afterPropertiesSet() { + Set set = new HashSet<>(); + RequestMappingHandlerMapping mapping = SpringUtils.getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class); + Map map = mapping.getHandlerMethods(); + map.keySet().forEach(info -> { + // 获取注解上边的 path 替代 path variable 为 * + if(info.getPathPatternsCondition()!=null){ + Objects.requireNonNull(info.getPathPatternsCondition().getPatterns()) + .forEach(url -> set.add(ReUtil.replaceAll(url.getPatternString(), PATTERN, "*"))); + } + }); + urls.addAll(set); + } + +} diff --git a/aibidding-common/aibidding-common-security/src/main/java/org/aibidding/common/security/handler/GlobalExceptionHandler.java b/aibidding-common/aibidding-common-security/src/main/java/org/aibidding/common/security/handler/GlobalExceptionHandler.java new file mode 100644 index 0000000..0890795 --- /dev/null +++ b/aibidding-common/aibidding-common-security/src/main/java/org/aibidding/common/security/handler/GlobalExceptionHandler.java @@ -0,0 +1,140 @@ +package org.aibidding.common.security.handler; + +import cn.dev33.satoken.exception.NotLoginException; +import cn.dev33.satoken.exception.NotPermissionException; +import cn.dev33.satoken.exception.NotRoleException; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.http.HttpStatus; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.exception.DemoModeException; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.StreamUtils; +import org.springframework.context.support.DefaultMessageSourceResolvable; +import org.springframework.validation.BindException; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * 全局异常处理器 + * + * @author Lion Li + */ +@Slf4j +@RestControllerAdvice +public class GlobalExceptionHandler { + + /** + * 权限码异常 + */ + @ExceptionHandler(NotPermissionException.class) + public R handleNotPermissionException(NotPermissionException e, HttpServletRequest request) { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',权限码校验失败'{}'", requestURI, e.getMessage()); + return R.fail(HttpStatus.HTTP_FORBIDDEN, "没有访问权限,请联系管理员授权"); + } + + /** + * 角色权限异常 + */ + @ExceptionHandler(NotRoleException.class) + public R handleNotRoleException(NotRoleException e, HttpServletRequest request) { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',角色权限校验失败'{}'", requestURI, e.getMessage()); + return R.fail(HttpStatus.HTTP_FORBIDDEN, "没有访问权限,请联系管理员授权"); + } + + /** + * 认证失败 + */ + @ExceptionHandler(NotLoginException.class) + public R handleNotLoginException(NotLoginException e, HttpServletRequest request) { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',认证失败'{}',无法访问系统资源", requestURI, e.getMessage()); + return R.fail(HttpStatus.HTTP_UNAUTHORIZED, "认证失败,无法访问系统资源"); + } + + /** + * 请求方式不支持 + */ + @ExceptionHandler(HttpRequestMethodNotSupportedException.class) + public R handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e, + HttpServletRequest request) { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',不支持'{}'请求", requestURI, e.getMethod()); + return R.fail(e.getMessage()); + } + + /** + * 业务异常 + */ + @ExceptionHandler(ServiceException.class) + public R handleServiceException(ServiceException e, HttpServletRequest request) { + log.error(e.getMessage(), e); + Integer code = e.getCode(); + return ObjectUtil.isNotNull(code) ? R.fail(code, e.getMessage()) : R.fail(e.getMessage()); + } + + /** + * 拦截未知的运行时异常 + */ + @ExceptionHandler(RuntimeException.class) + public R handleRuntimeException(RuntimeException e, HttpServletRequest request) { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',发生未知异常.", requestURI, e); + return R.fail(e.getMessage()); + } + + /** + * 系统异常 + */ + @ExceptionHandler(Exception.class) + public R handleException(Exception e, HttpServletRequest request) { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',发生系统异常.", requestURI, e); + return R.fail(e.getMessage()); + } + + /** + * 自定义验证异常 + */ + @ExceptionHandler(BindException.class) + public R handleBindException(BindException e) { + log.error(e.getMessage(), e); + String message = StreamUtils.join(e.getAllErrors(), DefaultMessageSourceResolvable::getDefaultMessage, ", "); + return R.fail(message); + } + + /** + * 自定义验证异常 + */ + @ExceptionHandler(ConstraintViolationException.class) + public R constraintViolationException(ConstraintViolationException e) { + log.error(e.getMessage(), e); + String message = StreamUtils.join(e.getConstraintViolations(), ConstraintViolation::getMessage, ", "); + return R.fail(message); + } + + /** + * 自定义验证异常 + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + public R handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { + log.error(e.getMessage(), e); + String message = e.getBindingResult().getFieldError().getDefaultMessage(); + return R.fail(message); + } + + /** + * 演示模式异常 + */ + @ExceptionHandler(DemoModeException.class) + public R handleDemoModeException(DemoModeException e) { + return R.fail("演示模式,不允许操作"); + } +} diff --git a/aibidding-common/aibidding-common-security/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-security/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..8f7f997 --- /dev/null +++ b/aibidding-common/aibidding-common-security/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,3 @@ +org.aibidding.common.security.handler.GlobalExceptionHandler +org.aibidding.common.security.handler.AllUrlHandler +org.aibidding.common.security.config.SecurityConfig diff --git a/aibidding-common/aibidding-common-sensitive/pom.xml b/aibidding-common/aibidding-common-sensitive/pom.xml new file mode 100644 index 0000000..9ad6fbe --- /dev/null +++ b/aibidding-common/aibidding-common-sensitive/pom.xml @@ -0,0 +1,26 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-sensitive + + + ruoyi-common-sensitive 脱敏模块 + + + + + org.ruoyi + aibidding-common-json + + + + diff --git a/aibidding-common/aibidding-common-sensitive/src/main/java/org/aibidding/common/sensitive/annotation/Sensitive.java b/aibidding-common/aibidding-common-sensitive/src/main/java/org/aibidding/common/sensitive/annotation/Sensitive.java new file mode 100644 index 0000000..b32aae2 --- /dev/null +++ b/aibidding-common/aibidding-common-sensitive/src/main/java/org/aibidding/common/sensitive/annotation/Sensitive.java @@ -0,0 +1,24 @@ +package org.aibidding.common.sensitive.annotation; + +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.aibidding.common.sensitive.core.SensitiveStrategy; +import org.aibidding.common.sensitive.handler.SensitiveHandler; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 数据脱敏注解 + * + * @author zhujie + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +@JacksonAnnotationsInside +@JsonSerialize(using = SensitiveHandler.class) +public @interface Sensitive { + SensitiveStrategy strategy(); +} diff --git a/aibidding-common/aibidding-common-sensitive/src/main/java/org/aibidding/common/sensitive/core/SensitiveService.java b/aibidding-common/aibidding-common-sensitive/src/main/java/org/aibidding/common/sensitive/core/SensitiveService.java new file mode 100644 index 0000000..ebd8a75 --- /dev/null +++ b/aibidding-common/aibidding-common-sensitive/src/main/java/org/aibidding/common/sensitive/core/SensitiveService.java @@ -0,0 +1,18 @@ +package org.aibidding.common.sensitive.core; + +/** + * 脱敏服务 + * 默认管理员不过滤 + * 需自行根据业务重写实现 + * + * @author Lion Li + * @version 3.6.0 + */ +public interface SensitiveService { + + /** + * 是否脱敏 + */ + boolean isSensitive(); + +} diff --git a/aibidding-common/aibidding-common-sensitive/src/main/java/org/aibidding/common/sensitive/core/SensitiveStrategy.java b/aibidding-common/aibidding-common-sensitive/src/main/java/org/aibidding/common/sensitive/core/SensitiveStrategy.java new file mode 100644 index 0000000..d236ed4 --- /dev/null +++ b/aibidding-common/aibidding-common-sensitive/src/main/java/org/aibidding/common/sensitive/core/SensitiveStrategy.java @@ -0,0 +1,49 @@ +package org.aibidding.common.sensitive.core; + +import cn.hutool.core.util.DesensitizedUtil; +import lombok.AllArgsConstructor; + +import java.util.function.Function; + +/** + * 脱敏策略 + * + * @author Yjoioooo + * @version 3.6.0 + */ +@AllArgsConstructor +public enum SensitiveStrategy { + + /** + * 身份证脱敏 + */ + ID_CARD(s -> DesensitizedUtil.idCardNum(s, 3, 4)), + + /** + * 手机号脱敏 + */ + PHONE(DesensitizedUtil::mobilePhone), + + /** + * 地址脱敏 + */ + ADDRESS(s -> DesensitizedUtil.address(s, 8)), + + /** + * 邮箱脱敏 + */ + EMAIL(DesensitizedUtil::email), + + /** + * 银行卡 + */ + BANK_CARD(DesensitizedUtil::bankCard); + + //可自行添加其他脱敏策略 + + private final Function desensitizer; + + public Function desensitizer() { + return desensitizer; + } +} diff --git a/aibidding-common/aibidding-common-sensitive/src/main/java/org/aibidding/common/sensitive/handler/SensitiveHandler.java b/aibidding-common/aibidding-common-sensitive/src/main/java/org/aibidding/common/sensitive/handler/SensitiveHandler.java new file mode 100644 index 0000000..6cb4aee --- /dev/null +++ b/aibidding-common/aibidding-common-sensitive/src/main/java/org/aibidding/common/sensitive/handler/SensitiveHandler.java @@ -0,0 +1,54 @@ +package org.aibidding.common.sensitive.handler; + +import cn.hutool.core.util.ObjectUtil; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.BeanProperty; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.ContextualSerializer; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.sensitive.annotation.Sensitive; +import org.aibidding.common.sensitive.core.SensitiveService; +import org.aibidding.common.sensitive.core.SensitiveStrategy; +import org.springframework.beans.BeansException; + +import java.io.IOException; +import java.util.Objects; + +/** + * 数据脱敏json序列化工具 + * + * @author Yjoioooo + */ +@Slf4j +public class SensitiveHandler extends JsonSerializer implements ContextualSerializer { + + private SensitiveStrategy strategy; + + @Override + public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException { + try { + SensitiveService sensitiveService = SpringUtils.getBean(SensitiveService.class); + if (ObjectUtil.isNotNull(sensitiveService) && sensitiveService.isSensitive()) { + gen.writeString(strategy.desensitizer().apply(value)); + } else { + gen.writeString(value); + } + } catch (BeansException e) { + log.error("脱敏实现不存在, 采用默认处理 => {}", e.getMessage()); + gen.writeString(value); + } + } + + @Override + public JsonSerializer createContextual(SerializerProvider prov, BeanProperty property) throws JsonMappingException { + Sensitive annotation = property.getAnnotation(Sensitive.class); + if (Objects.nonNull(annotation) && Objects.equals(String.class, property.getType().getRawClass())) { + this.strategy = annotation.strategy(); + return this; + } + return prov.findValueSerializer(property.getType(), property); + } +} diff --git a/aibidding-common/aibidding-common-sms/pom.xml b/aibidding-common/aibidding-common-sms/pom.xml new file mode 100644 index 0000000..a81765d --- /dev/null +++ b/aibidding-common/aibidding-common-sms/pom.xml @@ -0,0 +1,38 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-sms + + + ruoyi-common-sms 短信模块 + + + + + org.ruoyi + aibidding-common-json + + + + com.aliyun + dysmsapi20170525 + true + + + + com.tencentcloudapi + tencentcloud-sdk-java-sms + true + + + + diff --git a/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/config/SmsConfig.java b/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/config/SmsConfig.java new file mode 100644 index 0000000..0f706f5 --- /dev/null +++ b/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/config/SmsConfig.java @@ -0,0 +1,48 @@ +package org.aibidding.common.sms.config; + +import org.aibidding.common.sms.config.properties.SmsProperties; +import org.aibidding.common.sms.core.AliyunSmsTemplate; +import org.aibidding.common.sms.core.SmsTemplate; +import org.aibidding.common.sms.core.TencentSmsTemplate; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * 短信配置类 + * + * @author Lion Li + * @version 4.2.0 + */ +@AutoConfiguration +@EnableConfigurationProperties(SmsProperties.class) +public class SmsConfig { + + @Configuration + @ConditionalOnProperty(value = "sms.enabled", havingValue = "true") + @ConditionalOnClass(com.aliyun.dysmsapi20170525.Client.class) + static class AliyunSmsConfig { + + @Bean + public SmsTemplate aliyunSmsTemplate(SmsProperties smsProperties) { + return new AliyunSmsTemplate(smsProperties); + } + + } + + @Configuration + @ConditionalOnProperty(value = "sms.enabled", havingValue = "true") + @ConditionalOnClass(com.tencentcloudapi.sms.v20190711.SmsClient.class) + static class TencentSmsConfig { + + @Bean + public SmsTemplate tencentSmsTemplate(SmsProperties smsProperties) { + return new TencentSmsTemplate(smsProperties); + } + + } + +} diff --git a/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/config/properties/SmsProperties.java b/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/config/properties/SmsProperties.java new file mode 100644 index 0000000..6a2b832 --- /dev/null +++ b/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/config/properties/SmsProperties.java @@ -0,0 +1,45 @@ +package org.aibidding.common.sms.config.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * SMS短信 配置属性 + * + * @author Lion Li + * @version 4.2.0 + */ +@Data +@ConfigurationProperties(prefix = "sms") +public class SmsProperties { + + private Boolean enabled; + + /** + * 配置节点 + * 阿里云 dysmsapi.aliyuncs.com + * 腾讯云 sms.tencentcloudapi.com + */ + private String endpoint; + + /** + * key + */ + private String accessKeyId; + + /** + * 密匙 + */ + private String accessKeySecret; + + /* + * 短信签名 + */ + private String signName; + + /** + * 短信应用ID (腾讯专属) + */ + private String sdkAppId; + +} diff --git a/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/core/AliyunSmsTemplate.java b/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/core/AliyunSmsTemplate.java new file mode 100644 index 0000000..cf7fb82 --- /dev/null +++ b/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/core/AliyunSmsTemplate.java @@ -0,0 +1,66 @@ +package org.aibidding.common.sms.core; + +import com.aliyun.dysmsapi20170525.Client; +import com.aliyun.dysmsapi20170525.models.SendSmsRequest; +import com.aliyun.dysmsapi20170525.models.SendSmsResponse; +import com.aliyun.teaopenapi.models.Config; +import lombok.SneakyThrows; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.json.utils.JsonUtils; +import org.aibidding.common.sms.config.properties.SmsProperties; +import org.aibidding.common.sms.entity.SmsResult; +import org.aibidding.common.sms.exception.SmsException; + +import java.util.Map; + +/** + * Aliyun 短信模板 + * + * @author Lion Li + * @version 4.2.0 + */ +public class AliyunSmsTemplate implements SmsTemplate { + + private SmsProperties properties; + + private Client client; + + @SneakyThrows(Exception.class) + public AliyunSmsTemplate(SmsProperties smsProperties) { + this.properties = smsProperties; + Config config = new Config() + // 您的AccessKey ID + .setAccessKeyId(smsProperties.getAccessKeyId()) + // 您的AccessKey Secret + .setAccessKeySecret(smsProperties.getAccessKeySecret()) + // 访问的域名 + .setEndpoint(smsProperties.getEndpoint()); + this.client = new Client(config); + } + + @Override + public SmsResult send(String phones, String templateId, Map param) { + if (StringUtils.isBlank(phones)) { + throw new SmsException("手机号不能为空"); + } + if (StringUtils.isBlank(templateId)) { + throw new SmsException("模板ID不能为空"); + } + SendSmsRequest req = new SendSmsRequest() + .setPhoneNumbers(phones) + .setSignName(properties.getSignName()) + .setTemplateCode(templateId) + .setTemplateParam(JsonUtils.toJsonString(param)); + try { + SendSmsResponse resp = client.sendSms(req); + return SmsResult.builder() + .isSuccess("OK".equals(resp.getBody().getCode())) + .message(resp.getBody().getMessage()) + .response(JsonUtils.toJsonString(resp)) + .build(); + } catch (Exception e) { + throw new SmsException(e.getMessage()); + } + } + +} diff --git a/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/core/SmsTemplate.java b/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/core/SmsTemplate.java new file mode 100644 index 0000000..4da9d68 --- /dev/null +++ b/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/core/SmsTemplate.java @@ -0,0 +1,26 @@ +package org.aibidding.common.sms.core; + +import org.aibidding.common.sms.entity.SmsResult; + +import java.util.Map; + +/** + * 短信模板 + * + * @author Lion Li + * @version 4.2.0 + */ +public interface SmsTemplate { + + /** + * 发送短信 + * + * @param phones 电话号(多个逗号分割) + * @param templateId 模板id + * @param param 模板对应参数 + * 阿里 需使用 模板变量名称对应内容 例如: code=1234 + * 腾讯 需使用 模板变量顺序对应内容 例如: 1=1234, 1为模板内第一个参数 + */ + SmsResult send(String phones, String templateId, Map param); + +} diff --git a/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/core/TencentSmsTemplate.java b/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/core/TencentSmsTemplate.java new file mode 100644 index 0000000..13fcc45 --- /dev/null +++ b/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/core/TencentSmsTemplate.java @@ -0,0 +1,82 @@ +package org.aibidding.common.sms.core; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ArrayUtil; +import com.tencentcloudapi.common.Credential; +import com.tencentcloudapi.common.profile.ClientProfile; +import com.tencentcloudapi.common.profile.HttpProfile; +import com.tencentcloudapi.sms.v20190711.SmsClient; +import com.tencentcloudapi.sms.v20190711.models.SendSmsRequest; +import com.tencentcloudapi.sms.v20190711.models.SendSmsResponse; +import com.tencentcloudapi.sms.v20190711.models.SendStatus; +import lombok.SneakyThrows; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.json.utils.JsonUtils; +import org.aibidding.common.sms.config.properties.SmsProperties; +import org.aibidding.common.sms.entity.SmsResult; +import org.aibidding.common.sms.exception.SmsException; + +import java.util.Arrays; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * Tencent 短信模板 + * + * @author Lion Li + * @version 4.2.0 + */ +public class TencentSmsTemplate implements SmsTemplate { + + private SmsProperties properties; + + private SmsClient client; + + @SneakyThrows(Exception.class) + public TencentSmsTemplate(SmsProperties smsProperties) { + this.properties = smsProperties; + Credential credential = new Credential(smsProperties.getAccessKeyId(), smsProperties.getAccessKeySecret()); + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint(smsProperties.getEndpoint()); + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + this.client = new SmsClient(credential, "", clientProfile); + } + + @Override + public SmsResult send(String phones, String templateId, Map param) { + if (StringUtils.isBlank(phones)) { + throw new SmsException("手机号不能为空"); + } + if (StringUtils.isBlank(templateId)) { + throw new SmsException("模板ID不能为空"); + } + SendSmsRequest req = new SendSmsRequest(); + Set set = Arrays.stream(phones.split(StringUtils.SEPARATOR)).map(p -> "+86" + p).collect(Collectors.toSet()); + req.setPhoneNumberSet(ArrayUtil.toArray(set, String.class)); + if (CollUtil.isNotEmpty(param)) { + req.setTemplateParamSet(ArrayUtil.toArray(param.values(), String.class)); + } + req.setTemplateID(templateId); + req.setSign(properties.getSignName()); + req.setSmsSdkAppid(properties.getSdkAppId()); + try { + SendSmsResponse resp = client.SendSms(req); + SmsResult.SmsResultBuilder builder = SmsResult.builder() + .isSuccess(true) + .message("send success") + .response(JsonUtils.toJsonString(resp)); + for (SendStatus sendStatus : resp.getSendStatusSet()) { + if (!"Ok".equals(sendStatus.getCode())) { + builder.isSuccess(false).message(sendStatus.getMessage()); + break; + } + } + return builder.build(); + } catch (Exception e) { + throw new SmsException(e.getMessage()); + } + } + +} diff --git a/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/entity/SmsResult.java b/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/entity/SmsResult.java new file mode 100644 index 0000000..b4ae047 --- /dev/null +++ b/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/entity/SmsResult.java @@ -0,0 +1,31 @@ +package org.aibidding.common.sms.entity; + +import lombok.Builder; +import lombok.Data; + +/** + * 上传返回体 + * + * @author Lion Li + */ +@Data +@Builder +public class SmsResult { + + /** + * 是否成功 + */ + private boolean isSuccess; + + /** + * 响应消息 + */ + private String message; + + /** + * 实际响应体 + *

+ * 可自行转换为 SDK 对应的 SendSmsResponse + */ + private String response; +} diff --git a/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/exception/SmsException.java b/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/exception/SmsException.java new file mode 100644 index 0000000..c654e53 --- /dev/null +++ b/aibidding-common/aibidding-common-sms/src/main/java/org/aibidding/common/sms/exception/SmsException.java @@ -0,0 +1,19 @@ +package org.aibidding.common.sms.exception; + +import java.io.Serial; + +/** + * Sms异常类 + * + * @author Lion Li + */ +public class SmsException extends RuntimeException { + + @Serial + private static final long serialVersionUID = 1L; + + public SmsException(String msg) { + super(msg); + } + +} diff --git a/aibidding-common/aibidding-common-sms/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-sms/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..609ff9c --- /dev/null +++ b/aibidding-common/aibidding-common-sms/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.aibidding.common.sms.config.SmsConfig diff --git a/aibidding-common/aibidding-common-tenant/pom.xml b/aibidding-common/aibidding-common-tenant/pom.xml new file mode 100644 index 0000000..ad018a1 --- /dev/null +++ b/aibidding-common/aibidding-common-tenant/pom.xml @@ -0,0 +1,37 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-tenant + + + ruoyi-common-tenant 租户模块 + + + + + org.ruoyi + aibidding-common-mybatis + + + + org.ruoyi + aibidding-common-redis + + + + com.alibaba + transmittable-thread-local + + + + + diff --git a/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/config/TenantConfig.java b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/config/TenantConfig.java new file mode 100644 index 0000000..67d8f22 --- /dev/null +++ b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/config/TenantConfig.java @@ -0,0 +1,100 @@ +package org.aibidding.common.tenant.config; + +import cn.dev33.satoken.dao.SaTokenDao; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor; +import org.aibidding.common.core.utils.reflect.ReflectUtils; +import org.aibidding.common.mybatis.config.MybatisPlusConfig; +import org.aibidding.common.redis.config.RedisConfig; +import org.aibidding.common.redis.config.properties.RedissonProperties; +import org.aibidding.common.tenant.core.TenantSaTokenDao; +import org.aibidding.common.tenant.handle.PlusTenantLineHandler; +import org.aibidding.common.tenant.handle.TenantKeyPrefixHandler; +import org.aibidding.common.tenant.manager.TenantSpringCacheManager; +import org.aibidding.common.tenant.properties.TenantProperties; +import org.redisson.config.ClusterServersConfig; +import org.redisson.config.SingleServerConfig; +import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.cache.CacheManager; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Primary; + +import java.util.ArrayList; +import java.util.List; + +/** + * 租户配置类 + * + * @author Lion Li + */ +@EnableConfigurationProperties(TenantProperties.class) +@AutoConfiguration(after = {RedisConfig.class, MybatisPlusConfig.class}) +@ConditionalOnProperty(value = "tenant.enable", havingValue = "true") +public class TenantConfig { + + /** + * 初始化租户配置 + */ + @Bean + public boolean tenantInit(MybatisPlusInterceptor mybatisPlusInterceptor, + TenantProperties tenantProperties) { + List interceptors = new ArrayList<>(); + // 多租户插件 必须放到第一位 + interceptors.add(tenantLineInnerInterceptor(tenantProperties)); + interceptors.addAll(mybatisPlusInterceptor.getInterceptors()); + mybatisPlusInterceptor.setInterceptors(interceptors); + return true; + } + + /** + * 多租户插件 + */ + public TenantLineInnerInterceptor tenantLineInnerInterceptor(TenantProperties tenantProperties) { + return new TenantLineInnerInterceptor(new PlusTenantLineHandler(tenantProperties)); + } + + @Bean + public RedissonAutoConfigurationCustomizer tenantRedissonCustomizer(RedissonProperties redissonProperties) { + return config -> { + TenantKeyPrefixHandler nameMapper = new TenantKeyPrefixHandler(redissonProperties.getKeyPrefix()); + SingleServerConfig singleServerConfig = ReflectUtils.invokeGetter(config, "singleServerConfig"); + if (ObjectUtil.isNotNull(singleServerConfig)) { + // 使用单机模式 + // 设置多租户 redis key前缀 + singleServerConfig.setNameMapper(nameMapper); + ReflectUtils.invokeSetter(config, "singleServerConfig", singleServerConfig); + } + ClusterServersConfig clusterServersConfig = ReflectUtils.invokeGetter(config, "clusterServersConfig"); + // 集群配置方式 参考下方注释 + if (ObjectUtil.isNotNull(clusterServersConfig)) { + // 设置多租户 redis key前缀 + clusterServersConfig.setNameMapper(nameMapper); + ReflectUtils.invokeSetter(config, "clusterServersConfig", clusterServersConfig); + } + }; + } + + /** + * 多租户缓存管理器 + */ + @Primary + @Bean + public CacheManager tenantCacheManager() { + return new TenantSpringCacheManager(); + } + + /** + * 多租户鉴权dao实现 + */ + @Primary + @Bean + public SaTokenDao tenantSaTokenDao() { + return new TenantSaTokenDao(); + } + +} diff --git a/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/core/TenantEntity.java b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/core/TenantEntity.java new file mode 100644 index 0000000..a98355b --- /dev/null +++ b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/core/TenantEntity.java @@ -0,0 +1,21 @@ +package org.aibidding.common.tenant.core; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; + +/** + * 租户基类 + * + * @author Michelle.Chung + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class TenantEntity extends BaseEntity { + + /** + * 租户编号 + */ + private String tenantId; + +} diff --git a/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/core/TenantSaTokenDao.java b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/core/TenantSaTokenDao.java new file mode 100644 index 0000000..2f3b132 --- /dev/null +++ b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/core/TenantSaTokenDao.java @@ -0,0 +1,148 @@ +package org.aibidding.common.tenant.core; + +import org.aibidding.common.core.constant.GlobalConstants; +import org.aibidding.common.redis.utils.RedisUtils; +import org.aibidding.common.satoken.core.dao.PlusSaTokenDao; + +import java.time.Duration; +import java.util.List; + +/** + * SaToken 认证数据持久层 适配多租户 + * + * @author Lion Li + */ +public class TenantSaTokenDao extends PlusSaTokenDao { + + @Override + public String get(String key) { + return super.get(GlobalConstants.GLOBAL_REDIS_KEY + key); + } + + @Override + public void set(String key, String value, long timeout) { + super.set(GlobalConstants.GLOBAL_REDIS_KEY + key, value, timeout); + } + + /** + * 修修改指定key-value键值对 (过期时间不变) + */ + @Override + public void update(String key, String value) { + long expire = getTimeout(key); + // -2 = 无此键 + if (expire == NOT_VALUE_EXPIRE) { + return; + } + this.set(key, value, expire); + } + + /** + * 删除Value + */ + @Override + public void delete(String key) { + super.delete(GlobalConstants.GLOBAL_REDIS_KEY + key); + } + + /** + * 获取Value的剩余存活时间 (单位: 秒) + */ + @Override + public long getTimeout(String key) { + return super.getTimeout(GlobalConstants.GLOBAL_REDIS_KEY + key); + } + + /** + * 修改Value的剩余存活时间 (单位: 秒) + */ + @Override + public void updateTimeout(String key, long timeout) { + // 判断是否想要设置为永久 + if (timeout == NEVER_EXPIRE) { + long expire = getTimeout(key); + if (expire == NEVER_EXPIRE) { + // 如果其已经被设置为永久,则不作任何处理 + } else { + // 如果尚未被设置为永久,那么再次set一次 + this.set(key, this.get(key), timeout); + } + return; + } + RedisUtils.expire(GlobalConstants.GLOBAL_REDIS_KEY + key, Duration.ofSeconds(timeout)); + } + + + /** + * 获取Object,如无返空 + */ + @Override + public Object getObject(String key) { + return super.getObject(GlobalConstants.GLOBAL_REDIS_KEY + key); + } + + /** + * 写入Object,并设定存活时间 (单位: 秒) + */ + @Override + public void setObject(String key, Object object, long timeout) { + super.setObject(GlobalConstants.GLOBAL_REDIS_KEY + key, object, timeout); + } + + /** + * 更新Object (过期时间不变) + */ + @Override + public void updateObject(String key, Object object) { + long expire = getObjectTimeout(key); + // -2 = 无此键 + if (expire == NOT_VALUE_EXPIRE) { + return; + } + this.setObject(key, object, expire); + } + + /** + * 删除Object + */ + @Override + public void deleteObject(String key) { + super.deleteObject(GlobalConstants.GLOBAL_REDIS_KEY + key); + } + + /** + * 获取Object的剩余存活时间 (单位: 秒) + */ + @Override + public long getObjectTimeout(String key) { + return super.getObjectTimeout(GlobalConstants.GLOBAL_REDIS_KEY + key); + } + + /** + * 修改Object的剩余存活时间 (单位: 秒) + */ + @Override + public void updateObjectTimeout(String key, long timeout) { + // 判断是否想要设置为永久 + if (timeout == NEVER_EXPIRE) { + long expire = getObjectTimeout(key); + if (expire == NEVER_EXPIRE) { + // 如果其已经被设置为永久,则不作任何处理 + } else { + // 如果尚未被设置为永久,那么再次set一次 + this.setObject(key, this.getObject(key), timeout); + } + return; + } + RedisUtils.expire(GlobalConstants.GLOBAL_REDIS_KEY + key, Duration.ofSeconds(timeout)); + } + + + /** + * 搜索数据 + */ + @Override + public List searchData(String prefix, String keyword, int start, int size, boolean sortType) { + return super.searchData(GlobalConstants.GLOBAL_REDIS_KEY + prefix, keyword, start, size, sortType); + } +} diff --git a/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/exception/TenantException.java b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/exception/TenantException.java new file mode 100644 index 0000000..e7d751b --- /dev/null +++ b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/exception/TenantException.java @@ -0,0 +1,20 @@ +package org.aibidding.common.tenant.exception; + +import org.aibidding.common.core.exception.base.BaseException; + +import java.io.Serial; + +/** + * 租户异常类 + * + * @author Lion Li + */ +public class TenantException extends BaseException { + + @Serial + private static final long serialVersionUID = 1L; + + public TenantException(String code, Object... args) { + super("tenant", code, args, null); + } +} diff --git a/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/handle/PlusTenantLineHandler.java b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/handle/PlusTenantLineHandler.java new file mode 100644 index 0000000..b6d6f9a --- /dev/null +++ b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/handle/PlusTenantLineHandler.java @@ -0,0 +1,59 @@ +package org.aibidding.common.tenant.handle; + +import cn.hutool.core.collection.ListUtil; +import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler; +import lombok.AllArgsConstructor; +import net.sf.jsqlparser.expression.Expression; +import net.sf.jsqlparser.expression.NullValue; +import net.sf.jsqlparser.expression.StringValue; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.common.tenant.helper.TenantHelper; +import org.aibidding.common.tenant.properties.TenantProperties; + +import java.util.List; + +/** + * 自定义租户处理器 + * + * @author Lion Li + */ +@AllArgsConstructor +public class PlusTenantLineHandler implements TenantLineHandler { + + private final TenantProperties tenantProperties; + + @Override + public Expression getTenantId() { + String tenantId = LoginHelper.getTenantId(); + if (StringUtils.isBlank(tenantId)) { + return new NullValue(); + } + String dynamicTenantId = TenantHelper.getDynamic(); + if (StringUtils.isNotBlank(dynamicTenantId)) { + // 返回动态租户 + return new StringValue(dynamicTenantId); + } + // 返回固定租户 + return new StringValue(tenantId); + } + + @Override + public boolean ignoreTable(String tableName) { + String tenantId = LoginHelper.getTenantId(); + // 判断是否有租户 + if (StringUtils.isNotBlank(tenantId)) { + // 不需要过滤租户的表 + List excludes = tenantProperties.getExcludes(); + // 非业务表 + List tables = ListUtil.toList( + "gen_table", + "gen_table_column" + ); + tables.addAll(excludes); + return tables.contains(tableName); + } + return true; + } + +} diff --git a/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/handle/TenantKeyPrefixHandler.java b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/handle/TenantKeyPrefixHandler.java new file mode 100644 index 0000000..60d2312 --- /dev/null +++ b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/handle/TenantKeyPrefixHandler.java @@ -0,0 +1,58 @@ +package org.aibidding.common.tenant.handle; + +import org.aibidding.common.core.constant.GlobalConstants; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.redis.handler.KeyPrefixHandler; +import org.aibidding.common.tenant.helper.TenantHelper; + +/** + * 多租户redis缓存key前缀处理 + * + * @author Lion Li + */ +public class TenantKeyPrefixHandler extends KeyPrefixHandler { + + public TenantKeyPrefixHandler(String keyPrefix) { + super(keyPrefix); + } + + /** + * 增加前缀 + */ + @Override + public String map(String name) { + if (StringUtils.isBlank(name)) { + return null; + } + if (StringUtils.contains(name, GlobalConstants.GLOBAL_REDIS_KEY)) { + return super.map(name); + } + String tenantId = TenantHelper.getTenantId(); + if (StringUtils.startsWith(name, tenantId)) { + // 如果存在则直接返回 + return super.map(name); + } + return super.map(tenantId + ":" + name); + } + + /** + * 去除前缀 + */ + @Override + public String unmap(String name) { + String unmap = super.unmap(name); + if (StringUtils.isBlank(unmap)) { + return null; + } + if (StringUtils.contains(name, GlobalConstants.GLOBAL_REDIS_KEY)) { + return super.unmap(name); + } + String tenantId = TenantHelper.getTenantId(); + if (StringUtils.startsWith(unmap, tenantId)) { + // 如果存在则删除 + return unmap.substring((tenantId + ":").length()); + } + return unmap; + } + +} diff --git a/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/helper/TenantHelper.java b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/helper/TenantHelper.java new file mode 100644 index 0000000..2081a31 --- /dev/null +++ b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/helper/TenantHelper.java @@ -0,0 +1,140 @@ +package org.aibidding.common.tenant.helper; + +import cn.dev33.satoken.context.SaHolder; +import cn.dev33.satoken.spring.SpringMVCUtil; +import cn.hutool.core.convert.Convert; +import com.alibaba.ttl.TransmittableThreadLocal; +import com.baomidou.mybatisplus.core.plugins.IgnoreStrategy; +import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.constant.GlobalConstants; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.redis.utils.RedisUtils; +import org.aibidding.common.satoken.utils.LoginHelper; + +import java.util.function.Supplier; + +/** + * 租户助手 + * + * @author Lion Li + */ +@Slf4j +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class TenantHelper { + + private static final String DYNAMIC_TENANT_KEY = GlobalConstants.GLOBAL_REDIS_KEY + "dynamicTenant"; + + private static final ThreadLocal TEMP_DYNAMIC_TENANT = new TransmittableThreadLocal<>(); + + /** + * 租户功能是否启用 + */ + public static boolean isEnable() { + return Convert.toBool(SpringUtils.getProperty("tenant.enable"), false); + } + + /** + * 开启忽略租户(开启后需手动调用 {@link #disableIgnore()} 关闭) + */ + public static void enableIgnore() { + InterceptorIgnoreHelper.handle(IgnoreStrategy.builder().tenantLine(true).build()); + } + + /** + * 关闭忽略租户 + */ + public static void disableIgnore() { + InterceptorIgnoreHelper.clearIgnoreStrategy(); + } + + /** + * 在忽略租户中执行 + * + * @param handle 处理执行方法 + */ + public static void ignore(Runnable handle) { + enableIgnore(); + try { + handle.run(); + } finally { + disableIgnore(); + } + } + + /** + * 在忽略租户中执行 + * + * @param handle 处理执行方法 + */ + public static T ignore(Supplier handle) { + enableIgnore(); + try { + return handle.get(); + } finally { + disableIgnore(); + } + } + + /** + * 设置动态租户(一直有效 需要手动清理) + *

+ * 如果为非web环境 那么只在当前线程内生效 + */ + public static void setDynamic(String tenantId) { + if (!SpringMVCUtil.isWeb()) { + TEMP_DYNAMIC_TENANT.set(tenantId); + return; + } + String cacheKey = DYNAMIC_TENANT_KEY + ":" + LoginHelper.getUserId(); + RedisUtils.setCacheObject(cacheKey, tenantId); + SaHolder.getStorage().set(cacheKey, tenantId); + } + + /** + * 获取动态租户(一直有效 需要手动清理) + *

+ * 如果为非web环境 那么只在当前线程内生效 + */ + public static String getDynamic() { + if (!SpringMVCUtil.isWeb()) { + return TEMP_DYNAMIC_TENANT.get(); + } + String cacheKey = DYNAMIC_TENANT_KEY + ":" + LoginHelper.getUserId(); + String tenantId = (String) SaHolder.getStorage().get(cacheKey); + if (StringUtils.isNotBlank(tenantId)) { + return tenantId; + } + tenantId = RedisUtils.getCacheObject(cacheKey); + SaHolder.getStorage().set(cacheKey, tenantId); + return tenantId; + } + + /** + * 清除动态租户 + */ + public static void clearDynamic() { + if (!SpringMVCUtil.isWeb()) { + TEMP_DYNAMIC_TENANT.remove(); + return; + } + String cacheKey = DYNAMIC_TENANT_KEY + ":" + LoginHelper.getUserId(); + RedisUtils.deleteObject(cacheKey); + SaHolder.getStorage().delete(cacheKey); + } + + /** + * 获取当前租户id(动态租户优先) + */ + public static String getTenantId() { + String tenantId = TenantHelper.getDynamic(); + if (StringUtils.isBlank(tenantId)) { + tenantId = LoginHelper.getTenantId(); + } + return tenantId; + } + +} diff --git a/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/manager/TenantSpringCacheManager.java b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/manager/TenantSpringCacheManager.java new file mode 100644 index 0000000..0a9205d --- /dev/null +++ b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/manager/TenantSpringCacheManager.java @@ -0,0 +1,32 @@ +package org.aibidding.common.tenant.manager; + +import org.aibidding.common.core.constant.GlobalConstants; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.redis.manager.PlusSpringCacheManager; +import org.aibidding.common.tenant.helper.TenantHelper; +import org.springframework.cache.Cache; + +/** + * 重写 cacheName 处理方法 支持多租户 + * + * @author Lion Li + */ +public class TenantSpringCacheManager extends PlusSpringCacheManager { + + public TenantSpringCacheManager() { + } + + @Override + public Cache getCache(String name) { + if (StringUtils.contains(name, GlobalConstants.GLOBAL_REDIS_KEY)) { + return super.getCache(name); + } + String tenantId = TenantHelper.getTenantId(); + if (StringUtils.startsWith(name, tenantId)) { + // 如果存在则直接返回 + return super.getCache(name); + } + return super.getCache(tenantId + ":" + name); + } + +} diff --git a/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/properties/TenantProperties.java b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/properties/TenantProperties.java new file mode 100644 index 0000000..e5a6104 --- /dev/null +++ b/aibidding-common/aibidding-common-tenant/src/main/java/org/aibidding/common/tenant/properties/TenantProperties.java @@ -0,0 +1,27 @@ +package org.aibidding.common.tenant.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.util.List; + +/** + * 租户 配置属性 + * + * @author Lion Li + */ +@Data +@ConfigurationProperties(prefix = "tenant") +public class TenantProperties { + + /** + * 是否启用 + */ + private Boolean enable; + + /** + * 排除表 + */ + private List excludes; + +} diff --git a/aibidding-common/aibidding-common-tenant/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-tenant/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..59ccf83 --- /dev/null +++ b/aibidding-common/aibidding-common-tenant/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.aibidding.common.tenant.config.TenantConfig diff --git a/aibidding-common/aibidding-common-translation/pom.xml b/aibidding-common/aibidding-common-translation/pom.xml new file mode 100644 index 0000000..6269106 --- /dev/null +++ b/aibidding-common/aibidding-common-translation/pom.xml @@ -0,0 +1,28 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-translation + + + ruoyi-common-translation 通用翻译功能 + + + + + + org.ruoyi + aibidding-common-json + + + + + diff --git a/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/annotation/Translation.java b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/annotation/Translation.java new file mode 100644 index 0000000..103848b --- /dev/null +++ b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/annotation/Translation.java @@ -0,0 +1,39 @@ +package org.aibidding.common.translation.annotation; + +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.aibidding.common.translation.core.handler.TranslationHandler; + +import java.lang.annotation.*; + +/** + * 通用翻译注解 + * + * @author Lion Li + */ +@Inherited +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD, ElementType.METHOD}) +@Documented +@JacksonAnnotationsInside +@JsonSerialize(using = TranslationHandler.class) +public @interface Translation { + + /** + * 类型 (需与实现类上的 {@link TranslationType} 注解type对应) + *

+ * 默认取当前字段的值 如果设置了 @{@link Translation#mapper()} 则取映射字段的值 + */ + String type(); + + /** + * 映射字段 (如果不为空则取此字段的值) + */ + String mapper() default ""; + + /** + * 其他条件 例如: 字典type(sys_user_sex) + */ + String other() default ""; + +} diff --git a/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/annotation/TranslationType.java b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/annotation/TranslationType.java new file mode 100644 index 0000000..c1e378d --- /dev/null +++ b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/annotation/TranslationType.java @@ -0,0 +1,23 @@ +package org.aibidding.common.translation.annotation; + +import org.aibidding.common.translation.core.TranslationInterface; + +import java.lang.annotation.*; + +/** + * 翻译类型注解 (标注到{@link TranslationInterface} 的实现类) + * + * @author Lion Li + */ +@Inherited +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) +@Documented +public @interface TranslationType { + + /** + * 类型 + */ + String type(); + +} diff --git a/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/config/TranslationConfig.java b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/config/TranslationConfig.java new file mode 100644 index 0000000..33e5c38 --- /dev/null +++ b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/config/TranslationConfig.java @@ -0,0 +1,50 @@ +package org.aibidding.common.translation.config; + +import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.annotation.PostConstruct; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.translation.annotation.TranslationType; +import org.aibidding.common.translation.core.TranslationInterface; +import org.aibidding.common.translation.core.handler.TranslationBeanSerializerModifier; +import org.aibidding.common.translation.core.handler.TranslationHandler; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfiguration; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 翻译模块配置类 + * + * @author Lion Li + */ +@Slf4j +@AutoConfiguration +public class TranslationConfig { + + @Autowired + private List> list; + + @Autowired + private ObjectMapper objectMapper; + + @PostConstruct + public void init() { + Map> map = new HashMap<>(list.size()); + for (TranslationInterface trans : list) { + if (trans.getClass().isAnnotationPresent(TranslationType.class)) { + TranslationType annotation = trans.getClass().getAnnotation(TranslationType.class); + map.put(annotation.type(), trans); + } else { + log.warn(trans.getClass().getName() + " 翻译实现类未标注 TranslationType 注解!"); + } + } + TranslationHandler.TRANSLATION_MAPPER.putAll(map); + // 设置 Bean 序列化修改器 + objectMapper.setSerializerFactory( + objectMapper.getSerializerFactory() + .withSerializerModifier(new TranslationBeanSerializerModifier())); + } + +} diff --git a/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/constant/TransConstant.java b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/constant/TransConstant.java new file mode 100644 index 0000000..d243dbd --- /dev/null +++ b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/constant/TransConstant.java @@ -0,0 +1,30 @@ +package org.aibidding.common.translation.constant; + +/** + * 翻译常量 + * + * @author Lion Li + */ +public interface TransConstant { + + /** + * 用户id转账号 + */ + String USER_ID_TO_NAME = "user_id_to_name"; + + /** + * 部门id转名称 + */ + String DEPT_ID_TO_NAME = "dept_id_to_name"; + + /** + * 字典type转label + */ + String DICT_TYPE_TO_LABEL = "dict_type_to_label"; + + /** + * ossId转url + */ + String OSS_ID_TO_URL = "oss_id_to_url"; + +} diff --git a/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/TranslationInterface.java b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/TranslationInterface.java new file mode 100644 index 0000000..aabc38e --- /dev/null +++ b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/TranslationInterface.java @@ -0,0 +1,20 @@ +package org.aibidding.common.translation.core; + +import org.aibidding.common.translation.annotation.TranslationType; + +/** + * 翻译接口 (实现类需标注 {@link TranslationType} 注解标明翻译类型) + * + * @author Lion Li + */ +public interface TranslationInterface { + + /** + * 翻译 + * + * @param key 需要被翻译的键(不为空) + * @param other 其他参数 + * @return 返回键对应的值 + */ + T translation(Object key, String other); +} diff --git a/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/handler/TranslationBeanSerializerModifier.java b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/handler/TranslationBeanSerializerModifier.java new file mode 100644 index 0000000..c0c3714 --- /dev/null +++ b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/handler/TranslationBeanSerializerModifier.java @@ -0,0 +1,29 @@ +package org.aibidding.common.translation.core.handler; + +import com.fasterxml.jackson.databind.BeanDescription; +import com.fasterxml.jackson.databind.SerializationConfig; +import com.fasterxml.jackson.databind.ser.BeanPropertyWriter; +import com.fasterxml.jackson.databind.ser.BeanSerializerModifier; + +import java.util.List; + +/** + * Bean 序列化修改器 解决 Null 被单独处理问题 + * + * @author Lion Li + */ +public class TranslationBeanSerializerModifier extends BeanSerializerModifier { + + @Override + public List changeProperties(SerializationConfig config, BeanDescription beanDesc, + List beanProperties) { + for (BeanPropertyWriter writer : beanProperties) { + // 如果序列化器为 TranslationHandler 的话 将 Null 值也交给他处理 + if (writer.getSerializer() instanceof TranslationHandler serializer) { + writer.assignNullSerializer(serializer); + } + } + return beanProperties; + } + +} diff --git a/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/handler/TranslationHandler.java b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/handler/TranslationHandler.java new file mode 100644 index 0000000..7799d0c --- /dev/null +++ b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/handler/TranslationHandler.java @@ -0,0 +1,65 @@ +package org.aibidding.common.translation.core.handler; + +import cn.hutool.core.util.ObjectUtil; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.BeanProperty; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.ContextualSerializer; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.core.utils.reflect.ReflectUtils; +import org.aibidding.common.translation.annotation.Translation; +import org.aibidding.common.translation.core.TranslationInterface; + +import java.io.IOException; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 翻译处理器 + * + * @author Lion Li + */ +@Slf4j +public class TranslationHandler extends JsonSerializer implements ContextualSerializer { + + /** + * 全局翻译实现类映射器 + */ + public static final Map> TRANSLATION_MAPPER = new ConcurrentHashMap<>(); + + private Translation translation; + + @Override + public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) throws IOException { + TranslationInterface trans = TRANSLATION_MAPPER.get(translation.type()); + if (ObjectUtil.isNotNull(trans)) { + // 如果映射字段不为空 则取映射字段的值 + if (StringUtils.isNotBlank(translation.mapper())) { + value = ReflectUtils.invokeGetter(gen.getCurrentValue(), translation.mapper()); + } + // 如果为 null 直接写出 + if (ObjectUtil.isNull(value)) { + gen.writeNull(); + return; + } + Object result = trans.translation(value, translation.other()); + gen.writeObject(result); + } else { + gen.writeObject(value); + } + } + + @Override + public JsonSerializer createContextual(SerializerProvider prov, BeanProperty property) throws JsonMappingException { + Translation translation = property.getAnnotation(Translation.class); + if (Objects.nonNull(translation)) { + this.translation = translation; + return this; + } + return prov.findValueSerializer(property.getType(), property); + } +} diff --git a/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/impl/DeptNameTranslationImpl.java b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/impl/DeptNameTranslationImpl.java new file mode 100644 index 0000000..b6f086f --- /dev/null +++ b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/impl/DeptNameTranslationImpl.java @@ -0,0 +1,29 @@ +package org.aibidding.common.translation.core.impl; + +import lombok.AllArgsConstructor; +import org.aibidding.common.core.service.DeptService; +import org.aibidding.common.translation.annotation.TranslationType; +import org.aibidding.common.translation.constant.TransConstant; +import org.aibidding.common.translation.core.TranslationInterface; + +/** + * 部门翻译实现 + * + * @author Lion Li + */ +@AllArgsConstructor +@TranslationType(type = TransConstant.DEPT_ID_TO_NAME) +public class DeptNameTranslationImpl implements TranslationInterface { + + private final DeptService deptService; + + @Override + public String translation(Object key, String other) { + if (key instanceof String ids) { + return deptService.selectDeptNameByIds(ids); + } else if (key instanceof Long id) { + return deptService.selectDeptNameByIds(id.toString()); + } + return null; + } +} diff --git a/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/impl/DictTypeTranslationImpl.java b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/impl/DictTypeTranslationImpl.java new file mode 100644 index 0000000..2526682 --- /dev/null +++ b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/impl/DictTypeTranslationImpl.java @@ -0,0 +1,28 @@ +package org.aibidding.common.translation.core.impl; + +import lombok.AllArgsConstructor; +import org.aibidding.common.core.service.DictService; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.translation.annotation.TranslationType; +import org.aibidding.common.translation.constant.TransConstant; +import org.aibidding.common.translation.core.TranslationInterface; + +/** + * 字典翻译实现 + * + * @author Lion Li + */ +@AllArgsConstructor +@TranslationType(type = TransConstant.DICT_TYPE_TO_LABEL) +public class DictTypeTranslationImpl implements TranslationInterface { + + private final DictService dictService; + + @Override + public String translation(Object key, String other) { + if (key instanceof String dictValue && StringUtils.isNotBlank(other)) { + return dictService.getDictLabel(other, dictValue); + } + return null; + } +} diff --git a/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/impl/OssUrlTranslationImpl.java b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/impl/OssUrlTranslationImpl.java new file mode 100644 index 0000000..ec86e4f --- /dev/null +++ b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/impl/OssUrlTranslationImpl.java @@ -0,0 +1,29 @@ +package org.aibidding.common.translation.core.impl; + +import lombok.AllArgsConstructor; +import org.aibidding.common.core.service.OssService; +import org.aibidding.common.translation.annotation.TranslationType; +import org.aibidding.common.translation.constant.TransConstant; +import org.aibidding.common.translation.core.TranslationInterface; + +/** + * OSS翻译实现 + * + * @author Lion Li + */ +@AllArgsConstructor +@TranslationType(type = TransConstant.OSS_ID_TO_URL) +public class OssUrlTranslationImpl implements TranslationInterface { + + private final OssService ossService; + + @Override + public String translation(Object key, String other) { + if (key instanceof String ids) { + return ossService.selectUrlByIds(ids); + } else if (key instanceof Long id) { + return ossService.selectUrlByIds(id.toString()); + } + return null; + } +} diff --git a/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/impl/UserNameTranslationImpl.java b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/impl/UserNameTranslationImpl.java new file mode 100644 index 0000000..676bb82 --- /dev/null +++ b/aibidding-common/aibidding-common-translation/src/main/java/org/aibidding/common/translation/core/impl/UserNameTranslationImpl.java @@ -0,0 +1,27 @@ +package org.aibidding.common.translation.core.impl; + +import lombok.AllArgsConstructor; +import org.aibidding.common.core.service.UserService; +import org.aibidding.common.translation.annotation.TranslationType; +import org.aibidding.common.translation.constant.TransConstant; +import org.aibidding.common.translation.core.TranslationInterface; + +/** + * 用户名翻译实现 + * + * @author Lion Li + */ +@AllArgsConstructor +@TranslationType(type = TransConstant.USER_ID_TO_NAME) +public class UserNameTranslationImpl implements TranslationInterface { + + private final UserService userService; + + @Override + public String translation(Object key, String other) { + if (key instanceof Long id) { + return userService.selectUserNameById(id); + } + return null; + } +} diff --git a/aibidding-common/aibidding-common-translation/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-translation/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..5ac48ab --- /dev/null +++ b/aibidding-common/aibidding-common-translation/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,5 @@ +org.aibidding.common.translation.config.TranslationConfig +org.aibidding.common.translation.core.impl.DeptNameTranslationImpl +org.aibidding.common.translation.core.impl.DictTypeTranslationImpl +org.aibidding.common.translation.core.impl.OssUrlTranslationImpl +org.aibidding.common.translation.core.impl.UserNameTranslationImpl diff --git a/aibidding-common/aibidding-common-web/pom.xml b/aibidding-common/aibidding-common-web/pom.xml new file mode 100644 index 0000000..c6297c1 --- /dev/null +++ b/aibidding-common/aibidding-common-web/pom.xml @@ -0,0 +1,72 @@ + + + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-common-web + + + ruoyi-common-web web服务 + + + + + org.ruoyi + aibidding-common-json + + + + org.ruoyi + aibidding-common-redis + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + + + + org.springframework.boot + spring-boot-starter-undertow + + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + cn.hutool + hutool-captcha + + + + cn.hutool + hutool-crypto + + + + com.alibaba + transmittable-thread-local + + + + diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/CaptchaConfig.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/CaptchaConfig.java new file mode 100644 index 0000000..1eea549 --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/CaptchaConfig.java @@ -0,0 +1,65 @@ +package org.aibidding.common.web.config; + +import cn.hutool.captcha.CaptchaUtil; +import cn.hutool.captcha.CircleCaptcha; +import cn.hutool.captcha.LineCaptcha; +import cn.hutool.captcha.ShearCaptcha; +import org.aibidding.common.web.config.properties.CaptchaProperties; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Lazy; + +import java.awt.*; + +/** + * 验证码配置 + * + * @author Lion Li + */ +@AutoConfiguration +@EnableConfigurationProperties(CaptchaProperties.class) +public class CaptchaConfig { + + private static final int WIDTH = 160; + private static final int HEIGHT = 60; + private static final Color BACKGROUND = Color.PINK; + private static final Font FONT = new Font("Arial", Font.BOLD, 48); + + /** + * 圆圈干扰验证码 + */ + @Lazy + @Bean + public CircleCaptcha circleCaptcha() { + CircleCaptcha captcha = CaptchaUtil.createCircleCaptcha(WIDTH, HEIGHT); + captcha.setBackground(BACKGROUND); + captcha.setFont(FONT); + return captcha; + } + + /** + * 线段干扰的验证码 + */ + @Lazy + @Bean + public LineCaptcha lineCaptcha() { + LineCaptcha captcha = CaptchaUtil.createLineCaptcha(WIDTH, HEIGHT); + captcha.setBackground(BACKGROUND); + captcha.setFont(FONT); + return captcha; + } + + /** + * 扭曲干扰验证码 + */ + @Lazy + @Bean + public ShearCaptcha shearCaptcha() { + ShearCaptcha captcha = CaptchaUtil.createShearCaptcha(WIDTH, HEIGHT); + captcha.setBackground(BACKGROUND); + captcha.setFont(FONT); + return captcha; + } + +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/FilterConfig.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/FilterConfig.java new file mode 100644 index 0000000..4d2a311 --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/FilterConfig.java @@ -0,0 +1,53 @@ +package org.aibidding.common.web.config; + +import jakarta.servlet.DispatcherType; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.web.config.properties.XssProperties; +import org.aibidding.common.web.filter.RepeatableFilter; +import org.aibidding.common.web.filter.XssFilter; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; + +import java.util.HashMap; +import java.util.Map; + +/** + * Filter配置 + * + * @author Lion Li + */ +@AutoConfiguration +@EnableConfigurationProperties(XssProperties.class) +public class FilterConfig { + + @SuppressWarnings({"rawtypes", "unchecked"}) + @Bean + @ConditionalOnProperty(value = "xss.enabled", havingValue = "true") + public FilterRegistrationBean xssFilterRegistration(XssProperties xssProperties) { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setDispatcherTypes(DispatcherType.REQUEST); + registration.setFilter(new XssFilter()); + registration.addUrlPatterns(StringUtils.split(xssProperties.getUrlPatterns(), StringUtils.SEPARATOR)); + registration.setName("xssFilter"); + registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE); + Map initParameters = new HashMap<>(); + initParameters.put("excludes", xssProperties.getExcludes()); + registration.setInitParameters(initParameters); + return registration; + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + @Bean + public FilterRegistrationBean someFilterRegistration() { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setFilter(new RepeatableFilter()); + registration.addUrlPatterns("/*"); + registration.setName("repeatableFilter"); + registration.setOrder(FilterRegistrationBean.LOWEST_PRECEDENCE); + return registration; + } + +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/I18nConfig.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/I18nConfig.java new file mode 100644 index 0000000..aa391eb --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/I18nConfig.java @@ -0,0 +1,22 @@ +package org.aibidding.common.web.config; + +import org.aibidding.common.web.core.I18nLocaleResolver; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.web.servlet.LocaleResolver; + +/** + * 国际化配置 + * + * @author Lion Li + */ +@AutoConfiguration(before = WebMvcAutoConfiguration.class) +public class I18nConfig { + + @Bean + public LocaleResolver localeResolver() { + return new I18nLocaleResolver(); + } + +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/ResourcesConfig.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/ResourcesConfig.java new file mode 100644 index 0000000..6ed2d8b --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/ResourcesConfig.java @@ -0,0 +1,52 @@ +package org.aibidding.common.web.config; + +import org.aibidding.common.web.interceptor.PlusWebInvokeTimeInterceptor; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * 通用配置 + * + * @author Lion Li + */ +@AutoConfiguration +public class ResourcesConfig implements WebMvcConfigurer { + + @Override + public void addInterceptors(InterceptorRegistry registry) { + // 全局访问性能拦截 + registry.addInterceptor(new PlusWebInvokeTimeInterceptor()); + } + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + } + + /** + * 跨域配置 + */ + @Bean + public CorsFilter corsFilter() { + CorsConfiguration config = new CorsConfiguration(); + config.setAllowCredentials(true); + // 设置访问源地址 + config.addAllowedOriginPattern("*"); + // 设置访问源请求头 + config.addAllowedHeader("*"); + // 设置访问源请求方法 + config.addAllowedMethod("*"); + // 有效期 1800秒 + config.setMaxAge(1800L); + // 添加映射路径,拦截一切请求 + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", config); + // 返回新的CorsFilter + return new CorsFilter(source); + } +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/UndertowConfig.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/UndertowConfig.java new file mode 100644 index 0000000..bb172f8 --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/UndertowConfig.java @@ -0,0 +1,30 @@ +package org.aibidding.common.web.config; + +import io.undertow.server.DefaultByteBufferPool; +import io.undertow.websockets.jsr.WebSocketDeploymentInfo; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.boot.web.server.WebServerFactoryCustomizer; + +/** + * Undertow 自定义配置 + * + * @author Lion Li + */ +@AutoConfiguration +public class UndertowConfig implements WebServerFactoryCustomizer { + + /** + * 设置 Undertow 的 websocket 缓冲池 + */ + @Override + public void customize(UndertowServletWebServerFactory factory) { + // 默认不直接分配内存 如果项目中使用了 websocket 建议直接分配 + factory.addDeploymentInfoCustomizers(deploymentInfo -> { + WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo(); + webSocketDeploymentInfo.setBuffers(new DefaultByteBufferPool(false, 512)); + deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo); + }); + } + +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/properties/CaptchaProperties.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/properties/CaptchaProperties.java new file mode 100644 index 0000000..b30a7eb --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/properties/CaptchaProperties.java @@ -0,0 +1,38 @@ +package org.aibidding.common.web.config.properties; + +import lombok.Data; +import org.aibidding.common.web.enums.CaptchaCategory; +import org.aibidding.common.web.enums.CaptchaType; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * 验证码 配置属性 + * + * @author Lion Li + */ +@Data +@ConfigurationProperties(prefix = "captcha") +public class CaptchaProperties { + + private Boolean enable; + + /** + * 验证码类型 + */ + private CaptchaType type; + + /** + * 验证码类别 + */ + private CaptchaCategory category; + + /** + * 数字验证码位数 + */ + private Integer numberLength; + + /** + * 字符验证码长度 + */ + private Integer charLength; +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/properties/XssProperties.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/properties/XssProperties.java new file mode 100644 index 0000000..5382a87 --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/config/properties/XssProperties.java @@ -0,0 +1,30 @@ +package org.aibidding.common.web.config.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * xss过滤 配置属性 + * + * @author Lion Li + */ +@Data +@ConfigurationProperties(prefix = "xss") +public class XssProperties { + + /** + * 过滤开关 + */ + private String enabled; + + /** + * 排除链接(多个用逗号分隔) + */ + private String excludes; + + /** + * 匹配链接 + */ + private String urlPatterns; + +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/core/BaseController.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/core/BaseController.java new file mode 100644 index 0000000..0d460c0 --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/core/BaseController.java @@ -0,0 +1,40 @@ +package org.aibidding.common.web.core; + +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.utils.StringUtils; + +/** + * web层通用数据处理 + * + * @author Lion Li + */ +public class BaseController { + + /** + * 响应返回结果 + * + * @param rows 影响行数 + * @return 操作结果 + */ + protected R toAjax(int rows) { + return rows > 0 ? R.ok() : R.fail(); + } + + /** + * 响应返回结果 + * + * @param result 结果 + * @return 操作结果 + */ + protected R toAjax(boolean result) { + return result ? R.ok() : R.fail(); + } + + /** + * 页面跳转 + */ + public String redirect(String url) { + return StringUtils.format("redirect:{}", url); + } + +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/core/I18nLocaleResolver.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/core/I18nLocaleResolver.java new file mode 100644 index 0000000..5e1a6fc --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/core/I18nLocaleResolver.java @@ -0,0 +1,31 @@ +package org.aibidding.common.web.core; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.web.servlet.LocaleResolver; + +import java.util.Locale; + +/** + * 获取请求头国际化信息 + * + * @author Lion Li + */ +public class I18nLocaleResolver implements LocaleResolver { + + @Override + public Locale resolveLocale(HttpServletRequest httpServletRequest) { + String language = httpServletRequest.getHeader("content-language"); + Locale locale = Locale.getDefault(); + if (language != null && language.length() > 0) { + String[] split = language.split("_"); + locale = new Locale(split[0], split[1]); + } + return locale; + } + + @Override + public void setLocale(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Locale locale) { + + } +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/enums/CaptchaCategory.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/enums/CaptchaCategory.java new file mode 100644 index 0000000..79b4fea --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/enums/CaptchaCategory.java @@ -0,0 +1,35 @@ +package org.aibidding.common.web.enums; + +import cn.hutool.captcha.AbstractCaptcha; +import cn.hutool.captcha.CircleCaptcha; +import cn.hutool.captcha.LineCaptcha; +import cn.hutool.captcha.ShearCaptcha; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 验证码类别 + * + * @author Lion Li + */ +@Getter +@AllArgsConstructor +public enum CaptchaCategory { + + /** + * 线段干扰 + */ + LINE(LineCaptcha.class), + + /** + * 圆圈干扰 + */ + CIRCLE(CircleCaptcha.class), + + /** + * 扭曲干扰 + */ + SHEAR(ShearCaptcha.class); + + private final Class clazz; +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/enums/CaptchaType.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/enums/CaptchaType.java new file mode 100644 index 0000000..c12b22d --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/enums/CaptchaType.java @@ -0,0 +1,29 @@ +package org.aibidding.common.web.enums; + +import cn.hutool.captcha.generator.CodeGenerator; +import cn.hutool.captcha.generator.RandomGenerator; +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.aibidding.common.web.utils.UnsignedMathGenerator; + +/** + * 验证码类型 + * + * @author Lion Li + */ +@Getter +@AllArgsConstructor +public enum CaptchaType { + + /** + * 数字 + */ + MATH(UnsignedMathGenerator.class), + + /** + * 字符 + */ + CHAR(RandomGenerator.class); + + private final Class clazz; +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/filter/RepeatableFilter.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/filter/RepeatableFilter.java new file mode 100644 index 0000000..d23154a --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/filter/RepeatableFilter.java @@ -0,0 +1,40 @@ +package org.aibidding.common.web.filter; + +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletRequest; +import org.aibidding.common.core.utils.StringUtils; +import org.springframework.http.MediaType; + +import java.io.IOException; + +/** + * Repeatable 过滤器 + * + * @author aibidding + */ +public class RepeatableFilter implements Filter { + @Override + public void init(FilterConfig filterConfig) throws ServletException { + + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException { + ServletRequest requestWrapper = null; + if (request instanceof HttpServletRequest + && StringUtils.startsWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE)) { + requestWrapper = new RepeatedlyRequestWrapper((HttpServletRequest) request, response); + } + if (null == requestWrapper) { + chain.doFilter(request, response); + } else { + chain.doFilter(requestWrapper, response); + } + } + + @Override + public void destroy() { + + } +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/filter/RepeatedlyRequestWrapper.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/filter/RepeatedlyRequestWrapper.java new file mode 100644 index 0000000..543351f --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/filter/RepeatedlyRequestWrapper.java @@ -0,0 +1,67 @@ +package org.aibidding.common.web.filter; + +import cn.hutool.core.io.IoUtil; +import jakarta.servlet.ReadListener; +import jakarta.servlet.ServletInputStream; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequestWrapper; +import org.aibidding.common.core.constant.Constants; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStreamReader; + +/** + * 构建可重复读取inputStream的request + * + * @author aibidding + */ +public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper { + private final byte[] body; + + public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException { + super(request); + request.setCharacterEncoding(Constants.UTF8); + response.setCharacterEncoding(Constants.UTF8); + + body = IoUtil.readBytes(request.getInputStream(), false); + } + + @Override + public BufferedReader getReader() throws IOException { + return new BufferedReader(new InputStreamReader(getInputStream())); + } + + @Override + public ServletInputStream getInputStream() throws IOException { + final ByteArrayInputStream bais = new ByteArrayInputStream(body); + return new ServletInputStream() { + @Override + public int read() throws IOException { + return bais.read(); + } + + @Override + public int available() throws IOException { + return body.length; + } + + @Override + public boolean isFinished() { + return false; + } + + @Override + public boolean isReady() { + return false; + } + + @Override + public void setReadListener(ReadListener readListener) { + + } + }; + } +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/filter/XssFilter.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/filter/XssFilter.java new file mode 100644 index 0000000..5435ea2 --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/filter/XssFilter.java @@ -0,0 +1,62 @@ +package org.aibidding.common.web.filter; + +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.aibidding.common.core.utils.StringUtils; +import org.springframework.http.HttpMethod; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * 防止XSS攻击的过滤器 + * + * @author aibidding + */ +public class XssFilter implements Filter { + /** + * 排除链接 + */ + public List excludes = new ArrayList<>(); + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + String tempExcludes = filterConfig.getInitParameter("excludes"); + if (StringUtils.isNotEmpty(tempExcludes)) { + String[] url = tempExcludes.split(StringUtils.SEPARATOR); + for (int i = 0; url != null && i < url.length; i++) { + excludes.add(url[i]); + } + } + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException { + HttpServletRequest req = (HttpServletRequest) request; + HttpServletResponse resp = (HttpServletResponse) response; + if (handleExcludeURL(req, resp)) { + chain.doFilter(request, response); + return; + } + XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper((HttpServletRequest) request); + chain.doFilter(xssRequest, response); + } + + private boolean handleExcludeURL(HttpServletRequest request, HttpServletResponse response) { + String url = request.getServletPath(); + String method = request.getMethod(); + // GET DELETE 不过滤 + if (method == null || HttpMethod.GET.matches(method) || HttpMethod.DELETE.matches(method)) { + return true; + } + return StringUtils.matches(url, excludes); + } + + @Override + public void destroy() { + + } +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/filter/XssHttpServletRequestWrapper.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/filter/XssHttpServletRequestWrapper.java new file mode 100644 index 0000000..2ae88b2 --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/filter/XssHttpServletRequestWrapper.java @@ -0,0 +1,97 @@ +package org.aibidding.common.web.filter; + +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HtmlUtil; +import jakarta.servlet.ReadListener; +import jakarta.servlet.ServletInputStream; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequestWrapper; +import org.aibidding.common.core.utils.StringUtils; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +/** + * XSS过滤处理 + * + * @author aibidding + */ +public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { + /** + * @param request + */ + public XssHttpServletRequestWrapper(HttpServletRequest request) { + super(request); + } + + @Override + public String[] getParameterValues(String name) { + String[] values = super.getParameterValues(name); + if (values != null) { + int length = values.length; + String[] escapseValues = new String[length]; + for (int i = 0; i < length; i++) { + // 防xss攻击和过滤前后空格 + escapseValues[i] = HtmlUtil.cleanHtmlTag(values[i]).trim(); + } + return escapseValues; + } + return super.getParameterValues(name); + } + + @Override + public ServletInputStream getInputStream() throws IOException { + // 非json类型,直接返回 + if (!isJsonRequest()) { + return super.getInputStream(); + } + + // 为空,直接返回 + String json = StrUtil.str(IoUtil.readBytes(super.getInputStream(), false), StandardCharsets.UTF_8); + if (StringUtils.isEmpty(json)) { + return super.getInputStream(); + } + + // xss过滤 + json = HtmlUtil.cleanHtmlTag(json).trim(); + byte[] jsonBytes = json.getBytes(StandardCharsets.UTF_8); + final ByteArrayInputStream bis = IoUtil.toStream(jsonBytes); + return new ServletInputStream() { + @Override + public boolean isFinished() { + return true; + } + + @Override + public boolean isReady() { + return true; + } + + @Override + public int available() throws IOException { + return jsonBytes.length; + } + + @Override + public void setReadListener(ReadListener readListener) { + } + + @Override + public int read() throws IOException { + return bis.read(); + } + }; + } + + /** + * 是否是Json请求 + */ + public boolean isJsonRequest() { + String header = super.getHeader(HttpHeaders.CONTENT_TYPE); + return StringUtils.startsWithIgnoreCase(header, MediaType.APPLICATION_JSON_VALUE); + } +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/interceptor/PlusWebInvokeTimeInterceptor.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/interceptor/PlusWebInvokeTimeInterceptor.java new file mode 100644 index 0000000..976916a --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/interceptor/PlusWebInvokeTimeInterceptor.java @@ -0,0 +1,113 @@ +package org.aibidding.common.web.interceptor; + +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.map.MapUtil; +import com.alibaba.ttl.TransmittableThreadLocal; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.time.StopWatch; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.json.utils.JsonUtils; +import org.aibidding.common.web.filter.RepeatedlyRequestWrapper; +import org.springframework.http.MediaType; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.ModelAndView; + +import java.io.BufferedReader; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * web的调用时间统计拦截器 + * dev环境有效 + * + * @author Lion Li + * @since 3.3.0 + */ +@Slf4j +public class PlusWebInvokeTimeInterceptor implements HandlerInterceptor { + + private final TransmittableThreadLocal invokeTimeTL = new TransmittableThreadLocal<>(); + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + String url = request.getMethod() + " " + request.getRequestURI(); + String domainName = request.getServerName(); + log.info("域名信息:{}",domainName); + + String requestURI = request.getRequestURI(); + List urls = whitelistUrls(); + boolean isWhitelisted = urls.stream().anyMatch(requestURI::startsWith); + + if (!isWhitelisted){ + // 根据授权编号查询激活状态 +// ConfigService configService = SpringUtils.context().getBean(ConfigService.class); +// String authNo = configService.getConfigValue("sys", "authcode"); +// if(!configService.checkAuth(authNo,domainName)){ +// throw new BaseException("系统未激活,请联系管理员授权"); +// } + } + + // 打印请求参数 + if (isJsonRequest(request)) { + String jsonParam = ""; + if (request instanceof RepeatedlyRequestWrapper) { + BufferedReader reader = request.getReader(); + jsonParam = IoUtil.read(reader); + } + log.debug("[PLUS]开始请求 => URL[{}],参数类型[json],参数:[{}]", url, jsonParam); + } else { + Map parameterMap = request.getParameterMap(); + if (MapUtil.isNotEmpty(parameterMap)) { + String parameters = JsonUtils.toJsonString(parameterMap); + log.debug("[PLUS]开始请求 => URL[{}],参数类型[param],参数:[{}]", url, parameters); + } else { + log.debug("[PLUS]开始请求 => URL[{}],无参数", url); + } + } + + StopWatch stopWatch = new StopWatch(); + invokeTimeTL.set(stopWatch); + stopWatch.start(); + + return true; + } + + + @Override + public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) { + + } + + @Override + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) { + log.debug("结束请求 => URL[{}]", request.getRequestURI()); + } + + /** + * 判断本次请求的数据类型是否为json + * + * @param request request + * @return boolean + */ + private boolean isJsonRequest(HttpServletRequest request) { + String contentType = request.getContentType(); + if (contentType != null) { + return StringUtils.startsWithIgnoreCase(contentType, MediaType.APPLICATION_JSON_VALUE); + } + return false; + } + + // 授权白名单 + public List whitelistUrls() { + return Arrays.asList( + "/chat/config", + "/pay", + "/weixin", + "/user/qrcode", + "/user/login/qrcode" + ); + } +} diff --git a/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/utils/UnsignedMathGenerator.java b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/utils/UnsignedMathGenerator.java new file mode 100644 index 0000000..8f22d19 --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/java/org/aibidding/common/web/utils/UnsignedMathGenerator.java @@ -0,0 +1,88 @@ +package org.aibidding.common.web.utils; + +import cn.hutool.captcha.generator.CodeGenerator; +import cn.hutool.core.math.Calculator; +import cn.hutool.core.util.CharUtil; +import cn.hutool.core.util.RandomUtil; +import org.aibidding.common.core.utils.StringUtils; + +import java.io.Serial; + +/** + * 无符号计算生成器 + * + * @author Lion Li + */ +public class UnsignedMathGenerator implements CodeGenerator { + + @Serial + private static final long serialVersionUID = -5514819971774091076L; + + private static final String OPERATORS = "+-*"; + + /** + * 参与计算数字最大长度 + */ + private final int numberLength; + + /** + * 构造 + */ + public UnsignedMathGenerator() { + this(2); + } + + /** + * 构造 + * + * @param numberLength 参与计算最大数字位数 + */ + public UnsignedMathGenerator(int numberLength) { + this.numberLength = numberLength; + } + + @Override + public String generate() { + final int limit = getLimit(); + int a = RandomUtil.randomInt(limit); + int b = RandomUtil.randomInt(limit); + String max = Integer.toString(Math.max(a,b)); + String min = Integer.toString(Math.min(a,b)); + max = StringUtils.rightPad(max, this.numberLength, CharUtil.SPACE); + min = StringUtils.rightPad(min, this.numberLength, CharUtil.SPACE); + + return max + RandomUtil.randomChar(OPERATORS) + min + '='; + } + + @Override + public boolean verify(String code, String userInputCode) { + int result; + try { + result = Integer.parseInt(userInputCode); + } catch (NumberFormatException e) { + // 用户输入非数字 + return false; + } + + final int calculateResult = (int) Calculator.conversion(code); + return result == calculateResult; + } + + /** + * 获取验证码长度 + * + * @return 验证码长度 + */ + public int getLength() { + return this.numberLength * 2 + 2; + } + + /** + * 根据长度获取参与计算数字最大值 + * + * @return 最大值 + */ + private int getLimit() { + return Integer.parseInt("1" + StringUtils.repeat('0', this.numberLength)); + } +} diff --git a/aibidding-common/aibidding-common-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/aibidding-common/aibidding-common-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..a9398a4 --- /dev/null +++ b/aibidding-common/aibidding-common-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,5 @@ +org.aibidding.common.web.config.CaptchaConfig +org.aibidding.common.web.config.FilterConfig +org.aibidding.common.web.config.I18nConfig +org.aibidding.common.web.config.ResourcesConfig +org.aibidding.common.web.config.UndertowConfig diff --git a/aibidding-common/aibidding-common-wechat/pom.xml b/aibidding-common/aibidding-common-wechat/pom.xml new file mode 100644 index 0000000..a5d3976 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/pom.xml @@ -0,0 +1,68 @@ + + + 4.0.0 + + org.ruoyi + aibidding-common + ${revision} + ../pom.xml + + aibidding-common-wechat + 1.0.0 + ruoyi-common-wechat 微信服务 + + UTF-8 + + + + + com.jfinal + jfinal + 3.5 + + + com.jfinal + cos + 2017.5 + + + + com.jfinal + jfinal-undertow + 1.4 + + + + com.alibaba + druid + 1.0.29 + + + + com.vdurmont + emoji-java + 3.2.0 + + + javax.activation + activation + 1.1.1 + + + net.mamoe + mirai-core-jvm + 2.16.0 + + + org.ruoyi + aibidding-common-json + + + + com.alibaba + fastjson + 1.2.31 + + + diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/api/MessageTools.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/api/MessageTools.java new file mode 100644 index 0000000..1a24fc0 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/api/MessageTools.java @@ -0,0 +1,546 @@ +package org.aibidding.common.wechat.itchat4j.api; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.Consts; +import org.apache.http.HttpEntity; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.mime.HttpMultipartMode; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.util.EntityUtils; +import org.aibidding.common.wechat.itchat4j.beans.BaseMsg; +import org.aibidding.common.wechat.itchat4j.beans.RecommendInfo; +import org.aibidding.common.wechat.itchat4j.core.Core; +import org.aibidding.common.wechat.itchat4j.core.CoreManage; +import org.aibidding.common.wechat.itchat4j.utils.Config; +import org.aibidding.common.wechat.itchat4j.utils.LogInterface; +import org.aibidding.common.wechat.itchat4j.utils.enums.SendMsgType; +import org.aibidding.common.wechat.itchat4j.utils.enums.StorageLoginInfoEnum; +import org.aibidding.common.wechat.itchat4j.utils.enums.URLEnum; +import org.aibidding.common.wechat.itchat4j.utils.enums.VerifyFriendEnum; +import org.aibidding.common.wechat.web.constant.UploadConstant; + +import javax.activation.MimetypesFileTypeMap; +import java.io.File; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * 消息处理类 + * + * @author https://github.com/yaphone + * @date 创建时间:2017年4月23日 下午2:30:37 + * @version 1.0 + * + * @author WesleyOne 修改 + */ +public class MessageTools implements LogInterface { + + + /** + * 通过UserName发送消息 + * @param toUserName + * @param uniqueKey + * @param data + * @param type + * @return + */ + public static boolean send(String toUserName, String uniqueKey, String data, String type){ + String nickName = WechatTools.getNickNameByUserName(toUserName, uniqueKey); + if (SendMsgType.TEXT.toValue().equals(type)){ + LOG.info("发送文本 {}:{}", nickName, data); + return MessageTools.sendMsgById(data,toUserName,uniqueKey); + }else if (SendMsgType.IMG.toValue().equals(type)){ + LOG.info("发送图片 {}:{}", nickName, UploadConstant.IMG_PATH_SEP+data); + return MessageTools.sendPicMsgByUserId(toUserName,UploadConstant.IMG_PATH_SEP+data,uniqueKey); + }else if (SendMsgType.FILE.toValue().equals(type)){ + LOG.info("发送文件 {}:{}",nickName,UploadConstant.FILE_PATH_SEP+data); + return MessageTools.sendFileMsgByUserId(toUserName,UploadConstant.FILE_PATH_SEP+data,uniqueKey); + } + return false; + } + + /** + * 通过NickName发送消息 + * @param nickName + * @param uniqueKey + * @param data + * @param type + * @param isGroup + * @return + */ + public static boolean sendByNickName(String nickName, String uniqueKey, String data, String type,boolean isGroup){ + + if (SendMsgType.TEXT.toValue().equals(type)){ + LOG.info("发送文本 {}:{}", nickName, data); + return MessageTools.sendMsgByNickNameApi(data, nickName, uniqueKey, isGroup); + }else if (SendMsgType.IMG.toValue().equals(type)){ + LOG.info("发送图片 {}:{}", nickName, UploadConstant.IMG_PATH_SEP+data); + return MessageTools.sendPicMsgByNickNameApi(nickName, UploadConstant.IMG_PATH_SEP + data, uniqueKey, isGroup); + }else if (SendMsgType.FILE.toValue().equals(type)){ + LOG.info("发送文件 {}:{}",nickName,UploadConstant.FILE_PATH_SEP+data); + return MessageTools.sendFileMsgByNickNameApi(nickName,UploadConstant.FILE_PATH_SEP+data,uniqueKey,isGroup); + } + return false; + } + + + /** + * 根据UserName发送文本消息 + * + * @author https://github.com/yaphone + * @date 2017年5月6日 上午11:45:51 + * @param text + * @param toUserName + * @param uniqueKey + */ + public static boolean sendMsgById(String text, String toUserName, String uniqueKey) { + if (text == null) { + return false; + } + return webWxSendMsg(1, text, toUserName, uniqueKey); + } + + /** + * 根据NickName发送文本消息 + * + * @author https://github.com/yaphone + * @date 2017年5月4日 下午11:17:38 + * @param text + * @param nickName + */ + public static boolean sendMsgByNickName(String text, String nickName, String uniqueKey) { + if (nickName != null) { + String toUserName = WechatTools.getContactUserNameByNickName(nickName,uniqueKey); + if (toUserName != null) { + return sendMsgById(text, toUserName, uniqueKey); + } + } + return false; + + } + + public static boolean sendMsgByNickNameApi(String text, String nickName, String uniqueKey, boolean isGroup){ + if (isGroup){ + return sendGroupMsgByNickName(text,nickName,uniqueKey); + }else{ + return sendMsgByNickName(text,nickName,uniqueKey); + } + } + + + /** + * 根据NickName发送群文本消息 + * @param text + * @param nickName + * @param uniqueKey + * @return + */ + private static boolean sendGroupMsgByNickName(String text, String nickName, String uniqueKey) { + if (nickName != null) { + String toUserName = WechatTools.getGroupUserNameByNickName(nickName,uniqueKey); + if (toUserName != null) { + return sendMsgById(text, toUserName, uniqueKey); + } + } + return false; + + } + + /** + * 消息发送 + * + * @author https://github.com/yaphone + * @date 2017年4月23日 下午2:32:02 + * @param msgType + * @param content + * @param toUserName + */ + public static boolean webWxSendMsg(int msgType, String content, String toUserName, String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + if (!core.isAlive()){ + return false; + } + String url = String.format(URLEnum.WEB_WX_SEND_MSG.getUrl(), core.getLoginInfo().get("url")); + Map msgMap = new HashMap(12); + msgMap.put("Type", msgType); + msgMap.put("Content", content); + msgMap.put("FromUserName", core.getUserName()); + msgMap.put("ToUserName", toUserName == null ? core.getUserName() : toUserName); + msgMap.put("LocalID", System.currentTimeMillis() * 10); + msgMap.put("ClientMsgId", System.currentTimeMillis() * 10); + Map paramMap = core.getParamMap(); + paramMap.put("Msg", msgMap); + paramMap.put("Scene", 0); + try { + String paramStr = JSON.toJSONString(paramMap); + HttpEntity entity = core.getMyHttpClient().doPost(url, paramStr); + EntityUtils.toString(entity, Consts.UTF_8); + return true; + } catch (Exception e) { + LOG.error("webWxSendMsg", e); + return false; + } + } + + /** + * 上传多媒体文件到 微信服务器,目前应该支持3种类型: 1. pic 直接显示,包含图片,表情 2.video 3.doc 显示为文件,包含PDF等 + * + * @author https://github.com/yaphone + * @date 2017年5月7日 上午12:41:13 + * @param filePath + * @return + */ + private static JSONObject webWxUploadMedia(String filePath, String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + File f = new File(filePath); + if (!f.exists() || !f.isFile()) { + LOG.info("file is not exist"); + return null; + } + String url = String.format(URLEnum.WEB_WX_UPLOAD_MEDIA.getUrl(), core.getLoginInfo().get("fileUrl")); + String mimeType = new MimetypesFileTypeMap().getContentType(f); + String mediaType = ""; + if (mimeType == null) { + mimeType = "text/plain"; + } else { + mediaType = mimeType.split("/")[0].equals("image") ? "pic" : "doc"; + } + String lastModifieDate = new SimpleDateFormat("yyyy MM dd HH:mm:ss").format(new Date()); + long fileSize = f.length(); + String passTicket = (String) core.getLoginInfo().get("pass_ticket"); + String clientMediaId = String.valueOf(System.currentTimeMillis()) + + String.valueOf(new Random().nextLong()).substring(0, 4); + String webwxDataTicket = core.getMyHttpClient().getCookie("webwx_data_ticket"); + if (webwxDataTicket == null) { + LOG.error("get cookie webwx_data_ticket error"); + return null; + } + + Map paramMap = core.getParamMap(); + + paramMap.put("ClientMediaId", clientMediaId); + paramMap.put("TotalLen", fileSize); + paramMap.put("StartPos", 0); + paramMap.put("DataLen", fileSize); + paramMap.put("MediaType", 4); + + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); + + builder.addTextBody("id", "WU_FILE_0", ContentType.TEXT_PLAIN); + builder.addTextBody("name", filePath, ContentType.TEXT_PLAIN); + builder.addTextBody("type", mimeType, ContentType.TEXT_PLAIN); + builder.addTextBody("lastModifieDate", lastModifieDate, ContentType.TEXT_PLAIN); + builder.addTextBody("size", String.valueOf(fileSize), ContentType.TEXT_PLAIN); + builder.addTextBody("mediatype", mediaType, ContentType.TEXT_PLAIN); + builder.addTextBody("uploadmediarequest", JSON.toJSONString(paramMap), ContentType.TEXT_PLAIN); + builder.addTextBody("webwx_data_ticket", webwxDataTicket, ContentType.TEXT_PLAIN); + builder.addTextBody("pass_ticket", passTicket, ContentType.TEXT_PLAIN); + builder.addBinaryBody("filename", f, ContentType.create(mimeType), filePath); + HttpEntity reqEntity = builder.build(); + HttpEntity entity = core.getMyHttpClient().doPostFile(url, reqEntity); + if (entity != null) { + try { + String result = EntityUtils.toString(entity, Consts.UTF_8); + return JSON.parseObject(result); + } catch (Exception e) { + LOG.error("webWxUploadMedia 错误: ", e); + } + + } + return null; + } + + + public static boolean sendPicMsgByNickNameApi(String nickName, String filePath, String uniqueKey,boolean isGroup){ + if (isGroup){ + return sendGroupPicMsgByNickName(nickName, filePath, uniqueKey); + }else { + return sendPicMsgByNickName(nickName, filePath, uniqueKey); + } + } + + /** + * 根据NickName发送图片消息 + * + * @author https://github.com/yaphone + * @date 2017年5月7日 下午10:32:45 + * @param nickName + * @param filePath + * @return + */ + public static boolean sendPicMsgByNickName(String nickName, String filePath, String uniqueKey) { + String toUserName = WechatTools.getContactUserNameByNickName(nickName,uniqueKey); + if (toUserName != null) { + LOG.info("发送图片 {}:{}",nickName,filePath); + return sendPicMsgByUserId(toUserName, filePath, uniqueKey); + } + return false; + } + + /** + * 根据群的NickName发送图片消息到群 + * @param nickName + * @param filePath + * @param uniqueKey + * @return + */ + public static boolean sendGroupPicMsgByNickName(String nickName, String filePath, String uniqueKey) { + String toUserName = WechatTools.getGroupUserNameByNickName(nickName,uniqueKey); + if (toUserName != null) { + LOG.info("发送群图片 {}:{}",nickName,filePath); + return sendPicMsgByUserId(toUserName, filePath, uniqueKey); + } + return false; + } + + /** + * 根据用户id发送图片消息 + * + * @author https://github.com/yaphone + * @date 2017年5月7日 下午10:34:24 + * @param userId + * @param filePath + * @param uniqueKey + * @return + */ + public static boolean sendPicMsgByUserId(String userId, String filePath, String uniqueKey) { + JSONObject responseObj = webWxUploadMedia(filePath, uniqueKey); + if (responseObj != null) { + String mediaId = responseObj.getString("MediaId"); + if (mediaId != null) { + return webWxSendMsgImg(userId, mediaId, uniqueKey); + } + } + return false; + } + + /** + * 发送图片消息,内部调用 + * + * @author https://github.com/yaphone + * @date 2017年5月7日 下午10:38:55 + * @return + */ + private static boolean webWxSendMsgImg(String userId, String mediaId, String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + if (!core.isAlive()){ + return false; + } + String url = String.format("%s/webwxsendmsgimg?fun=async&f=json&pass_ticket=%s", core.getLoginInfo().get("url"), + core.getLoginInfo().get("pass_ticket")); + Map msgMap = new HashMap(8); + msgMap.put("Type", 3); + msgMap.put("MediaId", mediaId); + msgMap.put("FromUserName", core.getUserSelf().getString("UserName")); + msgMap.put("ToUserName", userId); + String clientMsgId = String.valueOf(System.currentTimeMillis()) + + String.valueOf(new Random().nextLong()).substring(1, 5); + msgMap.put("LocalID", clientMsgId); + msgMap.put("ClientMsgId", clientMsgId); + Map paramMap = core.getParamMap(); + paramMap.put("BaseRequest", core.getParamMap().get("BaseRequest")); + paramMap.put("Msg", msgMap); + String paramStr = JSON.toJSONString(paramMap); + HttpEntity entity = core.getMyHttpClient().doPost(url, paramStr); + if (entity != null) { + try { + String result = EntityUtils.toString(entity, Consts.UTF_8); + return JSON.parseObject(result).getJSONObject("BaseResponse").getInteger("Ret") == 0; + } catch (Exception e) { + LOG.error("webWxSendMsgImg 错误: ", e); + } + } + return false; + + } + + /** + * 根据用户id发送文件 + * + * @author https://github.com/yaphone + * @date 2017年5月7日 下午11:57:36 + * @param userId + * @param filePath + * @return + */ + private static boolean sendFileMsgByUserId(String userId, String filePath, String uniqueKey) { + String title = new File(filePath).getName(); + Map data = new HashMap(12); + data.put("appid", Config.API_WXAPPID); + data.put("title", title); + data.put("totallen", ""); + data.put("attachid", ""); + data.put("type", "6"); // APPMSGTYPE_ATTACH + data.put("fileext", title.split("\\.")[1]); // 文件后缀 + JSONObject responseObj = webWxUploadMedia(filePath, uniqueKey); + if (responseObj != null) { + data.put("totallen", responseObj.getString("StartPos")); + data.put("attachid", responseObj.getString("MediaId")); + } else { + LOG.error("sednFileMsgByUserId 错误: ", data); + } + return webWxSendAppMsg(userId, data, uniqueKey); + } + + public static boolean sendFileMsgByNickNameApi(String nickName, String filePath, String uniqueKey, boolean isGroup){ + if (isGroup){ + return sendGroupFileMsgByNickName(nickName,filePath,uniqueKey); + }else { + return sendFileMsgByNickName(nickName,filePath,uniqueKey); + } + } + + + /** + * 根据用户昵称发送文件消息 + * + * @author https://github.com/yaphone + * @date 2017年5月10日 下午10:59:27 + * @param nickName + * @param filePath + * @return + */ + private static boolean sendFileMsgByNickName(String nickName, String filePath, String uniqueKey) { + String toUserName = WechatTools.getContactUserNameByNickName(nickName,uniqueKey); + if (toUserName != null) { + LOG.info("发送文件 {}:{}",nickName,filePath); + return sendFileMsgByUserId(toUserName, filePath, uniqueKey); + } + return false; + } + + /** + * 根据群昵称发送文件消息 + * @param nickName + * @param filePath + * @param uniqueKey + * @return + */ + private static boolean sendGroupFileMsgByNickName(String nickName, String filePath, String uniqueKey) { + String toUserName = WechatTools.getGroupUserNameByNickName(nickName,uniqueKey); + if (toUserName != null) { + LOG.info("发送文件 {}:{}",nickName,filePath); + return sendFileMsgByUserId(toUserName, filePath, uniqueKey); + } + return false; + } + + /** + * 内部调用 + * + * @author https://github.com/yaphone + * @date 2017年5月10日 上午12:21:28 + * @param userId + * @param data + * @param uniqueKey + * @return + */ + private static boolean webWxSendAppMsg(String userId, Map data, String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + if (!core.isAlive()){ + return false; + } + String url = String.format("%s/webwxsendappmsg?fun=async&f=json&pass_ticket=%s", core.getLoginInfo().get("url"), + core.getLoginInfo().get("pass_ticket")); + String clientMsgId = String.valueOf(System.currentTimeMillis()) + + String.valueOf(new Random().nextLong()).substring(1, 5); + String content = "" + data.get("title") + + "6" + + "" + data.get("totallen") + "" + data.get("attachid") + + "" + data.get("fileext") + ""; + Map msgMap = new HashMap(12); + msgMap.put("Type", data.get("type")); + msgMap.put("Content", content); + msgMap.put("FromUserName", core.getUserSelf().getString("UserName")); + msgMap.put("ToUserName", userId); + msgMap.put("LocalID", clientMsgId); + msgMap.put("ClientMsgId", clientMsgId); + /* + * Map paramMap = new HashMap(); + * + * @SuppressWarnings("unchecked") Map> + * baseRequestMap = (Map>) + * core.getLoginInfo() .get("baseRequest"); paramMap.put("BaseRequest", + * baseRequestMap.get("BaseRequest")); + */ + + Map paramMap = core.getParamMap(); + paramMap.put("Msg", msgMap); + paramMap.put("Scene", 0); + String paramStr = JSON.toJSONString(paramMap); + HttpEntity entity = core.getMyHttpClient().doPost(url, paramStr); + if (entity != null) { + try { + String result = EntityUtils.toString(entity, Consts.UTF_8); + return JSON.parseObject(result).getJSONObject("BaseResponse").getInteger("Ret") == 0; + } catch (Exception e) { + LOG.error("错误: ", e); + } + } + return false; + } + + /** + * 被动添加好友 + * + * @date 2017年6月29日 下午10:08:43 + * @param msg + * @param accept + * true 接受 false 拒绝 + */ + private static void addFriend(BaseMsg msg, boolean accept, String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + if (!accept) { // 不添加 + return; + } + int status = VerifyFriendEnum.ACCEPT.getCode(); // 接受好友请求 + RecommendInfo recommendInfo = msg.getRecommendInfo(); + String userName = recommendInfo.getUserName(); + String ticket = recommendInfo.getTicket(); + // 更新好友列表 + // TODO 此处需要更新好友列表 + // core.getContactList().add(msg.getJSONObject("RecommendInfo")); + + String url = String.format(URLEnum.WEB_WX_VERIFYUSER.getUrl(), core.getLoginInfo().get("url"), + String.valueOf(System.currentTimeMillis() / 3158L), core.getLoginInfo().get("pass_ticket")); + + List> verifyUserList = new ArrayList>(); + Map verifyUser = new HashMap(); + verifyUser.put("Value", userName); + verifyUser.put("VerifyUserTicket", ticket); + verifyUserList.add(verifyUser); + + List sceneList = new ArrayList(); + sceneList.add(33); + + JSONObject body = new JSONObject(); + body.put("BaseRequest", core.getParamMap().get("BaseRequest")); + body.put("Opcode", status); + body.put("VerifyUserListSize", 1); + body.put("VerifyUserList", verifyUserList); + body.put("VerifyContent", ""); + body.put("SceneListCount", 1); + body.put("SceneList", sceneList); + body.put("skey", core.getLoginInfo().get(StorageLoginInfoEnum.skey.getKey())); + + String result = null; + try { + String paramStr = JSON.toJSONString(body); + HttpEntity entity = core.getMyHttpClient().doPost(url, paramStr); + result = EntityUtils.toString(entity, Consts.UTF_8); + } catch (Exception e) { + LOG.error("webWxSendMsg", e); + } + + if (StringUtils.isBlank(result)) { + LOG.error("被动添加好友失败"); + } + + LOG.debug(result); + + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/api/WechatTools.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/api/WechatTools.java new file mode 100644 index 0000000..b5ab935 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/api/WechatTools.java @@ -0,0 +1,352 @@ +package org.aibidding.common.wechat.itchat4j.api; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.Consts; +import org.apache.http.HttpEntity; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.aibidding.common.wechat.itchat4j.core.Core; +import org.aibidding.common.wechat.itchat4j.core.CoreManage; +import org.aibidding.common.wechat.itchat4j.utils.LogInterface; +import org.aibidding.common.wechat.itchat4j.utils.enums.StorageLoginInfoEnum; +import org.aibidding.common.wechat.itchat4j.utils.enums.URLEnum; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 微信小工具,如获好友列表,根据昵称查找好友或群等 + * + * @author https://github.com/yaphone + * @date 创建时间:2017年5月4日 下午10:49:16 + * @version 1.0 + * + * @author WesleyOne 修改 + */ +public class WechatTools implements LogInterface { + + /** + * 返回好友昵称列表 + * @param uniqueKey + * @return + */ + public static List getContactNickNameList(String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + List contactNickNameList = new ArrayList(); + for (JSONObject o : core.getContactList()) { + contactNickNameList.add(o.getString("NickName")); + // 顺便刷下缓存 + core.getUserInfoMap().put(o.getString("NickName"),o); + core.getUserInfoMap().put(o.getString("UserName"),o); + } + return contactNickNameList; + } + + /** + * 返回好友完整信息列表 + * @param uniqueKey + * @return + */ + public static List getContactList(String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + return core.getContactList(); + } + + /** + * 返回群列表 + * @param uniqueKey + * @return + */ + public static List getGroupList(String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + return core.getGroupList(); + } + + /** + * 获取群NickName列表 + * @param uniqueKey + * @return + */ + public static List getGroupNickNameList(String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + List groupNickNameList = new ArrayList(); + for (JSONObject o : core.getGroupList()) { + groupNickNameList.add(o.getString("NickName")); + } + return groupNickNameList; + } + + /** + * 获取群所有成员信息 + * @param groupId + * @param uniqueKey + * @return + */ + public static JSONArray getGroupMemberByGroupId(String groupId, String uniqueKey){ + Core core = CoreManage.getInstance(uniqueKey); + JSONObject jsonObject = core.getGroupInfoMap().get(groupId); + if (jsonObject == null){ + return new JSONArray(); + } + return jsonObject.getJSONArray("MemberList"); + } + + /** + * 通过群成员ID获取昵称 + * @param groupId + * @param uniqueKey + * @param memberId + * @return + */ + public static String getMemberNickName(String groupId, String uniqueKey, String memberId){ + JSONArray members = getGroupMemberByGroupId(groupId, uniqueKey); + int size = members.size(); + if (size > 0){ + for (int i=0;i params = new ArrayList(); + params.add(new BasicNameValuePair("redirect", "1")); + params.add(new BasicNameValuePair("type", "1")); + params.add( + new BasicNameValuePair("skey", (String) core.getLoginInfo().get(StorageLoginInfoEnum.skey.getKey()))); + try { + HttpEntity entity = core.getMyHttpClient().doGet(url, params, false, null); + String text = EntityUtils.toString(entity, Consts.UTF_8); + return true; + } catch (Exception e) { + LOG.debug(e.getMessage()); + } finally { + // 强制退出,提示相关线程退出 + core.setAlive(false); + } + return false; + } + + public static void setUserInfo(String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + for (JSONObject o : core.getContactList()) { + core.getUserInfoMap().put(o.getString("NickName"), o); + core.getUserInfoMap().put(o.getString("UserName"), o); + } + } + + /** + * + * 根据用户昵称设置备注名称 + * + * @date 2017年5月27日 上午12:21:40 + * @param nickName + * @param remName + */ + public static void remarkNameByNickName(String nickName, String remName, String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + String url = String.format(URLEnum.WEB_WX_REMARKNAME.getUrl(), core.getLoginInfo().get("url"), + core.getLoginInfo().get(StorageLoginInfoEnum.pass_ticket.getKey())); + Map msgMap = new HashMap(8); + Map msgMap_BaseRequest = new HashMap(8); + msgMap.put("CmdId", 2); + msgMap.put("RemarkName", remName); + msgMap.put("UserName", core.getUserInfoMap().get(nickName).get("UserName")); + msgMap_BaseRequest.put("Uin", core.getLoginInfo().get(StorageLoginInfoEnum.wxuin.getKey())); + msgMap_BaseRequest.put("Sid", core.getLoginInfo().get(StorageLoginInfoEnum.wxsid.getKey())); + msgMap_BaseRequest.put("Skey", core.getLoginInfo().get(StorageLoginInfoEnum.skey.getKey())); + msgMap_BaseRequest.put("DeviceID", core.getLoginInfo().get(StorageLoginInfoEnum.deviceid.getKey())); + msgMap.put("BaseRequest", msgMap_BaseRequest); + try { + String paramStr = JSON.toJSONString(msgMap); + HttpEntity entity = core.getMyHttpClient().doPost(url, paramStr); + // String result = EntityUtils.toString(entity, Consts.UTF_8); + LOG.info("修改备注" + remName); + } catch (Exception e) { + LOG.error("remarkNameByUserName", e); + } + } + + /** + * 获取微信在线状态 + * + * @date 2017年6月16日 上午12:47:46 + * @return + */ + public static boolean getWechatStatus(String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + return core.isAlive(); + } + + + /** + * + * @param userName + * @param nickName + * @return + */ + private static JSONObject getContactByNickNameAndUserName(String userName, String nickName, String uniqueKey){ + Core core = CoreManage.getInstance(uniqueKey); + // 通过userName查询 + if (StringUtils.isNotEmpty(userName) && StringUtils.isEmpty(nickName)){ + for (JSONObject contact:core.getContactList()){ + if (userName.equals(contact.getString("UserName"))){ + return contact; + } + } + } + + // 通过群昵称查询 + if (StringUtils.isNotEmpty(nickName) && StringUtils.isEmpty(userName)){ + for (JSONObject contact:core.getContactList()){ + if (nickName.equals(contact.getString("NickName"))){ + return contact; + } + } + } + + // 通过userName和昵称联合查 + if (StringUtils.isNotEmpty(userName) && StringUtils.isNotEmpty(nickName)){ + for (JSONObject contact:core.getContactList()){ + if (nickName.equals(contact.getString("NickName")) && userName.equals(contact.getString("UserName"))){ + return contact; + } + } + } + + return null; + } + + /** + * 通过群id查找群昵称 + * @param userName + * @return + */ + public static String getContactNickNameByUserName(String userName, String uniqueKey){ + JSONObject contact = getContactByNickNameAndUserName(userName,null, uniqueKey); + if (contact!=null && StringUtils.isNotEmpty(contact.getString("NickName"))){ + return contact.getString("NickName"); + }else{ + return ""; + } + } + + /** + * 通过群昵称查找群id + * @param nickName + * @return + */ + public static String getContactUserNameByNickName(String nickName, String uniqueKey){ + JSONObject contact = getContactByNickNameAndUserName(null,nickName,uniqueKey); + if (contact!=null && StringUtils.isNotEmpty(contact.getString("UserName"))){ + return contact.getString("UserName"); + }else{ + return null; + } + } + + /** + * 通过userName或昵称查找群信息 + * @param userName + * @return + */ + private static JSONObject getGroupByNickNameAndUserName(String userName, String nickName, String uniqueKey){ + Core core = CoreManage.getInstance(uniqueKey); + // 通过userName查询 + if (StringUtils.isNotEmpty(userName) && StringUtils.isEmpty(nickName)){ + for (JSONObject group:core.getGroupList()){ + if (userName.equals(group.getString("UserName"))){ + return group; + } + } + } + + // 通过群昵称查询 + if (StringUtils.isNotEmpty(nickName) && StringUtils.isEmpty(userName)){ + for (JSONObject group:core.getGroupList()){ + if (nickName.equals(group.getString("NickName"))){ + return group; + } + } + } + + // 通过userName和昵称联合查 + if (StringUtils.isNotEmpty(userName) && StringUtils.isNotEmpty(nickName)){ + for (JSONObject group:core.getGroupList()){ + if (nickName.equals(group.getString("NickName")) && userName.equals(group.getString("UserName"))){ + return group; + } + } + } + + return null; + } + + /** + * 通过群id查找群昵称 + * @param userName + * @return + */ + public static String getGroupNickNameByUserName(String userName, String uniqueKey){ + JSONObject group = getGroupByNickNameAndUserName(userName,null,uniqueKey); + if (group!=null && StringUtils.isNotEmpty(group.getString("NickName"))){ + return group.getString("NickName"); + }else{ + return ""; + } + } + + /** + * 通过群昵称查找群id + * @param nickName + * @return + */ + public static String getGroupUserNameByNickName(String nickName, String uniqueKey){ + JSONObject group = getGroupByNickNameAndUserName(null,nickName, uniqueKey); + if (group!=null && StringUtils.isNotEmpty(group.getString("UserName"))){ + return group.getString("UserName"); + }else{ + return null; + } + } + + /** + * 通过UserName查找NickName + * 只查群名和好友名 + * @param userName + * @param uniqueKey + * @return + */ + public static String getNickNameByUserName(String userName, String uniqueKey){ + if (userName.startsWith("@@")){ + return getGroupNickNameByUserName(userName,uniqueKey); + }else if (userName.startsWith("@")){ + return getContactNickNameByUserName(userName,uniqueKey); + }else { + return ""; + } + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/AppInfo.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/AppInfo.java new file mode 100644 index 0000000..8368ca5 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/AppInfo.java @@ -0,0 +1,37 @@ +package org.aibidding.common.wechat.itchat4j.beans; + +import java.io.Serializable; + +/** + * AppInfo + * + * @author https://github.com/yaphone + * @date 创建时间:2017年7月3日 下午10:38:14 + * @version 1.0 + * + */ +public class AppInfo implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + private int type; + private String appId; + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/BaseMsg.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/BaseMsg.java new file mode 100644 index 0000000..d4dceba --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/BaseMsg.java @@ -0,0 +1,330 @@ +package org.aibidding.common.wechat.itchat4j.beans; + +import java.io.Serializable; + +/** + * 收到的微信消息 + * + * @author https://github.com/yaphone + * @date 创建时间:2017年7月3日 下午10:28:06 + * @version 1.0 + * + */ +public class BaseMsg implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + private int subMsgType; + private int voiceLength; + private String fileName; + private int imgHeight; + private String toUserName; + private int hasProductId; + private int imgStatus; + private String url; + private int imgWidth; + private int forwardFlag; + private int status; + private String Ticket; + /** 推荐消息报文 **/ + private RecommendInfo recommendInfo; + private long createTime; + private String newMsgId; + /** 文本消息内容 **/ + private String text; + /** 消息类型 **/ + private int msgType; + /** 是否为群消息 **/ + private boolean groupMsg; + private String msgId; + private int statusNotifyCode; + private AppInfo appInfo; + private int appMsgType; + private String Type; + private int playLength; + private String mediaId; + private String content; + private String statusNotifyUserName; + private boolean atMe; + // 群发送者ID昵称 + private String sendMemberId; + private String memberNickname; + /** 消息发送者ID **/ + private String fromUserName; + private String oriContent; + private String fileSize; + private String fromNickName; + + public int getSubMsgType() { + return subMsgType; + } + + public void setSubMsgType(int subMsgType) { + this.subMsgType = subMsgType; + } + + public int getVoiceLength() { + return voiceLength; + } + + public void setVoiceLength(int voiceLength) { + this.voiceLength = voiceLength; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public int getImgHeight() { + return imgHeight; + } + + public void setImgHeight(int imgHeight) { + this.imgHeight = imgHeight; + } + + public String getToUserName() { + return toUserName; + } + + public void setToUserName(String toUserName) { + this.toUserName = toUserName; + } + + public int getHasProductId() { + return hasProductId; + } + + public void setHasProductId(int hasProductId) { + this.hasProductId = hasProductId; + } + + public int getImgStatus() { + return imgStatus; + } + + public void setImgStatus(int imgStatus) { + this.imgStatus = imgStatus; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public int getImgWidth() { + return imgWidth; + } + + public void setImgWidth(int imgWidth) { + this.imgWidth = imgWidth; + } + + public int getForwardFlag() { + return forwardFlag; + } + + public void setForwardFlag(int forwardFlag) { + this.forwardFlag = forwardFlag; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getTicket() { + return Ticket; + } + + public void setTicket(String ticket) { + Ticket = ticket; + } + + public RecommendInfo getRecommendInfo() { + return recommendInfo; + } + + public void setRecommendInfo(RecommendInfo recommendInfo) { + this.recommendInfo = recommendInfo; + } + + public long getCreateTime() { + return createTime; + } + + public void setCreateTime(long createTime) { + this.createTime = createTime; + } + + public String getNewMsgId() { + return newMsgId; + } + + public void setNewMsgId(String newMsgId) { + this.newMsgId = newMsgId; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public int getMsgType() { + return msgType; + } + + public void setMsgType(int msgType) { + this.msgType = msgType; + } + + public boolean isGroupMsg() { + return groupMsg; + } + + public void setGroupMsg(boolean groupMsg) { + this.groupMsg = groupMsg; + } + + public String getMsgId() { + return msgId; + } + + public void setMsgId(String msgId) { + this.msgId = msgId; + } + + public int getStatusNotifyCode() { + return statusNotifyCode; + } + + public void setStatusNotifyCode(int statusNotifyCode) { + this.statusNotifyCode = statusNotifyCode; + } + + public AppInfo getAppInfo() { + return appInfo; + } + + public void setAppInfo(AppInfo appInfo) { + this.appInfo = appInfo; + } + + public int getAppMsgType() { + return appMsgType; + } + + public void setAppMsgType(int appMsgType) { + this.appMsgType = appMsgType; + } + + public String getType() { + return Type; + } + + public void setType(String type) { + Type = type; + } + + public int getPlayLength() { + return playLength; + } + + public void setPlayLength(int playLength) { + this.playLength = playLength; + } + + public String getMediaId() { + return mediaId; + } + + public void setMediaId(String mediaId) { + this.mediaId = mediaId; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getStatusNotifyUserName() { + return statusNotifyUserName; + } + + public void setStatusNotifyUserName(String statusNotifyUserName) { + this.statusNotifyUserName = statusNotifyUserName; + } + + public String getFromUserName() { + return fromUserName; + } + + public void setFromUserName(String fromUserName) { + this.fromUserName = fromUserName; + } + + public String getOriContent() { + return oriContent; + } + + public void setOriContent(String oriContent) { + this.oriContent = oriContent; + } + + public String getFileSize() { + return fileSize; + } + + public void setFileSize(String fileSize) { + this.fileSize = fileSize; + } + + public String getMemberNickname() { + return memberNickname; + } + + public void setMemberNickname(String memberNickname) { + this.memberNickname = memberNickname; + } + + public String getFromNickName() { + return fromNickName; + } + + public void setFromNickName(String fromNickName) { + this.fromNickName = fromNickName; + } + + public String getSendMemberId() { + return sendMemberId; + } + + public void setSendMemberId(String sendMemberId) { + this.sendMemberId = sendMemberId; + } + + public boolean isAtMe() { + return atMe; + } + + public void setAtMe(boolean atMe) { + this.atMe = atMe; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/BaseResponse.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/BaseResponse.java new file mode 100644 index 0000000..a9fe666 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/BaseResponse.java @@ -0,0 +1,28 @@ +package org.aibidding.common.wechat.itchat4j.beans; + +/** + * @author WesleyOne + * @create 2018/12/21 + */ +@Deprecated +public class BaseResponse { + + private Integer Ret; + private String ErrMsg; + + public Integer getRet() { + return Ret; + } + + public void setRet(Integer ret) { + Ret = ret; + } + + public String getErrMsg() { + return ErrMsg; + } + + public void setErrMsg(String errMsg) { + ErrMsg = errMsg; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/Member.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/Member.java new file mode 100644 index 0000000..175bba8 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/Member.java @@ -0,0 +1,306 @@ +package org.aibidding.common.wechat.itchat4j.beans; + +import java.util.List; + +/** + * 成员信息对象 + * + * 来自获取好友列表 + * /cgi-bin/mmwebwx-bin/webwxgetcontact + * MemberList中单体 + * @author WesleyOne + * @create 2018/12/21 + */ +@Deprecated +public class Member { + + private String Alias; + private Integer AppAccountFlag; + private Integer AttrStatus; + private Integer ChatRoomId; + private String City; + private Integer ContactFlag; + /** + * 群昵称 + */ + private String DisplayName; + private String EncryChatRoomId; + private String HeadImgUrl; + private Integer HideInputBarFlag; + private Integer IsOwner; + private String KeyWord; + private Integer MemberCount; + private List MemberList; + private String NickName; + private Integer OwnerUin; + private String PYInitial; + private String PYQuanPin; + private String Province; + /** + * 备注名、首拼、全拼 + */ + private String RemarkName; + private String RemarkPYInitial; + private String RemarkPYQuanPin; + + private Integer Sex; + private String Signature; + private Integer SnsFlag; + private Integer StarFriend; + private Integer Statues; + private Integer Uin; + private Integer UniFriend; + private String UserName; + /** + * 用来判断是否是公众号或服务号的字段 + */ + private String VerifyFlag; + + public String getAlias() { + return Alias; + } + + public void setAlias(String alias) { + Alias = alias; + } + + public Integer getAppAccountFlag() { + return AppAccountFlag; + } + + public void setAppAccountFlag(Integer appAccountFlag) { + AppAccountFlag = appAccountFlag; + } + + public Integer getAttrStatus() { + return AttrStatus; + } + + public void setAttrStatus(Integer attrStatus) { + AttrStatus = attrStatus; + } + + public Integer getChatRoomId() { + return ChatRoomId; + } + + public void setChatRoomId(Integer chatRoomId) { + ChatRoomId = chatRoomId; + } + + public String getCity() { + return City; + } + + public void setCity(String city) { + City = city; + } + + public Integer getContactFlag() { + return ContactFlag; + } + + public void setContactFlag(Integer contactFlag) { + ContactFlag = contactFlag; + } + + public String getDisplayName() { + return DisplayName; + } + + public void setDisplayName(String displayName) { + DisplayName = displayName; + } + + public String getEncryChatRoomId() { + return EncryChatRoomId; + } + + public void setEncryChatRoomId(String encryChatRoomId) { + EncryChatRoomId = encryChatRoomId; + } + + public String getHeadImgUrl() { + return HeadImgUrl; + } + + public void setHeadImgUrl(String headImgUrl) { + HeadImgUrl = headImgUrl; + } + + public Integer getHideInputBarFlag() { + return HideInputBarFlag; + } + + public void setHideInputBarFlag(Integer hideInputBarFlag) { + HideInputBarFlag = hideInputBarFlag; + } + + public Integer getIsOwner() { + return IsOwner; + } + + public void setIsOwner(Integer isOwner) { + IsOwner = isOwner; + } + + public String getKeyWord() { + return KeyWord; + } + + public void setKeyWord(String keyWord) { + KeyWord = keyWord; + } + + public Integer getMemberCount() { + return MemberCount; + } + + public void setMemberCount(Integer memberCount) { + MemberCount = memberCount; + } + + public List getMemberList() { + return MemberList; + } + + public void setMemberList(List memberList) { + MemberList = memberList; + } + + public String getNickName() { + return NickName; + } + + public void setNickName(String nickName) { + NickName = nickName; + } + + public Integer getOwnerUin() { + return OwnerUin; + } + + public void setOwnerUin(Integer ownerUin) { + OwnerUin = ownerUin; + } + + public String getPYInitial() { + return PYInitial; + } + + public void setPYInitial(String PYInitial) { + this.PYInitial = PYInitial; + } + + public String getPYQuanPin() { + return PYQuanPin; + } + + public void setPYQuanPin(String PYQuanPin) { + this.PYQuanPin = PYQuanPin; + } + + public String getProvince() { + return Province; + } + + public void setProvince(String province) { + Province = province; + } + + public String getRemarkName() { + return RemarkName; + } + + public void setRemarkName(String remarkName) { + RemarkName = remarkName; + } + + public String getRemarkPYInitial() { + return RemarkPYInitial; + } + + public void setRemarkPYInitial(String remarkPYInitial) { + RemarkPYInitial = remarkPYInitial; + } + + public String getRemarkPYQuanPin() { + return RemarkPYQuanPin; + } + + public void setRemarkPYQuanPin(String remarkPYQuanPin) { + RemarkPYQuanPin = remarkPYQuanPin; + } + + public Integer getSex() { + return Sex; + } + + public void setSex(Integer sex) { + Sex = sex; + } + + public String getSignature() { + return Signature; + } + + public void setSignature(String signature) { + Signature = signature; + } + + public Integer getSnsFlag() { + return SnsFlag; + } + + public void setSnsFlag(Integer snsFlag) { + SnsFlag = snsFlag; + } + + public Integer getStarFriend() { + return StarFriend; + } + + public void setStarFriend(Integer starFriend) { + StarFriend = starFriend; + } + + public Integer getStatues() { + return Statues; + } + + public void setStatues(Integer statues) { + Statues = statues; + } + + public Integer getUin() { + return Uin; + } + + public void setUin(Integer uin) { + Uin = uin; + } + + public Integer getUniFriend() { + return UniFriend; + } + + public void setUniFriend(Integer uniFriend) { + UniFriend = uniFriend; + } + + public String getUserName() { + return UserName; + } + + public void setUserName(String userName) { + UserName = userName; + } + + public String getVerifyFlag() { + return VerifyFlag; + } + + public void setVerifyFlag(String verifyFlag) { + VerifyFlag = verifyFlag; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/RecommendInfo.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/RecommendInfo.java new file mode 100644 index 0000000..6182b6b --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/RecommendInfo.java @@ -0,0 +1,146 @@ +package org.aibidding.common.wechat.itchat4j.beans; + +import java.io.Serializable; + +/** + * RecommendInfo + * + * @author https://github.com/yaphone + * @date 创建时间:2017年7月3日 下午10:35:14 + * @version 1.0 + * + */ +public class RecommendInfo implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + + private String ticket; + private String userName; + private int sex; + private int attrStatus; + private String city; + private String nickName; + private int scene; + private String province; + private String content; + private String alias; + private String signature; + private int opCode; + private int qQNum; + private int verifyFlag; + + public String getTicket() { + return ticket; + } + + public void setTicket(String ticket) { + this.ticket = ticket; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public int getSex() { + return sex; + } + + public void setSex(int sex) { + this.sex = sex; + } + + public int getAttrStatus() { + return attrStatus; + } + + public void setAttrStatus(int attrStatus) { + this.attrStatus = attrStatus; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public int getScene() { + return scene; + } + + public void setScene(int scene) { + this.scene = scene; + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getAlias() { + return alias; + } + + public void setAlias(String alias) { + this.alias = alias; + } + + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + public int getOpCode() { + return opCode; + } + + public void setOpCode(int opCode) { + this.opCode = opCode; + } + + public int getqQNum() { + return qQNum; + } + + public void setqQNum(int qQNum) { + this.qQNum = qQNum; + } + + public int getVerifyFlag() { + return verifyFlag; + } + + public void setVerifyFlag(int verifyFlag) { + this.verifyFlag = verifyFlag; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/SendMsg.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/SendMsg.java new file mode 100644 index 0000000..9450676 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/SendMsg.java @@ -0,0 +1,59 @@ +package org.aibidding.common.wechat.itchat4j.beans; + +import org.aibidding.common.wechat.itchat4j.utils.enums.SendMsgType; + +import java.io.Serializable; + +/** + * 发送消息体 + * @author WesleyOne + * @create 2019/1/7 + */ +public class SendMsg implements Serializable { + + private String userName; + private String nickName; + private String message; + private SendMsgType msgType; + private boolean isGroup; + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public SendMsgType getMsgType() { + return msgType; + } + + public void setMsgType(SendMsgType msgType) { + this.msgType = msgType; + } + + public boolean isGroup() { + return isGroup; + } + + public void setGroup(boolean group) { + isGroup = group; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/SyncKey.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/SyncKey.java new file mode 100644 index 0000000..757e574 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/SyncKey.java @@ -0,0 +1,52 @@ +package org.aibidding.common.wechat.itchat4j.beans; + +import java.util.List; + +/** + * @author WesleyOne + * @create 2018/12/21 + */ +@Deprecated +public class SyncKey { + + private Integer Count; + + private List List; + + public Integer getCount() { + return Count; + } + + public void setCount(Integer count) { + Count = count; + } + + public java.util.List getList() { + return List; + } + + public void setList(java.util.List list) { + List = list; + } + + class KV{ + private Integer Key; + private Long Val; + + public Integer getKey() { + return Key; + } + + public void setKey(Integer key) { + Key = key; + } + + public Long getVal() { + return Val; + } + + public void setVal(Long val) { + Val = val; + } + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/User.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/User.java new file mode 100644 index 0000000..545e9f4 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/User.java @@ -0,0 +1,54 @@ +package org.aibidding.common.wechat.itchat4j.beans; + +/* +AppAccountFlag: 0 +ContactFlag: 0 +HeadImgFlag: 1 +HeadImgUrl: "/cgi-bin/mmwebwx-bin/webwxgeticon?seq=778915892&username=@7e6934104b3cf1f92dd11344c63a06833ae54bd43b34229b5cc472c4d05eba4a&skey=@crypt_a24169c_f4c07f70afe861da5e8a6e1947044b6e" +HideInputBarFlag: 0 +NickName: "[è¡°]晓炜" +PYInitial: "" +PYQuanPin: "" +RemarkName: "" +RemarkPYInitial: "" +RemarkPYQuanPin: "" +Sex: 1 +Signature: "人工智障" +SnsFlag: 49 +StarFriend: 0 +Uin: 902478981 +UserName: "@7e6934104b3cf1f92dd11344c63a06833ae54bd43b34229b5cc472c4d05eba4a" +VerifyFlag: 0 +WebWxPluginSwitch: 0 +*/ + +/** + * @author WesleyOne + * @create 2018/12/21 + */ +@Deprecated +public class User { + + private String AppAccountFlag; + private String ContactFlag; + private String HeadImgFlag; + private String HeadImgUrl; + private String HideInputBarFlag; + private String NickName; + private String PYInitial; + private String PYQuanPin; + private String RemarkName; + private String RemarkPYInitial; + private String RemarkPYQuanPin; + private String Sex; + /** + * 签名 + */ + private String Signature; + private String SnsFlag; + private String StarFriend; + private String Uin; + private String UserName; + private String VerifyFlag; + private String WebWxPluginSwitch; +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/WebWxInit.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/WebWxInit.java new file mode 100644 index 0000000..6ecb29b --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/beans/WebWxInit.java @@ -0,0 +1,43 @@ +package org.aibidding.common.wechat.itchat4j.beans; + +import java.util.List; + +/** + * @author WesleyOne + * @create 2018/12/21 + */ +@Deprecated +public class WebWxInit { + + private BaseResponse BaseResponse; + + private String ChatSet; + + private Long ClickReportInterval; + + private Long ClientVersion; + + private List ContactList; + + private Integer Count; + + private Integer GrayScale; + + private Integer InviteStartCount; + + /** + * 订阅号字段省略 + * MPSubscribeMsgCount + * MPSubscribeMsgList + */ + + private String SKey; + + private SyncKey SyncKey; + + private Long SystemTime; + + private User User; + + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/client/HttpClientManage.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/client/HttpClientManage.java new file mode 100644 index 0000000..ddbb16f --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/client/HttpClientManage.java @@ -0,0 +1,34 @@ +package org.aibidding.common.wechat.itchat4j.client; + +import org.apache.commons.lang3.StringUtils; +import org.apache.http.client.CookieStore; + +import java.util.HashMap; + +/** + * 多开请求类管理 + * @author WesleyOne + * @create 2018/12/15 + */ +public class HttpClientManage { + + private static HashMap clientMap = new HashMap<>(32); + + public static SingleHttpClient getInstance(String uniqueKey){ + return getInstance(uniqueKey,null); + } + + public static SingleHttpClient getInstance(String uniqueKey,CookieStore outCookieStore) { + if (StringUtils.isEmpty(uniqueKey)){ + return null; + } + SingleHttpClient client; + + // outCookieStore不为空时也重新构造,主要用于热登录 + if (!clientMap.containsKey(uniqueKey) || clientMap.get(uniqueKey) == null || outCookieStore != null){ + client = SingleHttpClient.getInstance(outCookieStore); + clientMap.put(uniqueKey, client); + } + return clientMap.get(uniqueKey); + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/client/SingleHttpClient.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/client/SingleHttpClient.java new file mode 100644 index 0000000..9be2298 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/client/SingleHttpClient.java @@ -0,0 +1,187 @@ +package org.aibidding.common.wechat.itchat4j.client; + +import org.apache.http.Consts; +import org.apache.http.HttpEntity; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.CookieStore; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.cookie.Cookie; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.BasicCookieStore; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.DefaultHttpRequestRetryHandler; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.aibidding.common.wechat.itchat4j.utils.Config; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * @author WesleyOne + * @create 2018/12/15 + */ +public class SingleHttpClient { + private Logger logger = LoggerFactory.getLogger("UTILLOG"); + + private CloseableHttpClient httpClient ; + + private CookieStore cookieStore; + + private String uniqueKey; + + public String getCookie(String name) { + List cookies = cookieStore.getCookies(); + for (Cookie cookie : cookies) { + if (cookie.getName().equalsIgnoreCase(name)) { + return cookie.getValue(); + } + } + return null; + + } + + private SingleHttpClient(CookieStore outCookieStore){ + if (outCookieStore == null){ + outCookieStore = new BasicCookieStore(); + } + this.cookieStore = outCookieStore; + httpClient = HttpClients.custom().setDefaultCookieStore(cookieStore).setRetryHandler(new DefaultHttpRequestRetryHandler(0,false)).build(); + } + + private SingleHttpClient(){ + this(null); + } + + public static SingleHttpClient getInstance(CookieStore outCookieStore){ + return new SingleHttpClient(outCookieStore); + } + + /** + * 处理GET请求 + * + * @author https://github.com/yaphone + * @date 2017年4月9日 下午7:06:19 + * @param url + * @param params + * @return + */ + public HttpEntity doGet(String url, List params, boolean redirect, + Map headerMap) { + HttpEntity entity = null; + HttpGet httpGet = new HttpGet(); + + try { + if (params != null) { + String paramStr = EntityUtils.toString(new UrlEncodedFormEntity(params, Consts.UTF_8)); + httpGet = new HttpGet(url + "?" + paramStr); +// System.out.println(url + "?" + paramStr); + } else { + httpGet = new HttpGet(url); + } + if (!redirect) { + // 禁止重定向 + httpGet.setConfig(RequestConfig.custom().setRedirectsEnabled(false).build()); + } + httpGet.setHeader("User-Agent", Config.USER_AGENT); + if (headerMap != null) { + Set> entries = headerMap.entrySet(); + for (Map.Entry entry : entries) { + httpGet.setHeader(entry.getKey(), entry.getValue()); + } + } + CloseableHttpResponse response = httpClient.execute(httpGet); + entity = response.getEntity(); + } catch (ClientProtocolException e) { + logger.error(e.getMessage()); + } catch (IOException e) { + logger.error(e.getMessage()); + } catch (Exception e){ + logger.error(e.getMessage()); + } + return entity; + } + + /** + * 处理POST请求 + * + * @author https://github.com/yaphone + * @date 2017年4月9日 下午7:06:35 + * @param url + * @param paramsStr + * @return + */ + public HttpEntity doPost(String url, String paramsStr) { + return doPost(url,paramsStr,null); + } + + public HttpEntity doPost(String url, String paramsStr, Map headerMap) { + HttpEntity entity = null; + HttpPost httpPost = new HttpPost(); + try { + StringEntity params = new StringEntity(paramsStr, Consts.UTF_8); + httpPost = new HttpPost(url); + httpPost.setEntity(params); + httpPost.setHeader("Content-type", "application/json; charset=utf-8"); + httpPost.setHeader("User-Agent", Config.USER_AGENT); + if (headerMap != null) { + Set> entries = headerMap.entrySet(); + for (Map.Entry entry : entries) { + httpPost.setHeader(entry.getKey(), entry.getValue()); + } + } + CloseableHttpResponse response = httpClient.execute(httpPost); + entity = response.getEntity(); + } catch (ClientProtocolException e) { + logger.error(e.getMessage()); + } catch (IOException e) { + logger.error(e.getMessage()); + } catch (Exception e){ + logger.error(e.getMessage()); + } + return entity; + } + + /** + * 上传文件到服务器 + * + * @author https://github.com/yaphone + * @date 2017年5月7日 下午9:19:23 + * @param url + * @param reqEntity + * @return + */ + public HttpEntity doPostFile(String url, HttpEntity reqEntity) { + HttpEntity entity = null; + HttpPost httpPost = new HttpPost(url); + httpPost.setHeader("User-Agent", Config.USER_AGENT); + httpPost.setEntity(reqEntity); + try { + CloseableHttpResponse response = httpClient.execute(httpPost); + entity = response.getEntity(); + + } catch (Exception e) { + logger.error(e.getMessage()); + } + return entity; + } + + + public CookieStore getCookieStore() { + return this.cookieStore; + } + + public void setCookieStore(CookieStore cookieStore) { + this.cookieStore = cookieStore; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/controller/LoginController.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/controller/LoginController.java new file mode 100644 index 0000000..3740955 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/controller/LoginController.java @@ -0,0 +1,148 @@ +package org.aibidding.common.wechat.itchat4j.controller; + +import org.aibidding.common.wechat.itchat4j.core.Core; +import org.aibidding.common.wechat.itchat4j.core.CoreManage; +import org.aibidding.common.wechat.itchat4j.core.MsgCenter; +import org.aibidding.common.wechat.itchat4j.service.ILoginService; +import org.aibidding.common.wechat.itchat4j.service.impl.LoginServiceImpl; +import org.aibidding.common.wechat.itchat4j.utils.LogInterface; +import org.aibidding.common.wechat.itchat4j.utils.SleepUtils; +import org.aibidding.common.wechat.itchat4j.utils.enums.URLEnum; +import org.aibidding.common.wechat.web.base.BaseException; + +/** + * 登陆控制器 + * + * @author https://github.com/yaphone + * @date 创建时间:2017年5月13日 下午12:56:07 + * @version 1.0 + * + * @author WesleyOne 修改 + */ +public class LoginController implements LogInterface { + + private ILoginService loginService; + private String uniqueKey; + private Core core; + + public LoginController(String uniqueKey){ + this.uniqueKey = uniqueKey; + this.loginService = new LoginServiceImpl(uniqueKey); + this.core = CoreManage.getInstance(uniqueKey); + } + + /** + * 获取二维码地址 + * 风险:已登录账号不可调用该接口,会移除当前core信息 + * @return + */ + public String login_1() throws BaseException { + if (core.isAlive()) { + LOG.warn("微信已登陆"); + throw new BaseException("微信已登陆"); + } + LOG.info("1.获取微信UUID"); + while (loginService.getUuid() == null) { + LOG.warn("1.1. 获取微信UUID失败,一秒后重新获取"); + SleepUtils.sleep(1000); + } + LOG.info("2. 获取登陆二维码图片"); + return URLEnum.QRCODE_URL.getUrl() + core.getUuid(); + } + + /** + * 确认登录 + * @return + */ + public boolean login_2(){ + + boolean result = false; + + LOG.info("3. 请扫描二维码图片,并在手机上确认"); + if (!core.isAlive()) { + if (loginService.login()){ + core.setAlive(true); + LOG.info(("3.1登陆成功")); + result = true; + } + } + return result; + } + + /** + * 加载数据 + * @return + */ + public boolean login_3() { + + boolean result = true; + + LOG.info("4.微信初始化"); + if (!loginService.webWxInit()) { + LOG.info("4.1 微信初始化异常"); + result = false; + } + + if (result){ + + LOG.info("5. 开启微信状态通知"); + loginService.wxStatusNotify(); + + LOG.info(String.format("欢迎回来, %s", core.getNickName())); + LOG.info("6.+++开启消息发送线程["+uniqueKey+"]+++"); + Thread sendThread = new Thread(core.getThreadGroup(), () -> MsgCenter.sendMsg(uniqueKey), "SEND-" + uniqueKey); + sendThread.start(); + + LOG.info("8. +++开始接收消息线程["+uniqueKey+"]+++"); + loginService.startReceiving(); + + LOG.info("9. 获取联系人信息"); + loginService.webWxGetContact(); + + LOG.info("10. 获取群好友及群好友列表及缓存"); + loginService.WebWxBatchGetContact(); + + } + + if (!result){ + core.setAlive(false); + return false; + } + + core.setFinishInit(true); + + return true; + } + + public boolean reboot(){ + + core.setFinishInit(false); + // 重新加载数据 + boolean result = true; + LOG.info("1.刷新初始化信息"); + if (!loginService.webWxInit()) { + LOG.info("1.1 微信初始化异常"); + result = false; + } + + if (result){ + LOG.info("2. 刷新开启微信状态通知"); + loginService.wxStatusNotify(); + + LOG.info("3. 刷新获取联系人信息"); + loginService.webWxGetContact(); + + LOG.info("4. 刷新获取群好友及群好友列表"); + loginService.WebWxBatchGetContact(); + } + + if (!result){ + core.setAlive(false); + return false; + } + + core.setFinishInit(true); + return true; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/core/Core.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/core/Core.java new file mode 100644 index 0000000..60712b8 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/core/Core.java @@ -0,0 +1,371 @@ +package org.aibidding.common.wechat.itchat4j.core; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.annotation.JSONField; +import org.aibidding.common.wechat.itchat4j.beans.BaseMsg; +import org.aibidding.common.wechat.itchat4j.beans.SendMsg; +import org.aibidding.common.wechat.itchat4j.beans.User; +import org.aibidding.common.wechat.itchat4j.client.HttpClientManage; +import org.aibidding.common.wechat.itchat4j.client.SingleHttpClient; +import org.aibidding.common.wechat.itchat4j.service.impl.LoginServiceImpl; +import org.aibidding.common.wechat.itchat4j.utils.enums.parameters.BaseParaEnum; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 核心存储类,全局只保存一份,单例模式 + * + * @author https://github.com/yaphone + * @author WesleyOne 修改 + * @version 1.0 + * @date 创建时间:2017年4月23日 下午2:33:56 + */ +public class Core { + + private Core() { + + } + + private Core(String uniqueKey) { + this.uniqueKey = uniqueKey; + this.myHttpClient = HttpClientManage.getInstance(this.uniqueKey); + this.threadGroup = new ThreadGroup(this.uniqueKey); + } + + protected static Core getInstance(String uniqueKey) { + return new Core(uniqueKey); + } + + private String uniqueKey; + + boolean alive = false; + + /** + * 管理当前机器人的所有业务线程 + */ + @JSONField(serialize = false) + private ThreadGroup threadGroup; + + @JSONField(serialize = false) + boolean isFinishInit = false; + + /** + * login,webWxInit + * 登录接口获取 + */ + private String indexUrl; + private String userName; + private String nickName; + String uuid = null; + /** + * webWxInit + * InviteStartCount + * SyncKey + * synckey 随着每次获取最新消息后的返回值更新,其目的在于每次同步消息后记录一个当前同步的状态 + */ + Map loginInfo = new HashMap(); + + /** + * webWxInit + * 登陆账号自身信息 + * + * @see User + */ + private JSONObject userSelf; + + + /** + * 初始化/cgi-bin/mmwebwx-bin/webwxinit + * 最后一次收到正常retcode的时间,秒为单位 + *

+ * synccheck刷新 + */ + private long lastNormalRetcodeTime; + + + /** + * synccheck和webWxSync容错次数,超过退出 + */ + int receivingRetryCount = 5; + + + @JSONField(serialize = false) + SingleHttpClient myHttpClient; + + public SingleHttpClient getMyHttpClient() { + return HttpClientManage.getInstance(uniqueKey); + } + + /** + * 初始话时获取联系人时创建 + * @see LoginServiceImpl#webWxGetContact() + */ + /** + * memberList长度 + */ + @JSONField(serialize = false) + private int memberCount = 0; + /** + * 好友+群聊+公众号+特殊账号 + * 注意:不主动插入,获取时通过其他几个账号集合合并 + */ + @JSONField(serialize = false) + private List memberList = new ArrayList(); + /** + * 好友 + */ + @JSONField(serialize = false) + private List contactList = new ArrayList(); + /** + * 群 + */ + @JSONField(serialize = false) + private List groupList = new ArrayList(); + /** + * 公众号/服务号 + */ + @Deprecated + @JSONField(serialize = false) + private List publicUsersList = new ArrayList(); + /** + * 特殊账号 + */ + @JSONField(serialize = false) + private List specialUsersList = new ArrayList(); + + /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ + + /** + * synccheck和webWxSynct添加 + * 异步接受消息存储 + */ + @JSONField(serialize = false) + private List msgList = new ArrayList<>(); + + /** + * 异步发送消息存储 + */ + @JSONField(serialize = false) + private List sendList = new ArrayList(); + + /******************************** + * 缓存字段,用于快速查找 + ********************************/ + + /** + * 微信昵称不能超过16位,而ID比较长,干脆用一个Map + * 群ID或昵称,群信息 + * 注意:存在相同昵称会后者覆盖前者 + *

+ * WebWxBatchGetContact之后可以通过 + * .getJSONArray("MemberList")获取群成员列表 + */ + @JSONField(serialize = false) + private Map groupInfoMap = new HashMap<>(1024); + + /** + * 微信昵称不能超过16位,而ID比较长,干脆用一个Map + * 玩家ID或昵称,玩家信息 + * 注意:存在相同昵称会后者覆盖前者 + */ + @JSONField(serialize = false) + private Map userInfoMap = new HashMap<>(1024); + + /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ + + /** + * 请求参数 + */ + @JSONField(serialize = false) + public Map getParamMap() { + return new HashMap(1) { + /** + * + */ + private static final long serialVersionUID = 1L; + + { + Map map = new HashMap<>(16); + for (BaseParaEnum baseRequest : BaseParaEnum.values()) { + map.put(baseRequest.para(), getLoginInfo().get(baseRequest.value()).toString()); + } + put("BaseRequest", map); + } + }; + } + + public String getUniqueKey() { + return uniqueKey; + } + + public void setUniqueKey(String uniqueKey) { + this.uniqueKey = uniqueKey; + } + + public boolean isAlive() { + return alive; + } + + public void setAlive(boolean alive) { + this.alive = alive; + if (!alive) { + this.isFinishInit = false; + } + } + + public String getIndexUrl() { + return indexUrl; + } + + public void setIndexUrl(String indexUrl) { + this.indexUrl = indexUrl; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Map getLoginInfo() { + return loginInfo; + } + + public void setLoginInfo(Map loginInfo) { + this.loginInfo = loginInfo; + } + + public JSONObject getUserSelf() { + return userSelf; + } + + public void setUserSelf(JSONObject userSelf) { + this.userSelf = userSelf; + } + + public long getLastNormalRetcodeTime() { + return lastNormalRetcodeTime; + } + + public void setLastNormalRetcodeTime(long lastNormalRetcodeTime) { + this.lastNormalRetcodeTime = lastNormalRetcodeTime; + } + + public int getReceivingRetryCount() { + return receivingRetryCount; + } + + public void setReceivingRetryCount(int receivingRetryCount) { + this.receivingRetryCount = receivingRetryCount; + } + + public int getMemberCount() { + return getContactList().size() + getGroupList().size() + getPublicUsersList().size() + getSpecialUsersList().size(); + } + + public List getMemberList() { + List memberList = new ArrayList<>(); + memberList.addAll(this.getContactList()); + memberList.addAll(this.getGroupList()); + memberList.addAll(this.getPublicUsersList()); + memberList.addAll(this.getSpecialUsersList()); + return memberList; + } + + public List getContactList() { + return contactList; + } + + public void setContactList(List contactList) { + this.contactList = contactList; + } + + public List getGroupList() { + return groupList; + } + + public void setGroupList(List groupList) { + this.groupList = groupList; + } + + public List getPublicUsersList() { + return publicUsersList; + } + + public void setPublicUsersList(List publicUsersList) { + this.publicUsersList = publicUsersList; + } + + public List getSpecialUsersList() { + return specialUsersList; + } + + public void setSpecialUsersList(List specialUsersList) { + this.specialUsersList = specialUsersList; + } + + public List getMsgList() { + return msgList; + } + + public void setMsgList(List msgList) { + this.msgList = msgList; + } + + public Map getGroupInfoMap() { + return groupInfoMap; + } + + public void setGroupInfoMap(Map groupInfoMap) { + this.groupInfoMap = groupInfoMap; + } + + public Map getUserInfoMap() { + return userInfoMap; + } + + public void setUserInfoMap(Map userInfoMap) { + this.userInfoMap = userInfoMap; + } + + public boolean isFinishInit() { + return isFinishInit; + } + + public void setFinishInit(boolean finishInit) { + isFinishInit = finishInit; + } + + public ThreadGroup getThreadGroup() { + return threadGroup; + } + + public void setThreadGroup(ThreadGroup threadGroup) { + this.threadGroup = threadGroup; + } + + public List getSendList() { + return sendList; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/core/CoreManage.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/core/CoreManage.java new file mode 100644 index 0000000..f5dd59d --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/core/CoreManage.java @@ -0,0 +1,323 @@ +package org.aibidding.common.wechat.itchat4j.core; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.impl.client.BasicCookieStore; +import org.apache.http.impl.cookie.BasicClientCookie; +import org.aibidding.common.wechat.itchat4j.beans.SendMsg; +import org.aibidding.common.wechat.itchat4j.client.HttpClientManage; +import org.aibidding.common.wechat.itchat4j.controller.LoginController; +import org.aibidding.common.wechat.itchat4j.utils.LogInterface; +import org.aibidding.common.wechat.itchat4j.utils.enums.SendMsgType; +import org.aibidding.common.wechat.itchat4j.utils.tools.CommonTools; + +import java.io.*; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; + +/** + * 多开管理 + * + * @author WesleyOne + * @create 2018/12/13 + */ +public class CoreManage implements LogInterface { + + static int MAX_CORE_NUM = 50; + private static HashMap coreMap = new HashMap<>(MAX_CORE_NUM / 3 * 4 + 1); + + // 是否热加载 + public static boolean USE_HOT_RELOAD = false; + public static String HOT_RELOAD_DIR = "/Users/wesley/output/hotreload/wxwobot.hot"; + + public static Core getInstance(String uniqueKey) { + if (StringUtils.isEmpty(uniqueKey)) { + return null; + } + Core core; + if (!coreMap.containsKey(uniqueKey) || coreMap.get(uniqueKey) == null) { + core = Core.getInstance(uniqueKey); + coreMap.put(uniqueKey, core); + } + return coreMap.get(uniqueKey); + } + + /** + * 移除 + * + * @param uniqueKey + */ + public static void remove(String uniqueKey) { + if (coreMap.containsKey(uniqueKey)) { + coreMap.remove(uniqueKey); + } + } + + /** + * 查询是否在线 + * + * @param uniqueKey + * @return + */ + public static boolean isActive(String uniqueKey) { + if (StringUtils.isNotEmpty(uniqueKey) && coreMap.containsKey(uniqueKey) && coreMap.get(uniqueKey).isAlive()) { + return true; + } + return false; + } + + /** + * 持久化 + */ + public static void persistence() { + + // 格式化数据 + Collection valueCollection = coreMap.values(); + int size = valueCollection.size(); + // 没有数据不操作 + if (size <= 0) { + return; + } + LOG.info("登录数据持久化中"); + Iterator iterator = valueCollection.iterator(); + JSONArray jsonArray = new JSONArray(); + while (iterator.hasNext()) { + Core core = iterator.next(); + if (core.isAlive()) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("core", core); + jsonObject.put("cookies", core.getMyHttpClient().getCookieStore().getCookies()); + jsonArray.add(jsonObject); + } + } + + try { + File file = new File(HOT_RELOAD_DIR); + if (!file.exists()) { + file.createNewFile(); + } + // 每次覆盖 + FileWriter fileWritter = new FileWriter(HOT_RELOAD_DIR, false); + fileWritter.write(jsonArray.toJSONString()); + fileWritter.close(); + + LOG.info("登录数据持久化完成"); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 启动加载持久化文件 + */ + public static void reload() { + if (USE_HOT_RELOAD) { + File file = new File(HOT_RELOAD_DIR); + if (file.exists()) { + LOG.info("登录数据热加载中"); + StringBuilder stringBuilder = new StringBuilder(); + try { + FileReader fr = new FileReader(HOT_RELOAD_DIR); + BufferedReader bf = new BufferedReader(fr); + String str; + // 按行读取字符串 + while ((str = bf.readLine()) != null) { + stringBuilder.append(str); + } + bf.close(); + fr.close(); + } catch (IOException e) { + e.printStackTrace(); + return; + } + String result = stringBuilder.toString(); + if (StringUtils.isEmpty(result)) { + return; + } + + JSONArray jsonArray = JSONArray.parseArray(result); + int size = jsonArray.size(); + if (size > 0) { + // 封装成线程操作 + for (int i = 0; i < size; i++) { + JSONObject jsonObject = jsonArray.getJSONObject(i); + ReloadThread reloadThread = new ReloadThread(jsonObject); + Thread thread = new Thread(reloadThread); + thread.start(); + } + } + + LOG.info("登录数据热加载完成"); + } + } + } + + private static class ReloadThread implements Runnable { + + private JSONObject reloadObject; + + public ReloadThread(JSONObject object) { + this.reloadObject = object; + } + + @Override + public void run() { + Core core = null; + try { + /** + * 初始化Core, + * 1.获取登入的状态信息并装入CoreManage + * 2.构建ThreadGroup + * 3.获取Cookies并装入HttpClientManage + * 4.获取信息及启动线程 + */ + JSONObject jsonObject = this.reloadObject; + core = jsonObject.getObject("core", Core.class); + String uniqueKey = core.getUniqueKey(); + if (core.isAlive()) { + core.setThreadGroup(new ThreadGroup(uniqueKey)); + coreMap.put(uniqueKey, core); + + JSONArray cookiesJsonArray = jsonObject.getJSONArray("cookies"); + int arraySize = cookiesJsonArray.size(); + if (arraySize <= 0) { + return; + } + + // 装载原cookie信息,json解析cookie异常,干脆手动封装 + BasicCookieStore cookieStore = new BasicCookieStore(); + for (int ci = 0; ci < arraySize; ci++) { + JSONObject cookieJson = cookiesJsonArray.getJSONObject(ci); + String name = cookieJson.getString("name"); + String value = cookieJson.getString("value"); + String domain = cookieJson.getString("domain"); + String path = cookieJson.getString("path"); + Boolean persistent = cookieJson.getBoolean("persistent"); + Boolean secure = cookieJson.getBoolean("secure"); + Long expiryDate = cookieJson.getLong("expiryDate"); + Integer version = cookieJson.getInteger("version"); + + BasicClientCookie cookie = new BasicClientCookie(name, value); + cookie.setDomain(domain); + cookie.setPath(path); + cookie.setSecure(secure); + cookie.setExpiryDate(new Date(expiryDate)); + cookie.setVersion(version); + + cookieStore.addCookie(cookie); + } + // 必须在构建client时就放入cookie + HttpClientManage.getInstance(uniqueKey, cookieStore); + //装载core信息及启动线程 + LoginController login = new LoginController(uniqueKey); + if (!login.login_3()) { + // 加载失败退出 + core.setAlive(false); + return; + } + LOG.info("热登录成功: {}", uniqueKey); + } + } catch (Exception e) { + e.printStackTrace(); + if (core != null) { + core.setAlive(false); + core = null; + } + } + } + } + + + /** + * 存放新的群,昵称emoji处理 + * + * @param core + * @param jsonObject + */ + public static void addNewGroup(Core core, JSONObject jsonObject) { + String userName = jsonObject.getString("UserName"); + + CommonTools.emojiFormatter2(jsonObject, "NickName"); + // 删除重复的 + core.getGroupList().removeIf(group -> userName.equals(group.getString("UserName"))); + + core.getGroupList().add(jsonObject); + core.getGroupInfoMap().put(jsonObject.getString("NickName"), jsonObject); + core.getGroupInfoMap().put(userName, jsonObject); + } + + + /** + * 存放新的联系人,昵称emoji处理 + * + * @param core + * @param jsonObject + */ + public static void addNewContact(Core core, JSONObject jsonObject) { + String userName = jsonObject.getString("UserName"); + + CommonTools.emojiFormatter2(jsonObject, "NickName"); + // 删除重复的 + core.getContactList().removeIf(contact -> userName.equals(contact.getString("UserName"))); + + core.getContactList().add(jsonObject); + core.getUserInfoMap().put(jsonObject.getString("NickName"), jsonObject); + core.getUserInfoMap().put(userName, jsonObject); + } + + /** + * 消息统一加到队列里处理1 + * 用于已知UserName + * + * @param uniqueKey + * @param toUserName + * @param data + * @param type + */ + public static void addSendMsg4UserName(String uniqueKey, String toUserName, String data, SendMsgType type) { + if (StringUtils.isEmpty(uniqueKey) || StringUtils.isEmpty(toUserName) || StringUtils.isEmpty(data) || type == null) { + LOG.error("消息参数不完整 uk:{} un: {} data: {} ", uniqueKey, toUserName, data); + return; + } + + SendMsg sendMsg = new SendMsg(); + sendMsg.setUserName(toUserName); + sendMsg.setMessage(data); + sendMsg.setMsgType(type); + boolean isGroup = true; + if (toUserName != null && !toUserName.startsWith("@@")) { + isGroup = false; + } + sendMsg.setGroup(isGroup); + CoreManage.getInstance(uniqueKey).getSendList().add(sendMsg); + } + + /** + * 消息统一加到队列里处理2 + * 用于已知NickName + * + * @param uniqueKey + * @param toNickName + * @param data + * @param type + * @param isGroup + */ + public static void addSendMsg4NickName(String uniqueKey, String toNickName, String data, SendMsgType type, Boolean isGroup) { + + if (StringUtils.isEmpty(uniqueKey) || StringUtils.isEmpty(toNickName) || StringUtils.isEmpty(data) || type == null) { + LOG.error("消息参数不完整 uk:{} nn: {} data: {} ", uniqueKey, toNickName, data); + return; + } + + SendMsg sendMsg = new SendMsg(); + sendMsg.setNickName(toNickName); + sendMsg.setMessage(data); + sendMsg.setMsgType(type); + sendMsg.setGroup(isGroup); + CoreManage.getInstance(uniqueKey).getSendList().add(sendMsg); + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/core/MsgCenter.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/core/MsgCenter.java new file mode 100644 index 0000000..29a1675 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/core/MsgCenter.java @@ -0,0 +1,273 @@ +package org.aibidding.common.wechat.itchat4j.core; + + +import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; +import org.aibidding.common.wechat.itchat4j.api.MessageTools; +import org.aibidding.common.wechat.itchat4j.api.WechatTools; +import org.aibidding.common.wechat.itchat4j.beans.BaseMsg; +import org.aibidding.common.wechat.itchat4j.beans.SendMsg; +import org.aibidding.common.wechat.itchat4j.face.IMsgHandlerFace; +import org.aibidding.common.wechat.itchat4j.utils.LogInterface; +import org.aibidding.common.wechat.itchat4j.utils.MoreConfig; +import org.aibidding.common.wechat.itchat4j.utils.enums.MsgCodeEnum; +import org.aibidding.common.wechat.itchat4j.utils.enums.MsgTypeEnum; +import org.aibidding.common.wechat.itchat4j.utils.enums.SendMsgType; +import org.aibidding.common.wechat.itchat4j.utils.tools.CommonTools; + +import java.util.ArrayList; +import java.util.List; + +/** + * 消息处理中心 + * + * @author https://github.com/yaphone + * @author WesleyOne 修改 + * @version 1.0 + * @date 创建时间:2017年5月14日 下午12:47:50 + */ +public class MsgCenter implements LogInterface { + + /** + * 接收消息,放入队列 + * + * @param msgList + * @return + * @author https://github.com/yaphone + * @date 2017年4月23日 下午2:30:48 + */ + public static JSONArray produceMsg(JSONArray msgList, String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + JSONArray result = new JSONArray(); + // 用于暂存未知群ID,最后调用webwxbatchgetcontact获取 + List unknowGroup = new ArrayList<>(); + + for (int i = 0; i < msgList.size(); i++) { + JSONObject m = msgList.getJSONObject(i); + // 是否是群消息 + boolean isGroupMsg = false; + boolean isAtMe = false; + if (m.getString("FromUserName").contains("@@") || m.getString("ToUserName").contains("@@")) { + // 群聊消息 + isGroupMsg = true; + if (m.getString("FromUserName").contains("@@") + && !core.getGroupInfoMap().containsKey(m.getString("FromUserName"))) { + unknowGroup.add(m.getString("FromUserName")); + } else if (m.getString("ToUserName").contains("@@") + && !core.getGroupInfoMap().containsKey(m.getString("ToUserName"))) { + unknowGroup.add(m.getString("ToUserName")); + } + // 群消息与普通消息不同的是在其消息体(Content)中会包含发送者id及":
"消息,这里需要处理一下,去掉多余信息,只保留消息内容 + String splitCode = ":
"; + if (m.getString("Content").contains(splitCode)) { + String source = m.getString("Content"); + String content = source.substring(source.indexOf(splitCode) + splitCode.length()); + String sendMemberId = source.substring(0, source.indexOf(splitCode)); + + m.put("Content", content); + m.put(MoreConfig.SEND_MEMBER_ID, sendMemberId); + + if (content.contains("@" + core.getNickName())) { + isAtMe = true; + } + } + + } + m.put("groupMsg", isGroupMsg); + m.put("atMe", isAtMe); + // 1.文本消息 + if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_TEXT.getCode())) { + if (m.getString("Url").length() != 0) { + // 1.1分享位置 不处理 + continue; +// String[] contents = m.getString("Content").split(":"); +// String data = "Map"; +// if (contents.length>0) { +// data = contents[0]+":"+m.getString("Url"); +// } +// m.put("Type", MsgTypeEnum.MAP.getType()); +// m.put("Text", data); +// LOG.warn("MAP_CONTENT: {},URL: {}",m.getString("Content"),m.getString("Url")); + /** + * MAP_CONTENT: 滨兴小区(东区):/cgi-bin/mmwebwx-bin/webwxgetpubliclinkimg?url=xxx&msgid=7525662842661720095&pictype=location,URL: http://apis.map.qq.com/uri/v1/geocoder?coord=30.191660,120.200508 + */ + + } else { + // 1.2 普通文本 + m.put("Type", MsgTypeEnum.TEXT.getType()); + CommonTools.emojiFormatter2(m, "Content"); + m.put("Text", m.getString("Content")); + + } + } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_IMAGE.getCode()) + || m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_EMOTICON.getCode())) { + // 2.图片消息 不处理 + continue; +// m.put("Type", MsgTypeEnum.PIC.getType()); + } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_VOICE.getCode())) { + // 3.语音消息 不处理 + continue; +// m.put("Type", MsgTypeEnum.VOICE.getType()); + } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_VERIFYMSG.getCode())) { + // 4.好友确认消息 不处理 + continue; + // MessageTools.addFriend(core, userName, 3, ticket); // 确认添加好友 +// m.put("Type", MsgTypeEnum.VERIFYMSG.getType()); + } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_SHARECARD.getCode())) { + // 5.共享名片 不处理 +// m.put("Type", MsgTypeEnum.NAMECARD.getType()); + } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_VIDEO.getCode()) + || m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_MICROVIDEO.getCode())) { + // 6.视频 不处理 + continue; +// m.put("Type", MsgTypeEnum.VIEDO.getType()); + } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_MEDIA.getCode())) { + // 7.分享链接 不处理 + continue; +// m.put("Type", MsgTypeEnum.MEDIA.getType()); + } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_STATUSNOTIFY.getCode())) { + // 微信初始化消息 系统 + m.put("Type", MsgTypeEnum.SYS.getType()); + } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_SYS.getCode())) { + // 系统消息 系统 + m.put("Type", MsgTypeEnum.SYS.getType()); + } else if (m.getInteger("MsgType").equals(MsgCodeEnum.MSGTYPE_RECALLED.getCode())) { + // 撤回消息 系统 不处理 + continue; +// m.put("Type", MsgTypeEnum.SYS.getType()); + } else { + LOG.error("Useless msg: {} \n {}", m.getInteger("MsgType"), m.getString("Content")); + } + + /** + * 日志 + * 显示收到的消息 + */ + String nickName; + String memberName = ""; + if (m.getBoolean("groupMsg")) { + nickName = WechatTools.getGroupNickNameByUserName(m.getString("FromUserName"), uniqueKey); + + if (m.getString(MoreConfig.SEND_MEMBER_ID) != null) { + // 获取成员昵称 + memberName = WechatTools.getMemberNickName(m.getString("FromUserName"), uniqueKey, m.getString(MoreConfig.SEND_MEMBER_ID)); + m.put(MoreConfig.SEND_MEMBER_NICKNAMW, memberName); + } + } else { + nickName = WechatTools.getContactNickNameByUserName(m.getString("FromUserName"), uniqueKey); + } + m.put("fromNickName", nickName); + LOG.info("收到【{}】=>【{}】消息,来自: {} 内容:\n{} ", + MsgCodeEnum.fromCode(m.getInteger("MsgType")) == null ? "未知类型" + m.getInteger("MsgType") : MsgCodeEnum.fromCode(m.getInteger("MsgType")).getType(), + m.getString("Type"), + nickName + " : " + memberName, + StringUtils.isNotEmpty(m.getString("Content")) ? m.getString("Content") : ""); + result.add(m); + } + return result; + } + + /** + * 微信接收消息处理 + * + * @param uniqueKey + * @author https://github.com/yaphone + * @date 2017年5月14日 上午10:52:34 + */ + public static void handleMsg(String uniqueKey, IMsgHandlerFace msgHandler) { + Core core = CoreManage.getInstance(uniqueKey); + while (true) { + if (!core.isAlive()) { + LOG.info("停止消息处理"); + break; + } + if (core.getMsgList().size() > 0 && core.getMsgList().get(0).getContent() != null) { + if (core.getMsgList().get(0).getContent().length() > 0) { + BaseMsg msg = core.getMsgList().get(0); + if (msg.getType() != null) { + try { + if (msg.getType().equals(MsgTypeEnum.TEXT.getType())) { + msgHandler.textMsgHandle(msg); + } else if (msg.getType().equals(MsgTypeEnum.PIC.getType())) { + msgHandler.picMsgHandle(msg); + } else if (msg.getType().equals(MsgTypeEnum.VOICE.getType())) { + msgHandler.voiceMsgHandle(msg); + } else if (msg.getType().equals(MsgTypeEnum.VIEDO.getType())) { + msgHandler.videoMsgHandle(msg); + } else if (msg.getType().equals(MsgTypeEnum.NAMECARD.getType())) { + msgHandler.nameCardMsgHandle(msg); + } else if (msg.getType().equals(MsgTypeEnum.SYS.getType())) { + msgHandler.sysMsgHandle(msg); + } else if (msg.getType().equals(MsgTypeEnum.VERIFYMSG.getType())) { + msgHandler.verifyAddFriendMsgHandle(msg); + } else if (msg.getType().equals(MsgTypeEnum.MEDIA.getType())) { + msgHandler.mediaMsgHandle(msg); + } else { + LOG.warn("暂未处理信息【{}】", msg.getType()); + } + } catch (Exception e) { + LOG.error(e.getMessage(), e); + } + } + } + core.getMsgList().remove(0); + } + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + LOG.error("消息处理中断"); + break; + } + } + } + + /** + * 统一发送消息 + * + * @param uniqueKey + */ + public static void sendMsg(String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + while (true) { + if (core == null || !core.isAlive()) { + LOG.info("停止消息发送"); + break; + } + if (CollectionUtil.isNotEmpty(core.getSendList())) { + SendMsg sendMsg = core.getSendList().get(0); + try { + String userName = sendMsg.getUserName(); + String nickName = sendMsg.getNickName(); + String message = sendMsg.getMessage(); + boolean isGroup = sendMsg.isGroup(); + SendMsgType msgType = sendMsg.getMsgType(); + if (StringUtils.isNotEmpty(message) && msgType != null) { + if (StringUtils.isNotEmpty(userName)) { + MessageTools.send(userName, uniqueKey, message, msgType.toValue()); + } else if (StringUtils.isNotEmpty(nickName)) { + MessageTools.sendByNickName(nickName, uniqueKey, message, msgType.toValue(), isGroup); + } else { + LOG.error("无效发送消息: {}", JSONObject.toJSONString(sendMsg)); + } + } + } catch (Exception e) { + LOG.error(e.getMessage(), e); + } + core.getSendList().remove(0); + } + try { + // 控制发送频率 + Thread.sleep(2000); + } catch (InterruptedException e) { + e.printStackTrace(); + LOG.error("消息发送中断"); + break; + } + } + + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/face/IMsgHandlerFace.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/face/IMsgHandlerFace.java new file mode 100644 index 0000000..fc1caec --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/face/IMsgHandlerFace.java @@ -0,0 +1,93 @@ +package org.aibidding.common.wechat.itchat4j.face; + +import org.aibidding.common.wechat.itchat4j.beans.BaseMsg; + +/** + * 消息处理接口 + * + * @author https://github.com/yaphone + * @date 创建时间:2017年4月20日 上午12:13:49 + * @version 1.0 + * + * @author WesleyOne 修改 + */ +public interface IMsgHandlerFace { + + /** + * + * @author https://github.com/yaphone + * @date 2017年4月20日 上午12:15:00 + * @param msg + * @return + */ + void textMsgHandle(BaseMsg msg); + + /** + * 处理图片消息 + * + * @author https://github.com/yaphone + * @date 2017年4月21日 下午11:07:06 + * @param msg + * @return + */ + void picMsgHandle(BaseMsg msg); + + /** + * 处理声音消息 + * + * @author https://github.com/yaphone + * @date 2017年4月22日 上午12:09:44 + * @param msg + * @return + */ + void voiceMsgHandle(BaseMsg msg); + + /** + * 处理小视频消息 + * + * @author https://github.com/yaphone + * @date 2017年4月23日 下午12:19:50 + * @param msg + * @return + */ + void videoMsgHandle(BaseMsg msg); + + /** + * 处理名片消息 + * + * @author https://github.com/yaphone + * @date 2017年5月1日 上午12:50:50 + * @param msg + * @return + */ + void nameCardMsgHandle(BaseMsg msg); + + /** + * 处理系统消息 + * + * @author Relyn + * @date 2017年6月21日17:43:51 + * @param msg + * @return + */ + void sysMsgHandle(BaseMsg msg); + + /** + * 处理确认添加好友消息 + * + * @date 2017年6月28日 下午10:15:30 + * @param msg + * @return + */ + void verifyAddFriendMsgHandle(BaseMsg msg); + + /** + * 处理收到的文件消息 + * + * @date 2017年7月21日 下午11:59:14 + * @param msg + * @return + */ + void mediaMsgHandle(BaseMsg msg); + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/service/ILoginService.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/service/ILoginService.java new file mode 100644 index 0000000..8df71af --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/service/ILoginService.java @@ -0,0 +1,85 @@ +package org.aibidding.common.wechat.itchat4j.service; + + + +/** + * 登陆服务接口 + * + * @author https://github.com/yaphone + * @date 创建时间:2017年5月13日 上午12:07:21 + * @version 1.0 + * + * @author WesleyOne 修改 + */ +public interface ILoginService { + + /** + * 登陆 + * + * @author https://github.com/yaphone + * @date 2017年5月13日 上午12:14:07 + * @return + */ + boolean login(); + + /** + * 获取UUID + * + * @author https://github.com/yaphone + * @date 2017年5月13日 上午12:21:40 + * @return + */ + String getUuid(); + + /** + * 获取二维码图片 + * (直接获取图片链接,不下载文件) + * @author https://github.com/yaphone + * @date 2017年5月13日 上午12:13:51 + * @param qrPath + * @return + */ + @Deprecated + boolean getQR(String qrPath); + + /** + * web初始化 + * + * @author https://github.com/yaphone + * @date 2017年5月13日 上午12:14:13 + * @return + */ + boolean webWxInit(); + + /** + * 微信状态通知 + * + * @author https://github.com/yaphone + * @date 2017年5月13日 上午12:14:24 + */ + void wxStatusNotify(); + + /** + * 接收消息 + * + * @author https://github.com/yaphone + * @date 2017年5月13日 上午12:14:37 + */ + void startReceiving(); + + /** + * 获取微信联系人 + * + * @author https://github.com/yaphone + * @date 2017年5月13日 下午2:26:18 + */ + void webWxGetContact(); + + /** + * 批量获取联系人信息 + * + * @date 2017年6月22日 下午11:24:35 + */ + void WebWxBatchGetContact(); + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/service/impl/LoginServiceImpl.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/service/impl/LoginServiceImpl.java new file mode 100644 index 0000000..8c3a343 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/service/impl/LoginServiceImpl.java @@ -0,0 +1,894 @@ +package org.aibidding.common.wechat.itchat4j.service.impl; + + +import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.Consts; +import org.apache.http.HttpEntity; +import org.apache.http.cookie.Cookie; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.aibidding.common.wechat.itchat4j.beans.BaseMsg; +import org.aibidding.common.wechat.itchat4j.beans.Member; +import org.aibidding.common.wechat.itchat4j.beans.WebWxInit; +import org.aibidding.common.wechat.itchat4j.core.Core; +import org.aibidding.common.wechat.itchat4j.core.CoreManage; +import org.aibidding.common.wechat.itchat4j.core.MsgCenter; +import org.aibidding.common.wechat.itchat4j.service.ILoginService; +import org.aibidding.common.wechat.itchat4j.utils.LogInterface; +import org.aibidding.common.wechat.itchat4j.utils.SleepUtils; +import org.aibidding.common.wechat.itchat4j.utils.enums.*; +import org.aibidding.common.wechat.itchat4j.utils.enums.parameters.BaseParaEnum; +import org.aibidding.common.wechat.itchat4j.utils.enums.parameters.LoginParaEnum; +import org.aibidding.common.wechat.itchat4j.utils.enums.parameters.StatusNotifyParaEnum; +import org.aibidding.common.wechat.itchat4j.utils.enums.parameters.UUIDParaEnum; +import org.aibidding.common.wechat.itchat4j.utils.tools.CommonTools; +import org.w3c.dom.Document; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.util.*; +import java.util.Map.Entry; +import java.util.regex.Matcher; + +/** + * 登陆服务实现类 + * + * @author https://github.com/yaphone + * @author WesleyOne 修改 + * @version 1.0 + * @date 创建时间:2017年5月13日 上午12:09:35 + */ +public class LoginServiceImpl implements ILoginService, LogInterface { + private Core core; + private String uniqueKey; + + public LoginServiceImpl(String uniqueKey) { + this.uniqueKey = uniqueKey; + this.core = CoreManage.getInstance(uniqueKey); + } + + @Override + public boolean login() { + + boolean isLogin = false; + // 组装参数和URL + List params = new ArrayList(); + params.add(new BasicNameValuePair(LoginParaEnum.LOGIN_ICON.para(), LoginParaEnum.LOGIN_ICON.value())); + params.add(new BasicNameValuePair(LoginParaEnum.UUID.para(), core.getUuid())); + params.add(new BasicNameValuePair(LoginParaEnum.TIP.para(), LoginParaEnum.TIP.value())); + + // long time = 4000; + long startMillis = System.currentTimeMillis(); + boolean overTime = false; + + while (!isLogin && !overTime) { + // 防止请求重复时的问题 + if (core.isAlive()) { + break; + } + + long millis = System.currentTimeMillis(); + params.add(new BasicNameValuePair(LoginParaEnum.R.para(), String.valueOf(millis / 1579L))); + params.add(new BasicNameValuePair(LoginParaEnum._1.para(), String.valueOf(millis))); + HttpEntity entity = core.getMyHttpClient().doGet(URLEnum.LOGIN_URL.getUrl(), params, true, null); + + try { + String result = EntityUtils.toString(entity); + String status = checklogin(result); + if (ResultEnum.SUCCESS.getCode().equals(status)) { + // 处理结果 + if (processLoginInfo(result)) { + isLogin = true; + core.setAlive(isLogin); + break; + } else { + isLogin = false; + core.setAlive(isLogin); + // 登入异常直接退出,防止死循环 + break; + } + } + if (ResultEnum.WAIT_CONFIRM.getCode().equals(status)) { + LOG.info("请点击微信确认按钮,进行登陆"); + } + + } catch (Exception e) { + LOG.error("微信登陆异常!", e); + break; + } + // 3分钟超时不再请求 + SleepUtils.sleep(1000); + overTime = (millis - startMillis) > 1000 * 180; + } + return isLogin; + } + + + @Override + public String getUuid() { + // 组装参数和URL + List params = new ArrayList(); + params.add(new BasicNameValuePair(UUIDParaEnum.APP_ID.para(), UUIDParaEnum.APP_ID.value())); + params.add(new BasicNameValuePair(UUIDParaEnum.FUN.para(), UUIDParaEnum.FUN.value())); + params.add(new BasicNameValuePair(UUIDParaEnum.LANG.para(), UUIDParaEnum.LANG.value())); + params.add(new BasicNameValuePair(UUIDParaEnum._1.para(), String.valueOf(System.currentTimeMillis()))); + + HttpEntity entity = core.getMyHttpClient().doGet(URLEnum.UUID_URL.getUrl(), params, true, null); + + try { + String result = EntityUtils.toString(entity); + String regEx = "window.QRLogin.code = (\\d+); window.QRLogin.uuid = \"(\\S+?)\";"; + Matcher matcher = CommonTools.getMatcher(regEx, result); + LOG.info(result); + if (matcher.find()) { + if ((ResultEnum.SUCCESS.getCode().equals(matcher.group(1)))) { + core.setUuid(matcher.group(2)); + } + } + } catch (Exception e) { + LOG.error(e.getMessage(), e); + } + + return core.getUuid(); + } + + @Deprecated + @Override + public boolean getQR(String qrPath) { + return getQR(qrPath, false); + } + + @Deprecated + public boolean getQR(String qrPath, boolean open) { + qrPath = qrPath + File.separator + "QR.jpg"; + String qrUrl = URLEnum.QRCODE_URL.getUrl() + core.getUuid(); + HttpEntity entity = core.getMyHttpClient().doGet(qrUrl, null, true, null); + try { + // 文件已存在先删除 + File file = new File(qrPath); + if (file.exists() && file.isFile()) { + file.delete(); + } + // 写入二维码 + OutputStream out = new FileOutputStream(qrPath); + byte[] bytes = EntityUtils.toByteArray(entity); + out.write(bytes); + out.flush(); + out.close(); + if (open) { + try { + CommonTools.printQr(qrPath); // 打开登陆二维码图片 + } catch (Exception e) { + LOG.info(e.getMessage()); + } + } + + } catch (Exception e) { + e.printStackTrace(); + LOG.error(e.getMessage(), e); + return false; + } + + return true; + } + + /** + * 获取自身登录信息缓存 + * + * @return + */ + @Override + public boolean webWxInit() { + core.setAlive(true); + core.setLastNormalRetcodeTime(System.currentTimeMillis()); + + try { + // 组装请求URL和参数 + String url = String.format(URLEnum.INIT_URL.getUrl(), + core.getLoginInfo().get(StorageLoginInfoEnum.url.getKey()), + System.currentTimeMillis() / 3158L, + core.getLoginInfo().get(StorageLoginInfoEnum.pass_ticket.getKey())); + Map paramMap = core.getParamMap(); + + // 请求初始化接口 + HttpEntity entity = core.getMyHttpClient().doPost(url, JSONObject.toJSONString(paramMap), getPersistentCookieMap()); + String result = EntityUtils.toString(entity, Consts.UTF_8); + + /** + * 相关返回信息,本项目未做封装 + * @see WebWxInit + */ + JSONObject obj = JSON.parseObject(result); + + JSONObject user = obj.getJSONObject(StorageLoginInfoEnum.User.getKey()); + JSONObject syncKey = obj.getJSONObject(StorageLoginInfoEnum.SyncKey.getKey()); + + core.getLoginInfo().put(StorageLoginInfoEnum.InviteStartCount.getKey(), + obj.getInteger(StorageLoginInfoEnum.InviteStartCount.getKey())); + core.getLoginInfo().put(StorageLoginInfoEnum.SyncKey.getKey(), syncKey); + + JSONArray syncArray = syncKey.getJSONArray("List"); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < syncArray.size(); i++) { + sb.append(syncArray.getJSONObject(i).getString("Key") + "_" + + syncArray.getJSONObject(i).getString("Val") + "|"); + } + // 1_661706053|2_661706420|3_661706415|1000_1494151022| + String synckey = sb.toString(); + + // 1_661706053|2_661706420|3_661706415|1000_1494151022 + core.getLoginInfo().put(StorageLoginInfoEnum.synckey.getKey(), synckey.substring(0, synckey.length() - 1)); + core.setUserName(user.getString("UserName")); + core.setNickName(user.getString("NickName")); + core.setUserSelf(obj.getJSONObject("User")); + + /** + * TIP: + * ContactList此处只是部分,不做处理,webwxgetcontact接口统一处理 + * MPSubscribeMsgList 公众号服务号也不处理 + */ + } catch (Exception e) { + LOG.error("热登录出现该异常请忽略" + e.getMessage(), e); + core.setAlive(false); + return false; + } + return true; + } + + @Override + public void wxStatusNotify() { + // 组装请求URL和参数 + String url = String.format(URLEnum.STATUS_NOTIFY_URL.getUrl(), + core.getLoginInfo().get(StorageLoginInfoEnum.pass_ticket.getKey())); + + Map paramMap = core.getParamMap(); + paramMap.put(StatusNotifyParaEnum.CODE.para(), StatusNotifyParaEnum.CODE.value()); + paramMap.put(StatusNotifyParaEnum.FROM_USERNAME.para(), core.getUserName()); + paramMap.put(StatusNotifyParaEnum.TO_USERNAME.para(), core.getUserName()); + paramMap.put(StatusNotifyParaEnum.CLIENT_MSG_ID.para(), System.currentTimeMillis()); + String paramStr = JSON.toJSONString(paramMap); + + try { + HttpEntity entity = core.getMyHttpClient().doPost(url, paramStr); +// String result = EntityUtils.toString(entity, Consts.UTF_8); +// LOG.info(result); + } catch (Exception e) { + LOG.error("微信状态通知接口失败!", e); + } + + } + + @Override + public void startReceiving() { + core.setAlive(true); + Thread thread = new Thread(core.getThreadGroup(), new Runnable() { + int retryCount = 0; + + @Override + public void run() { + while (core.isAlive()) { + try { + long startTime = System.currentTimeMillis(); + Map resultMap = syncCheck(); + LOG.info(JSONObject.toJSONString(resultMap)); + String retcode = resultMap.get("retcode"); + String selector = resultMap.get("selector"); + RetCodeEnum retCodeEnum = RetCodeEnum.fromCode(retcode); + if (retCodeEnum != null) { + LOG.info(retCodeEnum.getType()); + if (retcode.equals(RetCodeEnum.UNKOWN.getCode())) { + // 防止频繁请求 + Thread.sleep(1000); + continue; + } else if (retcode.equals(RetCodeEnum.SUCCESS.getCode())) { + // 修改最后收到正常报文时间 + core.setLastNormalRetcodeTime(System.currentTimeMillis()); + SelectorEnum selectorEnum = SelectorEnum.fromCode(selector); + if (selectorEnum != null) { + if (selector.equals(SelectorEnum.NORMAL.getCode())) { + continue; + } else if (selector.equals(SelectorEnum.NEW_MSG.getCode())) { + // 有新消息 +// processWebwxSync(); + } else if (selector.equals(SelectorEnum.ENTER_OR_LEAVE_CHAT.getCode())) { +// processWebwxSync(); + } else if (selector.equals(SelectorEnum.MOD_CONTACT.getCode())) { +// processWebwxSync(); + } else if (selector.equals(SelectorEnum.SELECTOR_3.getCode())) { +// processWebwxSync(); +// continue; + } else if (selector.equals(SelectorEnum.ADD_OR_DEL_CONTACT.getCode())) { +// processWebwxSync(); + } else { + LOG.error("UNKNOW SELECTOR CODE {}", selector); + } + } else { + // 防止新类型不处理堆积 +// processWebwxSync(); + } + } else if (retcode.equals(RetCodeEnum.NOT_LOGIN_CHECK.getCode()) || + retcode.equals(RetCodeEnum.TICKET_ERROR.getCode()) || + retcode.equals(RetCodeEnum.PARAM_ERROR.getCode()) || + retcode.equals(RetCodeEnum.NOT_LOGIN_WARN.getCode()) || + retcode.equals(RetCodeEnum.COOKIE_INVALID_ERROR.getCode()) || + retcode.equals(RetCodeEnum.LOGIN_ENV_ERROR.getCode())) { + // 状态异常直接退出 + core.setAlive(false); + break; + } else { + // 防止频繁请求 + Thread.sleep(1000); + break; + } + } else { + LOG.error("特殊retcode: {}", retcode); + } + // 统统尝试获取新消息 + processWebwxSync(); + if (System.currentTimeMillis() - startTime < 1000 * 1) { + Thread.sleep(1000); + } + } catch (InterruptedException e0) { + LOG.error("线程中断"); + core.setAlive(false); + break; + } catch (Exception e) { + LOG.error(e.getMessage()); + retryCount += 1; + if (core.getReceivingRetryCount() < retryCount) { + core.setAlive(false); + } else { + try { + Thread.sleep(1000); + } catch (InterruptedException e1) { + LOG.error(e.getMessage()); + break; + } + } + } + + } + } + }, "REC-" + uniqueKey); + thread.start(); + } + + + private void processWebwxSync() { + JSONObject msgObj = webWxSync(); + if (msgObj != null) { + Integer addMsgCount = msgObj.getInteger("AddMsgCount"); + Integer ModMsgCount = msgObj.getInteger("ModContactCount"); + Integer DelContactCount = msgObj.getInteger("DelContactCount"); + Integer ModChatRoomMemberCount = msgObj.getInteger("ModChatRoomMemberCount"); + + + if (addMsgCount > 0 || ModMsgCount > 0 || DelContactCount > 0 || ModChatRoomMemberCount > 0) { + LOG.info("接收原文:{}", msgObj.toJSONString()); + } + + // 用于通知获取详细详细 + List modUserName = new ArrayList<>(); + + // 处理新消息 + try { + + if (addMsgCount > 0) { + JSONArray msgList = msgObj.getJSONArray("AddMsgList"); + msgList = MsgCenter.produceMsg(msgList, uniqueKey); + for (int j = 0; j < msgList.size(); j++) { + BaseMsg baseMsg = JSON.toJavaObject(msgList.getJSONObject(j), + BaseMsg.class); + // TODO 日志 + LOG.info("处理后对象:{}", JSON.toJSONString(baseMsg)); + core.getMsgList().add(baseMsg); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + + // 处理修改联系人或群成员 + try { + if (ModMsgCount > 0) { + JSONArray list = msgObj.getJSONArray("ModContactList"); + int size = list.size(); + for (int j = 0; j < size; j++) { + String userName = list.getJSONObject(j).getString("UserName"); + if (userName.startsWith("@@")) { + CoreManage.addNewGroup(core, list.getJSONObject(j)); + } else if (userName.startsWith("@")) { + CoreManage.addNewContact(core, list.getJSONObject(j)); + } + modUserName.add(userName); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + + /** + * 没有获取过数据,不知道干啥用 + * DelContactCount: 0 + * DelContactList: [] + * ModChatRoomMemberCount: 0 + * ModChatRoomMemberList: [] + */ + + // 获取详细信息 + WebWxBatchGetContact(modUserName); + + } + + + } + + + @Override + public void webWxGetContact() { + String url = String.format(URLEnum.WEB_WX_GET_CONTACT.getUrl(), + core.getLoginInfo().get(StorageLoginInfoEnum.url.getKey())); + JSONArray member = new JSONArray(); + try { + + // 循环获取seq直到为0,即获取全部好友列表 ==0:好友获取完毕 >0:好友未获取完毕,此时seq为已获取的字节数 + Long seq = 0L; + do { + // 设置seq传参 + List params = new ArrayList<>(); + params.add(new BasicNameValuePair("r", String.valueOf(System.currentTimeMillis()))); + params.add(new BasicNameValuePair("seq", String.valueOf(seq))); + params.add(new BasicNameValuePair("skey", core.getLoginInfo().get(BaseParaEnum.Skey.value()).toString())); + HttpEntity entity = core.getMyHttpClient().doGet(url, params, false, getPersistentCookieMap()); + + String result = EntityUtils.toString(entity, Consts.UTF_8); + JSONObject fullFriendsJsonList = JSON.parseObject(result); + + if (fullFriendsJsonList.get("Seq") != null) { + seq = fullFriendsJsonList.getLong("Seq"); + } + + // 累加好友列表 + member.addAll(fullFriendsJsonList.getJSONArray(StorageLoginInfoEnum.MemberList.getKey())); + } while (seq > 0); + Iterator iterator = member.iterator(); + while (iterator.hasNext()) { + /** + * @see Member + */ + JSONObject o = (JSONObject) iterator.next(); + + String userName = o.getString("UserName"); + + if (StringUtils.isEmpty(userName)) { + LOG.error("{} 好友列表存在UserName空", core.getUniqueKey()); + continue; + } + /** + * 自己信息不添加 + */ + if (userName.equals(core.getUserName())) { + continue; + } + + /** + * 开头@@ => 群聊 + * 开头@ => VerifyFlag -> == 0 好友 + * -> != 0 公众号、服务号 + * 不含@开头(其他) => 特殊账号 + */ + + if (userName.startsWith("@@")) { + // 群聊 + CoreManage.addNewGroup(core, o); + + } else if (userName.startsWith("@")) { + Integer verifyFlag = o.getInteger("VerifyFlag"); + if (verifyFlag != null && verifyFlag == 0) { + // 好友 + CoreManage.addNewContact(core, o); + } else { + // 公众号 + core.getPublicUsersList().add(o); + } + } else { + // 特殊账号 + core.getSpecialUsersList().add(o); + } + } + } catch (Exception e) { + LOG.error(e.getMessage(), e); + } + return; + } + + /** + * 获取群和好友详细信息 + * 首次加载用 + */ + @Override + public void WebWxBatchGetContact() { + + Map paramMap = core.getParamMap(); + // 处理群成员信息 + int size = core.getGroupList().size(); + List> list = new ArrayList<>(); + for (int i = 0; i < size; i++) { + HashMap map = new HashMap<>(4); + map.put("UserName", core.getGroupList().get(i).getString("UserName")); + map.put("EncryChatRoomId", ""); + list.add(map); + } + // 处理玩家 + int sizeUser = core.getContactList().size(); + for (int i = 0; i < sizeUser; i++) { + HashMap map = new HashMap<>(4); + map.put("UserName", core.getContactList().get(i).getString("UserName")); + map.put("EncryChatRoomId", ""); + list.add(map); + } + + WebWxBatchGetContactMain(paramMap, list); + } + + /** + * 获取群和好友详细信息 + * 过程中零散查询 + */ + public void WebWxBatchGetContact(List userNameList) { + + if (CollectionUtil.isEmpty(userNameList)) { + return; + } + + String url = String.format(URLEnum.WEB_WX_BATCH_GET_CONTACT.getUrl(), + core.getLoginInfo().get(StorageLoginInfoEnum.url.getKey()), System.currentTimeMillis(), + core.getLoginInfo().get(StorageLoginInfoEnum.pass_ticket.getKey())); + Map paramMap = core.getParamMap(); + // 为了获取群成员信息 + List> list = new ArrayList<>(); + int size = userNameList.size(); + for (int i = 0; i < size; i++) { + HashMap map = new HashMap<>(4); + map.put("UserName", userNameList.get(i)); + map.put("EncryChatRoomId", ""); + list.add(map); + } + WebWxBatchGetContactMain(paramMap, list); + } + + private void WebWxBatchGetContactMain(Map paramMap, List> list) { + + String url = String.format(URLEnum.WEB_WX_BATCH_GET_CONTACT.getUrl(), + core.getLoginInfo().get(StorageLoginInfoEnum.url.getKey()), System.currentTimeMillis(), + core.getLoginInfo().get(StorageLoginInfoEnum.pass_ticket.getKey())); + + int totalSize = list.size(); + + int batchSize = 50; + int num = totalSize / batchSize; + if (totalSize % batchSize > 0) { + num += 1; + } + + for (int i = 0; i < num; i++) { + int startNum = i * batchSize; + int endNum = (i + 1) * batchSize; + if (endNum > totalSize) { + endNum = totalSize; + } + paramMap.put("Count", endNum - startNum); + paramMap.put("List", list.subList(startNum, endNum)); + HttpEntity entity = core.getMyHttpClient().doPost(url, JSON.toJSONString(paramMap), getPersistentCookieMap()); + try { + String text = EntityUtils.toString(entity, Consts.UTF_8); + JSONObject obj = JSON.parseObject(text); + JSONArray contactList = obj.getJSONArray("ContactList"); + int contactSize = contactList.size(); + if (contactSize > 0) { + for (int j = 0; j < contactSize; j++) { + String userName = contactList.getJSONObject(j).getString("UserName"); + if (userName.startsWith("@@")) { + CoreManage.addNewGroup(core, contactList.getJSONObject(j)); + } else if (userName.startsWith("@")) { + CoreManage.addNewContact(core, contactList.getJSONObject(j)); + } + } + } + } catch (Exception e) { + LOG.info(e.getMessage()); + } + } + } + + + /** + * 检查登陆状态 + * + * @param result + * @return + */ + public String checklogin(String result) { + String regEx = "window.code=(\\d+)"; + Matcher matcher = CommonTools.getMatcher(regEx, result); + if (matcher.find()) { + return matcher.group(1); + } + return null; + } + + /** + * 处理登陆信息 + * + * @param loginContent + * @author https://github.com/yaphone + * @date 2017年4月9日 下午12:16:26 + */ + private boolean processLoginInfo(String loginContent) { + String regEx = "window.redirect_uri=\"(\\S+)\";"; + Matcher matcher = CommonTools.getMatcher(regEx, loginContent); + if (matcher.find()) { + String originalUrl = matcher.group(1); + String url = originalUrl.substring(0, originalUrl.lastIndexOf('/')); + core.getLoginInfo().put("url", url); + Map> possibleUrlMap = this.getPossibleUrlMap(); + Iterator>> iterator = possibleUrlMap.entrySet().iterator(); + Entry> entry; + String fileUrl; + String syncUrl; + while (iterator.hasNext()) { + entry = iterator.next(); + String indexUrl = entry.getKey(); + fileUrl = "https://" + entry.getValue().get(0) + "/cgi-bin/mmwebwx-bin"; + syncUrl = "https://" + entry.getValue().get(1) + "/cgi-bin/mmwebwx-bin"; + if (core.getLoginInfo().get("url").toString().contains(indexUrl)) { + core.setIndexUrl(indexUrl); + core.getLoginInfo().put("fileUrl", fileUrl); + core.getLoginInfo().put("syncUrl", syncUrl); + break; + } + } + if (core.getLoginInfo().get("fileUrl") == null && core.getLoginInfo().get("syncUrl") == null) { + core.getLoginInfo().put("fileUrl", url); + core.getLoginInfo().put("syncUrl", url); + } + core.getLoginInfo().put("deviceid", "e" + String.valueOf(new Random().nextLong()).substring(1, 16)); // 生成15位随机数 + core.getLoginInfo().put("BaseRequest", new ArrayList()); + String text = ""; + + try { + Map header = new HashMap<>(); + header.put("client-version", "2.0.0"); + header.put("extspam", "Go8FCIkFEokFCggwMDAwMDAwMRAGGvAESySibk50w5Wb3uTl2c2h64jVVrV7gNs06GFlWplHQbY/5FfiO++1yH4ykCyNPWKXmco+wfQzK5R98D3so7rJ5LmGFvBLjGceleySrc3SOf2Pc1gVehzJgODeS0lDL3/I/0S2SSE98YgKleq6Uqx6ndTy9yaL9qFxJL7eiA/R3SEfTaW1SBoSITIu+EEkXff+Pv8NHOk7N57rcGk1w0ZzRrQDkXTOXFN2iHYIzAAZPIOY45Lsh+A4slpgnDiaOvRtlQYCt97nmPLuTipOJ8Qc5pM7ZsOsAPPrCQL7nK0I7aPrFDF0q4ziUUKettzW8MrAaiVfmbD1/VkmLNVqqZVvBCtRblXb5FHmtS8FxnqCzYP4WFvz3T0TcrOqwLX1M/DQvcHaGGw0B0y4bZMs7lVScGBFxMj3vbFi2SRKbKhaitxHfYHAOAa0X7/MSS0RNAjdwoyGHeOepXOKY+h3iHeqCvgOH6LOifdHf/1aaZNwSkGotYnYScW8Yx63LnSwba7+hESrtPa/huRmB9KWvMCKbDThL/nne14hnL277EDCSocPu3rOSYjuB9gKSOdVmWsj9Dxb/iZIe+S6AiG29Esm+/eUacSba0k8wn5HhHg9d4tIcixrxveflc8vi2/wNQGVFNsGO6tB5WF0xf/plngOvQ1/ivGV/C1Qpdhzznh0ExAVJ6dwzNg7qIEBaw+BzTJTUuRcPk92Sn6QDn2Pu3mpONaEumacjW4w6ipPnPw+g2TfywJjeEcpSZaP4Q3YV5HG8D6UjWA4GSkBKculWpdCMadx0usMomsSS/74QgpYqcPkmamB4nVv1JxczYITIqItIKjD35IGKAUwAA=="); + originalUrl = originalUrl + "&fun=new&version=v2&mod=desktop&lang=zh_CN"; + HttpEntity entity = core.getMyHttpClient().doGet(originalUrl, null, false, header); + text = EntityUtils.toString(entity); + } catch (Exception e) { + LOG.info(e.getMessage()); + return false; + } + //add by 默非默 2017-08-01 22:28:09 + //如果登录被禁止时,则登录返回的message内容不为空,下面代码则判断登录内容是否为空,不为空则退出程序 + String msg = getLoginMessage(text); + if (!"".equals(msg)) { + LOG.info(msg); +// System.exit(0); + return false; + } + Document doc = CommonTools.xmlParser(text); + if (doc != null) { + core.getLoginInfo().put(StorageLoginInfoEnum.skey.getKey(), + doc.getElementsByTagName(StorageLoginInfoEnum.skey.getKey()).item(0).getFirstChild() + .getNodeValue()); + core.getLoginInfo().put(StorageLoginInfoEnum.wxsid.getKey(), + doc.getElementsByTagName(StorageLoginInfoEnum.wxsid.getKey()).item(0).getFirstChild() + .getNodeValue()); + core.getLoginInfo().put(StorageLoginInfoEnum.wxuin.getKey(), + doc.getElementsByTagName(StorageLoginInfoEnum.wxuin.getKey()).item(0).getFirstChild() + .getNodeValue()); + core.getLoginInfo().put(StorageLoginInfoEnum.pass_ticket.getKey(), + doc.getElementsByTagName(StorageLoginInfoEnum.pass_ticket.getKey()).item(0).getFirstChild() + .getNodeValue()); + } + + } + return true; + } + + private Map> getPossibleUrlMap() { + Map> possibleUrlMap = new HashMap>(); + possibleUrlMap.put("wx.qq.com", new ArrayList() { + /** + * + */ + private static final long serialVersionUID = 1L; + + { + add("file.wx.qq.com"); + add("webpush.wx.qq.com"); + } + }); + + possibleUrlMap.put("wx2.qq.com", new ArrayList() { + /** + * + */ + private static final long serialVersionUID = 1L; + + { + add("file.wx2.qq.com"); + add("webpush.wx2.qq.com"); + } + }); + possibleUrlMap.put("wx8.qq.com", new ArrayList() { + /** + * + */ + private static final long serialVersionUID = 1L; + + { + add("file.wx8.qq.com"); + add("webpush.wx8.qq.com"); + } + }); + + possibleUrlMap.put("web2.wechat.com", new ArrayList() { + /** + * + */ + private static final long serialVersionUID = 1L; + + { + add("file.web2.wechat.com"); + add("webpush.web2.wechat.com"); + } + }); + possibleUrlMap.put("wechat.com", new ArrayList() { + /** + * + */ + private static final long serialVersionUID = 1L; + + { + add("file.web.wechat.com"); + add("webpush.web.wechat.com"); + } + }); + return possibleUrlMap; + } + + /** + * 同步消息 sync the messages + * + * @return + * @author https://github.com/yaphone + * @date 2017年5月12日 上午12:24:55 + */ + private JSONObject webWxSync() { + JSONObject result = null; + String url = String.format(URLEnum.WEB_WX_SYNC_URL.getUrl(), + core.getLoginInfo().get(StorageLoginInfoEnum.url.getKey()), + core.getLoginInfo().get(StorageLoginInfoEnum.wxsid.getKey()), + core.getLoginInfo().get(StorageLoginInfoEnum.skey.getKey()), + core.getLoginInfo().get(StorageLoginInfoEnum.pass_ticket.getKey())); + Map paramMap = core.getParamMap(); + paramMap.put(StorageLoginInfoEnum.SyncKey.getKey(), + core.getLoginInfo().get(StorageLoginInfoEnum.SyncKey.getKey())); + paramMap.put("rr", -System.currentTimeMillis() / 1000); + String paramStr = JSON.toJSONString(paramMap); + try { + HttpEntity entity = core.getMyHttpClient().doPost(url, paramStr, getPersistentCookieMap()); + String text = EntityUtils.toString(entity, Consts.UTF_8); + JSONObject obj = JSON.parseObject(text); + if (obj.getJSONObject("BaseResponse").getInteger("Ret") != 0) { + result = null; + } else { + result = obj; + core.getLoginInfo().put(StorageLoginInfoEnum.SyncKey.getKey(), obj.getJSONObject("SyncCheckKey")); + JSONArray syncArray = obj.getJSONObject(StorageLoginInfoEnum.SyncKey.getKey()).getJSONArray("List"); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < syncArray.size(); i++) { + sb.append(syncArray.getJSONObject(i).getString("Key") + "_" + + syncArray.getJSONObject(i).getString("Val") + "|"); + } + String synckey = sb.toString(); + /** + * 随着每次获取最新消息(参见9)后的返回值更新,其目的在于每次同步消息后记录一个当前同步的状态 + */ + core.getLoginInfo().put(StorageLoginInfoEnum.synckey.getKey(), + synckey.substring(0, synckey.length() - 1));// 1_656161336|2_656161626|3_656161313|11_656159955|13_656120033|201_1492273724|1000_1492265953|1001_1492250432|1004_1491805192 + } + } catch (Exception e) { + LOG.info(e.getMessage()); + } + return result; + + } + + /** + * 检查是否有新消息 check whether there's a message + * + * @return + * @author https://github.com/yaphone + * @date 2017年4月16日 上午11:11:34 + */ + private Map syncCheck() { + Map resultMap = new HashMap(); + // 组装请求URL和参数 + String url = core.getLoginInfo().get(StorageLoginInfoEnum.syncUrl.getKey()) + URLEnum.SYNC_CHECK_URL.getUrl(); + List params = new ArrayList(); + for (BaseParaEnum baseRequest : BaseParaEnum.values()) { + params.add(new BasicNameValuePair(baseRequest.para().toLowerCase(), + core.getLoginInfo().get(baseRequest.value()).toString())); + } + params.add(new BasicNameValuePair("r", String.valueOf(System.currentTimeMillis()))); + params.add(new BasicNameValuePair("synckey", (String) core.getLoginInfo().get("synckey"))); + params.add(new BasicNameValuePair("_", String.valueOf(System.currentTimeMillis()))); + try { + HttpEntity entity = core.getMyHttpClient().doGet(url, params, true, getPersistentCookieMap()); + if (entity == null) { + resultMap.put("retcode", "9999"); + resultMap.put("selector", "9999"); + return resultMap; + } + String text = EntityUtils.toString(entity); + String regEx = "window.synccheck=\\{retcode:\"(\\d+)\",selector:\"(\\d+)\"\\}"; + Matcher matcher = CommonTools.getMatcher(regEx, text); + if (!matcher.find() || matcher.group(1).equals("2")) { + LOG.info(String.format("Unexpected sync check result: %s", text)); + } else { + resultMap.put("retcode", matcher.group(1)); + resultMap.put("selector", matcher.group(2)); + } + } catch (Exception e) { + e.printStackTrace(); + } + return resultMap; + } + + private Map getPersistentCookieMap() { + /** + * 以下部分确保cookie存在header中,重启时需要强制手动添加, + * TODO 不强制加重启会cookie失效,还不确定问题 + */ + String cookieStr = null; + if (core != null && core.getMyHttpClient() != null && core.getMyHttpClient().getCookieStore() != null) { + List cookies = core.getMyHttpClient().getCookieStore().getCookies(); + StringBuilder sb = new StringBuilder(); + if (CollectionUtil.isNotEmpty(cookies)) { + for (Cookie ck : cookies) { + sb.append(ck.getName()).append('=').append(ck.getValue()).append(';'); + } + cookieStr = sb.toString().substring(0, sb.toString().length() - 1); + } + + } + Map headerMap = null; + if (cookieStr != null) { + headerMap = new HashMap<>(6); + headerMap.put("Cookie", cookieStr); + } + /* ^-----------------------------------------------^ */ + return headerMap; + } + + /** + * 解析登录返回的消息,如果成功登录,则message为空 + * + * @param result + * @return + */ + public String getLoginMessage(String result) { + String[] strArr = result.split(""); + String[] rs = strArr[1].split(""); + if (rs != null && rs.length > 1) { + return rs[0]; + } + return ""; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/Config.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/Config.java new file mode 100644 index 0000000..e604d0c --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/Config.java @@ -0,0 +1,78 @@ +package org.aibidding.common.wechat.itchat4j.utils; + +import org.aibidding.common.wechat.itchat4j.utils.enums.OsNameEnum; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; + +/** + * 配置信息 + * + * @author https://github.com/yaphone + * @date 创建时间:2017年4月23日 下午2:26:21 + * @version 1.0 + * + */ +public class Config { + + public static final String API_WXAPPID = "API_WXAPPID"; + + public static final String picDir = "D://org.aibidding.common.wechat"; + public static final String VERSION = "1.2.18"; + public static final String BASE_URL = "https://login.weixin.qq.com"; + public static final String OS = ""; + public static final String DIR = ""; + public static final String DEFAULT_QR = "QR.jpg"; + public static final String USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36"; + + /** + * 仅仅用于参考 + */ + @Deprecated + public static final ArrayList API_SPECIAL_USER = new ArrayList(Arrays.asList("filehelper", "weibo", + "qqmail", "fmessage", "tmessage", "qmessage", "qqsync", "floatbottle", "lbsapp", "shakeapp", "medianote", + "qqfriend", "readerapp", "blogapp", "facebookapp", "masssendapp", "meishiapp", "feedsapp", "voip", + "blogappweixin", "brandsessionholder", "weixin", "weixinreminder", "officialaccounts", "wxitil", + "notification_messages", "wxid_novlwrv3lqwv11", "gh_22b87fa7cb3c", "userexperience_alarm")); + + /** + * 获取文件目录 + * + * @author https://github.com/yaphone + * @date 2017年4月8日 下午10:27:42 + * @return + */ + public static String getLocalPath() { + String localPath = null; + try { + localPath = new File("").getCanonicalPath(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return localPath; + } + + /** + * 获取系统平台 + * + * @author https://github.com/yaphone + * @date 2017年4月8日 下午10:27:53 + */ + public static OsNameEnum getOsNameEnum() { + String os = System.getProperty("os.name").toUpperCase(); + if (os.indexOf(OsNameEnum.DARWIN.toString()) >= 0) { + return OsNameEnum.DARWIN; + } else if (os.indexOf(OsNameEnum.WINDOWS.toString()) >= 0) { + return OsNameEnum.WINDOWS; + } else if (os.indexOf(OsNameEnum.LINUX.toString()) >= 0) { + return OsNameEnum.LINUX; + } else if (os.indexOf(OsNameEnum.MAC.toString()) >= 0) { + return OsNameEnum.MAC; + } + return OsNameEnum.OTHER; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/ConstantConfigEnum.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/ConstantConfigEnum.java new file mode 100644 index 0000000..04a1076 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/ConstantConfigEnum.java @@ -0,0 +1,34 @@ +package org.aibidding.common.wechat.itchat4j.utils; + +/** + * 常量 + * + * @author https=//github.com/yaphone + * @date 创建时间:2017年5月5日 下午11=29=04 + * @version 1.0 + * + */ +public class ConstantConfigEnum { + public static final int APPMSGTYPE_TEXT = 1; + public static final int APPMSGTYPE_IMG = 2; + public static final int APPMSGTYPE_AUDIO = 3; + public static final int APPMSGTYPE_VIDEO = 4; + public static final int APPMSGTYPE_URL = 5; + public static final int APPMSGTYPE_ATTACH = 6; + public static final int APPMSGTYPE_OPEN = 7; + public static final int APPMSGTYPE_EMOJI = 8; + public static final int APPMSGTYPE_VOICE_REMIND = 9; + public static final int APPMSGTYPE_SCAN_GOOD = 10; + public static final int APPMSGTYPE_GOOD = 13; + public static final int APPMSGTYPE_EMOTION = 15; + public static final int APPMSGTYPE_CARD_TICKET = 16; + public static final int APPMSGTYPE_REALTIME_SHARE_LOCATION = 17; + // public static final int APPMSGTYPE_TRANSFERS = 2e3; + public static final int APPMSGTYPE_RED_ENVELOPES = 2001; + public static final int APPMSGTYPE_READER_TYPE = 100001; + public static final int UPLOAD_MEDIA_TYPE_IMAGE = 1; + public static final int UPLOAD_MEDIA_TYPE_VIDEO = 2; + public static final int UPLOAD_MEDIA_TYPE_AUDIO = 3; + public static final int UPLOAD_MEDIA_TYPE_ATTACHMENT = 4; + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/LogInterface.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/LogInterface.java new file mode 100644 index 0000000..b164798 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/LogInterface.java @@ -0,0 +1,13 @@ +package org.aibidding.common.wechat.itchat4j.utils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 公共日志接口 + * @author WesleyOne + * @create 2018/12/12 + */ +public interface LogInterface { + public final Logger LOG = LoggerFactory.getLogger("WXROBLOG"); +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/MoreConfig.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/MoreConfig.java new file mode 100644 index 0000000..876b53b --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/MoreConfig.java @@ -0,0 +1,12 @@ +package org.aibidding.common.wechat.itchat4j.utils; + +/** + * @author WesleyOne + * @create 2018/12/19 + */ +public class MoreConfig { + + //存储群聊成员ID的键标识 + public static final String SEND_MEMBER_ID = "sendMemberId"; + public static final String SEND_MEMBER_NICKNAMW = "memberNickname"; +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/SleepUtils.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/SleepUtils.java new file mode 100644 index 0000000..ca73d27 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/SleepUtils.java @@ -0,0 +1,20 @@ +package org.aibidding.common.wechat.itchat4j.utils; + +/** + * Created by xiaoxiaomo on 2017/5/6. + */ +public class SleepUtils { + + /** + * 毫秒为单位 + * @param time + */ + public static void sleep( long time ){ + try { + Thread.sleep( time ); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/MsgCodeEnum.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/MsgCodeEnum.java new file mode 100644 index 0000000..ff2cbf0 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/MsgCodeEnum.java @@ -0,0 +1,64 @@ +package org.aibidding.common.wechat.itchat4j.utils.enums; + +import java.util.EnumSet; +import java.util.HashMap; +import java.util.Map; + +/** + * 消息类型 + * + * @author https://github.com/yaphone + * @date 创建时间:2017年4月23日 下午12:15:00 + * @version 1.0 + * + */ +public enum MsgCodeEnum { + + MSGTYPE_TEXT(1, "文本消息"), + MSGTYPE_IMAGE(3, "图片消息"), + MSGTYPE_VOICE(34, "语音消息"), + MSGTYPE_VERIFYMSG(37, "好友请求"), + MSGTYPE_POSSIBLEFRIEND_MSG(40, "POSSIBLEFRIEND_MSG"), + MSGTYPE_SHARECARD(42, "分享名片"), + MSGTYPE_VIDEO(43, "视频消息"), + MSGTYPE_EMOTICON(47, "表情消息"), + MSGTYPE_LOCATION(48, "位置消息"), + MSGTYPE_MEDIA(49, "分享链接"), + MSGTYPE_VOIPMSG(50, "VOIPMSG"), + MSGTYPE_STATUSNOTIFY(51, "状态通知"), + MSGTYPE_VOIPNOTIFY(52, "VOIPNOTIFY"), + MSGTYPE_VOIPINVITE(53, "VOIPINVITE"), + MSGTYPE_MICROVIDEO(62, "短视频消息"), + MSGTYPE_SYSNOTICE(9999, "SYSNOTICE"), + MSGTYPE_SYS(10000, "系统消息"), + MSGTYPE_RECALLED(10002, "撤回消息") + + ; + + private static final Map lookup = new HashMap<>(); + static { + for (MsgCodeEnum s : EnumSet.allOf(MsgCodeEnum.class)){ + lookup.put(s.getCode(), s); + } + } + public static MsgCodeEnum fromCode(int code) { + return lookup.get(code); + } + + private int code; + private String type; + + MsgCodeEnum(int code, String type) { + this.code = code; + this.type = type; + } + + public int getCode() { + return code; + } + + public String getType() { + return type; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/MsgTypeEnum.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/MsgTypeEnum.java new file mode 100644 index 0000000..e5ac4f1 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/MsgTypeEnum.java @@ -0,0 +1,41 @@ +package org.aibidding.common.wechat.itchat4j.utils.enums; + + +/** + * 消息类型枚举类 + * + * @author https://github.com/yaphone + * @date 创建时间:2017年5月13日 下午11:53:00 + * @version 1.0 + * + */ +public enum MsgTypeEnum { + TEXT("Text", "文本消息"), + MAP("MAP", "地理位置"), + PIC("Pic", "图片消息"), + VOICE("Voice", "语音消息"), + VIEDO("Viedo", "小视频消息"), + NAMECARD("NameCard", "名片消息"), + SYS("Sys", "系统消息"), + VERIFYMSG("VerifyMsg", "添加好友"), + + // 地址分享 + MEDIA("app", "文件消息"); + + private String type; + private String code; + + MsgTypeEnum(String type, String code) { + this.type = type; + this.code = code; + } + + public String getType() { + return type; + } + + public String getCode() { + return code; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/OsNameEnum.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/OsNameEnum.java new file mode 100644 index 0000000..3dcd2ec --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/OsNameEnum.java @@ -0,0 +1,13 @@ +package org.aibidding.common.wechat.itchat4j.utils.enums; + +/** + * 系统平台 + * + * @author https://github.com/yaphone + * @date 创建时间:2017年4月8日 下午10:36:28 + * @version 1.0 + * + */ +public enum OsNameEnum { + WINDOWS, LINUX, DARWIN, MAC, OTHER +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/ResultEnum.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/ResultEnum.java new file mode 100644 index 0000000..0aa5300 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/ResultEnum.java @@ -0,0 +1,25 @@ +package org.aibidding.common.wechat.itchat4j.utils.enums; + +import lombok.Getter; + +/** + * 返回结构枚举类 + *

+ * Created by xiaoxiaomo on 2017/5/6. + */ +@Getter +public enum ResultEnum { + + SUCCESS("200", "成功"), + WAIT_CONFIRM("201", "请在手机上点击确认"), + WAIT_SCAN("400", "请扫描二维码"); + + + private final String code; + private final String msg; + + ResultEnum(String code, String msg) { + this.code = code; + this.msg = msg; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/RetCodeEnum.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/RetCodeEnum.java new file mode 100644 index 0000000..672d86b --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/RetCodeEnum.java @@ -0,0 +1,49 @@ +package org.aibidding.common.wechat.itchat4j.utils.enums; + +import java.util.EnumSet; +import java.util.HashMap; +import java.util.Map; + + +public enum RetCodeEnum { + + UNKOWN("9999", "未知"), + SUCCESS("0", "成功"), + TICKET_ERROR("-14", "ticket错误"), + PARAM_ERROR("1", "传入参数错误"), + NOT_LOGIN_WARN("1100", "未登录提示"), + NOT_LOGIN_CHECK("1101", "未检测到登录"), + COOKIE_INVALID_ERROR("1102", "cookie值无效"), + LOGIN_ENV_ERROR("1203", "当前登录环境异常,为了安全起见请不要在web端进行登录"), + TOO_OFEN("1205", "操作频繁") + ; + + private static final Map lookup = new HashMap(); + static { + for (RetCodeEnum s : EnumSet.allOf(RetCodeEnum.class)){ + lookup.put(s.getCode(), s); + } + } + public static RetCodeEnum fromCode(String code) { + return lookup.get(code); + } + + private String code; + private String type; + + RetCodeEnum(String code, String type) { + this.code = code; + this.type = type; + } + + public String getCode() { + return code; + } + + public String getType() { + return type; + } + + + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/SelectorEnum.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/SelectorEnum.java new file mode 100644 index 0000000..587aa63 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/SelectorEnum.java @@ -0,0 +1,48 @@ +package org.aibidding.common.wechat.itchat4j.utils.enums; + + +import java.util.EnumSet; +import java.util.HashMap; +import java.util.Map; + +/** + * @author WesleyOne + * @create 2018/12/21 + */ +public enum SelectorEnum { + + + UNKOWN("9999", "未知"), + NORMAL("0", "正常"), + NEW_MSG("2", "有新消息"), + SELECTOR_3("3", "访问频繁#"), + MOD_CONTACT("4", "有人修改了自己的昵称或你修改了别人的备注"), + ADD_OR_DEL_CONTACT("6", "存在删除或者新增的好友信息"), + ENTER_OR_LEAVE_CHAT("7", "进入或离开聊天界面"); + + private static final Map lookup = new HashMap<>(); + static { + for (SelectorEnum s : EnumSet.allOf(SelectorEnum.class)) { + lookup.put(s.getCode(), s); + } + } + public static SelectorEnum fromCode(String code) { + return lookup.get(code); + } + + private String code; + private String type; + + SelectorEnum(String code, String type) { + this.code = code; + this.type = type; + } + + public String getCode() { + return code; + } + + public String getType() { + return type; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/SendMsgType.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/SendMsgType.java new file mode 100644 index 0000000..55e566e --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/SendMsgType.java @@ -0,0 +1,65 @@ +package org.aibidding.common.wechat.itchat4j.utils.enums; + +import com.jfinal.plugin.activerecord.Record; + +import java.util.*; +/** + * 发送类型 + * @author WesleyOne + * @create 2018/12/14 + */ +public enum SendMsgType { + + IMG("IMG","图片"), + FILE("FILE","文件"), + TEXT("TEXT","纯文本") + ; + + private String value; + private String name; + + SendMsgType(String value, String name) { + this.value = value; + this.name = name; + } + + + private static final Map lookup = new HashMap<>(); + public static List LIST_KV = new ArrayList<>(); + static { + for (SendMsgType s : EnumSet.allOf(SendMsgType.class)){ + lookup.put(s.toValue(), s); + LIST_KV.add(new Record().set("v",s.toValue()).set("n",s.toName())); + } + } + + + /** + * 获取枚举的值(整数值、字符串值等) + * @return + */ + public String toValue() { + return this.value; + } + + public String toName() { + return this.name; + } + + + /** + * 根据值(整数值、字符串值等)获取相应的枚举类型 + * @param value + * @return + */ + public static SendMsgType fromValue(String value) { + return lookup.get(value); + } + + public boolean equal(SendMsgType type){ + if (type != null && this.toValue().equals(type.toValue())){ + return true; + } + return false; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/StorageLoginInfoEnum.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/StorageLoginInfoEnum.java new file mode 100644 index 0000000..20e734a --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/StorageLoginInfoEnum.java @@ -0,0 +1,57 @@ +package org.aibidding.common.wechat.itchat4j.utils.enums; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +/** + * Created by xiaoxiaomo on 2017/5/7. + */ +public enum StorageLoginInfoEnum { + + //URL + url("url",new String()), + fileUrl("fileUrl",new String()), + syncUrl("syncUrl",new String()), + //生成15位随机数 + deviceid("deviceid",new String()), + + //baseRequest + skey("skey",new String()), + wxsid("wxsid",new String()), + wxuin("wxuin",new String()), + pass_ticket("pass_ticket",new String()), + + + InviteStartCount("InviteStartCount",new Integer(0)), + // 登录用户登录时信息 + User("User",new JSONObject()), + SyncKey("SyncKey",new JSONObject()), + synckey("synckey",new String()), + + + + MemberCount("MemberCount",new String()), + MemberList("MemberList",new JSONArray()), + + + + ; + + private String key; + private Object type; + + StorageLoginInfoEnum(String key, Object type) { + this.key = key; + this.type = type; + } + + public String getKey() { + return key; + } + + + public Object getType() { + return type; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/URLEnum.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/URLEnum.java new file mode 100644 index 0000000..18e28e1 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/URLEnum.java @@ -0,0 +1,49 @@ +package org.aibidding.common.wechat.itchat4j.utils.enums; + +/** + * URL + * Created by xiaoxiaomo on 2017/5/6. + */ +public enum URLEnum { + + + + BASE_URL("https://login.weixin.qq.com","基本的URL"), + UUID_URL(BASE_URL.url+"/jslogin","UUIDLURL"), + QRCODE_URL(BASE_URL.url+"/qrcode/","初始化URL"), + STATUS_NOTIFY_URL(BASE_URL.url+"/webwxstatusnotify?lang=zh_CN&pass_ticket=%s","微信状态通知"), + LOGIN_URL(BASE_URL.url+"/cgi-bin/mmwebwx-bin/login","登陆URL"), + INIT_URL("%s/webwxinit?r=%s&pass_ticket=%s","初始化URL"), + SYNC_CHECK_URL("/synccheck","检查心跳URL"), + WEB_WX_SYNC_URL("%s/webwxsync?sid=%s&skey=%s&pass_ticket=%s&lang=zh_CN","web微信消息同步URL"), + WEB_WX_GET_CONTACT("%s/webwxgetcontact","web微信获取联系人信息URL"), + WEB_WX_SEND_MSG("%s/webwxsendmsg","发送消息URL"), + WEB_WX_UPLOAD_MEDIA("%s/webwxuploadmedia?f=json", "上传文件到服务器"), + WEB_WX_GET_MSG_IMG("%s/webwxgetmsgimg", "下载图片消息"), + WEB_WX_GET_VOICE("%s/webwxgetvoice", "下载语音消息"), + WEB_WX_GET_VIEDO("%s/webwxgetvideo", "下载语音消息"), + WEB_WX_PUSH_LOGIN("%s/webwxpushloginurl", "不扫码登陆"), + WEB_WX_LOGOUT("%s/webwxlogout", "退出微信"), + WEB_WX_BATCH_GET_CONTACT("%s/webwxbatchgetcontact?type=ex&r=%s&lang=zh_CN&pass_ticket=%s", "查询群信息"), + WEB_WX_REMARKNAME("%s/webwxoplog?lang=zh_CN&pass_ticket=%s", "修改好友备注"), + WEB_WX_VERIFYUSER("%s/webwxverifyuser?r=%s&lang=zh_CN&pass_ticket=%s", "被动添加好友"), + WEB_WX_GET_MEDIA("%s/webwxgetmedia", "下载文件") + + + + + ; + + private String url; + private String msg; + + URLEnum(String url, String msg) { + this.url = url; + this.msg = msg; + } + + + public String getUrl() { + return url; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/VerifyFriendEnum.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/VerifyFriendEnum.java new file mode 100644 index 0000000..d4f50b1 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/VerifyFriendEnum.java @@ -0,0 +1,28 @@ +package org.aibidding.common.wechat.itchat4j.utils.enums; + +/** + * 确认添加好友Enum + * + * @author https://github.com/yaphone + * @date 创建时间:2017年6月29日 下午9:47:14 + * @version 1.0 + * + */ +public enum VerifyFriendEnum { + + ADD(2, "添加"), + ACCEPT(3, "接受"); + + private int code; + private String desc; + + private VerifyFriendEnum(int code, String desc) { + this.code = code; + this.desc = desc; + } + + public int getCode() { + return code; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/parameters/BaseParaEnum.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/parameters/BaseParaEnum.java new file mode 100644 index 0000000..1063563 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/parameters/BaseParaEnum.java @@ -0,0 +1,36 @@ +package org.aibidding.common.wechat.itchat4j.utils.enums.parameters; + +/** + * + * 基本请求参数 + * 1. webWxInit 初始化 + * 2. wxStatusNotify 微信状态通知 + * + *

+ * Created by xiaoxiaomo on 2017/5/7. + */ +public enum BaseParaEnum { + + Uin("Uin", "wxuin"), + Sid("Sid", "wxsid"), + Skey("Skey", "skey"), + DeviceID("DeviceID", "pass_ticket"); + + private String para; + private String value; + + BaseParaEnum(String para, String value) { + this.para = para; + this.value = value; + } + + public String para() { + return para; + } + + + public Object value() { + return value; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/parameters/LoginParaEnum.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/parameters/LoginParaEnum.java new file mode 100644 index 0000000..bd34e7d --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/parameters/LoginParaEnum.java @@ -0,0 +1,31 @@ +package org.aibidding.common.wechat.itchat4j.utils.enums.parameters; + +/** + * 登陆 + *

+ * Created by xiaoxiaomo on 2017/5/7. + */ +public enum LoginParaEnum { + + LOGIN_ICON("loginicon", "true"), + UUID("uuid", ""), + TIP("tip", "0"), + R("r", ""), + _1("_", ""); + + private String para; + private String value; + + LoginParaEnum(String para, String value) { + this.para = para; + this.value = value; + } + + public String para() { + return para; + } + + public String value() { + return value; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/parameters/StatusNotifyParaEnum.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/parameters/StatusNotifyParaEnum.java new file mode 100644 index 0000000..8fc3591 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/parameters/StatusNotifyParaEnum.java @@ -0,0 +1,31 @@ +package org.aibidding.common.wechat.itchat4j.utils.enums.parameters; + +/** + * 状态通知 + *

+ * Created by xiaoxiaomo on 2017/5/7. + */ +public enum StatusNotifyParaEnum { + + CODE("Code", "3"), + FROM_USERNAME("FromUserName", ""), + TO_USERNAME("ToUserName", ""), + //时间戳 + CLIENT_MSG_ID("ClientMsgId", ""); + + private String para; + private String value; + + StatusNotifyParaEnum(String para, String value) { + this.para = para; + this.value = value; + } + + public String para() { + return para; + } + + public String value() { + return value; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/parameters/UUIDParaEnum.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/parameters/UUIDParaEnum.java new file mode 100644 index 0000000..412e11c --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/enums/parameters/UUIDParaEnum.java @@ -0,0 +1,30 @@ +package org.aibidding.common.wechat.itchat4j.utils.enums.parameters; + +/** + * UUID + *

+ * Created by xiaoxiaomo on 2017/5/7. + */ +public enum UUIDParaEnum { + + APP_ID("appid", "wx782c26e4c19acffb"), + FUN("fun", "new"), + LANG("lang", "zh_CN"), + _1("_", "时间戳"); + + private String para; + private String value; + + UUIDParaEnum(String para, String value) { + this.para = para; + this.value = value; + } + + public String para() { + return para; + } + + public String value() { + return value; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/tools/CommonTools.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/tools/CommonTools.java new file mode 100644 index 0000000..5a5a54a --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/tools/CommonTools.java @@ -0,0 +1,301 @@ +package org.aibidding.common.wechat.itchat4j.utils.tools; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.vdurmont.emoji.EmojiParser; +import org.aibidding.common.wechat.itchat4j.utils.Config; +import org.aibidding.common.wechat.itchat4j.utils.enums.OsNameEnum; +import org.w3c.dom.Document; +import org.xml.sax.InputSource; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import java.io.StringReader; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * 常用工具类 + * + * @author https://github.com/yaphone + * @date 创建时间:2017年4月8日 下午10:59:55 + * @version 1.0 + * + */ +public class CommonTools { + + public static boolean printQr(String qrPath) { + + switch (Config.getOsNameEnum()) { + case WINDOWS: + if (Config.getOsNameEnum().equals(OsNameEnum.WINDOWS)) { + Runtime runtime = Runtime.getRuntime(); + try { + runtime.exec("cmd /c start " + qrPath); + } catch (Exception e) { + e.printStackTrace(); + } + } + break; + case MAC: + if (Config.getOsNameEnum().equals(OsNameEnum.MAC)) { + Runtime runtime = Runtime.getRuntime(); + try { + runtime.exec("open " + qrPath); + } catch (Exception e) { + e.printStackTrace(); + } + } + break; + + default: + break; + } + return true; + } + + public static boolean clearScreen() { + switch (Config.getOsNameEnum()) { + case WINDOWS: + if (Config.getOsNameEnum().equals(OsNameEnum.WINDOWS)) { + Runtime runtime = Runtime.getRuntime(); + try { + runtime.exec("cmd /c " + "cls"); + } catch (Exception e) { + e.printStackTrace(); + } + } + break; + + default: + break; + } + return true; + } + + /** + * 正则表达式处理工具 + * + * @author https://github.com/yaphone + * @date 2017年4月9日 上午12:27:10 + * @return + */ + public static Matcher getMatcher(String regEx, String text) { + Pattern pattern = Pattern.compile(regEx); + Matcher matcher = pattern.matcher(text); + return matcher; + } + + /** + * xml解析器 + * + * @author https://github.com/yaphone + * @date 2017年4月9日 下午6:24:25 + * @param text + * @return + */ + public static Document xmlParser(String text) { + Document doc = null; + StringReader sr = new StringReader(text); + InputSource is = new InputSource(sr); + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + try { + DocumentBuilder builder = factory.newDocumentBuilder(); + doc = builder.parse(is); + } catch (Exception e) { + e.printStackTrace(); + } + return doc; + } + + public static JSONObject structFriendInfo(JSONObject userObj) { + Map friendInfoTemplate = new HashMap(); + friendInfoTemplate.put("UserName", ""); + friendInfoTemplate.put("City", ""); + friendInfoTemplate.put("DisplayName", ""); + friendInfoTemplate.put("PYQuanPin", ""); + friendInfoTemplate.put("RemarkPYInitial", ""); + friendInfoTemplate.put("Province", ""); + friendInfoTemplate.put("KeyWord", ""); + friendInfoTemplate.put("RemarkName", ""); + friendInfoTemplate.put("PYInitial", ""); + friendInfoTemplate.put("EncryChatRoomId", ""); + friendInfoTemplate.put("Alias", ""); + friendInfoTemplate.put("Signature", ""); + friendInfoTemplate.put("NickName", ""); + friendInfoTemplate.put("RemarkPYQuanPin", ""); + friendInfoTemplate.put("HeadImgUrl", ""); + + friendInfoTemplate.put("UniFriend", 0); + friendInfoTemplate.put("Sex", 0); + friendInfoTemplate.put("AppAccountFlag", 0); + friendInfoTemplate.put("VerifyFlag", 0); + friendInfoTemplate.put("ChatRoomId", 0); + friendInfoTemplate.put("HideInputBarFlag", 0); + friendInfoTemplate.put("AttrStatus", 0); + friendInfoTemplate.put("SnsFlag", 0); + friendInfoTemplate.put("MemberCount", 0); + friendInfoTemplate.put("OwnerUin", 0); + friendInfoTemplate.put("ContactFlag", 0); + friendInfoTemplate.put("Uin", 0); + friendInfoTemplate.put("StarFriend", 0); + friendInfoTemplate.put("Statues", 0); + + friendInfoTemplate.put("MemberList", new ArrayList()); + + JSONObject r = new JSONObject(); + Set keySet = friendInfoTemplate.keySet(); + for (String key : keySet) { + if (userObj.containsKey(key)) { + r.put(key, userObj.get(key)); + } else { + r.put(key, friendInfoTemplate.get(key)); + } + } + + return r; + } + + public static String getSynckey(JSONObject obj) { + JSONArray obj2 = obj.getJSONArray("List"); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < obj2.size(); i++) { + JSONObject obj3 = (JSONObject) JSON.toJSON(obj2.get(i)); + sb.append(obj3.get("Val") + "|"); + } + return sb.substring(0, sb.length() - 1); // 656159784|656159911|656159873|1491905341 + + } + + public static JSONObject searchDictList(List list, String key, String value) { + JSONObject r = null; + for (JSONObject i : list) { + if (i.getString(key).equals(value)) { + r = i; + break; + } + } + return r; + } + + /** + * 处理emoji表情 + * + * @author https://github.com/yaphone + * @date 2017年4月23日 下午2:39:04 + * @param d + * @param k + */ + public static void emojiFormatter(JSONObject d, String k) { +// Matcher matcher = getMatcher("", d.getString(k)); + Matcher matcher = getMatcher("", d.getString(k)); + StringBuilder sb = new StringBuilder(); + String content = d.getString(k); + int lastStart = 0; + while (matcher.find()) { + String str = matcher.group(1); + if (str.length() == 6) { + + } else if (str.length() == 10) { + + } else { + str = "&#x" + str + ";"; + String tmp = content.substring(lastStart, matcher.start()); + sb.append(tmp + str); + lastStart = matcher.end(); + } + } + if (lastStart < content.length()) { + sb.append(content.substring(lastStart)); + } + if (sb.length() != 0) { + d.put(k, EmojiParser.parseToUnicode(sb.toString())); + } else { + d.put(k, content); + } + + } + + /** + * 转化成alias + * @param d + * @param k + */ + public static void emojiFormatter2(JSONObject d, String k) { + Matcher matcher = getMatcher("", d.getString(k)); + StringBuilder sb = new StringBuilder(); + String content = d.getString(k); + int lastStart = 0; + while (matcher.find()) { + String str = matcher.group(1); + if (str.length() == 6) { + + } else if (str.length() == 10) { + + } else { + str = "&#x" + str + ";"; + String tmp = content.substring(lastStart, matcher.start()); + sb.append(tmp + str); + lastStart = matcher.end(); + } + } + if (lastStart < content.length()) { + sb.append(content.substring(lastStart)); + } + if (sb.length() != 0) { + d.put(k, EmojiParser.parseToAliases(EmojiParser.parseToUnicode(sb.toString()))); + } else { + d.put(k, content); + } + + } + + /** + * 消息格式化 + * + * @author https://github.com/yaphone + * @date 2017年4月23日 下午4:19:08 + * @param d + * @param k + */ + public static void msgFormatter(JSONObject d, String k) { + d.put(k, d.getString(k).replace("
", "\n")); + emojiFormatter(d, k); + // TODO 与emoji表情有部分兼容问题,目前暂未处理解码处理 d.put(k, + // StringEscapeUtils.unescapeHtml4(d.getString(k))); + + } + + public static void main(String[] args) { + String str2 = "三生三世十三水"; + + Matcher matcher = getMatcher("", str2); + StringBuilder sb = new StringBuilder(); + String content = str2; + int lastStart = 0; + while (matcher.find()) { + String str = matcher.group(1); + if (str.length() == 6) { + + } else if (str.length() == 10) { + + } else { + str = "&#x" + str + ";"; + String tmp = content.substring(lastStart, matcher.start()); + sb.append(tmp + str); + lastStart = matcher.end(); + } + } + if (lastStart < content.length()) { + sb.append(content.substring(lastStart)); + } + if (sb.length() != 0) { + System.out.println(EmojiParser.parseToUnicode(sb.toString())); + System.out.println(EmojiParser.parseToAliases(EmojiParser.parseToUnicode(sb.toString()))); + System.out.println(EmojiParser.removeAllEmojis(sb.toString())); + } + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/tools/DownloadTools.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/tools/DownloadTools.java new file mode 100644 index 0000000..c8c5bdc --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/itchat4j/utils/tools/DownloadTools.java @@ -0,0 +1,77 @@ +package org.aibidding.common.wechat.itchat4j.utils.tools; + +import org.apache.http.HttpEntity; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.aibidding.common.wechat.itchat4j.beans.BaseMsg; +import org.aibidding.common.wechat.itchat4j.core.Core; +import org.aibidding.common.wechat.itchat4j.core.CoreManage; +import org.aibidding.common.wechat.itchat4j.utils.LogInterface; +import org.aibidding.common.wechat.itchat4j.utils.enums.MsgTypeEnum; +import org.aibidding.common.wechat.itchat4j.utils.enums.URLEnum; + +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +/** + * 下载工具类 + * + * @author https://github.com/yaphone + * @date 创建时间:2017年4月21日 下午11:18:46 + * @version 1.0 + * + */ +public class DownloadTools implements LogInterface { + private static Logger logger = Logger.getLogger("UTILLOG"); + + /** + * 处理下载任务 + * + * @author https://github.com/yaphone + * @date 2017年4月21日 下午11:00:25 + * @param msg + * @param type + * @param path + * @return + */ + public static Object getDownloadFn(BaseMsg msg, String type, String path, String uniqueKey) { + Core core = CoreManage.getInstance(uniqueKey); + Map headerMap = new HashMap(); + List params = new ArrayList(); + String url = ""; + if (type.equals(MsgTypeEnum.PIC.getType())) { + url = String.format(URLEnum.WEB_WX_GET_MSG_IMG.getUrl(), (String) core.getLoginInfo().get("url")); + } else if (type.equals(MsgTypeEnum.VOICE.getType())) { + url = String.format(URLEnum.WEB_WX_GET_VOICE.getUrl(), (String) core.getLoginInfo().get("url")); + } else if (type.equals(MsgTypeEnum.VIEDO.getType())) { + headerMap.put("Range", "bytes=0-"); + url = String.format(URLEnum.WEB_WX_GET_VIEDO.getUrl(), (String) core.getLoginInfo().get("url")); + } else if (type.equals(MsgTypeEnum.MEDIA.getType())) { + headerMap.put("Range", "bytes=0-"); + url = String.format(URLEnum.WEB_WX_GET_MEDIA.getUrl(), (String) core.getLoginInfo().get("fileUrl")); + params.add(new BasicNameValuePair("sender", msg.getFromUserName())); + params.add(new BasicNameValuePair("mediaid", msg.getMediaId())); + params.add(new BasicNameValuePair("filename", msg.getFileName())); + } + params.add(new BasicNameValuePair("msgid", msg.getNewMsgId())); + params.add(new BasicNameValuePair("skey", (String) core.getLoginInfo().get("skey"))); + HttpEntity entity = core.getMyHttpClient().doGet(url, params, true, headerMap); + try { + OutputStream out = new FileOutputStream(path); + byte[] bytes = EntityUtils.toByteArray(entity); + out.write(bytes); + out.flush(); + out.close(); + } catch (Exception e) { + logger.info(e.getMessage()); + return false; + } + return null; + }; + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/annotation/UnCheckLogin.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/annotation/UnCheckLogin.java new file mode 100644 index 0000000..75948a7 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/annotation/UnCheckLogin.java @@ -0,0 +1,11 @@ +package org.aibidding.common.wechat.web.annotation; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * 不检查登录 + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface UnCheckLogin { +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/base/BaseError.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/base/BaseError.java new file mode 100644 index 0000000..9327165 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/base/BaseError.java @@ -0,0 +1,56 @@ +package org.aibidding.common.wechat.web.base; + +import java.util.EnumSet; +import java.util.HashMap; +import java.util.Map; + +/** + * 错误管理 + * @author WesleyOne + * @create 2018/7/28 + */ +public enum BaseError { + + UNPERMISSION("09","没有操作权限"), + UNLOGIN("01","未登录或登录过期"), + OPERATION_ERR("8899","操作失败!"), + NORMAL_ERR("8999","参数异常"), + SYSTEM_ERR("9999","系统异常"); + + + private String code; + private String msg; + BaseError(String code, String msg) { + this.code = code; + this.msg = msg; + } + + + private static final Map lookup = new HashMap(); + static { + for (BaseError s : EnumSet.allOf(BaseError.class)) + lookup.put(s.getMsg(), s); + } + + /** + * 获取枚举的值(整数值、字符串值等) + * @return + */ + public String getCode() { + return this.code; + } + + public String getMsg() { + return this.msg; + } + + + /** + * 根据值(整数值、字符串值等)获取相应的枚举类型 + * @param code + * @return + */ + public static BaseError fromValue(String code) { + return lookup.get(code); + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/base/BaseException.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/base/BaseException.java new file mode 100644 index 0000000..f9d8b5b --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/base/BaseException.java @@ -0,0 +1,40 @@ +package org.aibidding.common.wechat.web.base; + +import java.io.Serializable; + +/** + * 统一异常对象 + * @author WesleyOne + * @create 2018/7/28 + */ +public class BaseException extends Exception implements Serializable { + + private static final long serialVersionUID = 2007525058641283836L; + + private String code; + + public BaseException(String code, String msg) { + super(msg); + this.code = code; + + } + + public BaseException(BaseError baseError) { + super(baseError.getMsg()); + this.code = baseError.getCode(); + } + + public BaseException(String msg) { + super(msg); + this.code = BaseError.NORMAL_ERR.getCode(); + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/base/BaseResponse.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/base/BaseResponse.java new file mode 100644 index 0000000..bc5018d --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/base/BaseResponse.java @@ -0,0 +1,85 @@ +package org.aibidding.common.wechat.web.base; + +/** + * @author WesleyOne + * @create 2018/7/28 + */ +public class BaseResponse { + public static BaseResponse OK = new BaseResponse(); + + private String code = "00"; + private String message = "操作成功"; + + private T data; + public BaseResponse() { + } + + public BaseResponse(T data) { + this.data = data; + } + + public BaseResponse(String code, String message) { + this.code = code; + this.message = message; + } + + public static BaseResponse success(){ + return new BaseResponse(); + } + + public static BaseResponse success(Object o){ + return new BaseResponse(o); + } + + public static BaseResponse error(String code,String msg){ + BaseResponse r = new BaseResponse(); + r.setCode(code); + r.setMessage(msg); + return r; + } + public static BaseResponse error(BaseError baseError){ + BaseResponse r = new BaseResponse(); + r.setCode(baseError.getCode()); + r.setMessage(baseError.getMsg()); + return r; + } + + /** + * 未登录返回 + * @return + */ + public static BaseResponse unLogin(){ + BaseResponse r = new BaseResponse(); + r.setCode(BaseError.UNLOGIN.getCode()); + r.setMessage(BaseError.UNLOGIN.getMsg()); + return r; + } + + /** + * 无权限返回 + * @return + */ + public static BaseResponse unPermission(){ + BaseResponse r = new BaseResponse(); + r.setCode(BaseError.UNPERMISSION.getCode()); + r.setMessage(BaseError.UNPERMISSION.getMsg()); + return r; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/cache/UserSession.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/cache/UserSession.java new file mode 100644 index 0000000..33912af --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/cache/UserSession.java @@ -0,0 +1,30 @@ +package org.aibidding.common.wechat.web.cache; + +import org.aibidding.common.wechat.web.utils.LRUCache; + +import java.util.LinkedHashMap; + +/** + * 简单的本地会话存储 + * @author WesleyOne + * @create 2018/9/25 + */ +public class UserSession { + public static LinkedHashMap USERSESSION_CACHE = new LRUCache(64); + + public static void addUserSession(String username,String userSession){ + USERSESSION_CACHE.put(username,userSession); + } + + public static void delUserSession(String username){ + USERSESSION_CACHE.remove(username); + } + + public static boolean checkUserSession(String username,String userSession){ + String s = USERSESSION_CACHE.get(username); + if (userSession!=null&&userSession.equals(s)){ + return true; + } + return false; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/common/MyConfig.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/common/MyConfig.java new file mode 100644 index 0000000..db4fe53 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/common/MyConfig.java @@ -0,0 +1,153 @@ +package org.aibidding.common.wechat.web.common; + +import com.alibaba.druid.filter.stat.StatFilter; +import com.alibaba.druid.wall.WallFilter; +import com.jfinal.config.*; +import com.jfinal.json.FastJsonFactory; +import com.jfinal.kit.PropKit; +import com.jfinal.plugin.activerecord.ActiveRecordPlugin; +import com.jfinal.plugin.activerecord.dialect.MysqlDialect; +import com.jfinal.plugin.druid.DruidPlugin; +import com.jfinal.server.undertow.UndertowServer; +import com.jfinal.template.Engine; +import com.jfinal.template.source.ClassPathSourceFactory; +import org.aibidding.common.wechat.itchat4j.core.CoreManage; +import org.aibidding.common.wechat.web.constant.UploadConstant; +import org.aibidding.common.wechat.web.interceptor.ExceptionInterceptor; +import org.aibidding.common.wechat.web.model._MappingKit; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; + + +/** + * JFinal项目的核心配置 + * 详情查看官方文档 + * https://www.jfinal.com/doc + * + * @author WesleyOne + */ +public class MyConfig extends JFinalConfig { + + public final Logger LOG = LoggerFactory.getLogger(this.getClass()); + + public static void main(String[] args) { + UndertowServer.start(MyConfig.class, 8180, true); + } + + /** + * 配置常量 + */ + @Override + public void configConstant(Constants me) { + PropKit.use("appConfig.properties"); + me.setDevMode(PropKit.getBoolean("devMode", false)); + //上传的文件的最大50M + me.setMaxPostSize(10 * 1024 * 1024); + me.setEncoding("UTF-8"); + me.setJsonFactory(new FastJsonFactory()); + me.setError404View("/WEB-INF/templates/404.html"); + } + + /** + * 配置路由 + */ + @Override + public void configRoute(Routes me) { + me.add(new MyRoute()); + me.add(new OutRoute()); + } + + @Override + public void configEngine(Engine me) { + me.setDevMode(PropKit.use("appConfig.properties").getBoolean("devMode", false)); + me.addSharedFunction("/WEB-INF/templates/bs4temp/layout.html"); + me.addSharedObject("imgDomain" , UploadConstant.IMG_URL); + me.addSharedObject("filedomain" , UploadConstant.FILE_URL); + } + + /** + * 配置插件 + */ + @Override + public void configPlugin(Plugins me) { + // 配置 druid 数据库连接池插件 + DruidPlugin druidPlugin = createDruidPlugin(); + druidPlugin.addFilter(new StatFilter()); + WallFilter wall = new WallFilter(); + wall.setDbType("mysql"); + druidPlugin.addFilter(wall); + druidPlugin.setInitialSize(1); + me.add(druidPlugin); + + // 配置ActiveRecord插件 + ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPlugin); + _MappingKit.mapping(arp); + arp.setDialect(new MysqlDialect()); + arp.setShowSql(PropKit.use("appConfig.properties").getBoolean("devMode", false)); + arp.getEngine().setSourceFactory(new ClassPathSourceFactory()); + me.add(arp); + } + + public static DruidPlugin createDruidPlugin() { + return new DruidPlugin(PropKit.get("jdbcUrl"), PropKit.get("user"), PropKit.get("password").trim()); + } + /** + * 配置全局拦截器 + */ + @Override + public void configInterceptor(Interceptors me) { + me.add(new ExceptionInterceptor()); + } + + /** + * 配置处理器 + */ + @Override + public void configHandler(Handlers me) { + } + + @Override + public void afterJFinalStart() { + System.setProperty("jsse.enableSNIExtension", "false"); + // 检查文件夹(/热登录/下载根目录)是否存在 + checkFileExist(); + + // 热登陆操作 + CoreManage.reload(); + } + + @Override + public void beforeJFinalStop() { + CoreManage.persistence(); + } + + /** + * 检查文件夹(/热登录/下载根目录)是否存在 + */ + private void checkFileExist() { + String hotReloadDir = PropKit.get("hotReloadDir"); + String downloadPath = PropKit.get("download_path"); + String logPath = PropKit.get("log_path"); + File hotReloadFile = new File(hotReloadDir); + if (!hotReloadFile.exists()){ + if (!hotReloadFile.mkdirs()) { + LOG.error("热加载文件夹创建失败[{}]",hotReloadDir); + } + } + File downloadFile = new File(downloadPath); + if (!downloadFile.exists()){ + if (!downloadFile.mkdirs()) { + LOG.error("下载文件夹创建失败[{}]",downloadPath); + } + } + File logFile = new File(logPath); + if (!logFile.exists()){ + if (!logFile.mkdirs()) { + LOG.error("日志文件夹创建失败[{}]",logPath); + } + } + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/common/MyRoute.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/common/MyRoute.java new file mode 100644 index 0000000..c1ec7f6 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/common/MyRoute.java @@ -0,0 +1,30 @@ +package org.aibidding.common.wechat.web.common; + +import com.jfinal.config.Routes; +import org.aibidding.common.wechat.web.controller.*; +import org.aibidding.common.wechat.web.interceptor.VisitLogInterceptor; + +/** + * 管理后台路由统一管理 + * @author wesleyOne + */ +public class MyRoute extends Routes { + + + @Override + public void config() { + //设置视图根目录 + setBaseViewPath("/WEB-INF/templates"); + //设置拦截器,前面的先执行 + addInterceptor(new VisitLogInterceptor()); + //添加路由 + add("/", IndexController.class); + add("/rob",RobotController.class); + add("/robwk",RobotWorkController.class); + add("/relate",RelateController.class); + add("/kw",KeyWordController.class); + + add("/upload",UploadController.class); + add("/tool",ToolController.class); + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/common/OutRoute.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/common/OutRoute.java new file mode 100644 index 0000000..967bc36 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/common/OutRoute.java @@ -0,0 +1,21 @@ +package org.aibidding.common.wechat.web.common; + +import com.jfinal.config.Routes; +import org.aibidding.common.wechat.web.controller.ExtendController; +import org.aibidding.common.wechat.web.interceptor.VisitLogInterceptor4down; + +/** + * 对外路由统一管理 + * @author WesleyOne + * @create 2018/9/25 + */ +public class OutRoute extends Routes { + @Override + public void config() { + //设置视图根目录 + setBaseViewPath("/WEB-INF/templates"); + addInterceptor(new VisitLogInterceptor4down()); + //添加路由 + add("/ext", ExtendController.class); + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/constant/ConfigKeys.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/constant/ConfigKeys.java new file mode 100644 index 0000000..9160426 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/constant/ConfigKeys.java @@ -0,0 +1,21 @@ +package org.aibidding.common.wechat.web.constant; + +/** + * @author WesleyOne + * @create 2018/12/13 + */ +public class ConfigKeys { + + /** + * 默认全局关键字回复用昵称,该字段超过16字符防止与用户昵称冲突 + * + * http://kf.qq.com/touch/wxappfaq/150910F322eY150910eIV32Q.html?platform=14 + * 微信昵称设置规则 + * 最多可设置16个汉字,可设置含有中文、英文、数字、符号组合的昵称,但不建议设置特殊字符。 + * 温馨提示:1个符号相当于一个汉字,2个数字/英文相当于1个汉字; + */ + public static final String DEAFAULT_KEYWORD = "默认全局关键字回复用昵称-请勿修改"; + public static final String DEAFAULT_WELCOME = "默认群欢迎新人用-请勿修改"; + + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/constant/UploadConstant.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/constant/UploadConstant.java new file mode 100644 index 0000000..041dc47 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/constant/UploadConstant.java @@ -0,0 +1,21 @@ +package org.aibidding.common.wechat.web.constant; + +import com.jfinal.kit.PathKit; + +import java.io.File; + +public class UploadConstant { + + public static final String IMG_FOLD = "img"; + public static final String FILE_FOLD = "file"; + + public static final String IMG_URL = "/"+IMG_FOLD+"/"; + public static final String FILE_URL = "/"+FILE_FOLD+"/"; + + public static final String IMG_PATH = PathKit.getWebRootPath()+ File.separator +IMG_FOLD; + public static final String FILE_PATH = PathKit.getWebRootPath()+ File.separator +FILE_FOLD; + public static final String IMG_PATH_SEP = IMG_PATH + File.separator; + public static final String FILE_PATH_SEP = FILE_PATH + File.separator; + + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/ExtendController.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/ExtendController.java new file mode 100644 index 0000000..fac6986 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/ExtendController.java @@ -0,0 +1,125 @@ +package org.aibidding.common.wechat.web.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; +import org.aibidding.common.wechat.itchat4j.core.CoreManage; +import org.aibidding.common.wechat.itchat4j.utils.enums.SendMsgType; +import org.aibidding.common.wechat.web.model.WxRobRelation; +import org.aibidding.common.wechat.web.utils.IpUtil; + +/** + * 对外接口 + * @author WesleyOne + * @create 2018/12/16 + */ +public class ExtendController extends _BaseController { + + + /** + * 对外通用规则发消息 + * 参数: + * ok 外接唯一码 + * msg 消息列表 + * 类型参考@see org.aibidding.common.wechat.itchat4j.utils.enums.SendMsgType + * TEXT 文本消息串 + * IMG 图片名串(需要后台-通用工具-上传获取) + * FILE 文件名串(需要后台-通用工具-上传获取) + * 例子: + * {"ok":"test123", + * "msg":[ + * {"type":"TEXT","body":"我是消息体"}, + * {"type":"IMG","body":"ty6yLk3X_1545142908614.jpg"}, + * {"type":"FILE","body":"ty6yLk3X_1545142537914.txt"}, + * ] + * } + * + * 说明: + * 发送顺序按照列表顺序从前往后发 + * + * 返回: + * 00 成功 + * 01 外接码不存在 + * 02 外接码失效 + * 03 IP未通过审核 + * + */ + public void sendMsg(){ + + JSONObject postParam = getPostParam(); + String outKey = postParam.getString("ok"); + String msgStr = postParam.getString("msg"); + JSONArray msgs = JSONArray.parseArray(msgStr); + + if (StringUtils.isEmpty(outKey)){ + setCode("01"); + setMsg("外接码不存在"); + renderJson(); + return; + } + + WxRobRelation relationRecord = WxRobRelation.dao.findFirst("SELECT * FROM wx_rob_relation WHERE out_key = ? LIMIT 1", outKey); + + /** + * 校验IP + * 1.配置空则拒绝所有 + * 2.存在0.0.0.0不校验 + */ + String whiteList = relationRecord.getWhiteList(); + if (StringUtils.isEmpty(whiteList) || !relationRecord.getEnable()){ + setCode("02"); + setMsg("外接码失效或未配置白名单"); + renderJson(); + return; + } + String allPassIp = "0.0.0.0"; + // 不是完全开放IP并且访问IP不存在 + if (!whiteList.contains(allPassIp)){ + String outRealIp = IpUtil.getRealIp(getRequest()); + if (!whiteList.contains(outRealIp)){ + setCode("03"); + setMsg("IP未通过审核"); + renderJson(); + return; + } + } + + String uniqueKey = relationRecord.getUniqueKey(); + // 查看机器是否加载完成 + if (!CoreManage.getInstance(uniqueKey).isAlive() || !CoreManage.getInstance(uniqueKey).isFinishInit()){ + setCode("05"); + setMsg("机器未准备完成"); + renderJson(); + return; + } + + + /** + * 添加到消息队列 + */ + Boolean toGroup = relationRecord.getToGroup(); + String nickName = relationRecord.getNickName(); + // 单次请求最大消息数 + int maxMessages = 10; + int msgLength = msgs.size(); + if (msgLength page = WxRobKeyword.dao.paginate(pageNum, rows, "select * ", + " from wx_rob_keyword "+where); + + setAttrs(buildPagination(page.getList(), page.getTotalRow())); + render(new JsonRender().forIE()); + } + + public void editIndex(){ + Integer kid = getParaToInt("kid"); + WxRobKeyword kwRecord; + boolean isEdit = true; + List groupNickNames = new ArrayList<>(); + if (kid != null){ + kwRecord = WxRobKeyword.dao.findById(kid); + }else{ + isEdit = false; + kwRecord = new WxRobKeyword(); + String uniqueKey = getPara("uk"); + if (StringUtils.isNotEmpty(uniqueKey)){ + kwRecord.setUniqueKey(uniqueKey); + groupNickNames.addAll(WechatTools.getGroupNickNameList(uniqueKey)); + } + // 默认显示文本 + kwRecord.setTypeData(KeyMsgValueType.TEXT.toValue()); + } + setAttr("isEdit",isEdit); + setAttr("form",kwRecord); + + setAttr("keys",KeyMsgValueType.LIST_KV); + setAttr("groupNickNames",groupNickNames); + renderTemplate("editIndex.html"); + } + + /** + * 新增修改 + */ + public void editKeyWord(){ + JSONObject postParam = getPostParam(); + Long id = postParam.getLong("kid"); + String uniqueKey = postParam.getString("uniqueKey"); + String keyData = postParam.getString("keyData"); + String valueData = postParam.getString("valueData"); + String nickName = postParam.getString("nickName"); + String typeData = postParam.getString("typeData"); + Boolean enable = postParam.getBoolean("enable"); + Boolean toGroup = postParam.getBoolean("toGroup"); + + WxRobKeyword editRecord = new WxRobKeyword(); + + if (StringUtils.isNotEmpty(keyData)){ + editRecord.setKeyData(keyData); + } + if (StringUtils.isNotEmpty(valueData)){ + editRecord.setValueData(valueData); + } + if (StringUtils.isNotEmpty(nickName)){ + editRecord.setNickName(nickName); + } + if (KeyMsgValueType.fromValue(typeData) != null){ + editRecord.setTypeData(typeData); + }else { + editRecord.setTypeData(KeyMsgValueType.TEXT.toValue()); + } + if (enable != null){ + editRecord.setEnable(enable); + } + if (toGroup != null){ + editRecord.setToGroup(toGroup); + } + + if (id != null){ + editRecord.setId(id); + boolean update = editRecord.update(); + if (update){ + setMsg("修改成功"); + }else{ + setOperateErr("修改失败"); + } + }else{ + // 校验 + editRecord.setUniqueKey(uniqueKey); + editRecord.setCreateTime(new Date()); + editRecord.setEnable(true); + if (vldParamNull(editRecord.getUniqueKey(),"唯一码不能为空")){ + return; + } + if (vldParamNull(editRecord.getKeyData(),"关键字不能为空")){ + return; + } + if (vldParamNull(editRecord.getValueData(),"内容不能为空")){ + return; + } + if (vldParamNull(editRecord.getTypeData(),"内容类型不能为空")){ + return; + } + if (vldParamNull(editRecord.getNickName(),"昵称不能为空")){ + return; + } + if (vldParamNull(editRecord.getToGroup(),"群聊好友未选择")){ + return; + } + boolean save = editRecord.save(); + if (save){ + setMsg("新增成功"); + }else{ + setOperateErr("新增失败"); + } + } + renderJson(); + } + + /** + * 删除关键字 + */ + public void delKeyWord(){ + + String kid = getPara("kid"); + boolean delete = WxRobKeyword.dao.deleteById(kid); + if (delete){ + setMsg("删除成功"); + }else{ + setOperateErr("删除失败"); + } + renderJson(); + } + + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/RelateController.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/RelateController.java new file mode 100644 index 0000000..097a472 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/RelateController.java @@ -0,0 +1,179 @@ +package org.aibidding.common.wechat.web.controller; + +import com.alibaba.fastjson.JSONObject; +import com.jfinal.plugin.activerecord.Page; +import com.jfinal.render.JsonRender; +import org.apache.commons.lang3.StringUtils; +import org.aibidding.common.wechat.itchat4j.api.WechatTools; +import org.aibidding.common.wechat.web.model.WxRobRelation; +import org.aibidding.common.wechat.web.utils.UUIDShortUtil; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * TODO 关联配置 + * @author WesleyOne + * @create 2018/12/16 + */ +public class RelateController extends _BaseController { + + public void index(){ + String outKey = getPara("ok"); + if (StringUtils.isNotEmpty(outKey)){ + setAttr("search_ok",outKey); + } + String searchUk = getPara("uk"); + if (StringUtils.isNotEmpty(searchUk)){ + setAttr("search_uk",searchUk); + } + renderTemplate("index.html"); + } + + public void list(){ + int rows = getParaToInt("limit", 10); + int pageNum = getPageNum(getParaToInt("offset", 1), rows); + String outKey = getPara("outKey"); + String uniqueKey = getPara("uniqueKey"); + String nickName = getPara("nickName"); + Boolean enable = getParaToBoolean("enable"); + Boolean togrp = getParaToBoolean("togrp"); + + String where = " where 1=1 "; + if (StringUtils.isNotEmpty(outKey)) { + where += " and out_key = '" + outKey + "' "; + } + if (StringUtils.isNotEmpty(uniqueKey)){ + where += " and unique_key = '"+uniqueKey + "' "; + } + if (StringUtils.isNotEmpty(nickName)) { + where += " and nick_name LIKE '" + nickName + "%' "; + } + if (enable != null){ + where += " and enable = " + (enable?1:0); + } + if (togrp != null){ + where += " and to_group = " + (togrp?1:0); + } + + Page page = WxRobRelation.dao.paginate(pageNum, rows, "select * ", + " from wx_rob_relation "+where); + + setAttrs(buildPagination(page.getList(), page.getTotalRow())); + render(new JsonRender().forIE()); + } + + public void editIndex(){ + Integer kid = getParaToInt("kid"); + WxRobRelation wxRobRelation; + boolean isEdit = true; + List groupNickNames = new ArrayList<>(); + if (kid != null){ + wxRobRelation = WxRobRelation.dao.findById(kid); + }else{ + isEdit = false; + wxRobRelation = new WxRobRelation(); + String uniqueKey = getPara("uk"); + String nickName = getPara("nk"); + Boolean toGroup = getParaToBoolean("tgb"); + if (StringUtils.isNotEmpty(uniqueKey)){ + wxRobRelation.setUniqueKey(uniqueKey); + groupNickNames.addAll(WechatTools.getGroupNickNameList(uniqueKey)); + } + if (StringUtils.isNotEmpty(nickName)){ + wxRobRelation.setNickName(nickName); + } + if (toGroup != null){ + wxRobRelation.setToGroup(toGroup); + }else{ + wxRobRelation.setToGroup(true); + } + } + setAttr("isEdit",isEdit); + setAttr("form",wxRobRelation); + setAttr("groupNickNames",groupNickNames); + renderTemplate("editIndex.html"); + } + + /** + * 编辑外部id关联 + */ + public void editRelate(){ + JSONObject postParam = getPostParam(); + Long id = postParam.getLong("kid"); + String uniqueKey = postParam.getString("uniqueKey"); + String nickName = postParam.getString("nickName"); + String whiteList = postParam.getString("whiteList"); + Boolean enable = postParam.getBoolean("enable"); + Boolean toGroup = postParam.getBoolean("toGroup"); + + WxRobRelation editRecord = new WxRobRelation(); + + if (StringUtils.isNotEmpty(nickName)){ + editRecord.setNickName(nickName); + } + if (enable != null){ + editRecord.setEnable(enable); + } + if (toGroup != null){ + editRecord.setToGroup(toGroup); + } + if (StringUtils.isNotEmpty(whiteList)){ + editRecord.setWhiteList(whiteList); + } + + if (id != null){ + editRecord.setId(id); + boolean update = editRecord.update(); + if (update){ + setMsg("修改成功"); + }else{ + setOperateErr("修改失败"); + } + }else{ + // 校验 + editRecord.setUniqueKey(uniqueKey); + editRecord.setCreateTime(new Date()); + editRecord.setEnable(true); + if (vldParamNull(editRecord.getUniqueKey(),"唯一码不能为空")){ + return; + } + if (vldParamNull(editRecord.getNickName(),"昵称不能为空")){ + return; + } + if (vldParamNull(editRecord.getToGroup(),"群聊好友未选择")){ + return; + } + + boolean isSuccess = false; + int maxTime = 5; + while (!isSuccess && maxTime >0){ + String outKey = UUIDShortUtil.generateShortUuid(); + editRecord.setOutKey(outKey); + isSuccess = editRecord.save(); + maxTime--; + } + if (isSuccess){ + setMsg("新增成功"); + }else{ + setOperateErr("新增失败"); + } + } + renderJson(); + } + + /** + * 删除外部id关联 + */ + public void delRelate(){ + String kid = getPara("kid"); + boolean delete = WxRobRelation.dao.deleteById(kid); + if (delete){ + setMsg("删除成功"); + }else{ + setOperateErr("删除失败"); + } + renderJson(); + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/RobotController.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/RobotController.java new file mode 100644 index 0000000..7be536d --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/RobotController.java @@ -0,0 +1,223 @@ +package org.aibidding.common.wechat.web.controller; + +import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.fastjson.JSONObject; +import com.jfinal.plugin.activerecord.Db; +import com.jfinal.plugin.activerecord.Page; +import com.jfinal.plugin.activerecord.Record; +import com.jfinal.render.JsonRender; +import org.apache.commons.lang3.StringUtils; +import org.aibidding.common.wechat.itchat4j.core.Core; +import org.aibidding.common.wechat.itchat4j.core.CoreManage; +import org.aibidding.common.wechat.web.base.BaseException; +import org.aibidding.common.wechat.web.model.WxRobConfig; +import org.aibidding.common.wechat.web.utils.UUIDShortUtil; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 机器人相关管理接口 + * @author WesleyOne + * @create 2018/12/16 + */ +public class RobotController extends _BaseController { + + /** + * 机器人页面 + */ + public void index(){ + renderTemplate("index.html"); + } + + /** + * 机器人列表 + * 分页,搜索条件 + */ + public void list(){ + int rows = getParaToInt("limit", 10); + int pageNum = getPageNum(getParaToInt("offset", 1), rows); + String searchUniqueKey = getPara("uniqueKey"); + String remark = getPara("remark"); + Boolean enable = getParaToBoolean("enable"); + String where = " where 1=1 "; + if (StringUtils.isNotEmpty(searchUniqueKey)){ + where += " and unique_key = '"+searchUniqueKey + "' "; + } + if (StringUtils.isNotEmpty(remark)) { + where += " and remark like '" + remark + "%' "; + } + if (enable != null){ + where += " and enable = " + (enable?1:0); + } + + Page page = WxRobConfig.dao.paginate(pageNum, rows, "select * ", + " from wx_rob_config "+where); + //其他处理 + List dataList = page.getList(); + if (CollectionUtil.isNotEmpty(dataList)){ + for (WxRobConfig conf: dataList){ + // 获取机器人状态 + String uniqueKey = conf.getUniqueKey(); + conf.setActive(CoreManage.isActive(uniqueKey)); + } + } + + setAttrs(buildPagination(dataList, page.getTotalRow())); + render(new JsonRender().forIE()); + } + + /** + * 机器人页面 + */ + public void addIndex(){ + renderTemplate("addIndex.html"); + } + + /** + * 添加机器人 + */ + public void addRob(){ + JSONObject postParam = getPostParam(); + String remark = postParam.getString("remark"); + + if (vldParamNull(remark,"微信号不能为空")){ + return; + } + + Record remarkRecord = Db.findFirst("SELECT remark FROM wx_rob_config WHERE remark = ? LIMIT 1", remark); + if (vldParamNull(remarkRecord != null,"备注已存在")){ + return; + } + WxRobConfig bean = new WxRobConfig(); + bean.setRemark(remark) + .setCreateTime(new Date()) + .setUpdateTime(new Date()) + .setToFriend(false) + .setToGroup(true) + .setFromOut(false) + .setDefaultFriend(false) + .setDefaultGroup(false); + + boolean isSuccess = false; + int maxTime = 5; + while (!isSuccess && maxTime >0){ + String uniKey = UUIDShortUtil.generateShortUuid(); + bean.setUniqueKey(uniKey); + isSuccess = bean.save(); + maxTime--; + } + + if (!isSuccess){ + setOperateErr(); + }else{ + setData(bean); + } + renderJson(); + } + + /** + * 机器人启动禁止开关,发送群聊开关,发送好友开关,对外接口消息开关 + */ + public void change(){ + JSONObject postParam = getPostParam(); + Long id = postParam.getLong("rid"); + String type = postParam.getString("type"); + Boolean state = postParam.getBoolean("state"); + + if (id == null || StringUtils.isEmpty(type) || state == null){ + setOperateErr(); + renderJson(); + return; + } + + WxRobConfig config = new WxRobConfig(); + config.setId(id); + if ("enable".equals(type)){ + config.setEnable(state); + }else if ("tofrd".equals(type)){ + config.setToFriend(state); + }else if ("togrp".equals(type)){ + config.setToGroup(state); + }else if ("fromout".equals(type)) { + config.setFromOut(state); + }else if ("default_group".equals(type)){ + config.setDefaultGroup(state); + }else if ("default_friend".equals(type)){ + config.setDefaultFriend(state); + }else { + setOperateErr("非法操作"); + render(new JsonRender().forIE()); + return; + } + + config.setUpdateTime(new Date()); + boolean update = config.update(); + if (!update){ + setOperateErr(); + }else{ + setData(update); + } + renderJson(); + } + + /** + * 修改备注 + */ + public void changeRemark(){ + JSONObject postParam = getPostParam(); + Long id = postParam.getLong("rid"); + String remark = postParam.getString("remark"); + if (vldParamNull(id,"ID不能为空")){ + return; + } + if (vldParamNull(remark,"备注不能为空")){ + return; + } + + Record remarkRecord = Db.findFirst("SELECT remark FROM wx_rob_config WHERE remark = ? LIMIT 1", remark); + if (vldParamNull(remarkRecord != null,"备注已存在")){ + return; + } + WxRobConfig config = new WxRobConfig(); + config.setId(id); + config.setRemark(remark); + boolean update = config.update(); + if (!update){ + setOperateErr(); + }else{ + setData(update); + } + renderJson(); + } + + /** + * 发送页面 + */ + public void sendIndex() throws BaseException { + String uniqueKey = getUniqueKey(); + Core core = CoreManage.getInstance(uniqueKey); + List sourceSendList = new ArrayList<>(); + sourceSendList.addAll( core.getGroupList()); + sourceSendList.addAll( core.getContactList()); + List targetList = new ArrayList<>(); + JSONObject filehelper = new JSONObject(); + filehelper.put("UserName","filehelper"); + filehelper.put("NickName","文件传输助手"); + targetList.add(filehelper); + for (JSONObject jsonObject : sourceSendList) { + JSONObject newObject = new JSONObject(); + if (StringUtils.isEmpty(jsonObject.getString("NickName"))){ + continue; + } + newObject.put("NickName",jsonObject.getString("NickName")); + newObject.put("UserName",jsonObject.getString("UserName")); + targetList.add(newObject); + } + setAttr("uniqueKey",uniqueKey); + setAttr("targetList",targetList); + renderTemplate("sendIndex.html"); + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/RobotWorkController.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/RobotWorkController.java new file mode 100644 index 0000000..a86c951 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/RobotWorkController.java @@ -0,0 +1,179 @@ +package org.aibidding.common.wechat.web.controller; + +import com.alibaba.fastjson.JSONObject; +import org.aibidding.common.wechat.itchat4j.api.WechatTools; +import org.aibidding.common.wechat.itchat4j.controller.LoginController; +import org.aibidding.common.wechat.itchat4j.core.CoreManage; +import org.aibidding.common.wechat.itchat4j.service.impl.LoginServiceImpl; +import org.aibidding.common.wechat.itchat4j.utils.enums.SendMsgType; +import org.aibidding.common.wechat.web.base.BaseException; + +import java.io.IOException; +import java.util.List; + +/** + * @author WesleyOne + * @create 2018/12/16 + */ +public class RobotWorkController extends _BaseController { + + /** + * 获取状态 + * @throws BaseException + */ + public void getStatus() throws BaseException { + String uniqueKey = getUniqueKey(); + boolean wechatStatus = WechatTools.getWechatStatus(uniqueKey); + setData(wechatStatus); + renderJson(); + } + + /** + * 登录第一步,获取二维码链接 + * @throws BaseException + */ + public void getQr() throws BaseException, IOException { + String uniqueKey = getUniqueKey(); + LoginController login = new LoginController(uniqueKey); + String qrSrc = login.login_1(); + setData(qrSrc); + renderJson(); + } + + /** + * 登录第二步,确认登录状态 + * @throws BaseException + */ + public void login() throws BaseException { + String uniqueKey = getUniqueKey(); + LoginController login = new LoginController(uniqueKey); + boolean result = login.login_2(); + if (result){ + + }else{ + setOperateErr(); + } + renderJson(); + } + + /** + * 登录第三步,确认登录及初始化信息 + * @throws BaseException + */ + public void init() throws BaseException { + String uniqueKey = getUniqueKey(); + LoginController login = new LoginController(uniqueKey); + boolean loginResult = login.login_3(); + if (loginResult){ + setMsg("登录成功"); + }else{ + setMsg("登录失败,关闭二维码后重新打开"); + } + renderJson(); + } + + /** + * 退出 + * @throws BaseException + */ + public void logout() throws BaseException { + String uniqueKey = getUniqueKey(); + WechatTools.logout(uniqueKey); + renderJson(); + } + + /** + * 获取群昵称 + */ + public void getGroupNickNames() throws BaseException { + String uniqueKey = getUniqueKey(); + List groupNickNameList = WechatTools.getGroupNickNameList(uniqueKey); + setData(groupNickNameList); + renderJson(); + } + + /** + * 获取好友昵称 + */ + public void getContactNickNames() throws BaseException { + String uniqueKey = getUniqueKey(); + List contactNickNameList = WechatTools.getContactNickNameList(uniqueKey); + setData(contactNickNameList); + renderJson(); + } + + public void getGroups() throws BaseException { + String uniqueKey = getUniqueKey(); + List groupList = WechatTools.getGroupList(uniqueKey); + setData(groupList); + renderJson(); + } + + public void getContacts() throws BaseException { + String uniqueKey = getUniqueKey(); + List contactList = WechatTools.getContactList(uniqueKey); + setData(contactList); + renderJson(); + } + + public void getCore() throws BaseException { + String uniqueKey = getUniqueKey(); + setData(CoreManage.getInstance(uniqueKey)); + renderJson(); + } + + /** + * 强制刷新通讯录 + */ + public void gct() throws BaseException { + String uniqueKey = getUniqueKey(); + LoginServiceImpl loginService = new LoginServiceImpl(uniqueKey); + loginService.webWxGetContact(); + renderJson(); + } + + /** + * 刷新通讯录详情 + * @throws BaseException + */ + public void ggp() throws BaseException { + String uniqueKey = getUniqueKey(); + LoginServiceImpl loginService = new LoginServiceImpl(uniqueKey); + loginService.WebWxBatchGetContact(); + renderJson(); + } + + /** + * 重启 + * @throws BaseException + */ + public void reboot() throws BaseException { + String uniqueKey = getUniqueKey(); + LoginController login = new LoginController(uniqueKey); + boolean loginResult = login.reboot(); + setData(loginResult); + renderJson(); + } + + + /** + * 手动备份热登录信息 + */ + public void manualCopy(){ + CoreManage.persistence(); + renderJson(); + } + + public void testSend() throws BaseException { + + JSONObject postParam = getPostParam(); + String uniqueKey = postParam.getString("uniqueKey"); + String data = postParam.getString("valueData"); + String userName = postParam.getString("userName"); + String typeData = postParam.getString("typeData"); + + CoreManage.addSendMsg4UserName(uniqueKey,userName,data, SendMsgType.fromValue(typeData)); + renderJson(); + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/ToolController.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/ToolController.java new file mode 100644 index 0000000..fa7db11 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/ToolController.java @@ -0,0 +1,14 @@ +package org.aibidding.common.wechat.web.controller; + +/** + * 通用工具 + * @author WesleyOne + * @create 2018/12/24 + */ +public class ToolController extends _BaseController { + + public void index(){ + renderTemplate("index.html"); + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/UploadController.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/UploadController.java new file mode 100644 index 0000000..b094965 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/UploadController.java @@ -0,0 +1,47 @@ +package org.aibidding.common.wechat.web.controller; + +import com.jfinal.upload.UploadFile; +import org.aibidding.common.wechat.web.constant.UploadConstant; + +import java.io.File; + +/** + * @author WesleyOne + * @create 2018/12/14 + */ +public class UploadController extends _BaseController { + + + public void img2local(){ + UploadFile file = getFile(); + + String fn = getPara("fn", ""); + String originalFileName = file.getOriginalFileName(); + int i = file.getOriginalFileName().lastIndexOf(".")+1; + String fileType = originalFileName.substring(i); + String fileName = fn + "_" + System.currentTimeMillis() + "." + fileType; + String newFilePath = UploadConstant.IMG_PATH+File.separator+fileName; + file.getFile().renameTo(new File(newFilePath)); + + setAttr("name",fileName); + + renderJson(); + } + + public void file2local(){ + UploadFile file = getFile(); + + String fn = getPara("fn", ""); + String originalFileName = file.getOriginalFileName(); + int i = file.getOriginalFileName().lastIndexOf(".")+1; + String fileType = originalFileName.substring(i); + String fileName = fn + "_" + System.currentTimeMillis() + "." + fileType; + String newFilePath = UploadConstant.FILE_PATH+File.separator+fileName; + file.getFile().renameTo(new File(newFilePath)); + + setAttr("name",fileName); + + renderJson(); + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/_BaseController.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/_BaseController.java new file mode 100644 index 0000000..bb9c55c --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/controller/_BaseController.java @@ -0,0 +1,199 @@ +package org.aibidding.common.wechat.web.controller; + +import com.alibaba.fastjson.JSONObject; +import com.jfinal.core.Controller; +import com.jfinal.core.NotAction; +import com.jfinal.kit.HttpKit; +import com.jfinal.kit.StrKit; +import org.apache.commons.lang3.StringUtils; +import org.aibidding.common.wechat.web.base.BaseError; +import org.aibidding.common.wechat.web.base.BaseException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.servlet.http.Cookie; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author WesleyOne + * @create 2018/7/27 + */ +public class _BaseController extends Controller { + + public final Logger LOG = LoggerFactory.getLogger(this.getClass()); + + + /** + * 通用验证 + * @param result true说明验证不通过 + * @param code + * @param errorMsg + */ + @NotAction + public boolean vldParam(boolean result, String code, String errorMsg){ + if (result){ + setAttr("code",code); + setAttr("message",errorMsg); + this.renderJson(); + return true; + } + return false; + } + + @NotAction + public boolean vldParam(boolean result, BaseError baseError){ + if (result){ + return vldParam(true,baseError.getCode(),baseError.getMsg()); + } + return false; + } + + @NotAction + public boolean vldParam(boolean result, String errMsg){ + if (result){ + return vldParam(true,BaseError.NORMAL_ERR.getCode(),errMsg); + } + return false; + } + + /** + * 参数非空判断 + * @param paramValue + * @param baseError + * @return + */ + @NotAction + public boolean vldParamNull(String paramValue, BaseError baseError){ + if (StrKit.isBlank(paramValue)) { + return vldParam(true,baseError.getCode(),baseError.getMsg()); + } + return false; + } + + @NotAction + public boolean vldParamNull(String paramValue, String errMsg){ + if (StrKit.isBlank(paramValue)) { + return vldParam(true,BaseError.NORMAL_ERR.getCode(),errMsg); + } + return false; + } + + /** + * 参数非空判断 + * @param paramValue + * @param baseError + * @return + */ + @NotAction + public boolean vldParamNull(Object paramValue, BaseError baseError){ + if (paramValue == null) { + return vldParam(true,baseError.getCode(),baseError.getMsg()); + } + return false; + } + + @NotAction + public boolean vldParamNull(Object paramValue, String errMsg){ + if (paramValue == null) { + return vldParam(true,BaseError.NORMAL_ERR.getCode(),errMsg); + } + return false; + } + + @NotAction + public void setData(Object o){ + this.setAttr("data",o); + } + @NotAction + public void setCount(Object o){ + this.setAttr("_count",o); + } + @NotAction + public void setCode(String code){ + this.setAttr("code",code); + } + @NotAction + public void setMsg(String msg){ + this.setAttr("message",msg); + } + @NotAction + public void setOperateErr(String msg){ + this.setAttr("code",BaseError.OPERATION_ERR.getCode()); + this.setAttr("message",msg); + } + @NotAction + public void setOperateErr(){ + this.setAttr("code",BaseError.OPERATION_ERR.getCode()); + this.setAttr("message",BaseError.OPERATION_ERR.getMsg()); + } + @NotAction + public void setDeleteErr(){ + this.setAttr("code",BaseError.OPERATION_ERR.getCode()); + this.setAttr("message",BaseError.OPERATION_ERR.getMsg()); + } + + @NotAction + public void addCookie(String key,String value,int second) { + Cookie cookie = new Cookie(key,value); + cookie.setMaxAge(second); + cookie.setPath("/"); + setCookie(cookie); + } + + @NotAction + public JSONObject getPostParam(){ + String jsonString= HttpKit.readData(getRequest()); + return JSONObject.parseObject(jsonString); + } + @NotAction + public String getUid(){ + return this.getCookie("uid"); + } + + /** + * 分页处理 + * @param list + * @param count + * @return + */ + @SuppressWarnings("rawtypes") + @NotAction + protected Map buildPagination(List list, Integer count) { + return buildPagination(list, count, null); + } + + @SuppressWarnings("rawtypes") + @NotAction + protected Map buildPagination(List list, Integer count, + List> footer) { + Map map = new HashMap(4); + map.put("total", count); + map.put("rows", list); + if (footer != null){ + map.put("footer", footer); + } + return map; + } + + @NotAction + protected static int getPageNum(int pageNum,int rows){ + int pageNumber = pageNum / rows + 1; + return pageNumber; + } + + /** + * 获取UniqueKey + * @return + */ + @NotAction + public String getUniqueKey() throws BaseException { + String uniqueKey = getPara("_ck", ""); + if (StringUtils.isEmpty(uniqueKey)){ + throw new BaseException("机器唯一码为空"); + } + return uniqueKey; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/enums/KeyMsgValueType.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/enums/KeyMsgValueType.java new file mode 100644 index 0000000..fc6cc49 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/enums/KeyMsgValueType.java @@ -0,0 +1,45 @@ +package org.aibidding.common.wechat.web.enums; + +import com.jfinal.plugin.activerecord.Record; + +import java.util.*; +public enum KeyMsgValueType { + + IMG("IMG", "图片"), + FILE("FILE", "文件"), + TEXT("TEXT", "纯文本"); + + private String value; + private String name; + + KeyMsgValueType(String value, String name) { + this.value = value; + this.name = name; + } + + private static final Map lookup = new HashMap<>(); + public static List LIST_KV = new ArrayList<>(); + + static { + for (KeyMsgValueType s : EnumSet.allOf(KeyMsgValueType.class)) { + lookup.put(s.toValue(), s); + LIST_KV.add(new Record().set("v", s.toValue()).set("n", s.toName())); + } + } + + public String toValue() { + return this.value; + } + + public String toName() { + return this.name; + } + + public static KeyMsgValueType fromValue(String value) { + return lookup.get(value); + } + + public boolean equal(KeyMsgValueType type) { + return type != null && this.toValue().equals(type.toValue()); + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/interceptor/ExceptionInterceptor.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/interceptor/ExceptionInterceptor.java new file mode 100644 index 0000000..776a880 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/interceptor/ExceptionInterceptor.java @@ -0,0 +1,52 @@ +package org.aibidding.common.wechat.web.interceptor; + +import com.jfinal.aop.Interceptor; +import com.jfinal.aop.Invocation; +import org.aibidding.common.wechat.web.base.BaseError; +import org.aibidding.common.wechat.web.base.BaseException; +import org.aibidding.common.wechat.web.base.BaseResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * 全局异常拦截 + * @author WesleyOne + * @create 2018/7/28 + */ +public class ExceptionInterceptor implements Interceptor { + + private static final Logger LOG = LoggerFactory.getLogger(ExceptionInterceptor.class); + + @Override + public void intercept(Invocation me) { + try { + me.getController().setAttr("code","00"); + me.getController().setAttr("message","操作成功"); + me.invoke(); + } + catch (Exception e) { + LOG.error(e.getMessage(),e); + BaseResponse resp = new BaseResponse(); + Throwable cause = e.getCause(); + String ajax = me.getController().getRequest().getHeader("X-Requested-With"); + //判断ajax请求还是页面请求 + if ("XMLHttpRequest".equals(ajax)){ + if (cause instanceof BaseException) { + resp.setCode(((BaseException) cause).getCode()); + resp.setMessage(cause.getMessage()); + } else{ + resp.setCode(BaseError.SYSTEM_ERR.getCode()); + resp.setMessage(BaseError.SYSTEM_ERR.getMsg()); + } + me.getController().renderJson(resp); + return; + }else{ + //默认系统500页面,添加第二个参数可自行添加500页面 + me.getController().renderError(500); + return; + } + + } + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/interceptor/VisitLogInterceptor.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/interceptor/VisitLogInterceptor.java new file mode 100644 index 0000000..9f2c937 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/interceptor/VisitLogInterceptor.java @@ -0,0 +1,79 @@ +package org.aibidding.common.wechat.web.interceptor; + + +import com.jfinal.aop.Interceptor; +import com.jfinal.aop.Invocation; +import org.aibidding.common.wechat.web.annotation.UnCheckLogin; +import org.aibidding.common.wechat.web.cache.UserSession; +import org.aibidding.common.wechat.web.utils.IpUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; + + +/** + * 管理后台操作日志 + * @author admin + */ +public class VisitLogInterceptor implements Interceptor { + public static final Logger LOG = LoggerFactory.getLogger(VisitLogInterceptor.class); + + @Override + public void intercept(Invocation inv) { + String requestUrl = inv.getActionKey(); + String uid = inv.getController().getCookie("uid"); + String sid = inv.getController().getCookie("sid"); + String ip = IpUtil.getRealIp(inv.getController().getRequest()); + LOG.info("{} - {} - {} 操作了 {}",ip,uid,sid,requestUrl); + + inv.getController().setAttr("active",inv.getController().getControllerKey()); + + //找到不需要登录的action + Class controllerClass = inv.getController().getClass(); + UnCheckLogin methodOwn = getControllerMethodUnLoginOwn(controllerClass, inv.getMethodName()); + if (methodOwn != null) { + LOG.info("不需要登录,requestUrl=" + requestUrl); + inv.invoke(); + return; + } + + boolean isLogin = UserSession.checkUserSession(uid,sid); + if (!isLogin){ + //未登入 + inv.getController().redirect("/login",false); + return; + } + + long start = System.currentTimeMillis(); + inv.invoke(); + long l = System.currentTimeMillis() - start; + if (l > 1000*2){ + LOG.warn("请求 {} ,连接时长 {} ms",requestUrl,l); + } + } + + //--------------以下是内部方法----------- + + private UnCheckLogin getControllerMethodUnLoginOwn(Class controllerClass, String methodName) { + for (Method method : controllerClass.getMethods()) { + if (methodName.equals(method.getName())) { + return getUnLogin(method); + } + } + return null; + } + + private UnCheckLogin getUnLogin(Method method) { + Annotation[] annotations = method.getAnnotations(); + for (Annotation annt : annotations) { + if (annt instanceof UnCheckLogin) { + UnCheckLogin own = (UnCheckLogin) annt; + return own; + } + } + return null; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/interceptor/VisitLogInterceptor4down.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/interceptor/VisitLogInterceptor4down.java new file mode 100644 index 0000000..b7cbca6 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/interceptor/VisitLogInterceptor4down.java @@ -0,0 +1,26 @@ +package org.aibidding.common.wechat.web.interceptor; + +import com.jfinal.aop.Interceptor; +import com.jfinal.aop.Invocation; +import org.aibidding.common.wechat.web.utils.IpUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 对外接口访问日志 + * @author WesleyOne + * @create 2018/9/25 + */ +public class VisitLogInterceptor4down implements Interceptor { + + public static final Logger LOG = LoggerFactory.getLogger(VisitLogInterceptor4down.class); + + @Override + public void intercept(Invocation inv) { + String ip = IpUtil.getRealIp(inv.getController().getRequest()); + StringBuffer requestURL = inv.getController().getRequest().getRequestURL(); + String queryString = inv.getController().getRequest().getQueryString(); + LOG.info("{} 操作了 {} {}",ip,requestURL,queryString); + inv.invoke(); + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/WxRobConfig.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/WxRobConfig.java new file mode 100644 index 0000000..8192d18 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/WxRobConfig.java @@ -0,0 +1,21 @@ +package org.aibidding.common.wechat.web.model; + +import org.aibidding.common.wechat.web.model.base.BaseWxRobConfig; + +/** + * Generated by JFinal. + */ +@SuppressWarnings("serial") +public class WxRobConfig extends BaseWxRobConfig { + public static final WxRobConfig dao = new WxRobConfig().dao(); + + private boolean isActive; + + public boolean isActive() { + return isActive; + } + + public void setActive(boolean active) { + isActive = active; + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/WxRobKeyword.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/WxRobKeyword.java new file mode 100644 index 0000000..72df16a --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/WxRobKeyword.java @@ -0,0 +1,11 @@ +package org.aibidding.common.wechat.web.model; + +import org.aibidding.common.wechat.web.model.base.BaseWxRobKeyword; + +/** + * Generated by JFinal. + */ +@SuppressWarnings("serial") +public class WxRobKeyword extends BaseWxRobKeyword { + public static final WxRobKeyword dao = new WxRobKeyword().dao(); +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/WxRobRelation.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/WxRobRelation.java new file mode 100644 index 0000000..b8a3298 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/WxRobRelation.java @@ -0,0 +1,11 @@ +package org.aibidding.common.wechat.web.model; + +import org.aibidding.common.wechat.web.model.base.BaseWxRobRelation; + +/** + * Generated by JFinal. + */ +@SuppressWarnings("serial") +public class WxRobRelation extends BaseWxRobRelation { + public static final WxRobRelation dao = new WxRobRelation().dao(); +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/_JFinalDemoGenerator.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/_JFinalDemoGenerator.java new file mode 100644 index 0000000..fbdc83b --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/_JFinalDemoGenerator.java @@ -0,0 +1,72 @@ +package org.aibidding.common.wechat.web.model; + +import com.jfinal.kit.PathKit; +import com.jfinal.kit.PropKit; +import com.jfinal.plugin.activerecord.dialect.MysqlDialect; +import com.jfinal.plugin.activerecord.generator.Generator; +import com.jfinal.plugin.druid.DruidPlugin; +import org.aibidding.common.wechat.web.common.MyConfig; + +import javax.sql.DataSource; + +/** + * 本 demo 仅表达最为粗浅的 jfinal 用法,更为有价值的实用的企业级用法 + * 详见 JFinal 俱乐部: http://jfinal.com/club + * + * 在数据库表有任何变动时,运行一下 main 方法,极速响应变化进行代码重构 + */ +public class _JFinalDemoGenerator { + +// public static DataSource getDataSource() { +//// PropKit.use("appConfig.properties"); +//// DruidPlugin druidPlugin = new DruidPlugin(PropKit.get("jdbcUrl"), PropKit.get("user"), PropKit.get("password").trim(),PropKit.get("jdbcDriverSqlServe")); +//// DruidPlugin druidPlugin = new DruidPlugin("jdbc:mysql://127.0.0.1:3306/wxwobot?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull","root", "root"); +// DruidPlugin druidPlugin = new DruidPlugin("jdbc:mysql://localhost:3306/wxwobot?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull", +// "root", "root"); +// druidPlugin.start(); +// return druidPlugin.getDataSource(); +// } + public static DataSource getDataSource() { + DruidPlugin druidPlugin = MyConfig.createDruidPlugin(); + druidPlugin.start(); + return druidPlugin.getDataSource(); + } + + public static void main(String[] args) { + PropKit.use("appConfig.properties"); + // base model 所使用的包名 + String baseModelPackageName = "org.aibidding.common.wechat.web.model.base"; + // base model 文件保存路径 + String baseModelOutputDir = PathKit.getWebRootPath() + "/src/main/java/org.aibidding.common.wechat/web/model/base"; + + // model 所使用的包名 (MappingKit 默认使用的包名) + String modelPackageName = "org.aibidding.common.wechat.web.model"; + // model 文件保存路径 (MappingKit 与 DataDictionary 文件默认保存路径) + String modelOutputDir = baseModelOutputDir + "/.."; + + // 创建生成器 + Generator generator = new Generator(getDataSource(), baseModelPackageName, baseModelOutputDir, modelPackageName, modelOutputDir); + // 设置是否生成链式 setter 方法 + generator.setGenerateChainSetter(false); + // 添加不需要生成的表名 + generator.addExcludedTable(); + // 设置是否在 Model 中生成 dao 对象 + generator.setGenerateDaoInModel(false); + // 设置是否生成链式 setter 方法 + generator.setGenerateChainSetter(true); + // 设置是否生成字典文件 + generator.setGenerateDataDictionary(false); + // 设置需要被移除的表名前缀用于生成modelName。例如表名 "osc_user",移除前缀 "osc_"后生成的model名为 "User"而非 OscUser +// generator.setRemovedTableNamePrefixes("t_"); + + generator.setDialect(new MysqlDialect()); + // 生成 + generator.generate(); + + } + +} + + + + diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/_MappingKit.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/_MappingKit.java new file mode 100644 index 0000000..a778b8a --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/_MappingKit.java @@ -0,0 +1,24 @@ +package org.aibidding.common.wechat.web.model; + +import com.jfinal.plugin.activerecord.ActiveRecordPlugin; + +/** + * Generated by JFinal, do not modify this file. + *
+ * Example:
+ * public void configPlugin(Plugins me) {
+ *     ActiveRecordPlugin arp = new ActiveRecordPlugin(...);
+ *     _MappingKit.mapping(arp);
+ *     me.add(arp);
+ * }
+ * 
+ */ +public class _MappingKit { + + public static void mapping(ActiveRecordPlugin arp) { + arp.addMapping("wx_rob_config", "id", WxRobConfig.class); + arp.addMapping("wx_rob_keyword", "id", WxRobKeyword.class); + arp.addMapping("wx_rob_relation", "id", WxRobRelation.class); + } +} + diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/base/BaseWxRobConfig.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/base/BaseWxRobConfig.java new file mode 100644 index 0000000..a899c1e --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/base/BaseWxRobConfig.java @@ -0,0 +1,111 @@ +package org.aibidding.common.wechat.web.model.base; + +import com.jfinal.plugin.activerecord.IBean; +import com.jfinal.plugin.activerecord.Model; + +/** + * Generated by JFinal, do not modify this file. + */ +@SuppressWarnings({"serial", "unchecked"}) +public abstract class BaseWxRobConfig> extends Model implements IBean { + + public M setId(Long id) { + set("id", id); + return (M)this; + } + + public Long getId() { + return getLong("id"); + } + + public M setUniqueKey(String uniqueKey) { + set("unique_key", uniqueKey); + return (M)this; + } + + public String getUniqueKey() { + return getStr("unique_key"); + } + + public M setRemark(String remark) { + set("remark", remark); + return (M)this; + } + + public String getRemark() { + return getStr("remark"); + } + + public M setCreateTime(java.util.Date createTime) { + set("create_time", createTime); + return (M)this; + } + + public java.util.Date getCreateTime() { + return get("create_time"); + } + + public M setUpdateTime(java.util.Date updateTime) { + set("update_time", updateTime); + return (M)this; + } + + public java.util.Date getUpdateTime() { + return get("update_time"); + } + + public M setToFriend(Boolean toFriend) { + set("to_friend", toFriend); + return (M)this; + } + + public Boolean getToFriend() { + return get("to_friend"); + } + + public M setToGroup(Boolean toGroup) { + set("to_group", toGroup); + return (M)this; + } + + public Boolean getToGroup() { + return get("to_group"); + } + + public M setDefaultFriend(Boolean defaultFriend) { + set("default_friend", defaultFriend); + return (M)this; + } + + public Boolean getDefaultFriend() { + return get("default_friend"); + } + + public M setDefaultGroup(Boolean defaultGroup) { + set("default_group", defaultGroup); + return (M)this; + } + + public Boolean getDefaultGroup() { + return get("default_group"); + } + + public M setFromOut(Boolean fromOut) { + set("from_out", fromOut); + return (M)this; + } + + public Boolean getFromOut() { + return get("from_out"); + } + + public M setEnable(Boolean enable) { + set("enable", enable); + return (M)this; + } + + public Boolean getEnable() { + return get("enable"); + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/base/BaseWxRobKeyword.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/base/BaseWxRobKeyword.java new file mode 100644 index 0000000..9031712 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/base/BaseWxRobKeyword.java @@ -0,0 +1,93 @@ +package org.aibidding.common.wechat.web.model.base; + +import com.jfinal.plugin.activerecord.IBean; +import com.jfinal.plugin.activerecord.Model; + +/** + * Generated by JFinal, do not modify this file. + */ +@SuppressWarnings({"serial", "unchecked"}) +public abstract class BaseWxRobKeyword> extends Model implements IBean { + + public M setId(Long id) { + set("id", id); + return (M)this; + } + + public Long getId() { + return getLong("id"); + } + + public M setUniqueKey(String uniqueKey) { + set("unique_key", uniqueKey); + return (M)this; + } + + public String getUniqueKey() { + return getStr("unique_key"); + } + + public M setKeyData(String keyData) { + set("key_data", keyData); + return (M)this; + } + + public String getKeyData() { + return getStr("key_data"); + } + + public M setValueData(String valueData) { + set("value_data", valueData); + return (M)this; + } + + public String getValueData() { + return getStr("value_data"); + } + + public M setTypeData(String typeData) { + set("type_data", typeData); + return (M)this; + } + + public String getTypeData() { + return getStr("type_data"); + } + + public M setNickName(String nickName) { + set("nick_name", nickName); + return (M)this; + } + + public String getNickName() { + return getStr("nick_name"); + } + + public M setToGroup(Boolean toGroup) { + set("to_group", toGroup); + return (M)this; + } + + public Boolean getToGroup() { + return get("to_group"); + } + + public M setEnable(Boolean enable) { + set("enable", enable); + return (M)this; + } + + public Boolean getEnable() { + return get("enable"); + } + + public M setCreateTime(java.util.Date createTime) { + set("create_time", createTime); + return (M)this; + } + + public java.util.Date getCreateTime() { + return get("create_time"); + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/base/BaseWxRobRelation.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/base/BaseWxRobRelation.java new file mode 100644 index 0000000..6c90eae --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/model/base/BaseWxRobRelation.java @@ -0,0 +1,84 @@ +package org.aibidding.common.wechat.web.model.base; + +import com.jfinal.plugin.activerecord.IBean; +import com.jfinal.plugin.activerecord.Model; + +/** + * Generated by JFinal, do not modify this file. + */ +@SuppressWarnings({"serial", "unchecked"}) +public abstract class BaseWxRobRelation> extends Model implements IBean { + + public M setId(Long id) { + set("id", id); + return (M)this; + } + + public Long getId() { + return getLong("id"); + } + + public M setOutKey(String outKey) { + set("out_key", outKey); + return (M)this; + } + + public String getOutKey() { + return getStr("out_key"); + } + + public M setUniqueKey(String uniqueKey) { + set("unique_key", uniqueKey); + return (M)this; + } + + public String getUniqueKey() { + return getStr("unique_key"); + } + + public M setNickName(String nickName) { + set("nick_name", nickName); + return (M)this; + } + + public String getNickName() { + return getStr("nick_name"); + } + + public M setToGroup(Boolean toGroup) { + set("to_group", toGroup); + return (M)this; + } + + public Boolean getToGroup() { + return get("to_group"); + } + + public M setEnable(Boolean enable) { + set("enable", enable); + return (M)this; + } + + public Boolean getEnable() { + return get("enable"); + } + + public M setWhiteList(String whiteList) { + set("white_list", whiteList); + return (M)this; + } + + public String getWhiteList() { + return getStr("white_list"); + } + + public M setCreateTime(java.util.Date createTime) { + set("create_time", createTime); + return (M)this; + } + + public java.util.Date getCreateTime() { + return get("create_time"); + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/Base64Util.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/Base64Util.java new file mode 100644 index 0000000..cd7909a --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/Base64Util.java @@ -0,0 +1,30 @@ +package org.aibidding.common.wechat.web.utils; + +import org.apache.commons.codec.binary.Base64; + +/** + * @author WesleyOne + * @create 2018/12/19 + */ +public class Base64Util { + + /** + * 编码 + * @param source + * @return + */ + public static String encode(String source){ + byte[] result = Base64.encodeBase64(source.getBytes()); + return result.toString(); + } + + /** + * 解码 + * @param source + * @return + */ + public static String decode(String source){ + byte[] result = Base64.decodeBase64(source); + return result.toString(); + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/IpUtil.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/IpUtil.java new file mode 100644 index 0000000..2fe7b9d --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/IpUtil.java @@ -0,0 +1,35 @@ +package org.aibidding.common.wechat.web.utils; + + +import org.apache.commons.lang3.StringUtils; + +import javax.servlet.http.HttpServletRequest; + + +/** + * @author WesleyOne + * @create 2018/11/5 + */ +public class IpUtil { + + /** + * 获取用户真实IP(在安防或多层代理场景下) + * @param request + * @return + */ + public static String getRealIp(HttpServletRequest request) { + String ip = request.getHeader("x-forwarded-for"); + if(StringUtils.isNotEmpty(ip) && !"unKnown".equalsIgnoreCase(ip)){ + //多次反向代理后会有多个ip值,第一个ip才是真实ip + int index = ip.indexOf(","); + if(index != -1){ + return ip.substring(0,index); + } + } + ip = request.getHeader("X-Real-IP"); + if(StringUtils.isNotEmpty(ip) && !"unKnown".equalsIgnoreCase(ip)){ + return ip; + } + return request.getRemoteAddr(); + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/LRUCache.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/LRUCache.java new file mode 100644 index 0000000..ba2a7a9 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/LRUCache.java @@ -0,0 +1,26 @@ +package org.aibidding.common.wechat.web.utils; + +import java.util.LinkedHashMap; + +/** + * @author WesleyOne + * @create 2018/12/12 + */ +public class LRUCache extends LinkedHashMap { + + private static final long serialVersionUID = 1L; + protected int maxElements; + + public LRUCache(int maxSize) + { + super(maxSize * 4 / 3 , 0.75F, true); + maxElements = maxSize; + } + + @Override + protected boolean removeEldestEntry(java.util.Map.Entry eldest) + { + return size() > maxElements; + } + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/MD5Util.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/MD5Util.java new file mode 100644 index 0000000..a00225e --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/MD5Util.java @@ -0,0 +1,68 @@ +package org.aibidding.common.wechat.web.utils; + + + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +public class MD5Util { + + + private static String byteArrayToHexString(byte b[]) { + StringBuffer resultSb = new StringBuffer(); + for (int i = 0; i < b.length; i++){ + resultSb.append(byteToHexString(b[i])); + } + + return resultSb.toString(); + } + + private static String byteToHexString(byte b) { + int n = b; + if (n < 0){ + n += 256; + } + int d1 = n / 16; + int d2 = n % 16; + return hexDigits[d1] + hexDigits[d2]; + } + + public static String MD5Encode(String origin, String charsetname) { + String resultString = null; + try { + resultString = new String(origin); + MessageDigest md = MessageDigest.getInstance("MD5"); + if (charsetname == null || "".equals(charsetname)){ + resultString = byteArrayToHexString(md.digest(resultString.getBytes())); + } else{ + resultString = byteArrayToHexString(md.digest(resultString.getBytes(charsetname))); + } + } catch (Exception exception) { + } + return resultString; + } + + private static final String hexDigits[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; + + public static String MD5Encrypt(String str) { + String s = str; + if (s == null) { + return null; + } + String value = null; + MessageDigest md5 = null; + try { + md5 = MessageDigest.getInstance("MD5"); + } catch (NoSuchAlgorithmException ex) { + } + //sun.misc.BASE64Encoder baseEncoder = new sun.misc.BASE64Encoder(); + + return value; + } + + public static void main(String[] args) { + System.out.println(MD5Encrypt("wxwobot")); + } + + +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/UUIDShortUtil.java b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/UUIDShortUtil.java new file mode 100644 index 0000000..43fd153 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/java/org/aibidding/common/wechat/web/utils/UUIDShortUtil.java @@ -0,0 +1,33 @@ +package org.aibidding.common.wechat.web.utils; + +import java.util.UUID; + +/** + * + * @author internet + * @create 2018/12/17 + */ +public class UUIDShortUtil { + + private static String[] chars = new String[] { "a", "b", "c", "d", "e", "f", + "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", + "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", + "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", + "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", + "W", "X", "Y", "Z" }; + + /** + * 短8位 + * @return + */ + public static String generateShortUuid() { + StringBuffer shortBuffer = new StringBuffer(); + String uuid = UUID.randomUUID().toString().replace("-", ""); + for (int i = 0; i < 8; i++) { + String str = uuid.substring(i * 4, i * 4 + 4); + int x = Integer.parseInt(str, 16); + shortBuffer.append(chars[x % 0x3E]); + } + return shortBuffer.toString(); + } +} diff --git a/aibidding-common/aibidding-common-wechat/src/main/resources/appConfig.properties b/aibidding-common/aibidding-common-wechat/src/main/resources/appConfig.properties new file mode 100644 index 0000000..5ccffea --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/resources/appConfig.properties @@ -0,0 +1,7 @@ +jdbcUrl = ${pro.jdbc.agent.url} +user = ${pro.jdbc.agent.username} +password = ${pro.jdbc.agent.password} +devMode = ${pro.devMode} +hotReloadDir = ${pro.hotreload.realpath} +download_path = ${pro.download.path} +log_path = ${log.file.path} diff --git a/aibidding-common/aibidding-common-wechat/src/main/resources/passport.properties b/aibidding-common/aibidding-common-wechat/src/main/resources/passport.properties new file mode 100644 index 0000000..0e375b7 --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/resources/passport.properties @@ -0,0 +1 @@ +wxwobot = C9ah2BEPliU2EzPV/VAn9Q== \ No newline at end of file diff --git a/aibidding-common/aibidding-common-wechat/src/main/resources/undertow.txt b/aibidding-common/aibidding-common-wechat/src/main/resources/undertow.txt new file mode 100644 index 0000000..cdcd10b --- /dev/null +++ b/aibidding-common/aibidding-common-wechat/src/main/resources/undertow.txt @@ -0,0 +1,51 @@ +# 配置 undertow + +undertow.devMode=${pro.undertow.devMode} +undertow.host=${pro.domain.host} +undertow.port=${pro.domain.port} +undertow.contextPath=/ + +undertow.resourcePath=webapp, io.wxwobot.admin/src/main/webapp, src/main/webapp + +# 开启 gzip 压缩 +undertow.gzip.enable=true +# 配置压缩级别,默认值 -1。 可配置 1 到 9。 1 拥有最快压缩速度,9 拥有最高压缩率 +undertow.gzip.level=-1 +# 触发压缩的最小内容长度 +undertow.gzip.minLength=1024 + +# session 过期时间,注意单位是秒 +undertow.session.timeout=1800 +# 支持 session 热加载,避免依赖于 session 的登录型项目反复登录,默认值为 true。仅用于 devMode,生产环境无影响 +undertow.session.hotSwap=true + +# 下面两行命令生成密钥库 +# keytool -genkeypair -validity 3650 -alias club -keyalg RSA -keystore club.jks +# keytool -importkeystore -srckeystore club.jks -destkeystore club.pfx -deststoretype PKCS12 +# 生成过程中提示输入 "名字与姓氏" 时输入 localhost。生产环境从阿里云下载 tomcat 类型的密钥库 +# +# 更详细的 https/ssl 配置见 jfinal 官方文档 :http://www.jfinal.com/doc/1-4 +# +# 是否开启 ssl +undertow.ssl.enable=false +# ssl 监听端口号,部署环境设置为 443 +undertow.ssl.port=443 +# 密钥库类型,建议使用 PKCS12 +undertow.ssl.keyStoreType=PKCS12 +# 密钥库文件 +undertow.ssl.keyStore=demo.pfx +# 密钥库密码 +undertow.ssl.keyStorePassword=111111 + + +# ssl 开启时,是否开启 http2。检测该配置是否生效在 chrome 地址栏中输入: chrome://net-internals/#http2 +undertow.http2.enable=true + + +# ssl 开启时,http 请求是否重定向到 https +# undertow.http.toHttps=false +# ssl 开启时,是否关闭 http +# undertow.http.disable=false + + + diff --git a/aibidding-common/pom.xml b/aibidding-common/pom.xml new file mode 100644 index 0000000..b1a1b2a --- /dev/null +++ b/aibidding-common/pom.xml @@ -0,0 +1,46 @@ + + + + ruoyi-ai + org.ruoyi + ${revision} + ../pom.xml + + 4.0.0 + + + aibidding-common-bom + aibidding-common-core + aibidding-common-doc + aibidding-common-excel + aibidding-common-idempotent + aibidding-common-log + aibidding-common-mail + aibidding-common-mybatis + aibidding-common-oss + aibidding-common-ratelimiter + aibidding-common-redis + aibidding-common-satoken + aibidding-common-security + aibidding-common-sms + aibidding-common-web + aibidding-common-translation + aibidding-common-sensitive + aibidding-common-json + aibidding-common-encrypt + aibidding-common-tenant + aibidding-common-chat + aibidding-common-pay + aibidding-common-wechat + + + aibidding-common + pom + + + common 通用模块 + + + diff --git a/aibidding-modules/aibidding-demo/pom.xml b/aibidding-modules/aibidding-demo/pom.xml new file mode 100644 index 0000000..0615783 --- /dev/null +++ b/aibidding-modules/aibidding-demo/pom.xml @@ -0,0 +1,115 @@ + + + + org.ruoyi + aibidding-modules + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-demo + + + demo模块 + + + + + + + org.ruoyi + aibidding-common-core + + + + org.ruoyi + aibidding-common-doc + + + + org.ruoyi + aibidding-common-sms + + + + org.ruoyi + aibidding-common-mail + + + + org.ruoyi + aibidding-common-redis + + + + org.ruoyi + aibidding-common-idempotent + + + + org.ruoyi + aibidding-common-mybatis + + + + org.ruoyi + aibidding-common-log + + + + org.ruoyi + aibidding-common-excel + + + + org.ruoyi + aibidding-common-web + + + + org.ruoyi + aibidding-common-ratelimiter + + + + org.ruoyi + aibidding-common-translation + + + + org.ruoyi + aibidding-common-sensitive + + + + org.ruoyi + aibidding-common-encrypt + + + + org.ruoyi + aibidding-common-tenant + + + + org.ruoyi + aibidding-common-pay + + + + + + + + + + + + + + + + diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/MailController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/MailController.java new file mode 100644 index 0000000..6644b38 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/MailController.java @@ -0,0 +1,52 @@ +package org.aibidding.demo.controller; + +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.mail.utils.MailUtils; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.io.File; + + +/** + * 邮件发送案例 + * + * @author Michelle.Chung + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/mail") +public class MailController { + + /** + * 发送邮件 + * + * @param to 接收人 + * @param subject 标题 + * @param text 内容 + */ + @GetMapping("/sendSimpleMessage") + public R sendSimpleMessage(String to, String subject, String text) { + MailUtils.sendText(to, subject, text); + return R.ok(); + } + + /** + * 发送邮件(带附件) + * + * @param to 接收人 + * @param subject 标题 + * @param text 内容 + * @param filePath 附件路径 + */ + @GetMapping("/sendMessageWithAttachment") + public R sendMessageWithAttachment(String to, String subject, String text, String filePath) { + MailUtils.sendText(to, subject, text, new File(filePath)); + return R.ok(); + } + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/RedisCacheController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/RedisCacheController.java new file mode 100644 index 0000000..a833bd7 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/RedisCacheController.java @@ -0,0 +1,95 @@ +package org.aibidding.demo.controller; + +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.constant.CacheNames; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.redis.utils.RedisUtils; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.CachePut; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.time.Duration; + +/** + * spring-cache 演示案例 + * + * @author Lion Li + */ +// 类级别 缓存统一配置 +//@CacheConfig(cacheNames = CacheNames.DEMO_CACHE) +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/cache") +public class RedisCacheController { + + /** + * 测试 @Cacheable + *

+ * 表示这个方法有了缓存的功能,方法的返回值会被缓存下来 + * 下一次调用该方法前,会去检查是否缓存中已经有值 + * 如果有就直接返回,不调用方法 + * 如果没有,就调用方法,然后把结果缓存起来 + * 这个注解「一般用在查询方法上」 + *

+ * 重点说明: 缓存注解严谨与其他筛选数据功能一起使用 + * 例如: 数据权限注解 会造成 缓存击穿 与 数据不一致问题 + *

+ * cacheNames 命名规则 查看 {@link CacheNames} 注释 支持多参数 + */ + @Cacheable(cacheNames = "demo:cache#60s#10m#20", key = "#key", condition = "#key != null") + @GetMapping("/test1") + public R test1(String key, String value) { + return R.ok("操作成功", value); + } + + /** + * 测试 @CachePut + *

+ * 加了@CachePut注解的方法,会把方法的返回值put到缓存里面缓存起来,供其它地方使用 + * 它「通常用在新增或者实时更新方法上」 + *

+ * cacheNames 命名规则 查看 {@link CacheNames} 注释 支持多参数 + */ + @CachePut(cacheNames = CacheNames.DEMO_CACHE, key = "#key", condition = "#key != null") + @GetMapping("/test2") + public R test2(String key, String value) { + return R.ok("操作成功", value); + } + + /** + * 测试 @CacheEvict + *

+ * 使用了CacheEvict注解的方法,会清空指定缓存 + * 「一般用在删除的方法上」 + *

+ * cacheNames 命名规则 查看 {@link CacheNames} 注释 支持多参数 + */ + @CacheEvict(cacheNames = CacheNames.DEMO_CACHE, key = "#key", condition = "#key != null") + @GetMapping("/test3") + public R test3(String key, String value) { + return R.ok("操作成功", value); + } + + /** + * 测试设置过期时间 + * 手动设置过期时间10秒 + * 11秒后获取 判断是否相等 + */ + @GetMapping("/test6") + public R test6(String key, String value) { + RedisUtils.setCacheObject(key, value); + boolean flag = RedisUtils.expire(key, Duration.ofSeconds(10)); + System.out.println("***********" + flag); + try { + Thread.sleep(11 * 1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + Object obj = RedisUtils.getCacheObject(key); + return R.ok(value.equals(obj)); + } + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/RedisLockController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/RedisLockController.java new file mode 100644 index 0000000..bee6269 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/RedisLockController.java @@ -0,0 +1,71 @@ +package org.aibidding.demo.controller; + +import com.baomidou.lock.LockInfo; +import com.baomidou.lock.LockTemplate; +import com.baomidou.lock.annotation.Lock4j; +import com.baomidou.lock.executor.RedissonLockExecutor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.domain.R; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.time.LocalTime; + + +/** + * 测试分布式锁的样例 + * + * @author shenxinquan + */ +@Slf4j +@RestController +@RequestMapping("/demo/redisLock") +public class RedisLockController { + + @Autowired + private LockTemplate lockTemplate; + + /** + * 测试lock4j 注解 + */ + @Lock4j(keys = {"#key"}) + @GetMapping("/testLock4j") + public R testLock4j(String key, String value) { + System.out.println("start:" + key + ",time:" + LocalTime.now().toString()); + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println("end :" + key + ",time:" + LocalTime.now().toString()); + return R.ok("操作成功", value); + } + + /** + * 测试lock4j 工具 + */ + @GetMapping("/testLock4jLockTemplate") + public R testLock4jLockTemplate(String key, String value) { + final LockInfo lockInfo = lockTemplate.lock(key, 30000L, 5000L, RedissonLockExecutor.class); + if (null == lockInfo) { + throw new RuntimeException("业务处理中,请稍后再试"); + } + // 获取锁成功,处理业务 + try { + try { + Thread.sleep(8000); + } catch (InterruptedException e) { + // + } + System.out.println("执行简单方法1 , 当前线程:" + Thread.currentThread().getName()); + } finally { + //释放锁 + lockTemplate.releaseLock(lockInfo); + } + //结束 + return R.ok("操作成功", value); + } + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/RedisPubSubController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/RedisPubSubController.java new file mode 100644 index 0000000..36189dc --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/RedisPubSubController.java @@ -0,0 +1,47 @@ +package org.aibidding.demo.controller; + +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.redis.utils.RedisUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Redis 发布订阅 演示案例 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/redis/pubsub") +public class RedisPubSubController { + + /** + * 发布消息 + * + * @param key 通道Key + * @param value 发送内容 + */ + @GetMapping("/pub") + public R pub(String key, String value) { + RedisUtils.publish(key, value, consumer -> { + System.out.println("发布通道 => " + key + ", 发送值 => " + value); + }); + return R.ok("操作成功"); + } + + /** + * 订阅消息 + * + * @param key 通道Key + */ + @GetMapping("/sub") + public R sub(String key) { + RedisUtils.subscribe(key, String.class, msg -> { + System.out.println("订阅通道 => " + key + ", 接收值 => " + msg); + }); + return R.ok("操作成功"); + } + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/RedisRateLimiterController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/RedisRateLimiterController.java new file mode 100644 index 0000000..55eb705 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/RedisRateLimiterController.java @@ -0,0 +1,64 @@ +package org.aibidding.demo.controller; + +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.ratelimiter.annotation.RateLimiter; +import org.aibidding.common.ratelimiter.enums.LimitType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 测试分布式限流样例 + * + * @author Lion Li + */ +@Slf4j +@RestController +@RequestMapping("/demo/rateLimiter") +public class RedisRateLimiterController { + + /** + * 测试全局限流 + * 全局影响 + */ + @RateLimiter(count = 2, time = 10) + @GetMapping("/test") + public R test(String value) { + return R.ok("操作成功", value); + } + + /** + * 测试请求IP限流 + * 同一IP请求受影响 + */ + @RateLimiter(count = 2, time = 10, limitType = LimitType.IP) + @GetMapping("/testip") + public R testip(String value) { + return R.ok("操作成功", value); + } + + /** + * 测试集群实例限流 + * 启动两个后端服务互不影响 + */ + @RateLimiter(count = 2, time = 10, limitType = LimitType.CLUSTER) + @GetMapping("/testcluster") + public R testcluster(String value) { + return R.ok("操作成功", value); + } + + /** + * 测试请求IP限流(key基于参数获取) + * 同一IP请求受影响 + * + * 简单变量获取 #变量 复杂表达式 #{#变量 != 1 ? 1 : 0} + */ + @RateLimiter(count = 2, time = 10, limitType = LimitType.IP, key = "#value") + @GetMapping("/testObj") + public R testObj(String value) { + return R.ok("操作成功", value); + } + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/SmsController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/SmsController.java new file mode 100644 index 0000000..3622f7d --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/SmsController.java @@ -0,0 +1,76 @@ +package org.aibidding.demo.controller; + +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.sms.config.properties.SmsProperties; +import org.aibidding.common.sms.core.SmsTemplate; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +/** + * 短信演示案例 + * 请先阅读文档 否则无法使用 + * + * @author Lion Li + * @version 4.2.0 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/sms") +public class SmsController { + + private final SmsProperties smsProperties; +// private final SmsTemplate smsTemplate; // 可以使用spring注入 +// private final AliyunSmsTemplate smsTemplate; // 也可以注入某个厂家的模板工具 + + /** + * 发送短信Aliyun + * + * @param phones 电话号 + * @param templateId 模板ID + */ + @GetMapping("/sendAliyun") + public R sendAliyun(String phones, String templateId) { + if (!smsProperties.getEnabled()) { + return R.fail("当前系统没有开启短信功能!"); + } + if (!SpringUtils.containsBean("aliyunSmsTemplate")) { + return R.fail("阿里云依赖未引入!"); + } + SmsTemplate smsTemplate = SpringUtils.getBean(SmsTemplate.class); + Map map = new HashMap<>(1); + map.put("code", "1234"); + Object send = smsTemplate.send(phones, templateId, map); + return R.ok(send); + } + + /** + * 发送短信Tencent + * + * @param phones 电话号 + * @param templateId 模板ID + */ + @GetMapping("/sendTencent") + public R sendTencent(String phones, String templateId) { + if (!smsProperties.getEnabled()) { + return R.fail("当前系统没有开启短信功能!"); + } + if (!SpringUtils.containsBean("tencentSmsTemplate")) { + return R.fail("腾讯云依赖未引入!"); + } + SmsTemplate smsTemplate = SpringUtils.getBean(SmsTemplate.class); + Map map = new HashMap<>(1); +// map.put("2", "测试测试"); + map.put("1", "1234"); + Object send = smsTemplate.send(phones, templateId, map); + return R.ok(send); + } + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/Swagger3DemoController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/Swagger3DemoController.java new file mode 100644 index 0000000..5175a02 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/Swagger3DemoController.java @@ -0,0 +1,31 @@ +package org.aibidding.demo.controller; + +import org.aibidding.common.core.domain.R; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * swagger3 用法示例 + * + * @author Lion Li + */ +@RestController +@RequestMapping("/swagger/demo") +public class Swagger3DemoController { + + /** + * 上传请求 + * 必须使用 @RequestPart 注解标注为文件 + * + * @param file 文件 + */ + @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public R upload(@RequestPart("file") MultipartFile file) { + return R.ok("操作成功", file.getOriginalFilename()); + } + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestBatchController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestBatchController.java new file mode 100644 index 0000000..9dede77 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestBatchController.java @@ -0,0 +1,90 @@ +package org.aibidding.demo.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.demo.domain.TestDemo; +import org.aibidding.demo.mapper.TestDemoMapper; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; + +/** + * 测试批量方法 + * + * @author Lion Li + * @date 2021-05-30 + */ +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/batch") +public class TestBatchController extends BaseController { + + /** + * 为了便于测试 直接引入mapper + */ + private final TestDemoMapper testDemoMapper; + + /** + * 新增批量方法 可完美替代 saveBatch 秒级插入上万数据 (对mysql负荷较大) + *

+ * 3.5.0 版本 增加 rewriteBatchedStatements=true 批处理参数 使 MP 原生批处理可以达到同样的速度 + */ + @PostMapping("/add") +// @DS("slave") + public R add() { + List list = new ArrayList<>(); + for (int i = 0; i < 1000; i++) { + TestDemo testDemo = new TestDemo(); + testDemo.setOrderNum(-1); + testDemo.setTestKey("批量新增"); + testDemo.setValue("测试新增"); + list.add(testDemo); + } + return toAjax(testDemoMapper.insertBatch(list)); + } + + /** + * 新增或更新 可完美替代 saveOrUpdateBatch 高性能 + *

+ * 3.5.0 版本 增加 rewriteBatchedStatements=true 批处理参数 使 MP 原生批处理可以达到同样的速度 + */ + @PostMapping("/addOrUpdate") +// @DS("slave") + public R addOrUpdate() { + List list = new ArrayList<>(); + for (int i = 0; i < 1000; i++) { + TestDemo testDemo = new TestDemo(); + testDemo.setOrderNum(-1); + testDemo.setTestKey("批量新增"); + testDemo.setValue("测试新增"); + list.add(testDemo); + } + testDemoMapper.insertBatch(list); + for (int i = 0; i < list.size(); i++) { + TestDemo testDemo = list.get(i); + testDemo.setTestKey("批量新增或修改"); + testDemo.setValue("批量新增或修改"); + if (i % 2 == 0) { + testDemo.setId(null); + } + } + return toAjax(testDemoMapper.insertOrUpdateBatch(list)); + } + + /** + * 删除批量方法 + */ + @DeleteMapping() +// @DS("slave") + public R remove() { + return toAjax(testDemoMapper.delete(new LambdaQueryWrapper() + .eq(TestDemo::getOrderNum, -1L))); + } + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestDemoController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestDemoController.java new file mode 100644 index 0000000..13a3b3f --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestDemoController.java @@ -0,0 +1,147 @@ +package org.aibidding.demo.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.ValidatorUtils; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.core.validate.QueryGroup; +import org.aibidding.common.excel.core.ExcelResult; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.demo.domain.TestDemo; +import org.aibidding.demo.domain.bo.TestDemoBo; +import org.aibidding.demo.domain.bo.TestDemoImportVo; +import org.aibidding.demo.domain.vo.TestDemoVo; +import org.aibidding.demo.service.ITestDemoService; +import org.springframework.http.MediaType; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * 测试单表Controller + * + * @author Lion Li + * @date 2021-07-26 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/demo") +public class TestDemoController extends BaseController { + + private final ITestDemoService testDemoService; + + /** + * 查询测试单表列表 + */ + @SaCheckPermission("demo:demo:list") + @GetMapping("/list") + public TableDataInfo list(@Validated(QueryGroup.class) TestDemoBo bo, PageQuery pageQuery) { + return testDemoService.queryPageList(bo, pageQuery); + } + + /** + * 自定义分页查询 + */ + @SaCheckPermission("demo:demo:list") + @GetMapping("/page") + public TableDataInfo page(@Validated(QueryGroup.class) TestDemoBo bo, PageQuery pageQuery) { + return testDemoService.customPageList(bo, pageQuery); + } + + /** + * 导入数据 + * + * @param file 导入文件 + */ + @Log(title = "测试单表", businessType = BusinessType.IMPORT) + @SaCheckPermission("demo:demo:import") + @PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public R importData(@RequestPart("file") MultipartFile file) throws Exception { + ExcelResult excelResult = ExcelUtil.importExcel(file.getInputStream(), TestDemoImportVo.class, true); + List list = MapstructUtils.convert(excelResult.getList(), TestDemo.class); + testDemoService.saveBatch(list); + return R.ok(excelResult.getAnalysis()); + } + + /** + * 导出测试单表列表 + */ + @SaCheckPermission("demo:demo:export") + @Log(title = "测试单表", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(@Validated TestDemoBo bo, HttpServletResponse response) { + List list = testDemoService.queryList(bo); + // 测试雪花id导出 +// for (TestDemoVo vo : list) { +// vo.setId(1234567891234567893L); +// } + ExcelUtil.exportExcel(list, "测试单表", TestDemoVo.class, response); + } + + /** + * 获取测试单表详细信息 + * + * @param id 测试ID + */ + @SaCheckPermission("demo:demo:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable("id") Long id) { + return R.ok(testDemoService.queryById(id)); + } + + /** + * 新增测试单表 + */ + @SaCheckPermission("demo:demo:add") + @Log(title = "测试单表", businessType = BusinessType.INSERT) + @RepeatSubmit(interval = 2, timeUnit = TimeUnit.SECONDS, message = "{repeat.submit.message}") + @PostMapping() + public R add(@RequestBody TestDemoBo bo) { + // 使用校验工具对标 @Validated(AddGroup.class) 注解 + // 用于在非 Controller 的地方校验对象 + ValidatorUtils.validate(bo, AddGroup.class); + return toAjax(testDemoService.insertByBo(bo)); + } + + /** + * 修改测试单表 + */ + @SaCheckPermission("demo:demo:edit") + @Log(title = "测试单表", businessType = BusinessType.UPDATE) + @RepeatSubmit + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody TestDemoBo bo) { + return toAjax(testDemoService.updateByBo(bo)); + } + + /** + * 删除测试单表 + * + * @param ids 测试ID串 + */ + @SaCheckPermission("demo:demo:remove") + @Log(title = "测试单表", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(testDemoService.deleteWithValidByIds(Arrays.asList(ids), true)); + } +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestEncryptController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestEncryptController.java new file mode 100644 index 0000000..c8028aa --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestEncryptController.java @@ -0,0 +1,55 @@ +package org.aibidding.demo.controller; + +import org.aibidding.common.core.domain.R; +import org.aibidding.demo.domain.TestDemoEncrypt; +import org.aibidding.demo.mapper.TestDemoEncryptMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + + +/** + * 测试数据库加解密功能 + * + * @author Lion Li + */ +@Validated +@RestController +@RequestMapping("/demo/encrypt") +public class TestEncryptController { + + @Autowired + private TestDemoEncryptMapper mapper; + @Value("${mybatis-encryptor.enable}") + private Boolean encryptEnable; + + /** + * 测试数据库加解密 + * + * @param key 测试key + * @param value 测试value + */ + @GetMapping() + public R> test(String key, String value) { + if (!encryptEnable) { + throw new RuntimeException("加密功能未开启!"); + } + Map map = new HashMap<>(2); + TestDemoEncrypt demo = new TestDemoEncrypt(); + demo.setTestKey(key); + demo.setValue(value); + mapper.insert(demo); + map.put("加密", demo); + TestDemoEncrypt testDemo = mapper.selectById(demo.getId()); + map.put("解密", testDemo); + return R.ok(map); + } + + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestExcelController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestExcelController.java new file mode 100644 index 0000000..a217bba --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestExcelController.java @@ -0,0 +1,97 @@ +package org.aibidding.demo.controller; + +import cn.hutool.core.collection.CollUtil; +import jakarta.servlet.http.HttpServletResponse; +import lombok.AllArgsConstructor; +import lombok.Data; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 测试Excel功能 + * + * @author Lion Li + */ +@RestController +@RequestMapping("/demo/excel") +public class TestExcelController { + + /** + * 单列表多数据 + */ + @GetMapping("/exportTemplateOne") + public void exportTemplateOne(HttpServletResponse response) { + Map map = new HashMap<>(); + map.put("title", "单列表多数据"); + map.put("test1", "数据测试1"); + map.put("test2", "数据测试2"); + map.put("test3", "数据测试3"); + map.put("test4", "数据测试4"); + map.put("testTest", "666"); + List list = new ArrayList<>(); + list.add(new TestObj("单列表测试1", "列表测试1", "列表测试2", "列表测试3", "列表测试4")); + list.add(new TestObj("单列表测试2", "列表测试5", "列表测试6", "列表测试7", "列表测试8")); + list.add(new TestObj("单列表测试3", "列表测试9", "列表测试10", "列表测试11", "列表测试12")); + ExcelUtil.exportTemplate(CollUtil.newArrayList(map, list), "单列表.xlsx", "excel/单列表.xlsx", response); + } + + /** + * 多列表多数据 + */ + @GetMapping("/exportTemplateMuliti") + public void exportTemplateMuliti(HttpServletResponse response) { + Map map = new HashMap<>(); + map.put("title1", "标题1"); + map.put("title2", "标题2"); + map.put("title3", "标题3"); + map.put("title4", "标题4"); + map.put("author", "Lion Li"); + List list1 = new ArrayList<>(); + list1.add(new TestObj1("list1测试1", "list1测试2", "list1测试3")); + list1.add(new TestObj1("list1测试4", "list1测试5", "list1测试6")); + list1.add(new TestObj1("list1测试7", "list1测试8", "list1测试9")); + List list2 = new ArrayList<>(); + list2.add(new TestObj1("list2测试1", "list2测试2", "list2测试3")); + list2.add(new TestObj1("list2测试4", "list2测试5", "list2测试6")); + List list3 = new ArrayList<>(); + list3.add(new TestObj1("list3测试1", "list3测试2", "list3测试3")); + List list4 = new ArrayList<>(); + list4.add(new TestObj1("list4测试1", "list4测试2", "list4测试3")); + list4.add(new TestObj1("list4测试4", "list4测试5", "list4测试6")); + list4.add(new TestObj1("list4测试7", "list4测试8", "list4测试9")); + list4.add(new TestObj1("list4测试10", "list4测试11", "list4测试12")); + Map multiListMap = new HashMap<>(); + multiListMap.put("map", map); + multiListMap.put("data1", list1); + multiListMap.put("data2", list2); + multiListMap.put("data3", list3); + multiListMap.put("data4", list4); + ExcelUtil.exportTemplateMultiList(multiListMap, "多列表.xlsx", "excel/多列表.xlsx", response); + } + + @Data + @AllArgsConstructor + static class TestObj1 { + private String test1; + private String test2; + private String test3; + } + + @Data + @AllArgsConstructor + static class TestObj { + private String name; + private String list1; + private String list2; + private String list3; + private String list4; + } + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestI18nController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestI18nController.java new file mode 100644 index 0000000..d8bf44d --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestI18nController.java @@ -0,0 +1,70 @@ +package org.aibidding.demo.controller; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.utils.MessageUtils; +import org.hibernate.validator.constraints.Range; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 测试国际化 + * + * @author Lion Li + */ +@Validated +@RestController +@RequestMapping("/demo/i18n") +public class TestI18nController { + + /** + * 通过code获取国际化内容 + * code为 messages.properties 中的 key + *

+ * 测试使用 user.register.success + * + * @param code 国际化code + */ + @GetMapping() + public R get(String code) { + return R.ok(MessageUtils.message(code)); + } + + /** + * Validator 校验国际化 + * 不传值 分别查看异常返回 + *

+ * 测试使用 not.null + */ + @GetMapping("/test1") + public R test1(@NotBlank(message = "{not.null}") String str) { + return R.ok(str); + } + + /** + * Bean 校验国际化 + * 不传值 分别查看异常返回 + *

+ * 测试使用 not.null + */ + @GetMapping("/test2") + public R test2(@Validated TestI18nBo bo) { + return R.ok(bo); + } + + @Data + public static class TestI18nBo { + + @NotBlank(message = "{not.null}") + private String name; + + @NotNull(message = "{not.null}") + @Range(min = 0, max = 100, message = "{length.not.valid}") + private Integer age; + } +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestSensitiveController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestSensitiveController.java new file mode 100644 index 0000000..189aec7 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestSensitiveController.java @@ -0,0 +1,76 @@ +package org.aibidding.demo.controller; + +import lombok.Data; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.sensitive.annotation.Sensitive; +import org.aibidding.common.sensitive.core.SensitiveService; +import org.aibidding.common.sensitive.core.SensitiveStrategy; +import org.aibidding.common.web.core.BaseController; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 测试数据脱敏控制器 + *

+ * 默认管理员不过滤 + * 需自行根据业务重写实现 + * + * @author Lion Li + * @version 3.6.0 + * @see SensitiveService + */ +@RestController +@RequestMapping("/demo/sensitive") +public class TestSensitiveController extends BaseController { + + /** + * 测试数据脱敏 + */ + @GetMapping("/test") + public R test() { + TestSensitive testSensitive = new TestSensitive(); + testSensitive.setIdCard("210397198608215431"); + testSensitive.setPhone("17640125371"); + testSensitive.setAddress("北京市朝阳区某某四合院1203室"); + testSensitive.setEmail("17640125371@163.com"); + testSensitive.setBankCard("6226456952351452853"); + return R.ok(testSensitive); + } + + @Data + static class TestSensitive { + + /** + * 身份证 + */ + @Sensitive(strategy = SensitiveStrategy.ID_CARD) + private String idCard; + + /** + * 电话 + */ + @Sensitive(strategy = SensitiveStrategy.PHONE) + private String phone; + + /** + * 地址 + */ + @Sensitive(strategy = SensitiveStrategy.ADDRESS) + private String address; + + /** + * 邮箱 + */ + @Sensitive(strategy = SensitiveStrategy.EMAIL) + private String email; + + /** + * 银行卡 + */ + @Sensitive(strategy = SensitiveStrategy.BANK_CARD) + private String bankCard; + + } + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestTreeController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestTreeController.java new file mode 100644 index 0000000..1e05d58 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/TestTreeController.java @@ -0,0 +1,107 @@ +package org.aibidding.demo.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.core.validate.QueryGroup; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.demo.domain.bo.TestTreeBo; +import org.aibidding.demo.domain.vo.TestTreeVo; +import org.aibidding.demo.service.ITestTreeService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; + +/** + * 测试树表Controller + * + * @author Lion Li + * @date 2021-07-26 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/tree") +public class TestTreeController extends BaseController { + + private final ITestTreeService testTreeService; + + /** + * 查询测试树表列表 + */ + @SaCheckPermission("demo:tree:list") + @GetMapping("/list") + public R> list(@Validated(QueryGroup.class) TestTreeBo bo) { + List list = testTreeService.queryList(bo); + return R.ok(list); + } + + /** + * 导出测试树表列表 + */ + @SaCheckPermission("demo:tree:export") + @Log(title = "测试树表", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public void export(@Validated TestTreeBo bo, HttpServletResponse response) { + List list = testTreeService.queryList(bo); + ExcelUtil.exportExcel(list, "测试树表", TestTreeVo.class, response); + } + + /** + * 获取测试树表详细信息 + * + * @param id 测试树ID + */ + @SaCheckPermission("demo:tree:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable("id") Long id) { + return R.ok(testTreeService.queryById(id)); + } + + /** + * 新增测试树表 + */ + @SaCheckPermission("demo:tree:add") + @Log(title = "测试树表", businessType = BusinessType.INSERT) + @RepeatSubmit + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody TestTreeBo bo) { + return toAjax(testTreeService.insertByBo(bo)); + } + + /** + * 修改测试树表 + */ + @SaCheckPermission("demo:tree:edit") + @Log(title = "测试树表", businessType = BusinessType.UPDATE) + @RepeatSubmit + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody TestTreeBo bo) { + return toAjax(testTreeService.updateByBo(bo)); + } + + /** + * 删除测试树表 + * + * @param ids 测试树ID串 + */ + @SaCheckPermission("demo:tree:remove") + @Log(title = "测试树表", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(testTreeService.deleteWithValidByIds(Arrays.asList(ids), true)); + } +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/queue/BoundedQueueController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/queue/BoundedQueueController.java new file mode 100644 index 0000000..a5210ad --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/queue/BoundedQueueController.java @@ -0,0 +1,90 @@ +package org.aibidding.demo.controller.queue; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.redis.utils.QueueUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 有界队列 演示案例 + *

+ * 轻量级队列 重量级数据量 请使用 MQ + *

+ * 集群测试通过 同一个数据只会被消费一次 做好事务补偿 + * 集群测试流程 在其中一台发送数据 两端分别调用获取接口 一次获取一条 + * + * @author Lion Li + * @version 3.6.0 + */ +@Slf4j +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/queue/bounded") +public class BoundedQueueController { + + + /** + * 添加队列数据 + * + * @param queueName 队列名 + * @param capacity 容量 + */ + @GetMapping("/add") + public R add(String queueName, int capacity) { + // 用完了一定要销毁 否则会一直存在 + boolean b = QueueUtils.destroyQueue(queueName); + log.info("通道: {} , 删除: {}", queueName, b); + // 初始化设置一次即可 + if (QueueUtils.trySetBoundedQueueCapacity(queueName, capacity)) { + log.info("通道: {} , 设置容量: {}", queueName, capacity); + } else { + log.info("通道: {} , 设置容量失败", queueName); + return R.fail("操作失败"); + } + for (int i = 0; i < 11; i++) { + String data = "data-" + i; + boolean flag = QueueUtils.addBoundedQueueObject(queueName, data); + if (flag == false) { + log.info("通道: {} , 发送数据: {} 失败, 通道已满", queueName, data); + } else { + log.info("通道: {} , 发送数据: {}", queueName, data); + } + } + return R.ok("操作成功"); + } + + /** + * 删除队列数据 + * + * @param queueName 队列名 + */ + @GetMapping("/remove") + public R remove(String queueName) { + String data = "data-" + 5; + if (QueueUtils.removeQueueObject(queueName, data)) { + log.info("通道: {} , 删除数据: {}", queueName, data); + } else { + return R.fail("操作失败"); + } + return R.ok("操作成功"); + } + + /** + * 获取队列数据 + * + * @param queueName 队列名 + */ + @GetMapping("/get") + public R get(String queueName) { + String data; + do { + data = QueueUtils.getQueueObject(queueName); + log.info("通道: {} , 获取数据: {}", queueName, data); + } while (data != null); + return R.ok("操作成功"); + } + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/queue/DelayedQueueController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/queue/DelayedQueueController.java new file mode 100644 index 0000000..f8d6665 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/queue/DelayedQueueController.java @@ -0,0 +1,90 @@ +package org.aibidding.demo.controller.queue; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.redis.utils.QueueUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.concurrent.TimeUnit; + +/** + * 延迟队列 演示案例 + *

+ * 轻量级队列 重量级数据量 请使用 MQ + * 例如: 创建订单30分钟后过期处理 + *

+ * 集群测试通过 同一个数据只会被消费一次 做好事务补偿 + * 集群测试流程 两台集群分别开启订阅 在其中一台发送数据 观察接收消息的规律 + * + * @author Lion Li + * @version 3.6.0 + */ +@Slf4j +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/queue/delayed") +public class DelayedQueueController { + + /** + * 订阅队列 + * + * @param queueName 队列名 + */ + @GetMapping("/subscribe") + public R subscribe(String queueName) { + log.info("通道: {} 监听中......", queueName); + // 项目初始化设置一次即可 + QueueUtils.subscribeBlockingQueue(queueName, (String orderNum) -> { + // 观察接收时间 + log.info("通道: {}, 收到数据: {}", queueName, orderNum); + }); + return R.ok("操作成功"); + } + + /** + * 添加队列数据 + * + * @param queueName 队列名 + * @param orderNum 订单号 + * @param time 延迟时间(秒) + */ + @GetMapping("/add") + public R add(String queueName, String orderNum, Long time) { + QueueUtils.addDelayedQueueObject(queueName, orderNum, time, TimeUnit.SECONDS); + // 观察发送时间 + log.info("通道: {} , 发送数据: {}", queueName, orderNum); + return R.ok("操作成功"); + } + + /** + * 删除队列数据 + * + * @param queueName 队列名 + * @param orderNum 订单号 + */ + @GetMapping("/remove") + public R remove(String queueName, String orderNum) { + if (QueueUtils.removeDelayedQueueObject(queueName, orderNum)) { + log.info("通道: {} , 删除数据: {}", queueName, orderNum); + } else { + return R.fail("操作失败"); + } + return R.ok("操作成功"); + } + + /** + * 销毁队列 + * + * @param queueName 队列名 + */ + @GetMapping("/destroy") + public R destroy(String queueName) { + // 用完了一定要销毁 否则会一直存在 + QueueUtils.destroyDelayedQueue(queueName); + return R.ok("操作成功"); + } + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/queue/PriorityDemo.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/queue/PriorityDemo.java new file mode 100644 index 0000000..3502fda --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/queue/PriorityDemo.java @@ -0,0 +1,22 @@ +package org.aibidding.demo.controller.queue; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 实体类 注意不允许使用内部类 否则会找不到类 + * + * @author Lion Li + * @version 3.6.0 + */ +@Data +@NoArgsConstructor +public class PriorityDemo implements Comparable { + private String name; + private Integer orderNum; + + @Override + public int compareTo(PriorityDemo other) { + return Integer.compare(getOrderNum(), other.getOrderNum()); + } +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/queue/PriorityQueueController.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/queue/PriorityQueueController.java new file mode 100644 index 0000000..e713a25 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/controller/queue/PriorityQueueController.java @@ -0,0 +1,89 @@ +package org.aibidding.demo.controller.queue; + +import cn.hutool.core.util.RandomUtil; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.redis.utils.QueueUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 优先队列 演示案例 + *

+ * 轻量级队列 重量级数据量 请使用 MQ + *

+ * 集群测试通过 同一个消息只会被消费一次 做好事务补偿 + * 集群测试流程 在其中一台发送数据 两端分别调用获取接口 一次获取一条 + * + * @author Lion Li + * @version 3.6.0 + */ +@Slf4j +@RequiredArgsConstructor +@RestController +@RequestMapping("/demo/queue/priority") +public class PriorityQueueController { + + /** + * 添加队列数据 + * + * @param queueName 队列名 + */ + @GetMapping("/add") + public R add(String queueName) { + // 用完了一定要销毁 否则会一直存在 + boolean b = QueueUtils.destroyQueue(queueName); + log.info("通道: {} , 删除: {}", queueName, b); + + for (int i = 0; i < 10; i++) { + int randomNum = RandomUtil.randomInt(10); + PriorityDemo data = new PriorityDemo(); + data.setName("data-" + i); + data.setOrderNum(randomNum); + if (QueueUtils.addPriorityQueueObject(queueName, data)) { + log.info("通道: {} , 发送数据: {}", queueName, data); + } else { + log.info("通道: {} , 发送数据: {}, 发送失败", queueName, data); + } + } + return R.ok("操作成功"); + } + + /** + * 删除队列数据 + * + * @param queueName 队列名 + * @param name 对象名 + * @param orderNum 排序号 + */ + @GetMapping("/remove") + public R remove(String queueName, String name, Integer orderNum) { + PriorityDemo data = new PriorityDemo(); + data.setName(name); + data.setOrderNum(orderNum); + if (QueueUtils.removeQueueObject(queueName, data)) { + log.info("通道: {} , 删除数据: {}", queueName, data); + } else { + return R.fail("操作失败"); + } + return R.ok("操作成功"); + } + + /** + * 获取队列数据 + * + * @param queueName 队列名 + */ + @GetMapping("/get") + public R get(String queueName) { + PriorityDemo data; + do { + data = QueueUtils.getQueueObject(queueName); + log.info("通道: {} , 获取数据: {}", queueName, data); + } while (data != null); + return R.ok("操作成功"); + } + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/TestDemo.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/TestDemo.java new file mode 100644 index 0000000..5f38d96 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/TestDemo.java @@ -0,0 +1,68 @@ +package org.aibidding.demo.domain; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.tenant.core.TenantEntity; + +import java.io.Serial; + +/** + * 测试单表对象 test_demo + * + * @author Lion Li + * @date 2021-07-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("test_demo") +public class TestDemo extends TenantEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 部门id + */ + private Long deptId; + + /** + * 用户id + */ + private Long userId; + + /** + * 排序号 + */ + @OrderBy(asc = false, sort = 1) + private Integer orderNum; + + /** + * key键 + */ + private String testKey; + + /** + * 值 + */ + private String value; + + /** + * 版本 + */ + @Version + private Long version; + + /** + * 删除标志 + */ + @TableLogic + private Long delFlag; + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/TestDemoEncrypt.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/TestDemoEncrypt.java new file mode 100644 index 0000000..b296f69 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/TestDemoEncrypt.java @@ -0,0 +1,29 @@ +package org.aibidding.demo.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.encrypt.annotation.EncryptField; +import org.aibidding.common.encrypt.enumd.AlgorithmType; + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("test_demo") +public class TestDemoEncrypt extends TestDemo { + + /** + * key键 + */ + // @EncryptField(algorithm=AlgorithmType.SM2, privateKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgZSlOvw8FBiH+aFJWLYZP/VRjg9wjfRarTkGBZd/T3N+gCgYIKoEcz1UBgi2hRANCAAR5DGuQwJqkxnbCsP+iPSDoHWIF4RwcR5EsSvT8QPxO1wRkR2IhCkzvRb32x2CUgJFdvoqVqfApFDPZzShqzBwX", publicKey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEeQxrkMCapMZ2wrD/oj0g6B1iBeEcHEeRLEr0/ED8TtcEZEdiIQpM70W99sdglICRXb6KlanwKRQz2c0oaswcFw==") + @EncryptField(algorithm = AlgorithmType.RSA, privateKey = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBANBBEeueWlXlkkj2+WY5l+IWe42d8b5K28g+G/CFKC/yYAEHtqGlCsBOrb+YBkG9mPzmuYA/n9k0NFIc8E8yY5vZQaroyFBrTTWEzG9RY2f7Y3svVyybs6jpXSUs4xff8abo7wL1Y/wUaeatTViamxYnyTvdTmLm3d+JjRij68rxAgMBAAECgYAB0TnhXraSopwIVRfmboea1b0upl+BUdTJcmci412UjrKr5aE695ZLPkXbFXijVu7HJlyyv94NVUdaMACV7Ku/S2RuNB70M7YJm8rAjHFC3/i2ZeIM60h1Ziy4QKv0XM3pRATlDCDNhC1WUrtQCQSgU8kcp6eUUppruOqDzcY04QJBAPm9+sBP9CwDRgy3e5+V8aZtJkwDstb0lVVV/KY890cydVxiCwvX3fqVnxKMlb+x0YtH0sb9v+71xvK2lGobaRECQQDVePU6r/cCEfpc+nkWF6osAH1f8Mux3rYv2DoBGvaPzV2BGfsLed4neRfCwWNCKvGPCdW+L0xMJg8+RwaoBUPhAkAT5kViqXxFPYWJYd1h2+rDXhMdH3ZSlm6HvDBDdrwlWinr0Iwcx3iSjPV93uHXwm118aUj4fg3LDJMCKxOwBxhAkByrQXfvwOMYygBprRBf/j0plazoWFrbd6lGR0f1uI5IfNnFRPdeFw1DEINZ2Hw+6zEUF44SqRMC+4IYJNc02dBAkBCgy7RvfyV/A7N6kKXxTHauY0v6XwSSvpeKtRJkbIcRWOdIYvaHO9L7cklj3vIEdwjSUp9K4VTBYYlmAz1xh03", publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDQQRHrnlpV5ZJI9vlmOZfiFnuNnfG+StvIPhvwhSgv8mABB7ahpQrATq2/mAZBvZj85rmAP5/ZNDRSHPBPMmOb2UGq6MhQa001hMxvUWNn+2N7L1csm7Oo6V0lLOMX3/Gm6O8C9WP8FGnmrU1YmpsWJ8k73U5i5t3fiY0Yo+vK8QIDAQAB") + private String testKey; + + /** + * 值 + */ + // @EncryptField // 什么也不写走默认yml配置 + // @EncryptField(algorithm = AlgorithmType.SM4, password = "10rfylhtccpuyke5") + @EncryptField(algorithm = AlgorithmType.AES, password = "10rfylhtccpuyke5") + private String value; + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/TestTree.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/TestTree.java new file mode 100644 index 0000000..4be356e --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/TestTree.java @@ -0,0 +1,65 @@ +package org.aibidding.demo.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.Version; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.tenant.core.TenantEntity; + +import java.io.Serial; + +/** + * 测试树表对象 test_tree + * + * @author Lion Li + * @date 2021-07-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("test_tree") +public class TestTree extends TenantEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 父ID + */ + private Long parentId; + + /** + * 部门id + */ + private Long deptId; + + /** + * 用户id + */ + private Long userId; + + /** + * 树节点名 + */ + private String treeName; + + /** + * 版本 + */ + @Version + private Long version; + + /** + * 删除标志 + */ + @TableLogic + private Long delFlag; + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/bo/TestDemoBo.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/bo/TestDemoBo.java new file mode 100644 index 0000000..c1fc5b8 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/bo/TestDemoBo.java @@ -0,0 +1,61 @@ +package org.aibidding.demo.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.demo.domain.TestDemo; + +/** + * 测试单表业务对象 test_demo + * + * @author Lion Li + * @date 2021-07-26 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = TestDemo.class, reverseConvertGenerate = false) +public class TestDemoBo extends BaseEntity { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = {EditGroup.class}) + private Long id; + + /** + * 部门id + */ + @NotNull(message = "部门id不能为空", groups = {AddGroup.class, EditGroup.class}) + private Long deptId; + + /** + * 用户id + */ + @NotNull(message = "用户id不能为空", groups = {AddGroup.class, EditGroup.class}) + private Long userId; + + /** + * 排序号 + */ + @NotNull(message = "排序号不能为空", groups = {AddGroup.class, EditGroup.class}) + private Integer orderNum; + + /** + * key键 + */ + @NotBlank(message = "key键不能为空", groups = {AddGroup.class, EditGroup.class}) + private String testKey; + + /** + * 值 + */ + @NotBlank(message = "值不能为空", groups = {AddGroup.class, EditGroup.class}) + private String value; + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/bo/TestDemoImportVo.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/bo/TestDemoImportVo.java new file mode 100644 index 0000000..03a049a --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/bo/TestDemoImportVo.java @@ -0,0 +1,52 @@ +package org.aibidding.demo.domain.bo; + +import com.alibaba.excel.annotation.ExcelProperty; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 测试单表业务对象 test_demo + * + * @author Lion Li + * @date 2021-07-26 + */ +@Data +public class TestDemoImportVo { + + /** + * 部门id + */ + @NotNull(message = "部门id不能为空") + @ExcelProperty(value = "部门id") + private Long deptId; + + /** + * 用户id + */ + @NotNull(message = "用户id不能为空") + @ExcelProperty(value = "用户id") + private Long userId; + + /** + * 排序号 + */ + @NotNull(message = "排序号不能为空") + @ExcelProperty(value = "排序号") + private Long orderNum; + + /** + * key键 + */ + @NotBlank(message = "key键不能为空") + @ExcelProperty(value = "key键") + private String testKey; + + /** + * 值 + */ + @NotBlank(message = "值不能为空") + @ExcelProperty(value = "值") + private String value; + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/bo/TestTreeBo.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/bo/TestTreeBo.java new file mode 100644 index 0000000..7a1931d --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/bo/TestTreeBo.java @@ -0,0 +1,54 @@ +package org.aibidding.demo.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.demo.domain.TestTree; + +/** + * 测试树表业务对象 test_tree + * + * @author Lion Li + * @date 2021-07-26 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = TestTree.class, reverseConvertGenerate = false) +public class TestTreeBo extends BaseEntity { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = {EditGroup.class}) + private Long id; + + /** + * 父ID + */ + private Long parentId; + + /** + * 部门id + */ + @NotNull(message = "部门id不能为空", groups = {AddGroup.class, EditGroup.class}) + private Long deptId; + + /** + * 用户id + */ + @NotNull(message = "用户id不能为空", groups = {AddGroup.class, EditGroup.class}) + private Long userId; + + /** + * 树节点名 + */ + @NotBlank(message = "树节点名不能为空", groups = {AddGroup.class, EditGroup.class}) + private String treeName; + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/vo/TestDemoVo.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/vo/TestDemoVo.java new file mode 100644 index 0000000..1d5a2bf --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/vo/TestDemoVo.java @@ -0,0 +1,104 @@ +package org.aibidding.demo.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.common.translation.annotation.Translation; +import org.aibidding.common.translation.constant.TransConstant; +import org.aibidding.demo.domain.TestDemo; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + +/** + * 测试单表视图对象 test_demo + * + * @author Lion Li + * @date 2021-07-26 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = TestDemo.class) +public class TestDemoVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ExcelProperty(value = "主键") + private Long id; + + /** + * 部门id + */ + @ExcelProperty(value = "部门id") + private Long deptId; + + /** + * 用户id + */ + @ExcelProperty(value = "用户id") + private Long userId; + + /** + * 排序号 + */ + @ExcelProperty(value = "排序号") + private Integer orderNum; + + /** + * key键 + */ + @ExcelProperty(value = "key键") + private String testKey; + + /** + * 值 + */ + @ExcelProperty(value = "值") + private String value; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; + + /** + * 创建人 + */ + @ExcelProperty(value = "创建人") + private Long createBy; + + /** + * 创建人账号 + */ + @Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "createBy") + @ExcelProperty(value = "创建人账号") + private String createByName; + + /** + * 更新时间 + */ + @ExcelProperty(value = "更新时间") + private Date updateTime; + + /** + * 更新人 + */ + @ExcelProperty(value = "更新人") + private Long updateBy; + + /** + * 更新人账号 + */ + @Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "updateBy") + @ExcelProperty(value = "更新人账号") + private String updateByName; + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/vo/TestTreeVo.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/vo/TestTreeVo.java new file mode 100644 index 0000000..a38f3c1 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/domain/vo/TestTreeVo.java @@ -0,0 +1,64 @@ +package org.aibidding.demo.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.demo.domain.TestTree; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + +/** + * 测试树表视图对象 test_tree + * + * @author Lion Li + * @date 2021-07-26 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = TestTree.class) +public class TestTreeVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Long id; + + /** + * 父id + */ + @ExcelProperty(value = "父id") + private Long parentId; + + /** + * 部门id + */ + @ExcelProperty(value = "部门id") + private Long deptId; + + /** + * 用户id + */ + @ExcelProperty(value = "用户id") + private Long userId; + + /** + * 树节点名 + */ + @ExcelProperty(value = "树节点名") + private String treeName; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; + + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/mapper/TestDemoEncryptMapper.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/mapper/TestDemoEncryptMapper.java new file mode 100644 index 0000000..75b3fb5 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/mapper/TestDemoEncryptMapper.java @@ -0,0 +1,13 @@ +package org.aibidding.demo.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.demo.domain.TestDemoEncrypt; + +/** + * 测试加密功能 + * + * @author Lion Li + */ +public interface TestDemoEncryptMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/mapper/TestDemoMapper.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/mapper/TestDemoMapper.java new file mode 100644 index 0000000..4a602ba --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/mapper/TestDemoMapper.java @@ -0,0 +1,58 @@ +package org.aibidding.demo.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; +import org.aibidding.common.mybatis.annotation.DataColumn; +import org.aibidding.common.mybatis.annotation.DataPermission; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.demo.domain.TestDemo; +import org.aibidding.demo.domain.vo.TestDemoVo; + +import java.util.Collection; +import java.util.List; + +/** + * 测试单表Mapper接口 + * + * @author Lion Li + * @date 2021-07-26 + */ +public interface TestDemoMapper extends BaseMapperPlus { + + @DataPermission({ + @DataColumn(key = "deptName", value = "dept_id"), + @DataColumn(key = "userName", value = "user_id") + }) + Page customPageList(@Param("page") Page page, @Param("ew") Wrapper wrapper); + + @Override + @DataPermission({ + @DataColumn(key = "deptName", value = "dept_id"), + @DataColumn(key = "userName", value = "user_id") + }) +

> P selectPage(P page, @Param(Constants.WRAPPER) Wrapper queryWrapper); + + @Override + @DataPermission({ + @DataColumn(key = "deptName", value = "dept_id"), + @DataColumn(key = "userName", value = "user_id") + }) + List selectList(@Param(Constants.WRAPPER) Wrapper queryWrapper); + + @Override + @DataPermission({ + @DataColumn(key = "deptName", value = "dept_id"), + @DataColumn(key = "userName", value = "user_id") + }) + int updateById(@Param(Constants.ENTITY) TestDemo entity); + + @Override + @DataPermission({ + @DataColumn(key = "deptName", value = "dept_id"), + @DataColumn(key = "userName", value = "user_id") + }) + int deleteBatchIds(@Param(Constants.COLL) Collection idList); +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/mapper/TestTreeMapper.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/mapper/TestTreeMapper.java new file mode 100644 index 0000000..57ac73c --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/mapper/TestTreeMapper.java @@ -0,0 +1,21 @@ +package org.aibidding.demo.mapper; + +import org.aibidding.common.mybatis.annotation.DataColumn; +import org.aibidding.common.mybatis.annotation.DataPermission; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.demo.domain.TestTree; +import org.aibidding.demo.domain.vo.TestTreeVo; + +/** + * 测试树表Mapper接口 + * + * @author Lion Li + * @date 2021-07-26 + */ +@DataPermission({ + @DataColumn(key = "deptName", value = "dept_id"), + @DataColumn(key = "userName", value = "user_id") +}) +public interface TestTreeMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/service/ITestDemoService.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/service/ITestDemoService.java new file mode 100644 index 0000000..25810ea --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/service/ITestDemoService.java @@ -0,0 +1,71 @@ +package org.aibidding.demo.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.demo.domain.TestDemo; +import org.aibidding.demo.domain.bo.TestDemoBo; +import org.aibidding.demo.domain.vo.TestDemoVo; + +import java.util.Collection; +import java.util.List; + +/** + * 测试单表Service接口 + * + * @author Lion Li + * @date 2021-07-26 + */ +public interface ITestDemoService { + + /** + * 查询单个 + * + * @return + */ + TestDemoVo queryById(Long id); + + /** + * 查询列表 + */ + TableDataInfo queryPageList(TestDemoBo bo, PageQuery pageQuery); + + /** + * 自定义分页查询 + */ + TableDataInfo customPageList(TestDemoBo bo, PageQuery pageQuery); + + /** + * 查询列表 + */ + List queryList(TestDemoBo bo); + + /** + * 根据新增业务对象插入测试单表 + * + * @param bo 测试单表新增业务对象 + * @return + */ + Boolean insertByBo(TestDemoBo bo); + + /** + * 根据编辑业务对象修改测试单表 + * + * @param bo 测试单表编辑业务对象 + * @return + */ + Boolean updateByBo(TestDemoBo bo); + + /** + * 校验并删除数据 + * + * @param ids 主键集合 + * @param isValid 是否校验,true-删除前校验,false-不校验 + * @return + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 批量保存 + */ + Boolean saveBatch(List list); +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/service/ITestTreeService.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/service/ITestTreeService.java new file mode 100644 index 0000000..ccf6b5c --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/service/ITestTreeService.java @@ -0,0 +1,52 @@ +package org.aibidding.demo.service; + +import org.aibidding.demo.domain.bo.TestTreeBo; +import org.aibidding.demo.domain.vo.TestTreeVo; + +import java.util.Collection; +import java.util.List; + +/** + * 测试树表Service接口 + * + * @author Lion Li + * @date 2021-07-26 + */ +public interface ITestTreeService { + /** + * 查询单个 + * + * @return + */ + TestTreeVo queryById(Long id); + + /** + * 查询列表 + */ + List queryList(TestTreeBo bo); + + /** + * 根据新增业务对象插入测试树表 + * + * @param bo 测试树表新增业务对象 + * @return + */ + Boolean insertByBo(TestTreeBo bo); + + /** + * 根据编辑业务对象修改测试树表 + * + * @param bo 测试树表编辑业务对象 + * @return + */ + Boolean updateByBo(TestTreeBo bo); + + /** + * 校验并删除数据 + * + * @param ids 主键集合 + * @param isValid 是否校验,true-删除前校验,false-不校验 + * @return + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/service/impl/TestDemoServiceImpl.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/service/impl/TestDemoServiceImpl.java new file mode 100644 index 0000000..738ddd4 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/service/impl/TestDemoServiceImpl.java @@ -0,0 +1,110 @@ +package org.aibidding.demo.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.demo.domain.TestDemo; +import org.aibidding.demo.domain.bo.TestDemoBo; +import org.aibidding.demo.domain.vo.TestDemoVo; +import org.aibidding.demo.mapper.TestDemoMapper; +import org.aibidding.demo.service.ITestDemoService; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 测试单表Service业务层处理 + * + * @author Lion Li + * @date 2021-07-26 + */ +@RequiredArgsConstructor +@Service +public class TestDemoServiceImpl implements ITestDemoService { + + private final TestDemoMapper baseMapper; + + @Override + public TestDemoVo queryById(Long id) { + return baseMapper.selectVoById(id); + } + + @Override + public TableDataInfo queryPageList(TestDemoBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 自定义分页查询 + */ + @Override + public TableDataInfo customPageList(TestDemoBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.customPageList(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + @Override + public List queryList(TestDemoBo bo) { + return baseMapper.selectVoList(buildQueryWrapper(bo)); + } + + private LambdaQueryWrapper buildQueryWrapper(TestDemoBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getTestKey()), TestDemo::getTestKey, bo.getTestKey()); + lqw.eq(StringUtils.isNotBlank(bo.getValue()), TestDemo::getValue, bo.getValue()); + lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, + TestDemo::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime")); + return lqw; + } + + @Override + public Boolean insertByBo(TestDemoBo bo) { + TestDemo add = MapstructUtils.convert(bo, TestDemo.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + @Override + public Boolean updateByBo(TestDemoBo bo) { + TestDemo update = MapstructUtils.convert(bo, TestDemo.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + * + * @param entity 实体类数据 + */ + private void validEntityBeforeSave(TestDemo entity) { + //TODO 做一些数据校验,如唯一约束 + } + + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if (isValid) { + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } + + @Override + public Boolean saveBatch(List list) { + return baseMapper.insertBatch(list); + } +} diff --git a/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/service/impl/TestTreeServiceImpl.java b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/service/impl/TestTreeServiceImpl.java new file mode 100644 index 0000000..4d9dc7e --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/java/org/aibidding/demo/service/impl/TestTreeServiceImpl.java @@ -0,0 +1,87 @@ +package org.aibidding.demo.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.demo.domain.TestTree; +import org.aibidding.demo.domain.bo.TestTreeBo; +import org.aibidding.demo.domain.vo.TestTreeVo; +import org.aibidding.demo.mapper.TestTreeMapper; +import org.aibidding.demo.service.ITestTreeService; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 测试树表Service业务层处理 + * + * @author Lion Li + * @date 2021-07-26 + */ +// @DS("slave") // 切换从库查询 +@RequiredArgsConstructor +@Service +public class TestTreeServiceImpl implements ITestTreeService { + + private final TestTreeMapper baseMapper; + + @Override + public TestTreeVo queryById(Long id) { + return baseMapper.selectVoById(id); + } + + // @DS("slave") // 切换从库查询 + @Override + public List queryList(TestTreeBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(TestTreeBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getTreeName()), TestTree::getTreeName, bo.getTreeName()); + lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, + TestTree::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime")); + return lqw; + } + + @Override + public Boolean insertByBo(TestTreeBo bo) { + TestTree add = MapstructUtils.convert(bo, TestTree.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + @Override + public Boolean updateByBo(TestTreeBo bo) { + TestTree update = MapstructUtils.convert(bo, TestTree.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + * + * @param entity 实体类数据 + */ + private void validEntityBeforeSave(TestTree entity) { + //TODO 做一些数据校验,如唯一约束 + } + + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if (isValid) { + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-demo/src/main/resources/excel/单列表.xlsx b/aibidding-modules/aibidding-demo/src/main/resources/excel/单列表.xlsx new file mode 100644 index 0000000..0f7347d Binary files /dev/null and b/aibidding-modules/aibidding-demo/src/main/resources/excel/单列表.xlsx differ diff --git a/aibidding-modules/aibidding-demo/src/main/resources/excel/多列表.xlsx b/aibidding-modules/aibidding-demo/src/main/resources/excel/多列表.xlsx new file mode 100644 index 0000000..c7d11dc Binary files /dev/null and b/aibidding-modules/aibidding-demo/src/main/resources/excel/多列表.xlsx differ diff --git a/aibidding-modules/aibidding-demo/src/main/resources/mapper/demo/TestDemoMapper.xml b/aibidding-modules/aibidding-demo/src/main/resources/mapper/demo/TestDemoMapper.xml new file mode 100644 index 0000000..47ea4cb --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/resources/mapper/demo/TestDemoMapper.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/aibidding-modules/aibidding-demo/src/main/resources/mapper/demo/TestTreeMapper.xml b/aibidding-modules/aibidding-demo/src/main/resources/mapper/demo/TestTreeMapper.xml new file mode 100644 index 0000000..46b0e36 --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/resources/mapper/demo/TestTreeMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-demo/src/main/resources/mapper/package-info.md b/aibidding-modules/aibidding-demo/src/main/resources/mapper/package-info.md new file mode 100644 index 0000000..c938b1e --- /dev/null +++ b/aibidding-modules/aibidding-demo/src/main/resources/mapper/package-info.md @@ -0,0 +1,3 @@ +java包使用 `.` 分割 resource 目录使用 `/` 分割 +
+此文件目的 防止文件夹粘连找不到 `xml` 文件 \ No newline at end of file diff --git a/aibidding-modules/aibidding-fusion/pom.xml b/aibidding-modules/aibidding-fusion/pom.xml new file mode 100644 index 0000000..9ab33ea --- /dev/null +++ b/aibidding-modules/aibidding-fusion/pom.xml @@ -0,0 +1,120 @@ + + + org.ruoyi + aibidding-modules + ${revision} + ../pom.xml + + + 4.0.0 + aibidding-fusion + + + 三方API接入 + + + + 5.8.18 + 20220924 + 5.0.0-beta.9 + 1.1.2-beta0 + 2.0.0 + 4.1.0 + 1.21 + 4.5.14 + 17 + ${java.version} + ${java.version} + + + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + cn.hutool + hutool-core + ${hutool.version} + + + cn.hutool + hutool-cache + ${hutool.version} + + + cn.hutool + hutool-crypto + ${hutool.version} + + + org.json + json + ${org-json.version} + + + net.dv8tion + JDA + ${jda.version} + + + club.minnced + opus-java + + + + + com.unfbx + chatgpt-java + ${chatgpt-java.version} + + + slf4j-simple + org.slf4j + + + + + eu.maxschuster + dataurl + ${dataurl.version} + + + com.github.xiaoymin + knife4j-openapi2-spring-boot-starter + ${knife4j.verison} + + + eu.bitwalker + UserAgentUtils + ${user-agent-utils.verison} + + + + org.springframework.boot + spring-boot-configuration-processor + true + + + org.projectlombok + lombok + true + + + jakarta.servlet + jakarta.servlet-api + + + org.ruoyi + aibidding-system + + + org.ruoyi + aibidding-knowledge + + + + diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/ChatController.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/ChatController.java new file mode 100644 index 0000000..5ff9a75 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/ChatController.java @@ -0,0 +1,129 @@ +package org.aibidding.fusion.controller; + + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.chat.domain.request.ChatRequest; +import org.aibidding.common.chat.domain.request.Dall3Request; +import org.aibidding.common.chat.entity.Tts.TextToSpeech; +import org.aibidding.common.chat.entity.files.UploadFileResponse; +import org.aibidding.common.chat.entity.images.Item; +import org.aibidding.common.chat.entity.whisper.WhisperResponse; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.exception.base.BaseException; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.system.domain.bo.ChatMessageBo; +import org.aibidding.system.domain.request.translation.TranslationRequest; +import org.aibidding.system.domain.vo.ChatMessageVo; +import org.aibidding.system.service.IChatMessageService; +import org.aibidding.system.service.ISseService; +import org.springframework.core.io.Resource; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; + +import java.util.List; + +/** + * 描述:聊天管理 + * + * @author ageerle@163.com + * @date 2023-03-01 + */ +@Controller +@Slf4j +@RequiredArgsConstructor +@RequestMapping("/chat") +public class ChatController { + + private final ISseService sseService; + + private final IChatMessageService chatMessageService; + + /** + * 聊天接口 + */ + @PostMapping("/send") + @ResponseBody + public SseEmitter sseChat(@RequestBody @Valid ChatRequest chatRequest, HttpServletRequest request) { + if (chatRequest.getModel().startsWith("ollama")) { + return sseService.ollamaChat(chatRequest); + } + return sseService.sseChat(chatRequest,request); + } + + + /** + * 上传文件 + */ + @PostMapping("/upload") + @ResponseBody + public UploadFileResponse upload(@RequestPart("file") MultipartFile file) { + return sseService.upload(file); + } + + + /** + * 语音转文本 + * + * @param file + */ + @PostMapping("/audio") + @ResponseBody + public WhisperResponse audio(@RequestParam("file") MultipartFile file) { + WhisperResponse whisperResponse = sseService.speechToTextTranscriptionsV2(file); + return whisperResponse; + } + + /** + * 文本转语音 + * + * @param textToSpeech + */ + @PostMapping("/speech") + @ResponseBody + public ResponseEntity speech(@RequestBody TextToSpeech textToSpeech) { + return sseService.textToSpeed(textToSpeech); + } + + /** + * 文本翻译 + * + * @param + */ + @PostMapping("/translation") + @ResponseBody + public String translation(@RequestBody TranslationRequest translationRequest) { + return sseService.translation(translationRequest); + } + + @PostMapping("/dall3") + @ResponseBody + public R> dall3(@RequestBody @Valid Dall3Request request) { + return R.ok(sseService.dall3(request)); + } + + /** + * 聊天记录 + */ + @PostMapping("/chatList") + @ResponseBody + public R> list(@RequestBody @Valid ChatMessageBo chatRequest, @RequestBody PageQuery pageQuery) { + // 默认查询当前登录用户消息记录 + LoginUser loginUser = LoginHelper.getLoginUser(); + if (loginUser == null) { + throw new BaseException("用户未登录!"); + } + chatRequest.setUserId(loginUser.getUserId()); + TableDataInfo chatMessageVoTableDataInfo = chatMessageService.queryPageList(chatRequest, pageQuery); + return R.ok(chatMessageVoTableDataInfo); + } + +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/CoverController.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/CoverController.java new file mode 100644 index 0000000..fa68704 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/CoverController.java @@ -0,0 +1,58 @@ +package org.aibidding.fusion.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.vo.cover.CoverParamVo; +import org.aibidding.system.domain.vo.cover.CoverVo; +import org.aibidding.system.domain.vo.cover.CoverCallbackVo; +import org.aibidding.system.domain.vo.cover.MusicVo; +import org.aibidding.system.service.ICoverService; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 绘声美音-翻唱 + * + * @author NSL + * @since 2024-12-25 + */ +@Api(tags = "歌曲翻唱") +@RequiredArgsConstructor +@RestController +@RequestMapping("/cover") +public class CoverController extends BaseController { + + private final ICoverService coverService; + + @ApiOperation(value = "查找歌曲") + @GetMapping("/searchMusic") + public R> searchMusic(String musicName) { + return R.ok(coverService.searchMusic(musicName)); + } + + @ApiOperation(value = "翻唱歌曲") + @PostMapping("/saveCoverTask") + public R saveCoverTask(@RequestBody CoverParamVo coverParamVo) { + coverService.saveCoverTask(coverParamVo); + return R.ok("翻唱歌曲处理中请等待10分钟-30分钟,翻唱结果请到翻唱记录中查询!"); + } + + @ApiOperation(value = "查询翻唱记录") + @PostMapping("/searchCoverRecord") + public R> searchCoverRecord(@RequestBody PageQuery pageQuery) { + return R.ok(coverService.searchCoverRecord(pageQuery)); + } + + @ApiOperation(value = "翻唱回调接口") + @PostMapping("/callback") + public R callback(@RequestBody CoverCallbackVo coverCallbackVo) { + coverService.callback(coverCallbackVo); + return R.ok(); + } +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/FaceController.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/FaceController.java new file mode 100644 index 0000000..b22bfc6 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/FaceController.java @@ -0,0 +1,42 @@ +package org.aibidding.fusion.controller; + +import cn.hutool.json.JSONUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Request; +import org.apache.commons.lang3.math.NumberUtils; +import org.aibidding.fusion.domain.InsightFace; +import org.aibidding.fusion.util.MjOkHttpUtil; +import org.aibidding.system.service.IChatCostService; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +@Api(tags = "任务查询") +@RestController +@RequestMapping("/mj") +@RequiredArgsConstructor +@Slf4j +public class FaceController { + + private final IChatCostService chatCostService; + + private final MjOkHttpUtil mjOkHttpUtil; + + @ApiOperation(value = "换脸") + @PostMapping("/insight-face/swap") + public String insightFace(@RequestBody InsightFace insightFace) { + // 扣除接口费用并且保存消息记录 + chatCostService.taskDeduct("mj","Face Changing", NumberUtils.toDouble(mjOkHttpUtil.getKey("faceSwapping"), 0.1)); + // 创建请求体(这里使用JSON作为媒体类型) + String insightFaceJson = JSONUtil.toJsonStr(insightFace); + String url = "mj/insight-face/swap"; + Request request = mjOkHttpUtil.createPostRequest(url, insightFaceJson); + return mjOkHttpUtil.executeRequest(request); + } + +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/LumaController.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/LumaController.java new file mode 100644 index 0000000..15b48ee --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/LumaController.java @@ -0,0 +1,52 @@ +package org.aibidding.fusion.controller; + +import cn.hutool.json.JSONUtil; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Request; +import org.apache.commons.lang3.math.NumberUtils; +import org.aibidding.common.core.utils.OkHttpUtil; +import org.aibidding.system.cofing.OkHttpConfig; +import org.aibidding.system.domain.GenerateLuma; +import org.aibidding.system.service.IChatCostService; +import org.springframework.web.bind.annotation.*; + +/** + * 描述:文生视频 + * + * @author ageerle@163.com + * date 2024/6/27 + */ +@RestController +@RequestMapping("/luma") +@RequiredArgsConstructor +@Slf4j +public class LumaController { + + private final OkHttpConfig okHttpConfig; + private final IChatCostService chatCostService; + + + @ApiOperation(value = "文生视频") + @PostMapping("/generations/") + public String generateVideo(@RequestBody GenerateLuma generateLuma) { + OkHttpUtil okHttpUtil = okHttpConfig.getOkHttpUtil("luma"); + + chatCostService.taskDeduct("luma", "文生视频", NumberUtils.toDouble(okHttpConfig.getGenerate(), 0.3)); + String generateJson = JSONUtil.toJsonStr(generateLuma); + String url = "luma/generations"; + Request request = okHttpUtil.createPostRequest(url, generateJson); + return okHttpUtil.executeRequest(request); + } + + @ApiOperation(value = "文生视频任务查询") + @GetMapping("/generations/{taskId}") + public String getGenerationTask(@PathVariable String taskId) { + OkHttpUtil okHttpUtil = okHttpConfig.getOkHttpUtil("luma"); + String url = "luma/generations/" + taskId; + Request request = okHttpUtil.createGetRequest(url); + return okHttpUtil.executeRequest(request); + } + +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/PptController.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/PptController.java new file mode 100644 index 0000000..013e585 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/PptController.java @@ -0,0 +1,79 @@ +package org.aibidding.fusion.controller; + +import com.alibaba.fastjson.JSONObject; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.vo.ppt.*; +import org.aibidding.system.service.IPptService; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; + +/** + * AI_PPT + * + * @author NSL + * @since 2024-12-30 + */ +@Api(tags = "AI-PPT") +@RequiredArgsConstructor +@RestController +@RequestMapping("/ppt") +public class PptController extends BaseController { + + private final IPptService pptService; + + @ApiOperation(value = "获取API Token") + @GetMapping("/getApiToken") + public R getApiToken() { + return R.ok(pptService.getApiToken()); + } + + @ApiOperation(value = "同步流式生成 PPT") + @PostMapping("/syncStreamGeneratePpt") + public R syncStreamGeneratePpt(String title) { + pptService.syncStreamGeneratePpt(title); + return R.ok(); + } + + @ApiOperation(value = "查询所有PPT列表") + @PostMapping("/selectPptList") + public R selectPptList(@RequestBody PptAllQueryDto pptQueryVo) { + pptService.selectPptList(pptQueryVo); + return R.ok(); + } + + @ApiOperation(value = "生成大纲") + @PostMapping(value = "/generateOutline", produces = {MediaType.TEXT_EVENT_STREAM_VALUE}) + public SseEmitter generateOutline(@RequestBody PptGenerateOutlineDto generateOutlineDto) { + return pptService.generateOutline(generateOutlineDto); + } + + @ApiOperation(value = "生成大纲内容") + @PostMapping(value = "/generateContent", produces = {MediaType.TEXT_EVENT_STREAM_VALUE}) + public SseEmitter generateOutline(@RequestBody PptGenerateContentDto generateContentDto) { + return pptService.generateContent(generateContentDto); + } + + @ApiOperation(value = "分页查询 PPT 模板") + @PostMapping("/getTemplates") + public R getPptTemplates(@RequestBody PptTemplateQueryDto pptQueryVo) { + return R.ok(pptService.getPptTemplates(pptQueryVo)); + } + + @ApiOperation(value = "生成 PPT") + @PostMapping("/generatePptx") + public R generatePptx(@RequestBody PptGeneratePptxDto pptQueryVo) { + return R.ok(pptService.generatePptx(pptQueryVo)); + } + + @ApiOperation(value = "生成PPT成功回调接口") + @PostMapping("/successCallback") + public R successCallback() { + pptService.successCallback(); + return R.ok(); + } +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/SubmitController.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/SubmitController.java new file mode 100644 index 0000000..966a6c8 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/SubmitController.java @@ -0,0 +1,134 @@ +package org.aibidding.fusion.controller; + +import cn.hutool.json.JSONUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Request; +import org.apache.commons.lang3.math.NumberUtils; +import org.aibidding.fusion.dto.*; +import org.aibidding.fusion.enums.ActionType; +import org.aibidding.fusion.util.MjOkHttpUtil; +import org.aibidding.system.service.IChatCostService; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Optional; + +@Api(tags = "任务提交") +@RestController +@RequestMapping("/mj/submit") +@RequiredArgsConstructor +@Slf4j +public class SubmitController { + + private final IChatCostService chatCostService; + private final MjOkHttpUtil mjOkHttpUtil; + + @ApiOperation(value = "绘图变化") + @PostMapping("/change") + public String change(@RequestBody SubmitChangeDTO changeDTO) { + String jsonStr = JSONUtil.toJsonStr(changeDTO); + String url = "mj/submit/change"; + Request request = mjOkHttpUtil.createPostRequest(url, jsonStr); + return mjOkHttpUtil.executeRequest(request); + } + + @ApiOperation(value = "执行动作") + @PostMapping("/action") + public String action(@RequestBody SubmitActionDTO changeDTO) { + ActionType actionType = ActionType.fromCustomId(getAction(changeDTO.getCustomId())); + Optional.ofNullable(actionType).ifPresentOrElse( + type -> { + switch (type) { + case UP_SAMPLE: + chatCostService.taskDeduct("mj","enlarge", NumberUtils.toDouble(mjOkHttpUtil.getKey("upsample"), 0.3)); + break; + case IN_PAINT: + // 局部重绘已经扣费,不执行任何操作 + break; + default: + chatCostService.taskDeduct("mj","change", NumberUtils.toDouble(mjOkHttpUtil.getKey("change"), 0.3)); + break; + } + }, + () -> chatCostService.taskDeduct("mj","change", NumberUtils.toDouble(mjOkHttpUtil.getKey("change"), 0.3)) + ); + + String jsonStr = JSONUtil.toJsonStr(changeDTO); + String url = "mj/submit/action"; + Request request = mjOkHttpUtil.createPostRequest(url, jsonStr); + return mjOkHttpUtil.executeRequest(request); + } + + @ApiOperation(value = "绘图变化-simple") + @PostMapping("/simple-change") + public String simpleChange(@RequestBody SubmitSimpleChangeDTO simpleChangeDTO) { + String jsonStr = JSONUtil.toJsonStr(simpleChangeDTO); + String url = "mj/submit/simple-change"; + Request request = mjOkHttpUtil.createPostRequest(url, jsonStr); + return mjOkHttpUtil.executeRequest(request); + } + + @ApiOperation(value = "提交图生图、混图任务") + @PostMapping("/blend") + public String blend(@RequestBody SubmitBlendDTO blendDTO) { + chatCostService.taskDeduct("mj","blend", NumberUtils.toDouble(mjOkHttpUtil.getKey("blend"), 0.3)); + String jsonStr = JSONUtil.toJsonStr(blendDTO); + String url = "mj/submit/blend"; + Request request = mjOkHttpUtil.createPostRequest(url, jsonStr); + return mjOkHttpUtil.executeRequest(request); + } + + @ApiOperation(value = "提交图生文任务") + @PostMapping("/describe") + public String describe(@RequestBody SubmitDescribeDTO describeDTO) { + chatCostService.taskDeduct("mj","describe", NumberUtils.toDouble(mjOkHttpUtil.getKey("describe"), 0.1)); + String jsonStr = JSONUtil.toJsonStr(describeDTO); + String url = "mj/submit/describe"; + Request request = mjOkHttpUtil.createPostRequest(url, jsonStr); + return mjOkHttpUtil.executeRequest(request); + } + + @ApiOperation(value = "提交文生图任务") + @PostMapping("/imagine") + public String imagine(@RequestBody SubmitImagineDTO imagineDTO) { + chatCostService.taskDeduct("mj",imagineDTO.getPrompt(), NumberUtils.toDouble(mjOkHttpUtil.getKey("imagine"), 0.3)); + String jsonStr = JSONUtil.toJsonStr(imagineDTO); + String url = "mj/submit/imagine"; + Request request = mjOkHttpUtil.createPostRequest(url, jsonStr); + return mjOkHttpUtil.executeRequest(request); + } + + @ApiOperation(value = "提交局部重绘任务") + @PostMapping("/modal") + public String modal(@RequestBody SubmitModalDTO submitModalDTO) { + chatCostService.taskDeduct("mj","repaint ", NumberUtils.toDouble(mjOkHttpUtil.getKey("inpaint"), 0.1)); + String jsonStr = JSONUtil.toJsonStr(submitModalDTO); + String url = "mj/submit/modal"; + Request request = mjOkHttpUtil.createPostRequest(url, jsonStr); + return mjOkHttpUtil.executeRequest(request); + } + + @ApiOperation(value = "提交提示词分析任务") + @PostMapping("/shorten") + public String shorten(@RequestBody SubmitShortenDTO submitShortenDTO) { + chatCostService.taskDeduct("mj","shorten", NumberUtils.toDouble(mjOkHttpUtil.getKey("shorten"), 0.1)); + String jsonStr = JSONUtil.toJsonStr(submitShortenDTO); + String url = "mj/submit/shorten"; + Request request = mjOkHttpUtil.createPostRequest(url, jsonStr); + return mjOkHttpUtil.executeRequest(request); + } + + public String getAction(String customId) { + if (customId == null || customId.isEmpty()) { + return null; + } + String[] parts = customId.split("::"); + return customId.endsWith("SOLO") ? parts[1] : parts[2]; + } + +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/SunoController.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/SunoController.java new file mode 100644 index 0000000..0f6bcf7 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/SunoController.java @@ -0,0 +1,68 @@ +package org.aibidding.fusion.controller; + +import cn.hutool.json.JSONUtil; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Request; +import org.apache.commons.lang3.math.NumberUtils; +import org.aibidding.common.core.utils.OkHttpUtil; +import org.aibidding.system.cofing.OkHttpConfig; +import org.aibidding.system.domain.GenerateLyric; +import org.aibidding.system.domain.GenerateSuno; +import org.aibidding.system.service.IChatCostService; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/sunoapi") +@RequiredArgsConstructor +@Slf4j +public class SunoController { + + private final OkHttpConfig okHttpConfig; + private final IChatCostService chatCostService; + + @ApiOperation(value = "文生歌曲") + @PostMapping("/generate") + public String generate(@RequestBody GenerateSuno generateSuno) { + OkHttpUtil okHttpUtil = okHttpConfig.getOkHttpUtil("suno"); + // 扣除接口费用并且保存消息记录 + chatCostService.taskDeduct("suno","文生歌曲", NumberUtils.toDouble(okHttpConfig.getGenerate(), 0.3)); + // 创建请求体(这里使用JSON作为媒体类型) + String generateJson = JSONUtil.toJsonStr(generateSuno); + String url = "suno/generate"; + Request request = okHttpUtil.createPostRequest(url, generateJson); + return okHttpUtil.executeRequest(request); + } + + @ApiOperation(value = "生成歌词") + @PostMapping("/generate/lyrics/") + public String generate(@RequestBody GenerateLyric generateLyric) { + OkHttpUtil okHttpUtil = okHttpConfig.getOkHttpUtil("suno"); + String generateJson = JSONUtil.toJsonStr(generateLyric); + String url = "task/suno/v1/submit/lyrics"; + Request request = okHttpUtil.createPostRequest(url, generateJson); + return okHttpUtil.executeRequest(request); + } + + + @ApiOperation(value = "查询歌词任务") + @GetMapping("/lyrics/{taskId}") + public String lyrics(@PathVariable String taskId) { + OkHttpUtil okHttpUtil = okHttpConfig.getOkHttpUtil("suno"); + String url = "task/suno/v1/fetch/"+taskId; + Request request = okHttpUtil.createGetRequest(url); + return okHttpUtil.executeRequest(request); + } + + + @ApiOperation(value = "查询歌曲任务") + @GetMapping("/feed/{taskId}") + public String feed(@PathVariable String taskId) { + OkHttpUtil okHttpUtil = okHttpConfig.getOkHttpUtil("suno"); + String url = "suno/feed/"+taskId; + Request request = okHttpUtil.createGetRequest(url); + return okHttpUtil.executeRequest(request); + } + +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/TaskController.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/TaskController.java new file mode 100644 index 0000000..2669fb5 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/TaskController.java @@ -0,0 +1,48 @@ +package org.aibidding.fusion.controller; + +import cn.hutool.json.JSONUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Request; +import org.aibidding.fusion.dto.TaskConditionDTO; +import org.aibidding.fusion.util.MjOkHttpUtil; +import org.springframework.web.bind.annotation.*; + +@Api(tags = "任务查询") +@RestController +@RequestMapping("/mj/task") +@RequiredArgsConstructor +@Slf4j +public class TaskController { + + private final MjOkHttpUtil mjOkHttpUtil; + + @ApiOperation(value = "指定ID获取任务") + @GetMapping("/{id}/fetch") + public String fetch(@ApiParam(value = "任务ID") @PathVariable String id) { + String url = "mj/task/" + id + "/fetch"; + Request request = mjOkHttpUtil.createGetRequest(url); + return mjOkHttpUtil.executeRequest(request); + } + + @ApiOperation(value = "根据ID列表查询任务") + @PostMapping("/list-by-condition") + public String listByIds(@RequestBody TaskConditionDTO conditionDTO) { + String url = "mj/task/list-by-condition"; + String conditionJson = JSONUtil.toJsonStr(conditionDTO); + Request request = mjOkHttpUtil.createPostRequest(url,conditionJson); + return mjOkHttpUtil.executeRequest(request); + } + + @ApiOperation(value = "获取任务图片的seed") + @GetMapping("/{id}/image-seed") + public String getSeed(@ApiParam(value = "任务ID") @PathVariable String id) { + String url = "mj/task/" + id + "/image-seed"; + Request request = mjOkHttpUtil.createGetRequest(url); + return mjOkHttpUtil.executeRequest(request); + } + +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/VoiceController.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/VoiceController.java new file mode 100644 index 0000000..3e36132 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/controller/VoiceController.java @@ -0,0 +1,52 @@ +package org.aibidding.fusion.controller; + +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.request.RoleListDto; +import org.aibidding.system.request.SimpleGenerateRequest; +import org.aibidding.system.response.SimpleGenerateDataResponse; +import org.aibidding.system.response.rolelist.ChatAppStoreVO; +import org.aibidding.system.service.IChatAppStoreService; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 应用市场 + * + * @author Lion Li + * @date 2024-03-19 + */ +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/voice") +public class VoiceController extends BaseController { + + private final IChatAppStoreService voiceRoleService; + + /** + * 实时语音生成 + */ + @PostMapping("/simpleGenerate") + public R simpleGenerate(@RequestBody SimpleGenerateRequest simpleGenerateRequest) { + return R.ok(voiceRoleService.simpleGenerate(simpleGenerateRequest)); + } + + /** + * 角色市场 + */ + @GetMapping("/roleList") + public R> roleList() { + return R.ok(voiceRoleService.roleList()); + } + + /** + * 收藏角色 + */ + @PostMapping("/copyRole") + public R copyRole(@RequestBody RoleListDto roleListDto) { + voiceRoleService.copyRole(roleListDto); + return R.ok(); + } +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/domain/DomainObject.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/domain/DomainObject.java new file mode 100644 index 0000000..ce883bd --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/domain/DomainObject.java @@ -0,0 +1,72 @@ +package org.aibidding.fusion.domain; + + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + + +public class DomainObject implements Serializable { + @Getter + @Setter + @ApiModelProperty("ID") + protected String id; + + @Setter + protected Map properties; // 扩展属性,仅支持基本类型 + + @JsonIgnore + private final transient Object lock = new Object(); + + public void sleep() throws InterruptedException { + synchronized (this.lock) { + this.lock.wait(); + } + } + + public void awake() { + synchronized (this.lock) { + this.lock.notifyAll(); + } + } + + public DomainObject setProperty(String name, Object value) { + getProperties().put(name, value); + return this; + } + + public DomainObject removeProperty(String name) { + getProperties().remove(name); + return this; + } + + public Object getProperty(String name) { + return getProperties().get(name); + } + + @SuppressWarnings("unchecked") + public T getPropertyGeneric(String name) { + return (T) getProperty(name); + } + + public T getProperty(String name, Class clz) { + return getProperty(name, clz, null); + } + + public T getProperty(String name, Class clz, T defaultValue) { + Object value = getProperty(name); + return value == null ? defaultValue : clz.cast(value); + } + + public Map getProperties() { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + return this.properties; + } +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/domain/InsightFace.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/domain/InsightFace.java new file mode 100644 index 0000000..e8a0f49 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/domain/InsightFace.java @@ -0,0 +1,22 @@ +package org.aibidding.fusion.domain; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author WangLe + */ +@Data +@ApiModel("Discord账号") +public class InsightFace implements Serializable { + /**本人头像json*/ + @ApiModelProperty("本人头像json") + private String sourceBase64; + + /**明星头像json*/ + @ApiModelProperty("明星头像json") + private String targetBase64; +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/BaseSubmitDTO.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/BaseSubmitDTO.java new file mode 100644 index 0000000..df9e780 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/BaseSubmitDTO.java @@ -0,0 +1,16 @@ +package org.aibidding.fusion.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public abstract class BaseSubmitDTO { + + @ApiModelProperty("自定义参数") + protected String state; + + @ApiModelProperty("回调地址, 为空时使用全局notifyHook") + protected String notifyHook; +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitActionDTO.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitActionDTO.java new file mode 100644 index 0000000..05920eb --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitActionDTO.java @@ -0,0 +1,18 @@ +package org.aibidding.fusion.dto; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + + +@Data +@ApiModel("变化任务提交参数") +public class SubmitActionDTO { + + private String customId; + + private String taskId; + + private String state; + + private String notifyHook; +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitBlendDTO.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitBlendDTO.java new file mode 100644 index 0000000..33f7f46 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitBlendDTO.java @@ -0,0 +1,21 @@ +package org.aibidding.fusion.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.fusion.enums.BlendDimensions; + +import java.util.List; + +@Data +@ApiModel("Blend提交参数") +@EqualsAndHashCode(callSuper = true) +public class SubmitBlendDTO extends BaseSubmitDTO { + + @ApiModelProperty(value = "图片base64数组", required = true, example = "[\"data:image/png;base64,xxx1\", \"data:image/png;base64,xxx2\"]") + private List base64Array; + + @ApiModelProperty(value = "比例: PORTRAIT(2:3); SQUARE(1:1); LANDSCAPE(3:2)", example = "SQUARE") + private BlendDimensions dimensions = BlendDimensions.SQUARE; +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitChangeDTO.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitChangeDTO.java new file mode 100644 index 0000000..bf2d4dd --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitChangeDTO.java @@ -0,0 +1,25 @@ +package org.aibidding.fusion.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.fusion.enums.TaskAction; + + +@Data +@ApiModel("变化任务提交参数") +@EqualsAndHashCode(callSuper = true) +public class SubmitChangeDTO extends BaseSubmitDTO { + + @ApiModelProperty(value = "任务ID", required = true, example = "\"1320098173412546\"") + private String taskId; + + @ApiModelProperty(value = "UPSCALE(放大); VARIATION(变换); REROLL(重新生成)", required = true, + allowableValues = "UPSCALE, VARIATION, REROLL", example = "UPSCALE") + private TaskAction action; + + @ApiModelProperty(value = "序号(1~4), action为UPSCALE,VARIATION时必传", allowableValues = "range[1, 4]", example = "1") + private Integer index; + +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitDescribeDTO.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitDescribeDTO.java new file mode 100644 index 0000000..ac47e88 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitDescribeDTO.java @@ -0,0 +1,15 @@ +package org.aibidding.fusion.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@ApiModel("Describe提交参数") +@EqualsAndHashCode(callSuper = true) +public class SubmitDescribeDTO extends BaseSubmitDTO { + + @ApiModelProperty(value = "图片base64", required = true, example = "data:image/png;base64,xxx") + private String base64; +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitImagineDTO.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitImagineDTO.java new file mode 100644 index 0000000..7ce1a4c --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitImagineDTO.java @@ -0,0 +1,26 @@ +package org.aibidding.fusion.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + + +@Data +@ApiModel("Imagine提交参数") +@EqualsAndHashCode(callSuper = true) +public class SubmitImagineDTO extends BaseSubmitDTO { + + @ApiModelProperty(value = "提示词", required = true, example = "Cat") + private String prompt; + + @ApiModelProperty(value = "垫图base64数组") + private List base64Array; + + @ApiModelProperty(hidden = true) + @Deprecated(since = "3.0", forRemoval = true) + private String base64; + +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitModalDTO.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitModalDTO.java new file mode 100644 index 0000000..0f011d7 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitModalDTO.java @@ -0,0 +1,19 @@ +package org.aibidding.fusion.dto; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel("局部重绘提交参数") +public class SubmitModalDTO extends BaseSubmitDTO{ + + private String maskBase64; + + private String taskId; + + private String prompt; + +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitShortenDTO.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitShortenDTO.java new file mode 100644 index 0000000..734d1d8 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitShortenDTO.java @@ -0,0 +1,17 @@ +package org.aibidding.fusion.dto; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel("prompt分析提交参数") +public class SubmitShortenDTO extends BaseSubmitDTO{ + + private String botType; + + private String prompt; + +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitSimpleChangeDTO.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitSimpleChangeDTO.java new file mode 100644 index 0000000..088b134 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/SubmitSimpleChangeDTO.java @@ -0,0 +1,17 @@ +package org.aibidding.fusion.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +@Data +@ApiModel("变化任务提交参数-simple") +@EqualsAndHashCode(callSuper = true) +public class SubmitSimpleChangeDTO extends BaseSubmitDTO { + + @ApiModelProperty(value = "变化描述: ID $action$index", required = true, example = "1320098173412546 U2") + private String content; + +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/TaskConditionDTO.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/TaskConditionDTO.java new file mode 100644 index 0000000..31d483d --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/dto/TaskConditionDTO.java @@ -0,0 +1,14 @@ +package org.aibidding.fusion.dto; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.util.List; + +@Data +@ApiModel("任务查询参数") +public class TaskConditionDTO { + + private List ids; + +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/enums/ActionType.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/enums/ActionType.java new file mode 100644 index 0000000..e6d7c20 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/enums/ActionType.java @@ -0,0 +1,32 @@ +package org.aibidding.fusion.enums; + +import lombok.Getter; + +/** + * @author WangLe + */ +@Getter +public enum ActionType { + IN_PAINT("Inpaint"), // 局部重绘操作 + RE_ROLL("reroll"), // 重绘操作 + UP_SAMPLE("upsample"), // 放大操作 + ZOOM("zoom"), // 变焦操作 + UPSCALE("upscale"), // 高清放大操作 + VARIATION("variation"); // 变化操作 + + private final String action; + + ActionType(String action) { + this.action = action; + } + + public static ActionType fromCustomId(String customId) { + for (ActionType type : values()) { + if (type.getAction().equals(customId)) { + return type; + } + } + return null; + } +} + diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/enums/BlendDimensions.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/enums/BlendDimensions.java new file mode 100644 index 0000000..6823150 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/enums/BlendDimensions.java @@ -0,0 +1,21 @@ +package org.aibidding.fusion.enums; + + +import lombok.Getter; + +@Getter +public enum BlendDimensions { + + PORTRAIT("2:3"), + + SQUARE("1:1"), + + LANDSCAPE("3:2"); + + private final String value; + + BlendDimensions(String value) { + this.value = value; + } + +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/enums/TaskAction.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/enums/TaskAction.java new file mode 100644 index 0000000..196c6a8 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/enums/TaskAction.java @@ -0,0 +1,30 @@ +package org.aibidding.fusion.enums; + + +public enum TaskAction { + /** + * 生成图片. + */ + IMAGINE, + /** + * 选中放大. + */ + UPSCALE, + /** + * 选中其中的一张图,生成四张相似的. + */ + VARIATION, + /** + * 重新执行. + */ + REROLL, + /** + * 图转prompt. + */ + DESCRIBE, + /** + * 多图混合. + */ + BLEND + +} diff --git a/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/util/MjOkHttpUtil.java b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/util/MjOkHttpUtil.java new file mode 100644 index 0000000..0336ce9 --- /dev/null +++ b/aibidding-modules/aibidding-fusion/src/main/java/org/aibidding/fusion/util/MjOkHttpUtil.java @@ -0,0 +1,87 @@ +package org.aibidding.fusion.util; + +import jakarta.annotation.PostConstruct; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import okhttp3.*; +import org.aibidding.common.core.service.ConfigService; +import org.aibidding.system.domain.bo.SysModelBo; +import org.aibidding.system.domain.vo.SysModelVo; +import org.aibidding.system.service.ISysModelService; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @author WangLe + */ +@RequiredArgsConstructor +@Component +@Slf4j +public class MjOkHttpUtil { + + private final ISysModelService sysModelService; + + private final ConfigService configService; + + private static final String API_SECRET_HEADER = "mj-api-secret"; + + private String apiKey; + + private String apiHost; + + private final OkHttpClient client = new OkHttpClient.Builder() + .connectTimeout(300, TimeUnit.SECONDS) + .writeTimeout(300, TimeUnit.SECONDS) + .readTimeout(300, TimeUnit.SECONDS) + .build(); + + public String executeRequest(Request request) { + try (Response response = client.newCall(request).execute()) { + if (!response.isSuccessful()) { + throw new IOException("Unexpected code " + response); + } + return response.body() != null ? response.body().string() : null; + } catch (IOException e) { + // 这里应根据实际情况使用适当的日志记录方式 + log.error("请求失败: {}",e.getMessage()); + return null; + } + } + + public Request createPostRequest(String url, String json) { + MediaType JSON = MediaType.get("application/json; charset=utf-8"); + RequestBody body = RequestBody.create(json, JSON); + return new Request.Builder() + .url(apiHost + url) + .post(body) + .header(API_SECRET_HEADER, apiKey) + .build(); + } + + public Request createGetRequest(String url) { + return new Request.Builder() + .url(apiHost + url) + .header(API_SECRET_HEADER, apiKey) + .build(); + } + + @PostConstruct + public void init() { + SysModelBo sysModelBo = new SysModelBo(); + sysModelBo.setModelName("midjourney"); + List sysModelList = sysModelService.queryList(sysModelBo); + if (!sysModelList.isEmpty()) { + SysModelVo model = sysModelList.get(0); + this.apiKey = model.getApiKey(); + this.apiHost = model.getApiHost(); + } + } + + public String getKey(String key) { + return configService.getConfigValue("mj", key); + } +} + diff --git a/aibidding-modules/aibidding-generator/pom.xml b/aibidding-modules/aibidding-generator/pom.xml new file mode 100644 index 0000000..99e3ba5 --- /dev/null +++ b/aibidding-modules/aibidding-generator/pom.xml @@ -0,0 +1,53 @@ + + + + org.ruoyi + aibidding-modules + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-generator + + + generator 代码生成 + + + + + + org.ruoyi + aibidding-common-core + + + + org.ruoyi + aibidding-common-doc + + + + org.ruoyi + aibidding-common-mybatis + + + + org.ruoyi + aibidding-common-web + + + + org.ruoyi + aibidding-common-log + + + + + org.apache.velocity + velocity-engine-core + + + + diff --git a/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/config/GenConfig.java b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/config/GenConfig.java new file mode 100644 index 0000000..715e490 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/config/GenConfig.java @@ -0,0 +1,73 @@ +package org.aibidding.generator.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +/** + * 读取代码生成相关配置 + * + * @author aibidding + */ +@Component +@ConfigurationProperties(prefix = "gen") +@PropertySource(value = {"classpath:generator.yml"}, encoding = "UTF-8") +public class GenConfig { + + /** + * 作者 + */ + public static String author; + + /** + * 生成包路径 + */ + public static String packageName; + + /** + * 自动去除表前缀,默认是false + */ + public static boolean autoRemovePre; + + /** + * 表前缀(类名不会包含表前缀) + */ + public static String tablePrefix; + + public static String getAuthor() { + return author; + } + + @Value("${author}") + public void setAuthor(String author) { + GenConfig.author = author; + } + + public static String getPackageName() { + return packageName; + } + + @Value("${packageName}") + public void setPackageName(String packageName) { + GenConfig.packageName = packageName; + } + + public static boolean getAutoRemovePre() { + return autoRemovePre; + } + + @Value("${autoRemovePre}") + public void setAutoRemovePre(boolean autoRemovePre) { + GenConfig.autoRemovePre = autoRemovePre; + } + + public static String getTablePrefix() { + return tablePrefix; + } + + @Value("${tablePrefix}") + public void setTablePrefix(String tablePrefix) { + GenConfig.tablePrefix = tablePrefix; + } +} diff --git a/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/constant/GenConstants.java b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/constant/GenConstants.java new file mode 100644 index 0000000..cdabbd7 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/constant/GenConstants.java @@ -0,0 +1,186 @@ +package org.aibidding.generator.constant; + +/** + * 代码生成通用常量 + * + * @author aibidding + */ +public interface GenConstants { + /** + * 单表(增删改查) + */ + String TPL_CRUD = "crud"; + + /** + * 树表(增删改查) + */ + String TPL_TREE = "tree"; + + /** + * 树编码字段 + */ + String TREE_CODE = "treeCode"; + + /** + * 树父编码字段 + */ + String TREE_PARENT_CODE = "treeParentCode"; + + /** + * 树名称字段 + */ + String TREE_NAME = "treeName"; + + /** + * 上级菜单ID字段 + */ + String PARENT_MENU_ID = "parentMenuId"; + + /** + * 上级菜单名称字段 + */ + String PARENT_MENU_NAME = "parentMenuName"; + + /** + * 数据库字符串类型 + */ + String[] COLUMNTYPE_STR = {"char", "varchar", "enum", "set", "nchar", "nvarchar", "varchar2", "nvarchar2"}; + + /** + * 数据库文本类型 + */ + String[] COLUMNTYPE_TEXT = {"tinytext", "text", "mediumtext", "longtext", "binary", "varbinary", "blob", + "ntext", "image", "bytea"}; + + /** + * 数据库时间类型 + */ + String[] COLUMNTYPE_TIME = {"datetime", "time", "date", "timestamp", "year", "interval", + "smalldatetime", "datetime2", "datetimeoffset"}; + + /** + * 数据库数字类型 + */ + String[] COLUMNTYPE_NUMBER = {"tinyint", "smallint", "mediumint", "int", "number", "integer", + "bit", "bigint", "float", "double", "decimal", "numeric", "real", "double precision", + "smallserial", "serial", "bigserial", "money", "smallmoney"}; + + /** + * BO对象 不需要添加字段 + */ + String[] COLUMNNAME_NOT_ADD = {"create_dept", "create_by", "create_time", "del_flag", "update_by", + "update_time", "version", "tenant_id"}; + + /** + * BO对象 不需要编辑字段 + */ + String[] COLUMNNAME_NOT_EDIT = {"create_dept", "create_by", "create_time", "del_flag", "update_by", + "update_time", "version", "tenant_id"}; + + /** + * VO对象 不需要返回字段 + */ + String[] COLUMNNAME_NOT_LIST = {"create_dept", "create_by", "create_time", "del_flag", "update_by", + "update_time", "version", "tenant_id"}; + + /** + * BO对象 不需要查询字段 + */ + String[] COLUMNNAME_NOT_QUERY = {"id", "create_dept", "create_by", "create_time", "del_flag", "update_by", + "update_time", "remark", "version", "tenant_id"}; + + /** + * Entity基类字段 + */ + String[] BASE_ENTITY = {"createDept", "createBy", "createTime", "updateBy", "updateTime", "tenantId"}; + + /** + * 文本框 + */ + String HTML_INPUT = "input"; + + /** + * 文本域 + */ + String HTML_TEXTAREA = "textarea"; + + /** + * 下拉框 + */ + String HTML_SELECT = "select"; + + /** + * 单选框 + */ + String HTML_RADIO = "radio"; + + /** + * 复选框 + */ + String HTML_CHECKBOX = "checkbox"; + + /** + * 日期控件 + */ + String HTML_DATETIME = "datetime"; + + /** + * 图片上传控件 + */ + String HTML_IMAGE_UPLOAD = "imageUpload"; + + /** + * 文件上传控件 + */ + String HTML_FILE_UPLOAD = "fileUpload"; + + /** + * 富文本控件 + */ + String HTML_EDITOR = "editor"; + + /** + * 字符串类型 + */ + String TYPE_STRING = "String"; + + /** + * 整型 + */ + String TYPE_INTEGER = "Integer"; + + /** + * 长整型 + */ + String TYPE_LONG = "Long"; + + /** + * 浮点型 + */ + String TYPE_DOUBLE = "Double"; + + /** + * 高精度计算类型 + */ + String TYPE_BIGDECIMAL = "BigDecimal"; + + /** + * 时间类型 + */ + String TYPE_DATE = "Date"; + + /** + * 模糊查询 + */ + String QUERY_LIKE = "LIKE"; + + /** + * 相等查询 + */ + String QUERY_EQ = "EQ"; + + /** + * 需要 + */ + String REQUIRE = "1"; +} diff --git a/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/controller/GenController.java b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/controller/GenController.java new file mode 100644 index 0000000..c59ae7b --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/controller/GenController.java @@ -0,0 +1,207 @@ +package org.aibidding.generator.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.io.IoUtil; +import org.aibidding.generator.domain.GenTable; +import org.aibidding.generator.domain.GenTableColumn; +import org.aibidding.generator.service.IGenTableService; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 代码生成 操作处理 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/tool/gen") +public class GenController extends BaseController { + + private final IGenTableService genTableService; + + /** + * 查询代码生成列表 + */ + @SaCheckPermission("tool:gen:list") + @GetMapping("/list") + public TableDataInfo genList(GenTable genTable, PageQuery pageQuery) { + return genTableService.selectPageGenTableList(genTable, pageQuery); + } + + /** + * 修改代码生成业务 + * + * @param tableId 表ID + */ + @SaCheckPermission("tool:gen:query") + @GetMapping(value = "/{tableId}") + public R> getInfo(@PathVariable Long tableId) { + GenTable table = genTableService.selectGenTableById(tableId); + List tables = genTableService.selectGenTableAll(); + List list = genTableService.selectGenTableColumnListByTableId(tableId); + Map map = new HashMap(); + map.put("info", table); + map.put("rows", list); + map.put("tables", tables); + return R.ok(map); + } + + /** + * 查询数据库列表 + */ + @SaCheckPermission("tool:gen:list") + @GetMapping("/db/list") + public TableDataInfo dataList(GenTable genTable, PageQuery pageQuery) { + return genTableService.selectPageDbTableList(genTable, pageQuery); + } + + /** + * 查询数据表字段列表 + * + * @param tableId 表ID + */ + @SaCheckPermission("tool:gen:list") + @GetMapping(value = "/column/{tableId}") + public TableDataInfo columnList(Long tableId) { + TableDataInfo dataInfo = new TableDataInfo<>(); + List list = genTableService.selectGenTableColumnListByTableId(tableId); + dataInfo.setRows(list); + dataInfo.setTotal(list.size()); + return dataInfo; + } + + /** + * 导入表结构(保存) + * + * @param tables 表名串 + */ + @SaCheckPermission("tool:gen:import") + @Log(title = "代码生成", businessType = BusinessType.IMPORT) + @PostMapping("/importTable") + public R importTableSave(String tables) { + String[] tableNames = Convert.toStrArray(tables); + // 查询表信息 + List tableList = genTableService.selectDbTableListByNames(tableNames); + genTableService.importGenTable(tableList); + return R.ok(); + } + + /** + * 修改保存代码生成业务 + */ + @SaCheckPermission("tool:gen:edit") + @Log(title = "代码生成", businessType = BusinessType.UPDATE) + @PutMapping + public R editSave(@Validated @RequestBody GenTable genTable) { + genTableService.validateEdit(genTable); + genTableService.updateGenTable(genTable); + return R.ok(); + } + + /** + * 删除代码生成 + * + * @param tableIds 表ID串 + */ + @SaCheckPermission("tool:gen:remove") + @Log(title = "代码生成", businessType = BusinessType.DELETE) + @DeleteMapping("/{tableIds}") + public R remove(@PathVariable Long[] tableIds) { + genTableService.deleteGenTableByIds(tableIds); + return R.ok(); + } + + /** + * 预览代码 + * + * @param tableId 表ID + */ + @SaCheckPermission("tool:gen:preview") + @GetMapping("/preview/{tableId}") + public R> preview(@PathVariable("tableId") Long tableId) throws IOException { + Map dataMap = genTableService.previewCode(tableId); + return R.ok(dataMap); + } + + /** + * 生成代码(下载方式) + * + * @param tableName 表名 + */ + @SaCheckPermission("tool:gen:code") + @Log(title = "代码生成", businessType = BusinessType.GENCODE) + @GetMapping("/download/{tableName}") + public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException { + byte[] data = genTableService.downloadCode(tableName); + genCode(response, data); + } + + /** + * 生成代码(自定义路径) + * + * @param tableName 表名 + */ + @SaCheckPermission("tool:gen:code") + @Log(title = "代码生成", businessType = BusinessType.GENCODE) + @GetMapping("/genCode/{tableName}") + public R genCode(@PathVariable("tableName") String tableName) { + genTableService.generatorCode(tableName); + return R.ok(); + } + + /** + * 同步数据库 + * + * @param tableName 表名 + */ + @SaCheckPermission("tool:gen:edit") + @Log(title = "代码生成", businessType = BusinessType.UPDATE) + @GetMapping("/synchDb/{tableName}") + public R synchDb(@PathVariable("tableName") String tableName) { + genTableService.synchDb(tableName); + return R.ok(); + } + + /** + * 批量生成代码 + * + * @param tables 表名串 + */ + @SaCheckPermission("tool:gen:code") + @Log(title = "代码生成", businessType = BusinessType.GENCODE) + @GetMapping("/batchGenCode") + public void batchGenCode(HttpServletResponse response, String tables) throws IOException { + String[] tableNames = Convert.toStrArray(tables); + byte[] data = genTableService.downloadCode(tableNames); + genCode(response, data); + } + + /** + * 生成zip文件 + */ + private void genCode(HttpServletResponse response, byte[] data) throws IOException { + response.reset(); + response.addHeader("Access-Control-Allow-Origin", "*"); + response.addHeader("Access-Control-Expose-Headers", "Content-Disposition"); + response.setHeader("Content-Disposition", "attachment; filename=\"aibidding.zip\""); + response.addHeader("Content-Length", "" + data.length); + response.setContentType("application/octet-stream; charset=UTF-8"); + IoUtil.write(response.getOutputStream(), false, data); + } +} diff --git a/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/domain/GenTable.java b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/domain/GenTable.java new file mode 100644 index 0000000..36e6e3e --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/domain/GenTable.java @@ -0,0 +1,190 @@ +package org.aibidding.generator.domain; + +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import org.aibidding.generator.constant.GenConstants; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 业务表 gen_table + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("gen_table") +public class GenTable extends BaseEntity { + + /** + * 编号 + */ + @TableId(value = "table_id") + private Long tableId; + + /** + * 表名称 + */ + @NotBlank(message = "表名称不能为空") + private String tableName; + + /** + * 表描述 + */ + @NotBlank(message = "表描述不能为空") + private String tableComment; + + /** + * 关联父表的表名 + */ + private String subTableName; + + /** + * 本表关联父表的外键名 + */ + private String subTableFkName; + + /** + * 实体类名称(首字母大写) + */ + @NotBlank(message = "实体类名称不能为空") + private String className; + + /** + * 使用的模板(crud单表操作 tree树表操作 sub主子表操作) + */ + private String tplCategory; + + /** + * 生成包路径 + */ + @NotBlank(message = "生成包路径不能为空") + private String packageName; + + /** + * 生成模块名 + */ + @NotBlank(message = "生成模块名不能为空") + private String moduleName; + + /** + * 生成业务名 + */ + @NotBlank(message = "生成业务名不能为空") + private String businessName; + + /** + * 生成功能名 + */ + @NotBlank(message = "生成功能名不能为空") + private String functionName; + + /** + * 生成作者 + */ + @NotBlank(message = "作者不能为空") + private String functionAuthor; + + /** + * 生成代码方式(0zip压缩包 1自定义路径) + */ + private String genType; + + /** + * 生成路径(不填默认项目路径) + */ + @TableField(updateStrategy = FieldStrategy.NOT_EMPTY) + private String genPath; + + /** + * 主键信息 + */ + @TableField(exist = false) + private GenTableColumn pkColumn; + + /** + * 表列信息 + */ + @Valid + @TableField(exist = false) + private List columns; + + /** + * 其它生成选项 + */ + private String options; + + /** + * 备注 + */ + private String remark; + + /** + * 树编码字段 + */ + @TableField(exist = false) + private String treeCode; + + /** + * 树父编码字段 + */ + @TableField(exist = false) + private String treeParentCode; + + /** + * 树名称字段 + */ + @TableField(exist = false) + private String treeName; + + /* + * 菜单id列表 + */ + @TableField(exist = false) + private List menuIds; + + /** + * 上级菜单ID字段 + */ + @TableField(exist = false) + private String parentMenuId; + + /** + * 上级菜单名称字段 + */ + @TableField(exist = false) + private String parentMenuName; + + public boolean isTree() { + return isTree(this.tplCategory); + } + + public static boolean isTree(String tplCategory) { + return tplCategory != null && StringUtils.equals(GenConstants.TPL_TREE, tplCategory); + } + + public boolean isCrud() { + return isCrud(this.tplCategory); + } + + public static boolean isCrud(String tplCategory) { + return tplCategory != null && StringUtils.equals(GenConstants.TPL_CRUD, tplCategory); + } + + public boolean isSuperColumn(String javaField) { + return isSuperColumn(this.tplCategory, javaField); + } + + public static boolean isSuperColumn(String tplCategory, String javaField) { + return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY); + } +} diff --git a/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/domain/GenTableColumn.java b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/domain/GenTableColumn.java new file mode 100644 index 0000000..d504a85 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/domain/GenTableColumn.java @@ -0,0 +1,222 @@ +package org.aibidding.generator.domain; + +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.apache.ibatis.type.JdbcType; + +/** + * 代码生成业务字段表 gen_table_column + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("gen_table_column") +public class GenTableColumn extends BaseEntity { + + /** + * 编号 + */ + @TableId(value = "column_id") + private Long columnId; + + /** + * 归属表编号 + */ + private Long tableId; + + /** + * 列名称 + */ + private String columnName; + + /** + * 列描述 + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String columnComment; + + /** + * 列类型 + */ + private String columnType; + + /** + * JAVA类型 + */ + private String javaType; + + /** + * JAVA字段名 + */ + @NotBlank(message = "Java属性不能为空") + private String javaField; + + /** + * 是否主键(1是) + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String isPk; + + /** + * 是否自增(1是) + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String isIncrement; + + /** + * 是否必填(1是) + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String isRequired; + + /** + * 是否为插入字段(1是) + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String isInsert; + + /** + * 是否编辑字段(1是) + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String isEdit; + + /** + * 是否列表字段(1是) + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String isList; + + /** + * 是否查询字段(1是) + */ + @TableField(updateStrategy = FieldStrategy.IGNORED, jdbcType = JdbcType.VARCHAR) + private String isQuery; + + /** + * 查询方式(EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围) + */ + private String queryType; + + /** + * 显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、image图片上传控件、upload文件上传控件、editor富文本控件) + */ + private String htmlType; + + /** + * 字典类型 + */ + private String dictType; + + /** + * 排序 + */ + private Integer sort; + + public String getCapJavaField() { + return StringUtils.capitalize(javaField); + } + + public boolean isPk() { + return isPk(this.isPk); + } + + public boolean isPk(String isPk) { + return isPk != null && StringUtils.equals("1", isPk); + } + + public boolean isIncrement() { + return isIncrement(this.isIncrement); + } + + public boolean isIncrement(String isIncrement) { + return isIncrement != null && StringUtils.equals("1", isIncrement); + } + + public boolean isRequired() { + return isRequired(this.isRequired); + } + + public boolean isRequired(String isRequired) { + return isRequired != null && StringUtils.equals("1", isRequired); + } + + public boolean isInsert() { + return isInsert(this.isInsert); + } + + public boolean isInsert(String isInsert) { + return isInsert != null && StringUtils.equals("1", isInsert); + } + + public boolean isEdit() { + return isInsert(this.isEdit); + } + + public boolean isEdit(String isEdit) { + return isEdit != null && StringUtils.equals("1", isEdit); + } + + public boolean isList() { + return isList(this.isList); + } + + public boolean isList(String isList) { + return isList != null && StringUtils.equals("1", isList); + } + + public boolean isQuery() { + return isQuery(this.isQuery); + } + + public boolean isQuery(String isQuery) { + return isQuery != null && StringUtils.equals("1", isQuery); + } + + public boolean isSuperColumn() { + return isSuperColumn(this.javaField); + } + + public static boolean isSuperColumn(String javaField) { + return StringUtils.equalsAnyIgnoreCase(javaField, + // BaseEntity + "createBy", "createTime", "updateBy", "updateTime", + // TreeEntity + "parentName", "parentId"); + } + + public boolean isUsableColumn() { + return isUsableColumn(javaField); + } + + public static boolean isUsableColumn(String javaField) { + // isSuperColumn()中的名单用于避免生成多余Domain属性,若某些属性在生成页面时需要用到不能忽略,则放在此处白名单 + return StringUtils.equalsAnyIgnoreCase(javaField, "parentId", "orderNum", "remark"); + } + + public String readConverterExp() { + String remarks = StringUtils.substringBetween(this.columnComment, "(", ")"); + StringBuffer sb = new StringBuffer(); + if (StringUtils.isNotEmpty(remarks)) { + for (String value : remarks.split(" ")) { + if (StringUtils.isNotEmpty(value)) { + Object startStr = value.subSequence(0, 1); + String endStr = value.substring(1); + sb.append(StringUtils.EMPTY).append(startStr).append("=").append(endStr).append(StringUtils.SEPARATOR); + } + } + return sb.deleteCharAt(sb.length() - 1).toString(); + } else { + return this.columnComment; + } + } +} diff --git a/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/mapper/GenTableColumnMapper.java b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/mapper/GenTableColumnMapper.java new file mode 100644 index 0000000..69a455d --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/mapper/GenTableColumnMapper.java @@ -0,0 +1,24 @@ +package org.aibidding.generator.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import org.aibidding.generator.domain.GenTableColumn; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; + +import java.util.List; + +/** + * 业务字段 数据层 + * + * @author Lion Li + */ +@InterceptorIgnore(dataPermission = "true", tenantLine = "true") +public interface GenTableColumnMapper extends BaseMapperPlus { + /** + * 根据表名称查询列信息 + * + * @param tableName 表名称 + * @return 列信息 + */ + List selectDbTableColumnsByName(String tableName); + +} diff --git a/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/mapper/GenTableMapper.java b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/mapper/GenTableMapper.java new file mode 100644 index 0000000..e63fb5a --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/mapper/GenTableMapper.java @@ -0,0 +1,58 @@ +package org.aibidding.generator.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.generator.domain.GenTable; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 业务 数据层 + * + * @author Lion Li + */ +@InterceptorIgnore(dataPermission = "true", tenantLine = "true") +public interface GenTableMapper extends BaseMapperPlus { + + /** + * 查询据库列表 + * + * @param genTable 查询条件 + * @return 数据库表集合 + */ + Page selectPageDbTableList(@Param("page") Page page, @Param("genTable") GenTable genTable); + + /** + * 查询据库列表 + * + * @param tableNames 表名称组 + * @return 数据库表集合 + */ + List selectDbTableListByNames(String[] tableNames); + + /** + * 查询所有表信息 + * + * @return 表信息集合 + */ + List selectGenTableAll(); + + /** + * 查询表ID业务信息 + * + * @param id 业务ID + * @return 业务信息 + */ + GenTable selectGenTableById(Long id); + + /** + * 查询表名称业务信息 + * + * @param tableName 表名称 + * @return 业务信息 + */ + GenTable selectGenTableByName(String tableName); + +} diff --git a/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/service/GenTableServiceImpl.java b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/service/GenTableServiceImpl.java new file mode 100644 index 0000000..5d1f2fe --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/service/GenTableServiceImpl.java @@ -0,0 +1,459 @@ +package org.aibidding.generator.service; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.lang.Dict; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.aibidding.generator.mapper.GenTableMapper; +import org.aibidding.common.core.constant.Constants; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.StreamUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.core.utils.file.FileUtils; +import org.aibidding.common.json.utils.JsonUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.generator.constant.GenConstants; +import org.aibidding.generator.domain.GenTable; +import org.aibidding.generator.domain.GenTableColumn; +import org.aibidding.generator.mapper.GenTableColumnMapper; +import org.aibidding.generator.util.GenUtils; +import org.aibidding.generator.util.VelocityInitializer; +import org.aibidding.generator.util.VelocityUtils; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.nio.charset.StandardCharsets; +import java.util.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +/** + * 业务 服务层实现 + * + * @author Lion Li + */ +@DS("#header.datasource") +@Slf4j +@RequiredArgsConstructor +@Service +public class GenTableServiceImpl implements IGenTableService { + + private final GenTableMapper baseMapper; + private final GenTableColumnMapper genTableColumnMapper; + private final IdentifierGenerator identifierGenerator; + + /** + * 查询业务字段列表 + * + * @param tableId 业务字段编号 + * @return 业务字段集合 + */ + @Override + public List selectGenTableColumnListByTableId(Long tableId) { + return genTableColumnMapper.selectList(new LambdaQueryWrapper() + .eq(GenTableColumn::getTableId, tableId) + .orderByAsc(GenTableColumn::getSort)); + } + + /** + * 查询业务信息 + * + * @param id 业务ID + * @return 业务信息 + */ + @Override + public GenTable selectGenTableById(Long id) { + GenTable genTable = baseMapper.selectGenTableById(id); + setTableFromOptions(genTable); + return genTable; + } + + @Override + public TableDataInfo selectPageGenTableList(GenTable genTable, PageQuery pageQuery) { + Page page = baseMapper.selectPage(pageQuery.build(), this.buildGenTableQueryWrapper(genTable)); + return TableDataInfo.build(page); + } + + private QueryWrapper buildGenTableQueryWrapper(GenTable genTable) { + Map params = genTable.getParams(); + QueryWrapper wrapper = Wrappers.query(); + wrapper.like(StringUtils.isNotBlank(genTable.getTableName()), "lower(table_name)", StringUtils.lowerCase(genTable.getTableName())) + .like(StringUtils.isNotBlank(genTable.getTableComment()), "lower(table_comment)", StringUtils.lowerCase(genTable.getTableComment())) + .between(params.get("beginTime") != null && params.get("endTime") != null, + "create_time", params.get("beginTime"), params.get("endTime")); + return wrapper; + } + + + @Override + public TableDataInfo selectPageDbTableList(GenTable genTable, PageQuery pageQuery) { + Page page = baseMapper.selectPageDbTableList(pageQuery.build(), genTable); + return TableDataInfo.build(page); + } + + /** + * 查询据库列表 + * + * @param tableNames 表名称组 + * @return 数据库表集合 + */ + @Override + public List selectDbTableListByNames(String[] tableNames) { + return baseMapper.selectDbTableListByNames(tableNames); + } + + /** + * 查询所有表信息 + * + * @return 表信息集合 + */ + @Override + public List selectGenTableAll() { + return baseMapper.selectGenTableAll(); + } + + /** + * 修改业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void updateGenTable(GenTable genTable) { + String options = JsonUtils.toJsonString(genTable.getParams()); + genTable.setOptions(options); + int row = baseMapper.updateById(genTable); + if (row > 0) { + for (GenTableColumn cenTableColumn : genTable.getColumns()) { + genTableColumnMapper.updateById(cenTableColumn); + } + } + } + + /** + * 删除业务对象 + * + * @param tableIds 需要删除的数据ID + * @return 结果 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteGenTableByIds(Long[] tableIds) { + List ids = Arrays.asList(tableIds); + baseMapper.deleteBatchIds(ids); + genTableColumnMapper.delete(new LambdaQueryWrapper().in(GenTableColumn::getTableId, ids)); + } + + /** + * 导入表结构 + * + * @param tableList 导入表列表 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void importGenTable(List tableList) { + String operName = LoginHelper.getUsername(); + try { + for (GenTable table : tableList) { + String tableName = table.getTableName(); + GenUtils.initTable(table, operName); + int row = baseMapper.insert(table); + if (row > 0) { + // 保存列信息 + List genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName); + List saveColumns = new ArrayList<>(); + for (GenTableColumn column : genTableColumns) { + GenUtils.initColumnField(column, table); + saveColumns.add(column); + } + if (CollUtil.isNotEmpty(saveColumns)) { + genTableColumnMapper.insertBatch(saveColumns); + } + } + } + } catch (Exception e) { + throw new ServiceException("导入失败:" + e.getMessage()); + } + } + + /** + * 预览代码 + * + * @param tableId 表编号 + * @return 预览数据列表 + */ + @Override + public Map previewCode(Long tableId) { + Map dataMap = new LinkedHashMap<>(); + // 查询表信息 + GenTable table = baseMapper.selectGenTableById(tableId); + List menuIds = new ArrayList<>(); + for (int i = 0; i < 6; i++) { + menuIds.add(identifierGenerator.nextId(null).longValue()); + } + table.setMenuIds(menuIds); + // 设置主键列信息 + setPkColumn(table); + VelocityInitializer.initVelocity(); + + VelocityContext context = VelocityUtils.prepareContext(table); + + // 获取模板列表 + List templates = VelocityUtils.getTemplateList(table.getTplCategory()); + for (String template : templates) { + // 渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF8); + tpl.merge(context, sw); + dataMap.put(template, sw.toString()); + } + return dataMap; + } + + /** + * 生成代码(下载方式) + * + * @param tableName 表名称 + * @return 数据 + */ + @Override + public byte[] downloadCode(String tableName) { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ZipOutputStream zip = new ZipOutputStream(outputStream); + generatorCode(tableName, zip); + IoUtil.close(zip); + return outputStream.toByteArray(); + } + + /** + * 生成代码(自定义路径) + * + * @param tableName 表名称 + */ + @Override + public void generatorCode(String tableName) { + // 查询表信息 + GenTable table = baseMapper.selectGenTableByName(tableName); + // 设置主键列信息 + setPkColumn(table); + + VelocityInitializer.initVelocity(); + + VelocityContext context = VelocityUtils.prepareContext(table); + + // 获取模板列表 + List templates = VelocityUtils.getTemplateList(table.getTplCategory()); + for (String template : templates) { + if (!StringUtils.containsAny(template, "sql.vm", "api.ts.vm", "types.ts.vm", "index.vue.vm", "index-tree.vue.vm")) { + // 渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF8); + tpl.merge(context, sw); + try { + String path = getGenPath(table, template); + FileUtils.writeUtf8String(sw.toString(), path); + } catch (Exception e) { + throw new ServiceException("渲染模板失败,表名:" + table.getTableName()); + } + } + } + } + + /** + * 同步数据库 + * + * @param tableName 表名称 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void synchDb(String tableName) { + GenTable table = baseMapper.selectGenTableByName(tableName); + List tableColumns = table.getColumns(); + Map tableColumnMap = StreamUtils.toIdentityMap(tableColumns, GenTableColumn::getColumnName); + + List dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName); + if (CollUtil.isEmpty(dbTableColumns)) { + throw new ServiceException("同步数据失败,原表结构不存在"); + } + List dbTableColumnNames = StreamUtils.toList(dbTableColumns, GenTableColumn::getColumnName); + + List saveColumns = new ArrayList<>(); + dbTableColumns.forEach(column -> { + GenUtils.initColumnField(column, table); + if (tableColumnMap.containsKey(column.getColumnName())) { + GenTableColumn prevColumn = tableColumnMap.get(column.getColumnName()); + column.setColumnId(prevColumn.getColumnId()); + if (column.isList()) { + // 如果是列表,继续保留查询方式/字典类型选项 + column.setDictType(prevColumn.getDictType()); + column.setQueryType(prevColumn.getQueryType()); + } + if (StringUtils.isNotEmpty(prevColumn.getIsRequired()) && !column.isPk() + && (column.isInsert() || column.isEdit()) + && ((column.isUsableColumn()) || (!column.isSuperColumn()))) { + // 如果是(新增/修改&非主键/非忽略及父属性),继续保留必填/显示类型选项 + column.setIsRequired(prevColumn.getIsRequired()); + column.setHtmlType(prevColumn.getHtmlType()); + } + } + saveColumns.add(column); + }); + if (CollUtil.isNotEmpty(saveColumns)) { + genTableColumnMapper.insertOrUpdateBatch(saveColumns); + } + List delColumns = StreamUtils.filter(tableColumns, column -> !dbTableColumnNames.contains(column.getColumnName())); + if (CollUtil.isNotEmpty(delColumns)) { + List ids = StreamUtils.toList(delColumns, GenTableColumn::getColumnId); + genTableColumnMapper.deleteBatchIds(ids); + } + } + + /** + * 批量生成代码(下载方式) + * + * @param tableNames 表数组 + * @return 数据 + */ + @Override + public byte[] downloadCode(String[] tableNames) { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ZipOutputStream zip = new ZipOutputStream(outputStream); + for (String tableName : tableNames) { + generatorCode(tableName, zip); + } + IoUtil.close(zip); + return outputStream.toByteArray(); + } + + /** + * 查询表信息并生成代码 + */ + private void generatorCode(String tableName, ZipOutputStream zip) { + // 查询表信息 + GenTable table = baseMapper.selectGenTableByName(tableName); + List menuIds = new ArrayList<>(); + for (int i = 0; i < 6; i++) { + menuIds.add(identifierGenerator.nextId(null).longValue()); + } + table.setMenuIds(menuIds); + // 设置主键列信息 + setPkColumn(table); + + VelocityInitializer.initVelocity(); + + VelocityContext context = VelocityUtils.prepareContext(table); + + // 获取模板列表 + List templates = VelocityUtils.getTemplateList(table.getTplCategory()); + for (String template : templates) { + // 渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF8); + tpl.merge(context, sw); + try { + // 添加到zip + zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table))); + IoUtil.write(zip, StandardCharsets.UTF_8, false, sw.toString()); + IoUtil.close(sw); + zip.flush(); + zip.closeEntry(); + } catch (IOException e) { + log.error("渲染模板失败,表名:" + table.getTableName(), e); + } + } + } + + /** + * 修改保存参数校验 + * + * @param genTable 业务信息 + */ + @Override + public void validateEdit(GenTable genTable) { + if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) { + String options = JsonUtils.toJsonString(genTable.getParams()); + Dict paramsObj = JsonUtils.parseMap(options); + if (StringUtils.isEmpty(paramsObj.getStr(GenConstants.TREE_CODE))) { + throw new ServiceException("树编码字段不能为空"); + } else if (StringUtils.isEmpty(paramsObj.getStr(GenConstants.TREE_PARENT_CODE))) { + throw new ServiceException("树父编码字段不能为空"); + } else if (StringUtils.isEmpty(paramsObj.getStr(GenConstants.TREE_NAME))) { + throw new ServiceException("树名称字段不能为空"); + } + } + } + + /** + * 设置主键列信息 + * + * @param table 业务表信息 + */ + public void setPkColumn(GenTable table) { + for (GenTableColumn column : table.getColumns()) { + if (column.isPk()) { + table.setPkColumn(column); + break; + } + } + if (ObjectUtil.isNull(table.getPkColumn())) { + table.setPkColumn(table.getColumns().get(0)); + } + + } + + /** + * 设置代码生成其他选项值 + * + * @param genTable 设置后的生成对象 + */ + public void setTableFromOptions(GenTable genTable) { + Dict paramsObj = JsonUtils.parseMap(genTable.getOptions()); + if (ObjectUtil.isNotNull(paramsObj)) { + String treeCode = paramsObj.getStr(GenConstants.TREE_CODE); + String treeParentCode = paramsObj.getStr(GenConstants.TREE_PARENT_CODE); + String treeName = paramsObj.getStr(GenConstants.TREE_NAME); + String parentMenuId = paramsObj.getStr(GenConstants.PARENT_MENU_ID); + String parentMenuName = paramsObj.getStr(GenConstants.PARENT_MENU_NAME); + + genTable.setTreeCode(treeCode); + genTable.setTreeParentCode(treeParentCode); + genTable.setTreeName(treeName); + genTable.setParentMenuId(parentMenuId); + genTable.setParentMenuName(parentMenuName); + } + } + + /** + * 获取代码生成地址 + * + * @param table 业务表信息 + * @param template 模板文件路径 + * @return 生成地址 + */ + public static String getGenPath(GenTable table, String template) { + String genPath = table.getGenPath(); + if (StringUtils.equals(genPath, "/")) { + return System.getProperty("user.dir") + File.separator + "src" + File.separator + VelocityUtils.getFileName(template, table); + } + return genPath + File.separator + VelocityUtils.getFileName(template, table); + } +} + diff --git a/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/service/IGenTableService.java b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/service/IGenTableService.java new file mode 100644 index 0000000..320b9b7 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/service/IGenTableService.java @@ -0,0 +1,133 @@ +package org.aibidding.generator.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.generator.domain.GenTable; +import org.aibidding.generator.domain.GenTableColumn; + +import java.util.List; +import java.util.Map; + +/** + * 业务 服务层 + * + * @author Lion Li + */ +public interface IGenTableService { + + /** + * 查询业务字段列表 + * + * @param tableId 业务字段编号 + * @return 业务字段集合 + */ + List selectGenTableColumnListByTableId(Long tableId); + + /** + * 查询业务列表 + * + * @param genTable 业务信息 + * @return 业务集合 + */ + TableDataInfo selectPageGenTableList(GenTable genTable, PageQuery pageQuery); + + /** + * 查询据库列表 + * + * @param genTable 业务信息 + * @return 数据库表集合 + */ + TableDataInfo selectPageDbTableList(GenTable genTable, PageQuery pageQuery); + + /** + * 查询据库列表 + * + * @param tableNames 表名称组 + * @return 数据库表集合 + */ + List selectDbTableListByNames(String[] tableNames); + + /** + * 查询所有表信息 + * + * @return 表信息集合 + */ + List selectGenTableAll(); + + /** + * 查询业务信息 + * + * @param id 业务ID + * @return 业务信息 + */ + GenTable selectGenTableById(Long id); + + /** + * 修改业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + void updateGenTable(GenTable genTable); + + /** + * 删除业务信息 + * + * @param tableIds 需要删除的表数据ID + * @return 结果 + */ + void deleteGenTableByIds(Long[] tableIds); + + /** + * 导入表结构 + * + * @param tableList 导入表列表 + */ + void importGenTable(List tableList); + + /** + * 预览代码 + * + * @param tableId 表编号 + * @return 预览数据列表 + */ + Map previewCode(Long tableId); + + /** + * 生成代码(下载方式) + * + * @param tableName 表名称 + * @return 数据 + */ + byte[] downloadCode(String tableName); + + /** + * 生成代码(自定义路径) + * + * @param tableName 表名称 + * @return 数据 + */ + void generatorCode(String tableName); + + /** + * 同步数据库 + * + * @param tableName 表名称 + */ + void synchDb(String tableName); + + /** + * 批量生成代码(下载方式) + * + * @param tableNames 表数组 + * @return 数据 + */ + byte[] downloadCode(String[] tableNames); + + /** + * 修改保存参数校验 + * + * @param genTable 业务信息 + */ + void validateEdit(GenTable genTable); +} diff --git a/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/util/GenUtils.java b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/util/GenUtils.java new file mode 100644 index 0000000..59418f9 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/util/GenUtils.java @@ -0,0 +1,233 @@ +package org.aibidding.generator.util; + +import org.aibidding.generator.config.GenConfig; +import org.aibidding.generator.constant.GenConstants; +import org.aibidding.generator.domain.GenTable; +import org.aibidding.generator.domain.GenTableColumn; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.satoken.utils.LoginHelper; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.RegExUtils; + +import java.util.Arrays; + +/** + * 代码生成器 工具类 + * + * @author aibidding + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class GenUtils { + + /** + * 初始化表信息 + */ + public static void initTable(GenTable genTable, String operName) { + genTable.setClassName(convertClassName(genTable.getTableName())); + genTable.setPackageName(GenConfig.getPackageName()); + genTable.setModuleName(getModuleName(GenConfig.getPackageName())); + genTable.setBusinessName(getBusinessName(genTable.getTableName())); + genTable.setFunctionName(replaceText(genTable.getTableComment())); + genTable.setFunctionAuthor(GenConfig.getAuthor()); + genTable.setCreateBy(LoginHelper.getUserId()); + } + + /** + * 初始化列属性字段 + */ + public static void initColumnField(GenTableColumn column, GenTable table) { + String dataType = getDbType(column.getColumnType()); + String columnName = column.getColumnName(); + column.setTableId(table.getTableId()); + column.setCreateBy(table.getCreateBy()); + // 设置java字段名 + column.setJavaField(StringUtils.toCamelCase(columnName)); + // 设置默认类型 + column.setJavaType(GenConstants.TYPE_STRING); + column.setQueryType(GenConstants.QUERY_EQ); + + if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType)) { + // 字符串长度超过500设置为文本域 + Integer columnLength = getColumnLength(column.getColumnType()); + String htmlType = columnLength >= 500 || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType) ? GenConstants.HTML_TEXTAREA : GenConstants.HTML_INPUT; + column.setHtmlType(htmlType); + } else if (arraysContains(GenConstants.COLUMNTYPE_TIME, dataType)) { + column.setJavaType(GenConstants.TYPE_DATE); + column.setHtmlType(GenConstants.HTML_DATETIME); + } else if (arraysContains(GenConstants.COLUMNTYPE_NUMBER, dataType)) { + column.setHtmlType(GenConstants.HTML_INPUT); + + // 如果是浮点型 统一用BigDecimal + String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), StringUtils.SEPARATOR); + if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) { + column.setJavaType(GenConstants.TYPE_BIGDECIMAL); + } + // 如果是整形 + else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) { + column.setJavaType(GenConstants.TYPE_INTEGER); + } + // 长整形 + else { + column.setJavaType(GenConstants.TYPE_LONG); + } + } + + // BO对象 默认插入勾选 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_ADD, columnName) && !column.isPk()) { + column.setIsInsert(GenConstants.REQUIRE); + } + // BO对象 默认编辑勾选 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName)) { + column.setIsEdit(GenConstants.REQUIRE); + } + // BO对象 默认是否必填勾选 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName)) { + column.setIsRequired(GenConstants.REQUIRE); + } + // VO对象 默认返回勾选 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName)) { + column.setIsList(GenConstants.REQUIRE); + } + // BO对象 默认查询勾选 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && !column.isPk()) { + column.setIsQuery(GenConstants.REQUIRE); + } + + // 查询字段类型 + if (StringUtils.endsWithIgnoreCase(columnName, "name")) { + column.setQueryType(GenConstants.QUERY_LIKE); + } + // 状态字段设置单选框 + if (StringUtils.endsWithIgnoreCase(columnName, "status")) { + column.setHtmlType(GenConstants.HTML_RADIO); + } + // 类型&性别字段设置下拉框 + else if (StringUtils.endsWithIgnoreCase(columnName, "type") + || StringUtils.endsWithIgnoreCase(columnName, "sex")) { + column.setHtmlType(GenConstants.HTML_SELECT); + } + // 图片字段设置图片上传控件 + else if (StringUtils.endsWithIgnoreCase(columnName, "image")) { + column.setHtmlType(GenConstants.HTML_IMAGE_UPLOAD); + } + // 文件字段设置文件上传控件 + else if (StringUtils.endsWithIgnoreCase(columnName, "file")) { + column.setHtmlType(GenConstants.HTML_FILE_UPLOAD); + } + // 内容字段设置富文本控件 + else if (StringUtils.endsWithIgnoreCase(columnName, "content")) { + column.setHtmlType(GenConstants.HTML_EDITOR); + } + } + + /** + * 校验数组是否包含指定值 + * + * @param arr 数组 + * @param targetValue 值 + * @return 是否包含 + */ + public static boolean arraysContains(String[] arr, String targetValue) { + return Arrays.asList(arr).contains(targetValue); + } + + /** + * 获取模块名 + * + * @param packageName 包名 + * @return 模块名 + */ + public static String getModuleName(String packageName) { + int lastIndex = packageName.lastIndexOf("."); + int nameLength = packageName.length(); + return StringUtils.substring(packageName, lastIndex + 1, nameLength); + } + + /** + * 获取业务名 + * + * @param tableName 表名 + * @return 业务名 + */ + public static String getBusinessName(String tableName) { + int firstIndex = tableName.indexOf("_"); + int nameLength = tableName.length(); + String businessName = StringUtils.substring(tableName, firstIndex + 1, nameLength); + businessName = StringUtils.toCamelCase(businessName); + return businessName; + } + + /** + * 表名转换成Java类名 + * + * @param tableName 表名称 + * @return 类名 + */ + public static String convertClassName(String tableName) { + boolean autoRemovePre = GenConfig.getAutoRemovePre(); + String tablePrefix = GenConfig.getTablePrefix(); + if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) { + String[] searchList = StringUtils.split(tablePrefix, StringUtils.SEPARATOR); + tableName = replaceFirst(tableName, searchList); + } + return StringUtils.convertToCamelCase(tableName); + } + + /** + * 批量替换前缀 + * + * @param replacementm 替换值 + * @param searchList 替换列表 + * @return + */ + public static String replaceFirst(String replacementm, String[] searchList) { + String text = replacementm; + for (String searchString : searchList) { + if (replacementm.startsWith(searchString)) { + text = replacementm.replaceFirst(searchString, ""); + break; + } + } + return text; + } + + /** + * 关键字替换 + * + * @param text 需要被替换的名字 + * @return 替换后的名字 + */ + public static String replaceText(String text) { + return RegExUtils.replaceAll(text, "(?:表|若依)", ""); + } + + /** + * 获取数据库类型字段 + * + * @param columnType 列类型 + * @return 截取后的列类型 + */ + public static String getDbType(String columnType) { + if (StringUtils.indexOf(columnType, '(') > 0) { + return StringUtils.substringBefore(columnType, "("); + } else { + return columnType; + } + } + + /** + * 获取字段长度 + * + * @param columnType 列类型 + * @return 截取后的列类型 + */ + public static Integer getColumnLength(String columnType) { + if (StringUtils.indexOf(columnType, '(') > 0) { + String length = StringUtils.substringBetween(columnType, "(", ")"); + return Integer.valueOf(length); + } else { + return 0; + } + } +} diff --git a/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/util/VelocityInitializer.java b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/util/VelocityInitializer.java new file mode 100644 index 0000000..2ebd1b8 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/util/VelocityInitializer.java @@ -0,0 +1,35 @@ +package org.aibidding.generator.util; + +import org.aibidding.common.core.constant.Constants; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.apache.velocity.app.Velocity; + +import java.util.Properties; + +/** + * VelocityEngine工厂 + * + * @author aibidding + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class VelocityInitializer { + + /** + * 初始化vm方法 + */ + public static void initVelocity() { + Properties p = new Properties(); + try { + // 加载classpath目录下的vm文件 + p.setProperty("resource.loader.file.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); + // 定义字符集 + p.setProperty(Velocity.INPUT_ENCODING, Constants.UTF8); + // 初始化Velocity引擎,指定配置Properties + Velocity.init(p); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + +} diff --git a/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/util/VelocityUtils.java b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/util/VelocityUtils.java new file mode 100644 index 0000000..79663ea --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/java/org/aibidding/generator/util/VelocityUtils.java @@ -0,0 +1,338 @@ +package org.aibidding.generator.util; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.lang.Dict; +import org.aibidding.generator.constant.GenConstants; +import org.aibidding.generator.domain.GenTable; +import org.aibidding.generator.domain.GenTableColumn; +import org.aibidding.common.core.utils.DateUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.json.utils.JsonUtils; +import org.aibidding.common.mybatis.helper.DataBaseHelper; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.apache.velocity.VelocityContext; + +import java.util.*; + +/** + * 模板处理工具类 + * + * @author aibidding + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class VelocityUtils { + + /** + * 项目空间路径 + */ + private static final String PROJECT_PATH = "main/java"; + + /** + * mybatis空间路径 + */ + private static final String MYBATIS_PATH = "main/resources/mapper"; + + /** + * 默认上级菜单,系统工具 + */ + private static final String DEFAULT_PARENT_MENU_ID = "3"; + + /** + * 设置模板变量信息 + * + * @return 模板列表 + */ + public static VelocityContext prepareContext(GenTable genTable) { + String moduleName = genTable.getModuleName(); + String businessName = genTable.getBusinessName(); + String packageName = genTable.getPackageName(); + String tplCategory = genTable.getTplCategory(); + String functionName = genTable.getFunctionName(); + + VelocityContext velocityContext = new VelocityContext(); + velocityContext.put("tplCategory", genTable.getTplCategory()); + velocityContext.put("tableName", genTable.getTableName()); + velocityContext.put("functionName", StringUtils.isNotEmpty(functionName) ? functionName : "【请填写功能名称】"); + velocityContext.put("ClassName", genTable.getClassName()); + velocityContext.put("className", StringUtils.uncapitalize(genTable.getClassName())); + velocityContext.put("moduleName", genTable.getModuleName()); + velocityContext.put("BusinessName", StringUtils.capitalize(genTable.getBusinessName())); + velocityContext.put("businessName", genTable.getBusinessName()); + velocityContext.put("basePackage", getPackagePrefix(packageName)); + velocityContext.put("packageName", packageName); + velocityContext.put("author", genTable.getFunctionAuthor()); + velocityContext.put("datetime", DateUtils.getDate()); + velocityContext.put("pkColumn", genTable.getPkColumn()); + velocityContext.put("importList", getImportList(genTable)); + velocityContext.put("permissionPrefix", getPermissionPrefix(moduleName, businessName)); + velocityContext.put("columns", genTable.getColumns()); + velocityContext.put("table", genTable); + velocityContext.put("dicts", getDicts(genTable)); + setMenuVelocityContext(velocityContext, genTable); + if (GenConstants.TPL_TREE.equals(tplCategory)) { + setTreeVelocityContext(velocityContext, genTable); + } + return velocityContext; + } + + public static void setMenuVelocityContext(VelocityContext context, GenTable genTable) { + String options = genTable.getOptions(); + Dict paramsObj = JsonUtils.parseMap(options); + String parentMenuId = getParentMenuId(paramsObj); + context.put("parentMenuId", parentMenuId); + } + + public static void setTreeVelocityContext(VelocityContext context, GenTable genTable) { + String options = genTable.getOptions(); + Dict paramsObj = JsonUtils.parseMap(options); + String treeCode = getTreecode(paramsObj); + String treeParentCode = getTreeParentCode(paramsObj); + String treeName = getTreeName(paramsObj); + + context.put("treeCode", treeCode); + context.put("treeParentCode", treeParentCode); + context.put("treeName", treeName); + context.put("expandColumn", getExpandColumn(genTable)); + if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) { + context.put("tree_parent_code", paramsObj.get(GenConstants.TREE_PARENT_CODE)); + } + if (paramsObj.containsKey(GenConstants.TREE_NAME)) { + context.put("tree_name", paramsObj.get(GenConstants.TREE_NAME)); + } + } + + /** + * 获取模板信息 + * + * @return 模板列表 + */ + public static List getTemplateList(String tplCategory) { + List templates = new ArrayList(); + templates.add("vm/java/domain.java.vm"); + templates.add("vm/java/vo.java.vm"); + templates.add("vm/java/bo.java.vm"); + templates.add("vm/java/mapper.java.vm"); + templates.add("vm/java/service.java.vm"); + templates.add("vm/java/serviceImpl.java.vm"); + templates.add("vm/java/controller.java.vm"); + templates.add("vm/xml/mapper.xml.vm"); + if (DataBaseHelper.isOracle()) { + templates.add("vm/sql/oracle/sql.vm"); + } else if (DataBaseHelper.isPostgerSql()) { + templates.add("vm/sql/postgres/sql.vm"); + } else if (DataBaseHelper.isSqlServer()) { + templates.add("vm/sql/sqlserver/sql.vm"); + } else { + templates.add("vm/sql/sql.vm"); + } + templates.add("vm/ts/api.ts.vm"); + templates.add("vm/ts/types.ts.vm"); + if (GenConstants.TPL_CRUD.equals(tplCategory)) { + templates.add("vm/vue/index.vue.vm"); + } else if (GenConstants.TPL_TREE.equals(tplCategory)) { + templates.add("vm/vue/index-tree.vue.vm"); + } + return templates; + } + + /** + * 获取文件名 + */ + public static String getFileName(String template, GenTable genTable) { + // 文件名称 + String fileName = ""; + // 包路径 + String packageName = genTable.getPackageName(); + // 模块名 + String moduleName = genTable.getModuleName(); + // 大写类名 + String className = genTable.getClassName(); + // 业务名称 + String businessName = genTable.getBusinessName(); + + String javaPath = PROJECT_PATH + "/" + StringUtils.replace(packageName, ".", "/"); + String mybatisPath = MYBATIS_PATH + "/" + moduleName; + String vuePath = "vue"; + + if (template.contains("domain.java.vm")) { + fileName = StringUtils.format("{}/domain/{}.java", javaPath, className); + } + if (template.contains("vo.java.vm")) { + fileName = StringUtils.format("{}/domain/vo/{}Vo.java", javaPath, className); + } + if (template.contains("bo.java.vm")) { + fileName = StringUtils.format("{}/domain/bo/{}Bo.java", javaPath, className); + } + if (template.contains("mapper.java.vm")) { + fileName = StringUtils.format("{}/mapper/{}Mapper.java", javaPath, className); + } else if (template.contains("service.java.vm")) { + fileName = StringUtils.format("{}/service/I{}Service.java", javaPath, className); + } else if (template.contains("serviceImpl.java.vm")) { + fileName = StringUtils.format("{}/service/impl/{}ServiceImpl.java", javaPath, className); + } else if (template.contains("controller.java.vm")) { + fileName = StringUtils.format("{}/controller/{}Controller.java", javaPath, className); + } else if (template.contains("mapper.xml.vm")) { + fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, className); + } else if (template.contains("sql.vm")) { + fileName = businessName + "Menu.sql"; + } else if (template.contains("api.ts.vm")) { + fileName = StringUtils.format("{}/api/{}/{}/index.ts", vuePath, moduleName, businessName); + } else if (template.contains("types.ts.vm")) { + fileName = StringUtils.format("{}/api/{}/{}/types.ts", vuePath, moduleName, businessName); + } else if (template.contains("index.vue.vm")) { + fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); + } else if (template.contains("index-tree.vue.vm")) { + fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); + } + return fileName; + } + + /** + * 获取包前缀 + * + * @param packageName 包名称 + * @return 包前缀名称 + */ + public static String getPackagePrefix(String packageName) { + int lastIndex = packageName.lastIndexOf("."); + return StringUtils.substring(packageName, 0, lastIndex); + } + + /** + * 根据列类型获取导入包 + * + * @param genTable 业务表对象 + * @return 返回需要导入的包列表 + */ + public static HashSet getImportList(GenTable genTable) { + List columns = genTable.getColumns(); + HashSet importList = new HashSet(); + for (GenTableColumn column : columns) { + if (!column.isSuperColumn() && GenConstants.TYPE_DATE.equals(column.getJavaType())) { + importList.add("java.util.Date"); + importList.add("com.fasterxml.jackson.annotation.JsonFormat"); + } else if (!column.isSuperColumn() && GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType())) { + importList.add("java.math.BigDecimal"); + } + } + return importList; + } + + /** + * 根据列类型获取字典组 + * + * @param genTable 业务表对象 + * @return 返回字典组 + */ + public static String getDicts(GenTable genTable) { + List columns = genTable.getColumns(); + Set dicts = new HashSet<>(); + addDicts(dicts, columns); + return StringUtils.join(dicts, ", "); + } + + /** + * 添加字典列表 + * + * @param dicts 字典列表 + * @param columns 列集合 + */ + public static void addDicts(Set dicts, List columns) { + for (GenTableColumn column : columns) { + if (!column.isSuperColumn() && StringUtils.isNotEmpty(column.getDictType()) && StringUtils.equalsAny( + column.getHtmlType(), + new String[] { GenConstants.HTML_SELECT, GenConstants.HTML_RADIO, GenConstants.HTML_CHECKBOX })) { + dicts.add("'" + column.getDictType() + "'"); + } + } + } + + /** + * 获取权限前缀 + * + * @param moduleName 模块名称 + * @param businessName 业务名称 + * @return 返回权限前缀 + */ + public static String getPermissionPrefix(String moduleName, String businessName) { + return StringUtils.format("{}:{}", moduleName, businessName); + } + + /** + * 获取上级菜单ID字段 + * + * @param paramsObj 生成其他选项 + * @return 上级菜单ID字段 + */ + public static String getParentMenuId(Dict paramsObj) { + if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID) + && StringUtils.isNotEmpty(paramsObj.getStr(GenConstants.PARENT_MENU_ID))) { + return paramsObj.getStr(GenConstants.PARENT_MENU_ID); + } + return DEFAULT_PARENT_MENU_ID; + } + + /** + * 获取树编码 + * + * @param paramsObj 生成其他选项 + * @return 树编码 + */ + public static String getTreecode(Map paramsObj) { + if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_CODE)) { + return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_CODE))); + } + return StringUtils.EMPTY; + } + + /** + * 获取树父编码 + * + * @param paramsObj 生成其他选项 + * @return 树父编码 + */ + public static String getTreeParentCode(Dict paramsObj) { + if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) { + return StringUtils.toCamelCase(paramsObj.getStr(GenConstants.TREE_PARENT_CODE)); + } + return StringUtils.EMPTY; + } + + /** + * 获取树名称 + * + * @param paramsObj 生成其他选项 + * @return 树名称 + */ + public static String getTreeName(Dict paramsObj) { + if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_NAME)) { + return StringUtils.toCamelCase(paramsObj.getStr(GenConstants.TREE_NAME)); + } + return StringUtils.EMPTY; + } + + /** + * 获取需要在哪一列上面显示展开按钮 + * + * @param genTable 业务表对象 + * @return 展开按钮列序号 + */ + public static int getExpandColumn(GenTable genTable) { + String options = genTable.getOptions(); + Dict paramsObj = JsonUtils.parseMap(options); + String treeName = paramsObj.getStr(GenConstants.TREE_NAME); + int num = 0; + for (GenTableColumn column : genTable.getColumns()) { + if (column.isList()) { + num++; + String columnName = column.getColumnName(); + if (columnName.equals(treeName)) { + break; + } + } + } + return num; + } +} diff --git a/aibidding-modules/aibidding-generator/src/main/resources/generator.yml b/aibidding-modules/aibidding-generator/src/main/resources/generator.yml new file mode 100644 index 0000000..2a04e84 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/generator.yml @@ -0,0 +1,10 @@ +# 代码生成 +gen: + # 作者 + author: ageerle + # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool + packageName: org.aibidding.system + # 自动去除表前缀,默认是false + autoRemovePre: false + # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) + tablePrefix: sys_ diff --git a/aibidding-modules/aibidding-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml b/aibidding-modules/aibidding-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml new file mode 100644 index 0000000..1dcbdf7 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml @@ -0,0 +1,93 @@ + + + + + + + + + + diff --git a/aibidding-modules/aibidding-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/aibidding-modules/aibidding-generator/src/main/resources/mapper/generator/GenTableMapper.xml new file mode 100644 index 0000000..0fba52b --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/mapper/generator/GenTableMapper.xml @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aibidding-modules/aibidding-generator/src/main/resources/mapper/package-info.md b/aibidding-modules/aibidding-generator/src/main/resources/mapper/package-info.md new file mode 100644 index 0000000..c938b1e --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/mapper/package-info.md @@ -0,0 +1,3 @@ +java包使用 `.` 分割 resource 目录使用 `/` 分割 +
+此文件目的 防止文件夹粘连找不到 `xml` 文件 \ No newline at end of file diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/java/bo.java.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/java/bo.java.vm new file mode 100644 index 0000000..3d630df --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/java/bo.java.vm @@ -0,0 +1,48 @@ +package ${packageName}.domain.bo; + +import ${packageName}.domain.${ClassName}; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +#foreach ($import in $importList) +import ${import}; +#end + +/** + * ${functionName}业务对象 ${tableName} + * + * @author ${author} + * @date ${datetime} + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = ${ClassName}.class, reverseConvertGenerate = false) +public class ${ClassName}Bo extends BaseEntity { + +#foreach ($column in $columns) +#if(!$table.isSuperColumn($column.javaField) && ($column.query || $column.insert || $column.edit)) + /** + * $column.columnComment + */ +#if($column.insert && $column.edit) +#set($Group="AddGroup.class, EditGroup.class") +#elseif($column.insert) +#set($Group="AddGroup.class") +#elseif($column.edit) +#set($Group="EditGroup.class") +#end +#if($column.required) +#if($column.javaType == 'String') + @NotBlank(message = "$column.columnComment不能为空", groups = { $Group }) +#else + @NotNull(message = "$column.columnComment不能为空", groups = { $Group }) +#end +#end + private $column.javaType $column.javaField; + +#end +#end + +} diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/java/controller.java.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/java/controller.java.vm new file mode 100644 index 0000000..877d7b5 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/java/controller.java.vm @@ -0,0 +1,115 @@ +package ${packageName}.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import annotation.idempotent.common.org.ruoyi.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.log.enums.BusinessType; +import utils.excel.common.org.ruoyi.ExcelUtil; +import ${packageName}.domain.vo.${ClassName}Vo; +import ${packageName}.domain.bo.${ClassName}Bo; +import ${packageName}.service.I${ClassName}Service; +#if($table.crud || $table.sub) +import org.aibidding.common.mybatis.core.page.TableDataInfo; +#elseif($table.tree) +#end + +/** + * ${functionName} + * + * @author ${author} + * @date ${datetime} + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/${moduleName}/${businessName}") +public class ${ClassName}Controller extends BaseController { + + private final I${ClassName}Service ${className}Service; + + /** + * 查询${functionName}列表 + */ + @SaCheckPermission("${permissionPrefix}:list") + @GetMapping("/list") +#if($table.crud || $table.sub) + public TableDataInfo<${ClassName}Vo> list(${ClassName}Bo bo, PageQuery pageQuery) { + return ${className}Service.queryPageList(bo, pageQuery); + } +#elseif($table.tree) + public R> list(${ClassName}Bo bo) { + List<${ClassName}Vo> list = ${className}Service.queryList(bo); + return R.ok(list); + } +#end + + /** + * 导出${functionName}列表 + */ + @SaCheckPermission("${permissionPrefix}:export") + @Log(title = "${functionName}", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(${ClassName}Bo bo, HttpServletResponse response) { + List<${ClassName}Vo> list = ${className}Service.queryList(bo); + ExcelUtil.exportExcel(list, "${functionName}", ${ClassName}Vo.class, response); + } + + /** + * 获取${functionName}详细信息 + * + * @param ${pkColumn.javaField} 主键 + */ + @SaCheckPermission("${permissionPrefix}:query") + @GetMapping("/{${pkColumn.javaField}}") + public R<${ClassName}Vo> getInfo(@NotNull(message = "主键不能为空") + @PathVariable ${pkColumn.javaType} ${pkColumn.javaField}) { + return R.ok(${className}Service.queryById(${pkColumn.javaField})); + } + + /** + * 新增${functionName} + */ + @SaCheckPermission("${permissionPrefix}:add") + @Log(title = "${functionName}", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody ${ClassName}Bo bo) { + return toAjax(${className}Service.insertByBo(bo)); + } + + /** + * 修改${functionName} + */ + @SaCheckPermission("${permissionPrefix}:edit") + @Log(title = "${functionName}", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody ${ClassName}Bo bo) { + return toAjax(${className}Service.updateByBo(bo)); + } + + /** + * 删除${functionName} + * + * @param ${pkColumn.javaField}s 主键串 + */ + @SaCheckPermission("${permissionPrefix}:remove") + @Log(title = "${functionName}", businessType = BusinessType.DELETE) + @DeleteMapping("/{${pkColumn.javaField}s}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) { + return toAjax(${className}Service.deleteWithValidByIds(List.of(${pkColumn.javaField}s), true)); + } +} diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/java/domain.java.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/java/domain.java.vm new file mode 100644 index 0000000..b1f8d92 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/java/domain.java.vm @@ -0,0 +1,59 @@ +package ${packageName}.domain; + +#foreach ($column in $columns) +#if($column.javaField=='tenantId') +#set($IsTenant=1) +#end +#end +#if($IsTenant==1) +import core.tenant.common.org.ruoyi.TenantEntity; +#else +#end +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +#foreach ($import in $importList) +import ${import}; +#end + +import java.io.Serial; + +/** + * ${functionName}对象 ${tableName} + * + * @author ${author} + * @date ${datetime} + */ +#if($IsTenant==1) +#set($Entity="TenantEntity") +#else +#set($Entity="BaseEntity") +#end +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("${tableName}") +public class ${ClassName} extends ${Entity} { + + @Serial + private static final long serialVersionUID = 1L; + +#foreach ($column in $columns) +#if(!$table.isSuperColumn($column.javaField)) + /** + * $column.columnComment + */ +#if($column.javaField=='delFlag') + @TableLogic +#end +#if($column.javaField=='version') + @Version +#end +#if($column.isPk==1) + @TableId(value = "$column.columnName") +#end + private $column.javaType $column.javaField; + +#end +#end + +} diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/java/mapper.java.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/java/mapper.java.vm new file mode 100644 index 0000000..a859e6b --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/java/mapper.java.vm @@ -0,0 +1,15 @@ +package ${packageName}.mapper; + +import ${packageName}.domain.${ClassName}; +import ${packageName}.domain.vo.${ClassName}Vo; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * ${functionName}Mapper接口 + * + * @author ${author} + * @date ${datetime} + */ +public interface ${ClassName}Mapper extends BaseMapperPlus<${ClassName}, ${ClassName}Vo> { + +} diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/java/service.java.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/java/service.java.vm new file mode 100644 index 0000000..ef62e89 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/java/service.java.vm @@ -0,0 +1,53 @@ +package ${packageName}.service; + +import ${packageName}.domain.${ClassName}; +import ${packageName}.domain.vo.${ClassName}Vo; +import ${packageName}.domain.bo.${ClassName}Bo; +#if($table.crud || $table.sub) +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; +#end + +import java.util.Collection; +import java.util.List; + +/** + * ${functionName}Service接口 + * + * @author ${author} + * @date ${datetime} + */ +public interface I${ClassName}Service { + + /** + * 查询${functionName} + */ + ${ClassName}Vo queryById(${pkColumn.javaType} ${pkColumn.javaField}); + +#if($table.crud || $table.sub) + /** + * 查询${functionName}列表 + */ + TableDataInfo<${ClassName}Vo> queryPageList(${ClassName}Bo bo, PageQuery pageQuery); +#end + + /** + * 查询${functionName}列表 + */ + List<${ClassName}Vo> queryList(${ClassName}Bo bo); + + /** + * 新增${functionName} + */ + Boolean insertByBo(${ClassName}Bo bo); + + /** + * 修改${functionName} + */ + Boolean updateByBo(${ClassName}Bo bo); + + /** + * 校验并批量删除${functionName}信息 + */ + Boolean deleteWithValidByIds(Collection<${pkColumn.javaType}> ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/java/serviceImpl.java.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/java/serviceImpl.java.vm new file mode 100644 index 0000000..a998a8a --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/java/serviceImpl.java.vm @@ -0,0 +1,133 @@ +package ${packageName}.service.impl; + +import org.aibidding.common.core.utils.MapstructUtils; + #if($table.crud || $table.sub) +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +#end +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import ${packageName}.domain.bo.${ClassName}Bo; +import ${packageName}.domain.vo.${ClassName}Vo; +import ${packageName}.domain.${ClassName}; +import ${packageName}.mapper.${ClassName}Mapper; +import ${packageName}.service.I${ClassName}Service; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * ${functionName}Service业务层处理 + * + * @author ${author} + * @date ${datetime} + */ +@RequiredArgsConstructor +@Service +public class ${ClassName}ServiceImpl implements I${ClassName}Service { + + private final ${ClassName}Mapper baseMapper; + + /** + * 查询${functionName} + */ + @Override + public ${ClassName}Vo queryById(${pkColumn.javaType} ${pkColumn.javaField}){ + return baseMapper.selectVoById(${pkColumn.javaField}); + } + +#if($table.crud || $table.sub) + /** + * 查询${functionName}列表 + */ + @Override + public TableDataInfo<${ClassName}Vo> queryPageList(${ClassName}Bo bo, PageQuery pageQuery) { + LambdaQueryWrapper<${ClassName}> lqw = buildQueryWrapper(bo); + Page<${ClassName}Vo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } +#end + + /** + * 查询${functionName}列表 + */ + @Override + public List<${ClassName}Vo> queryList(${ClassName}Bo bo) { + LambdaQueryWrapper<${ClassName}> lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper<${ClassName}> buildQueryWrapper(${ClassName}Bo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper<${ClassName}> lqw = Wrappers.lambdaQuery(); +#foreach($column in $columns) +#if($column.query) +#set($queryType=$column.queryType) +#set($javaField=$column.javaField) +#set($javaType=$column.javaType) +#set($columnName=$column.columnName) +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#set($mpMethod=$column.queryType.toLowerCase()) +#if($queryType != 'BETWEEN') +#if($javaType == 'String') +#set($condition='StringUtils.isNotBlank(bo.get'+$AttrName+'())') +#else +#set($condition='bo.get'+$AttrName+'() != null') +#end + lqw.$mpMethod($condition, ${ClassName}::get$AttrName, bo.get$AttrName()); +#else + lqw.between(params.get("begin$AttrName") != null && params.get("end$AttrName") != null, + ${ClassName}::get$AttrName ,params.get("begin$AttrName"), params.get("end$AttrName")); +#end +#end +#end + return lqw; + } + + /** + * 新增${functionName} + */ + @Override + public Boolean insertByBo(${ClassName}Bo bo) { + ${ClassName} add = MapstructUtils.convert(bo, ${ClassName}.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; +#set($pk=$pkColumn.javaField.substring(0,1).toUpperCase() + ${pkColumn.javaField.substring(1)}) + if (flag) { + bo.set$pk(add.get$pk()); + } + return flag; + } + + /** + * 修改${functionName} + */ + @Override + public Boolean updateByBo(${ClassName}Bo bo) { + ${ClassName} update = MapstructUtils.convert(bo, ${ClassName}.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(${ClassName} entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除${functionName} + */ + @Override + public Boolean deleteWithValidByIds(Collection<${pkColumn.javaType}> ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/java/vo.java.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/java/vo.java.vm new file mode 100644 index 0000000..2f41916 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/java/vo.java.vm @@ -0,0 +1,59 @@ +package ${packageName}.domain.vo; + +#foreach ($import in $importList) +import ${import}; +#end +import ${packageName}.domain.${ClassName}; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import annotation.excel.common.org.ruoyi.ExcelDictFormat; +import convert.excel.common.org.ruoyi.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * ${functionName}视图对象 ${tableName} + * + * @author ${author} + * @date ${datetime} + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = ${ClassName}.class) +public class ${ClassName}Vo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + +#foreach ($column in $columns) +#if($column.list) + /** + * $column.columnComment + */ +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if(${column.dictType} && ${column.dictType} != '') + @ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "${column.dictType}") +#elseif($parentheseIndex != -1) + @ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "$column.readConverterExp()") +#else + @ExcelProperty(value = "${comment}") +#end + private $column.javaType $column.javaField; + +#end +#end + +} diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/js/api.js.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/js/api.js.vm new file mode 100644 index 0000000..9295524 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/js/api.js.vm @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询${functionName}列表 +export function list${BusinessName}(query) { + return request({ + url: '/${moduleName}/${businessName}/list', + method: 'get', + params: query + }) +} + +// 查询${functionName}详细 +export function get${BusinessName}(${pkColumn.javaField}) { + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'get' + }) +} + +// 新增${functionName} +export function add${BusinessName}(data) { + return request({ + url: '/${moduleName}/${businessName}', + method: 'post', + data: data + }) +} + +// 修改${functionName} +export function update${BusinessName}(data) { + return request({ + url: '/${moduleName}/${businessName}', + method: 'put', + data: data + }) +} + +// 删除${functionName} +export function del${BusinessName}(${pkColumn.javaField}) { + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'delete' + }) +} diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/sql/oracle/sql.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/sql/oracle/sql.vm new file mode 100644 index 0000000..f6638be --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/sql/oracle/sql.vm @@ -0,0 +1,19 @@ +-- 菜单 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 103, 1, sysdate, null, null, '${functionName}菜单'); + +-- 按钮 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 103, 1, sysdate, null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 103, 1, sysdate, null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 103, 1, sysdate, null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 103, 1, sysdate, null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 103, 1, sysdate, null, null, ''); diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/sql/postgres/sql.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/sql/postgres/sql.vm new file mode 100644 index 0000000..0923392 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/sql/postgres/sql.vm @@ -0,0 +1,20 @@ +-- 菜单 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 103, 1, now(), null, null, '${functionName}菜单'); + +-- 按钮 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 103, 1, now(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 103, 1, now(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 103, 1, now(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 103, 1, now(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 103, 1, now(), null, null, ''); + diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/sql/sql.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/sql/sql.vm new file mode 100644 index 0000000..01824c2 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/sql/sql.vm @@ -0,0 +1,19 @@ +-- 菜单 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 103, 1, sysdate(), null, null, '${functionName}菜单'); + +-- 按钮 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 103, 1, sysdate(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 103, 1, sysdate(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 103, 1, sysdate(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 103, 1, sysdate(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 103, 1, sysdate(), null, null, ''); diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/sql/sqlserver/sql.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/sql/sqlserver/sql.vm new file mode 100644 index 0000000..bdf166e --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/sql/sqlserver/sql.vm @@ -0,0 +1,19 @@ +-- 菜单 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 103, 1, getdate(), null, null, '${functionName}菜单'); + +-- 按钮 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 103, 1, getdate(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 103, 1, getdate(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 103, 1, getdate(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 103, 1, getdate(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 103, 1, getdate(), null, null, ''); diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/ts/api.ts.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/ts/api.ts.vm new file mode 100644 index 0000000..9ef9ff4 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/ts/api.ts.vm @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import {AxiosPromise} from 'axios'; +import {${BusinessName}Form, ${BusinessName}Query, ${BusinessName}VO} from '@/api/'; + +/** + * 查询${functionName}列表 + * @param query + * @returns {*} + */ + +export const list${BusinessName} = (query?: ${BusinessName}Query): AxiosPromise<${BusinessName}VO[]> => { + return request({ + url: '/${moduleName}/${businessName}/list', + method: 'get', + params: query + }); +}; + +/** + * 查询${functionName}详细 + * @param ${pkColumn.javaField} + */ +export const get${BusinessName} = (${pkColumn.javaField}: string | number): AxiosPromise<${BusinessName}VO> => { + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'get' + }); +}; + +/** + * 新增${functionName} + * @param data + */ +export const add${BusinessName} = (data: ${BusinessName}Form) => { + return request({ + url: '/${moduleName}/${businessName}', + method: 'post', + data: data + }); +}; + +/** + * 修改${functionName} + * @param data + */ +export const update${BusinessName} = (data: ${BusinessName}Form) => { + return request({ + url: '/${moduleName}/${businessName}', + method: 'put', + data: data + }); +}; + +/** + * 删除${functionName} + * @param ${pkColumn.javaField} + */ +export const del${BusinessName} = (${pkColumn.javaField}: string | number | Array) => { + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'delete' + }); +}; diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/ts/types.ts.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/ts/types.ts.vm new file mode 100644 index 0000000..99359e0 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/ts/types.ts.vm @@ -0,0 +1,44 @@ +export interface ${BusinessName}VO { +#foreach ($column in $columns) +#if($column.insert || $column.edit) + /** + * $column.columnComment + */ + $column.javaField:#if($column.javaField.indexOf("id") != -1 || $column.javaField.indexOf("Id") != -1) string | number; + #elseif($column.javaType == 'Long' || $column.javaType == 'Integer' || $column.javaType == 'Double' || $column.javaType == 'Float' || $column.javaType == 'BigDecimal') number; + #elseif($column.javaType == 'Boolean') boolean; + #else string; + #end +#end +#end +} + +export interface ${BusinessName}Form extends BaseEntity { +#foreach ($column in $columns) +#if($column.insert || $column.edit) + /** + * $column.columnComment + */ + $column.javaField?:#if($column.javaField.indexOf("id") != -1 || $column.javaField.indexOf("Id") != -1) string | number; + #elseif($column.javaType == 'Long' || $column.javaType == 'Integer' || $column.javaType == 'Double' || $column.javaType == 'Float' || $column.javaType == 'BigDecimal') number; + #elseif($column.javaType == 'Boolean') boolean; + #else string; + #end +#end +#end +} + +export interface ${BusinessName}Query #if(!${treeCode})extends PageQuery #end{ +#foreach ($column in $columns) +#if($column.query) + /** + * $column.columnComment + */ + $column.javaField?:#if($column.javaField.indexOf("id") != -1 || $column.javaField.indexOf("Id") != -1) string | number; + #elseif($column.javaType == 'Long' || $column.javaType == 'Integer' || $column.javaType == 'Double' || $column.javaType == 'Float' || $column.javaType == 'BigDecimal') number; + #elseif($column.javaType == 'Boolean') boolean; + #else string; + #end +#end +#end +} diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/vue/index-tree.vue.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/vue/index-tree.vue.vm new file mode 100644 index 0000000..dda1b46 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/vue/index-tree.vue.vm @@ -0,0 +1,502 @@ + + + diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/vue/index.vue.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/vue/index.vue.vm new file mode 100644 index 0000000..6847f3b --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/vue/index.vue.vm @@ -0,0 +1,475 @@ + + + diff --git a/aibidding-modules/aibidding-generator/src/main/resources/vm/xml/mapper.xml.vm b/aibidding-modules/aibidding-generator/src/main/resources/vm/xml/mapper.xml.vm new file mode 100644 index 0000000..9fb48d9 --- /dev/null +++ b/aibidding-modules/aibidding-generator/src/main/resources/vm/xml/mapper.xml.vm @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-knowledge/pom.xml b/aibidding-modules/aibidding-knowledge/pom.xml new file mode 100644 index 0000000..3e131e9 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/pom.xml @@ -0,0 +1,203 @@ + + + 4.0.0 + + org.ruoyi + aibidding-modules + ${revision} + ../pom.xml + + + aibidding-knowledge + + + 17 + 17 + UTF-8 + + + + + org.springframework.boot + spring-boot-starter-data-redis + + + org.springframework.boot + spring-boot-starter-freemarker + + + org.springframework.boot + spring-boot-starter-validation + + + + org.springframework.boot + spring-boot-starter-aop + + + + org.webjars + webjars-locator-core + + + org.webjars + sockjs-client + 1.0.2 + + + + org.webjars + bootstrap + 3.3.7 + + + org.webjars + jquery + 3.1.1-1 + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 3.0.2 + + + com.baomidou + mybatis-plus-boot-starter + 3.5.3 + + + cn.hutool + hutool-all + 5.8.10 + + + com.github.xiaoymin + knife4j-openapi3-jakarta-spring-boot-starter + 4.0.0 + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + + + + com.mysql + mysql-connector-j + runtime + + + io.projectreactor.netty + reactor-netty-core + 1.1.16 + + + io.projectreactor.netty + reactor-netty-http + 1.1.16 + + + org.springframework.boot + spring-boot-configuration-processor + true + + + org.projectlombok + lombok + true + + + + com.theokanning.openai-gpt3-java + api + 0.18.0 + + + com.theokanning.openai-gpt3-java + client + 0.18.0 + + + com.theokanning.openai-gpt3-java + service + 0.18.0 + + + org.springframework.boot + spring-boot-starter-test + test + + + + + com.alibaba.fastjson2 + fastjson2 + 2.0.24 + + + com.knuddels + jtokkit + 0.5.0 + + + io.weaviate + client + 4.0.0 + + + org.apache.poi + poi + 3.8 + + + org.apache.poi + poi-ooxml + 3.8 + + + org.apache.poi + poi-ooxml-schemas + 3.8 + + + org.apache.pdfbox + pdfbox + 2.0.27 + + + com.squareup.retrofit2 + converter-jackson + 2.9.0 + + + io.milvus + milvus-sdk-java + 2.3.2 + + + com.github.pagehelper + pagehelper-spring-boot-starter + 1.4.6 + + + com.belerweb + pinyin4j + 2.5.1 + + + + + org.ruoyi + aibidding-system + + + + + + + diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/CodeFileLoader.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/CodeFileLoader.java new file mode 100644 index 0000000..6a7b6f8 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/CodeFileLoader.java @@ -0,0 +1,37 @@ +package org.aibidding.knowledge.chain.loader; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.knowledge.chain.split.TextSplitter; +import org.springframework.stereotype.Component; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.List; + +@Component +@AllArgsConstructor +@Slf4j +public class CodeFileLoader implements ResourceLoader{ + private final TextSplitter textSplitter; + @Override + public String getContent(InputStream inputStream) { + StringBuffer stringBuffer = new StringBuffer(); + try (InputStreamReader reader = new InputStreamReader(inputStream); + BufferedReader bufferedReader = new BufferedReader(reader)){ + String line; + while ((line = bufferedReader.readLine()) != null) { + stringBuffer.append(line).append("\n"); + } + } catch (IOException e) { + e.printStackTrace(); + } + return stringBuffer.toString(); + } + @Override + public List getChunkList(String content, String kid){ + return textSplitter.split(content, kid); + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/CsvFileLoader.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/CsvFileLoader.java new file mode 100644 index 0000000..4069273 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/CsvFileLoader.java @@ -0,0 +1,16 @@ +package org.aibidding.knowledge.chain.loader; + +import java.io.InputStream; +import java.util.List; + +public class CsvFileLoader implements ResourceLoader{ + @Override + public String getContent(InputStream inputStream) { + return null; + } + + @Override + public List getChunkList(String content, String kid) { + return null; + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/FolderLoader.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/FolderLoader.java new file mode 100644 index 0000000..20e4862 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/FolderLoader.java @@ -0,0 +1,16 @@ +package org.aibidding.knowledge.chain.loader; + +import java.io.InputStream; +import java.util.List; + +public class FolderLoader implements ResourceLoader{ + @Override + public String getContent(InputStream inputStream) { + return null; + } + + @Override + public List getChunkList(String content, String kid) { + return null; + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/GithubLoader.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/GithubLoader.java new file mode 100644 index 0000000..3791513 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/GithubLoader.java @@ -0,0 +1,16 @@ +package org.aibidding.knowledge.chain.loader; + +import java.io.InputStream; +import java.util.List; + +public class GithubLoader implements ResourceLoader{ + @Override + public String getContent(InputStream inputStream) { + return null; + } + + @Override + public List getChunkList(String content, String kid) { + return null; + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/JsonFileLoader.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/JsonFileLoader.java new file mode 100644 index 0000000..f9fb9d4 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/JsonFileLoader.java @@ -0,0 +1,16 @@ +package org.aibidding.knowledge.chain.loader; + +import java.io.InputStream; +import java.util.List; + +public class JsonFileLoader implements ResourceLoader{ + @Override + public String getContent(InputStream inputStream) { + return null; + } + + @Override + public List getChunkList(String content, String kid) { + return null; + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/MarkDownFileLoader.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/MarkDownFileLoader.java new file mode 100644 index 0000000..c67dfdf --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/MarkDownFileLoader.java @@ -0,0 +1,37 @@ +package org.aibidding.knowledge.chain.loader; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.knowledge.chain.split.TextSplitter; +import org.springframework.stereotype.Component; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.List; + +@Component +@AllArgsConstructor +@Slf4j +public class MarkDownFileLoader implements ResourceLoader{ + private final TextSplitter textSplitter; + @Override + public String getContent(InputStream inputStream) { + StringBuffer stringBuffer = new StringBuffer(); + try (InputStreamReader reader = new InputStreamReader(inputStream); + BufferedReader bufferedReader = new BufferedReader(reader)){ + String line; + while ((line = bufferedReader.readLine()) != null) { + stringBuffer.append(line).append("\n"); + } + } catch (IOException e) { + e.printStackTrace(); + } + return stringBuffer.toString(); + } + @Override + public List getChunkList(String content, String kid){ + return textSplitter.split(content, kid); + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/PdfFileLoader.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/PdfFileLoader.java new file mode 100644 index 0000000..99db2a4 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/PdfFileLoader.java @@ -0,0 +1,34 @@ +package org.aibidding.knowledge.chain.loader; + +import lombok.AllArgsConstructor; +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.text.PDFTextStripper; +import org.aibidding.knowledge.chain.split.TextSplitter; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.io.InputStream; +import java.util.List; + +@Component +@AllArgsConstructor +public class PdfFileLoader implements ResourceLoader{ + private final TextSplitter characterTextSplitter; + @Override + public String getContent(InputStream inputStream) { + PDDocument document = null; + try { + document = PDDocument.load(inputStream); + PDFTextStripper textStripper = new PDFTextStripper(); + String content = textStripper.getText(document); + return content; + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Override + public List getChunkList(String content, String kid) { + return characterTextSplitter.split(content, kid); + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/ResourceLoader.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/ResourceLoader.java new file mode 100644 index 0000000..ea6137c --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/ResourceLoader.java @@ -0,0 +1,14 @@ +package org.aibidding.knowledge.chain.loader; + +import java.io.InputStream; +import java.util.List; + +/** + * 资源载入 + */ +public interface ResourceLoader { + + String getContent(InputStream inputStream); + + List getChunkList(String content, String kid); +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/ResourceLoaderFactory.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/ResourceLoaderFactory.java new file mode 100644 index 0000000..b0005db --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/ResourceLoaderFactory.java @@ -0,0 +1,33 @@ +package org.aibidding.knowledge.chain.loader; + +import lombok.AllArgsConstructor; +import org.aibidding.knowledge.chain.split.CharacterTextSplitter; +import org.aibidding.knowledge.chain.split.CodeTextSplitter; +import org.aibidding.knowledge.chain.split.MarkdownTextSplitter; +import org.aibidding.knowledge.chain.split.TokenTextSplitter; +import org.aibidding.knowledge.constant.FileType; +import org.springframework.stereotype.Component; + +@AllArgsConstructor +@Component +public class ResourceLoaderFactory { + private final CharacterTextSplitter characterTextSplitter; + private final CodeTextSplitter codeTextSplitter; + private final MarkdownTextSplitter markdownTextSplitter; + private final TokenTextSplitter tokenTextSplitter; + public ResourceLoader getLoaderByFileType(String fileType){ + if (FileType.isTextFile(fileType)){ + return new TextFileLoader(characterTextSplitter); + } else if (FileType.isWord(fileType)) { + return new WordLoader(characterTextSplitter); + } else if (FileType.isPdf(fileType)) { + return new PdfFileLoader(characterTextSplitter); + } else if (FileType.isMdFile(fileType)) { + return new MarkDownFileLoader(markdownTextSplitter); + }else if (FileType.isCodeFile(fileType)) { + return new CodeFileLoader(codeTextSplitter); + }else { + return new TextFileLoader(characterTextSplitter); + } + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/TextFileLoader.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/TextFileLoader.java new file mode 100644 index 0000000..4f121a4 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/TextFileLoader.java @@ -0,0 +1,37 @@ +package org.aibidding.knowledge.chain.loader; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.knowledge.chain.split.TextSplitter; +import org.springframework.stereotype.Component; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.List; + +@Component +@AllArgsConstructor +@Slf4j +public class TextFileLoader implements ResourceLoader{ + private final TextSplitter textSplitter; + @Override + public String getContent(InputStream inputStream) { + StringBuffer stringBuffer = new StringBuffer(); + try (InputStreamReader reader = new InputStreamReader(inputStream, "UTF-8"); + BufferedReader bufferedReader = new BufferedReader(reader)){ + String line; + while ((line = bufferedReader.readLine()) != null) { + stringBuffer.append(line).append("\n"); + } + } catch (IOException e) { + e.printStackTrace(); + } + return stringBuffer.toString(); + } + @Override + public List getChunkList(String content, String kid){ + return textSplitter.split(content, kid); + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/WordLoader.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/WordLoader.java new file mode 100644 index 0000000..b7aa158 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/loader/WordLoader.java @@ -0,0 +1,37 @@ +package org.aibidding.knowledge.chain.loader; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.xwpf.extractor.XWPFWordExtractor; +import org.apache.poi.xwpf.usermodel.XWPFDocument; +import org.aibidding.knowledge.chain.split.TextSplitter; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.io.InputStream; +import java.util.List; + +@Component +@AllArgsConstructor +@Slf4j +public class WordLoader implements ResourceLoader{ + private final TextSplitter textSplitter; + @Override + public String getContent(InputStream inputStream) { + XWPFDocument document = null; + try { + document = new XWPFDocument(inputStream); + XWPFWordExtractor extractor = new XWPFWordExtractor(document); + String content = extractor.getText(); + return content; + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Override + public List getChunkList(String content, String kid) { + return textSplitter.split(content, kid); + } + +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/CharacterTextSplitter.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/CharacterTextSplitter.java new file mode 100644 index 0000000..ea46af7 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/CharacterTextSplitter.java @@ -0,0 +1,63 @@ +package org.aibidding.knowledge.chain.split; + +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.knowledge.domain.vo.KnowledgeInfoVo; +import org.aibidding.knowledge.service.IKnowledgeInfoService; +import org.springframework.context.annotation.Lazy; +import org.springframework.context.annotation.Primary; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@Component +@Slf4j +@Primary +public class CharacterTextSplitter implements TextSplitter { + + @Lazy + @Resource + private IKnowledgeInfoService knowledgeInfoService; + + @Override + public List split(String content, String kid) { + // 从知识库表中获取配置 + KnowledgeInfoVo knowledgeInfoVo = knowledgeInfoService.queryById(Long.valueOf(kid)); + String knowledgeSeparator = knowledgeInfoVo.getKnowledgeSeparator(); + int textBlockSize = knowledgeInfoVo.getTextBlockSize(); + int overlapChar = knowledgeInfoVo.getOverlapChar(); + List chunkList = new ArrayList<>(); + if (content.contains(knowledgeSeparator) && StringUtils.isNotBlank(knowledgeSeparator)) { + // 按自定义分隔符切分 + String[] chunks = content.split(knowledgeSeparator); + chunkList.addAll(Arrays.asList(chunks)); + } else { + int indexMin = 0; + int len = content.length(); + int i = 0; + int right = 0; + while (true) { + if (len > right) { + int begin = i * textBlockSize - overlapChar; + if (begin < indexMin) { + begin = indexMin; + } + int end = textBlockSize * (i + 1) + overlapChar; + if (end > len) { + end = len; + } + String chunk = content.substring(begin, end); + chunkList.add(chunk); + i++; + right = right + textBlockSize; + } else { + break; + } + } + } + return chunkList; + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/CodeTextSplitter.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/CodeTextSplitter.java new file mode 100644 index 0000000..3ea5b56 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/CodeTextSplitter.java @@ -0,0 +1,17 @@ +package org.aibidding.knowledge.chain.split; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +@AllArgsConstructor +@Slf4j +public class CodeTextSplitter implements TextSplitter{ + @Override + public List split(String content, String kid) { + return null; + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/MarkdownTextSplitter.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/MarkdownTextSplitter.java new file mode 100644 index 0000000..9602de0 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/MarkdownTextSplitter.java @@ -0,0 +1,17 @@ +package org.aibidding.knowledge.chain.split; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +@AllArgsConstructor +@Slf4j +public class MarkdownTextSplitter implements TextSplitter{ + @Override + public List split(String content, String kid) { + return null; + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/TextSplitter.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/TextSplitter.java new file mode 100644 index 0000000..db58fd5 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/TextSplitter.java @@ -0,0 +1,18 @@ +package org.aibidding.knowledge.chain.split; + +import java.util.List; + +/** + * 文本切分 + */ +public interface TextSplitter { + + /** + * 文本切分 + * + * @param content 文本内容 + * @param kid 知识库id + * @return 切分后的文本列表 + */ + List split(String content, String kid); +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/TokenTextSplitter.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/TokenTextSplitter.java new file mode 100644 index 0000000..9a81cef --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/split/TokenTextSplitter.java @@ -0,0 +1,17 @@ +package org.aibidding.knowledge.chain.split; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +@AllArgsConstructor +@Slf4j +public class TokenTextSplitter implements TextSplitter{ + @Override + public List split(String content, String kid) { + return null; + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/BgeLargeVectorization.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/BgeLargeVectorization.java new file mode 100644 index 0000000..89a70d3 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/BgeLargeVectorization.java @@ -0,0 +1,63 @@ +package org.aibidding.knowledge.chain.vectorizer; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import io.github.ollama4j.OllamaAPI; +import io.github.ollama4j.models.embeddings.OllamaEmbeddingsRequestModel; +import jakarta.annotation.Resource; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.knowledge.domain.vo.KnowledgeInfoVo; +import org.aibidding.knowledge.service.IKnowledgeInfoService; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Component; + +@Component +@Slf4j +@RequiredArgsConstructor +public class BgeLargeVectorization implements Vectorization { + + String host = "http://localhost:11434/"; + + @Lazy + @Resource + private IKnowledgeInfoService knowledgeInfoService; + + @Override + public List> batchVectorization(List chunkList, String kid) { + OllamaAPI ollamaAPI = new OllamaAPI(host); + KnowledgeInfoVo knowledgeInfoVo = knowledgeInfoService.queryById(Long.valueOf(kid)); + List doubleVector; + try { + doubleVector = ollamaAPI.generateEmbeddings(new OllamaEmbeddingsRequestModel(knowledgeInfoVo.getVectorModel(), new Gson().toJson(chunkList))); + } catch (Exception e) { + throw new RuntimeException(e); + } + List> vectorList = new ArrayList<>(); + vectorList.add(doubleVector); + return vectorList; + } + + @Override + public List singleVectorization(String chunk, String kid) { + List chunkList = new ArrayList<>(); + chunkList.add(chunk); + List> vectorList = batchVectorization(chunkList, kid); + return vectorList.get(0); + } + + public static void main(String[] args) { + OllamaAPI ollamaAPI = new OllamaAPI("http://localhost:11434/"); + List chunkList = Arrays.asList("天很蓝", "海很深"); + List doubleVector; + try { + doubleVector = ollamaAPI.generateEmbeddings(new OllamaEmbeddingsRequestModel("quentinz/bge-large-zh-v1.5", new Gson().toJson(chunkList))); + } catch (Exception e) { + throw new RuntimeException(e); + } + System.out.println("=== " + doubleVector + " 1==="); + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/LocalModelsVectorization.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/LocalModelsVectorization.java new file mode 100644 index 0000000..203d324 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/LocalModelsVectorization.java @@ -0,0 +1,92 @@ +package org.aibidding.knowledge.chain.vectorizer; + +import jakarta.annotation.Resource; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.chat.config.ChatConfig; +import org.aibidding.common.chat.localModels.LocalModelsofitClient; +import org.aibidding.common.chat.openai.OpenAiStreamClient; +import org.aibidding.knowledge.domain.vo.KnowledgeInfoVo; +import org.aibidding.knowledge.service.IKnowledgeInfoService; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; + +@Component +@Slf4j +@RequiredArgsConstructor +public class LocalModelsVectorization { + @Resource + private IKnowledgeInfoService knowledgeInfoService; + + @Resource + private LocalModelsofitClient localModelsofitClient; + + @Getter + private OpenAiStreamClient openAiStreamClient; + + private final ChatConfig chatConfig; + + /** + * 批量向量化 + * + * @param chunkList 文本块列表 + * @param kid 知识 ID + * @return 向量化结果 + */ + + public List> batchVectorization(List chunkList, String kid) { + logVectorizationRequest(kid, chunkList); // 在向量化开始前记录日志 + openAiStreamClient = chatConfig.getOpenAiStreamClient(); // 获取 OpenAi 客户端 + KnowledgeInfoVo knowledgeInfoVo = knowledgeInfoService.queryById(Long.valueOf(kid)); // 查询知识信息 + // 调用 localModelsofitClient 获取 Top K 嵌入向量 + try { + return localModelsofitClient.getTopKEmbeddings( + chunkList, + knowledgeInfoVo.getVectorModel(), + knowledgeInfoVo.getKnowledgeSeparator(), + knowledgeInfoVo.getRetrieveLimit(), + knowledgeInfoVo.getTextBlockSize(), + knowledgeInfoVo.getOverlapChar() + ); + } catch (Exception e) { + log.error("Failed to perform batch vectorization for knowledgeId: {}", kid, e); + throw new RuntimeException("Batch vectorization failed", e); + } + } + + /** + * 单一文本块向量化 + * + * @param chunk 单一文本块 + * @param kid 知识 ID + * @return 向量化结果 + */ + + public List singleVectorization(String chunk, String kid) { + List chunkList = new ArrayList<>(); + chunkList.add(chunk); + + // 调用批量向量化方法 + List> vectorList = batchVectorization(chunkList, kid); + + if (vectorList.isEmpty()) { + log.warn("Vectorization returned empty list for chunk: {}", chunk); + return new ArrayList<>(); + } + + return vectorList.get(0); // 返回第一个向量 + } + + /** + * 提供更简洁的日志记录方法 + * + * @param kid 知识 ID + * @param chunkList 文本块列表 + */ + private void logVectorizationRequest(String kid, List chunkList) { + log.info("Starting vectorization for Knowledge ID: {} with {} chunks.", kid, chunkList.size()); + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/OpenAiVectorization.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/OpenAiVectorization.java new file mode 100644 index 0000000..8ea0d7f --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/OpenAiVectorization.java @@ -0,0 +1,98 @@ +package org.aibidding.knowledge.chain.vectorizer; + +import jakarta.annotation.Resource; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.chat.config.ChatConfig; +import org.aibidding.common.chat.entity.embeddings.Embedding; + +import org.aibidding.common.chat.entity.embeddings.EmbeddingResponse; +import org.aibidding.common.chat.openai.OpenAiStreamClient; +import org.aibidding.knowledge.domain.vo.KnowledgeInfoVo; +import org.aibidding.knowledge.service.IKnowledgeInfoService; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Component +@Slf4j +@RequiredArgsConstructor +public class OpenAiVectorization implements Vectorization { + + @Lazy + @Resource + private IKnowledgeInfoService knowledgeInfoService; + @Lazy + @Resource + private LocalModelsVectorization localModelsVectorization; + + @Getter + private OpenAiStreamClient openAiStreamClient; + + private final ChatConfig chatConfig; + + @Override + public List> batchVectorization(List chunkList, String kid) { + List> vectorList; + openAiStreamClient = chatConfig.getOpenAiStreamClient(); + // 获取知识库信息 + KnowledgeInfoVo knowledgeInfoVo = knowledgeInfoService.queryById(Long.valueOf(kid)); + + Embedding embedding = buildEmbedding(chunkList, knowledgeInfoVo); + EmbeddingResponse embeddings = openAiStreamClient.embeddings(embedding); + + // 处理 OpenAI 返回的嵌入数据 + vectorList = processOpenAiEmbeddings(embeddings); + + return vectorList; + } + + /** + * 构建 Embedding 对象 + */ + private Embedding buildEmbedding(List chunkList, KnowledgeInfoVo knowledgeInfoVo) { + return Embedding.builder() + .input(chunkList) + .model(knowledgeInfoVo.getVectorModel()) + .build(); + } + + /** + * 处理 OpenAI 返回的嵌入数据 + */ + private List> processOpenAiEmbeddings(EmbeddingResponse embeddings) { + List> vectorList = new ArrayList<>(); + + embeddings.getData().forEach(data -> { + List vector = data.getEmbedding(); + List doubleVector = convertToDoubleList(vector); + vectorList.add(doubleVector); + }); + + return vectorList; + } + + /** + * 将 BigDecimal 转换为 Double 列表 + */ + private List convertToDoubleList(List vector) { + return vector.stream() + .map(BigDecimal::doubleValue) + .collect(Collectors.toList()); + } + + + @Override + public List singleVectorization(String chunk, String kid) { + List chunkList = new ArrayList<>(); + chunkList.add(chunk); + List> vectorList = batchVectorization(chunkList, kid); + return vectorList.get(0); + } + +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/Vectorization.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/Vectorization.java new file mode 100644 index 0000000..03bd428 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/Vectorization.java @@ -0,0 +1,12 @@ +package org.aibidding.knowledge.chain.vectorizer; + +import java.util.List; + +/** + * 向量化 + */ +public interface Vectorization { + List> batchVectorization(List chunkList, String kid); + + List singleVectorization(String chunk, String kid); +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/VectorizationFactory.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/VectorizationFactory.java new file mode 100644 index 0000000..90611ab --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/VectorizationFactory.java @@ -0,0 +1,45 @@ +package org.aibidding.knowledge.chain.vectorizer; + +import cn.hutool.core.util.StrUtil; +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.knowledge.domain.vo.KnowledgeInfoVo; +import org.aibidding.knowledge.service.IKnowledgeInfoService; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Component; + +/** + * 文本向量化 + * @author huangkh + */ +@Component +@Slf4j +public class VectorizationFactory { + + private final OpenAiVectorization openAiVectorization; + + private final BgeLargeVectorization bgeLargeVectorization; + + @Lazy + @Resource + private IKnowledgeInfoService knowledgeInfoService; + + public VectorizationFactory(OpenAiVectorization openAiVectorization,BgeLargeVectorization bgeLargeVectorization) { + this.openAiVectorization = openAiVectorization; + this.bgeLargeVectorization = bgeLargeVectorization; + } + + public Vectorization getEmbedding(String kid){ + String vectorModel = "text-embedding-3-small"; + if (StrUtil.isNotEmpty(kid)) { + KnowledgeInfoVo knowledgeInfoVo = knowledgeInfoService.queryById(Long.valueOf(kid)); + if (knowledgeInfoVo != null && StrUtil.isNotEmpty(knowledgeInfoVo.getVectorModel())) { + vectorModel = knowledgeInfoVo.getVectorModel(); + } + } + return switch (vectorModel) { + case "quentinz/bge-large-zh-v1.5" -> bgeLargeVectorization; + default -> openAiVectorization; + }; + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/VectorizationType.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/VectorizationType.java new file mode 100644 index 0000000..107ed79 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/VectorizationType.java @@ -0,0 +1,15 @@ +package org.aibidding.knowledge.chain.vectorizer; + +public enum VectorizationType { + OPENAI, // OpenAI 向量化 + LOCAL; // 本地模型向量化 + + public static VectorizationType fromString(String type) { + for (VectorizationType v : values()) { + if (v.name().equalsIgnoreCase(type)) { + return v; + } + } + throw new IllegalArgumentException("Unknown VectorizationType: " + type); + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/VectorizationWrapper.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/VectorizationWrapper.java new file mode 100644 index 0000000..b816298 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorizer/VectorizationWrapper.java @@ -0,0 +1,28 @@ +package org.aibidding.knowledge.chain.vectorizer; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Primary; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +@Slf4j +@Primary +@AllArgsConstructor +public class VectorizationWrapper implements Vectorization{ + + private final VectorizationFactory vectorizationFactory; + @Override + public List> batchVectorization(List chunkList, String kid) { + Vectorization embedding = vectorizationFactory.getEmbedding(kid); + return embedding.batchVectorization(chunkList, kid); + } + + @Override + public List singleVectorization(String chunk, String kid) { + Vectorization embedding = vectorizationFactory.getEmbedding(kid); + return embedding.singleVectorization(chunk, kid); + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/MilvusVectorStore.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/MilvusVectorStore.java new file mode 100644 index 0000000..56c98d9 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/MilvusVectorStore.java @@ -0,0 +1,395 @@ +package org.aibidding.knowledge.chain.vectorstore; + +import io.milvus.client.MilvusServiceClient; +import io.milvus.grpc.DataType; +import io.milvus.grpc.DescribeIndexResponse; +import io.milvus.grpc.MutationResult; +import io.milvus.grpc.SearchResults; +import io.milvus.param.*; +import io.milvus.param.collection.*; +import io.milvus.param.dml.DeleteParam; +import io.milvus.param.dml.InsertParam; +import io.milvus.param.dml.SearchParam; +import io.milvus.param.index.CreateIndexParam; +import io.milvus.param.index.DescribeIndexParam; +import io.milvus.param.partition.CreatePartitionParam; +import io.milvus.response.QueryResultsWrapper; +import io.milvus.response.SearchResultsWrapper; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.aibidding.common.core.service.ConfigService; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@Service +@Slf4j +public class MilvusVectorStore implements VectorStore { + + private volatile Integer dimension; + private volatile String collectionName; + private MilvusServiceClient milvusServiceClient; + + @Resource + private ConfigService configService; + + @PostConstruct + public void loadConfig() { + this.dimension = Integer.parseInt(configService.getConfigValue("milvus", "dimension")); + this.collectionName = configService.getConfigValue("milvus", "collection"); + } + + @PostConstruct + public void init() { + String milvusHost = configService.getConfigValue("milvus", "host"); + String milvausPort = configService.getConfigValue("milvus", "port"); + milvusServiceClient = new MilvusServiceClient( + ConnectParam.newBuilder() + .withHost(milvusHost) + .withPort(Integer.parseInt(milvausPort)) + .withDatabaseName("default") + .build() + ); + } + + private void createSchema(String kid) { + FieldType primaryField = FieldType.newBuilder() + .withName("row_id") + .withDataType(DataType.Int64) + .withPrimaryKey(true) + .withAutoID(true) + .build(); + FieldType contentField = FieldType.newBuilder() + .withName("content") + .withDataType(DataType.VarChar) + .withMaxLength(1000) + .build(); + FieldType kidField = FieldType.newBuilder() + .withName("kid") + .withDataType(DataType.VarChar) + .withMaxLength(20) + .build(); + FieldType docIdField = FieldType.newBuilder() + .withName("docId") + .withDataType(DataType.VarChar) + .withMaxLength(20) + .build(); + FieldType fidField = FieldType.newBuilder() + .withName("fid") + .withDataType(DataType.VarChar) + .withMaxLength(20) + .build(); + FieldType vectorField = FieldType.newBuilder() + .withName("fv") + .withDataType(DataType.FloatVector) + .withDimension(dimension) + .build(); + CreateCollectionParam createCollectionReq = CreateCollectionParam.newBuilder() + .withCollectionName(collectionName + kid) + .withDescription("local knowledge") + .addFieldType(primaryField) + .addFieldType(contentField) + .addFieldType(kidField) + .addFieldType(docIdField) + .addFieldType(fidField) + .addFieldType(vectorField) + .build(); + milvusServiceClient.createCollection(createCollectionReq); + + // 创建向量的索引 + IndexType INDEX_TYPE = IndexType.IVF_FLAT; + String INDEX_PARAM = "{\"nlist\":1024}"; + milvusServiceClient.createIndex( + CreateIndexParam.newBuilder() + .withCollectionName(collectionName + kid) + .withFieldName("fv") + .withIndexType(INDEX_TYPE) + .withMetricType(MetricType.IP) + .withExtraParam(INDEX_PARAM) + .withSyncMode(Boolean.FALSE) + .build() + ); + + } + + @Override + public void newSchema(String kid) { + createSchema(kid); + } + + @Override + public void removeByKidAndFid(String kid, String fid) { + milvusServiceClient.delete( + DeleteParam.newBuilder() + .withCollectionName(collectionName + kid) + .withExpr("fid == " + fid) + .build() + ); + } + + @Override + public void storeEmbeddings(List chunkList, List> vectorList, String kid, String docId, List fidList) { + String fullCollectionName = collectionName + kid; + + // 检查集合是否存在 + HasCollectionParam hasCollectionParam = HasCollectionParam.newBuilder() + .withCollectionName(fullCollectionName) + .build(); + R booleanR = milvusServiceClient.hasCollection(hasCollectionParam); + + if (booleanR.getStatus() == R.Status.Success.getCode()) { + boolean collectionExists = booleanR.getData().booleanValue(); + if (!collectionExists) { + // 集合不存在,创建集合 + List fieldTypes = new ArrayList<>(); + // 假设这里定义 id 字段,根据实际情况修改 + FieldType idField = FieldType.newBuilder() + .withName("id") + .withDataType(DataType.Int64) + .withPrimaryKey(true) + .withAutoID(true) + .build(); + fieldTypes.add(idField); + + // 定义向量字段 + FieldType vectorField = FieldType.newBuilder() + .withName("fv") + .withDataType(DataType.FloatVector) + .withDimension(vectorList.get(0).size()) + .build(); + fieldTypes.add(vectorField); + + // 定义其他字段 + FieldType contentField = FieldType.newBuilder() + .withName("content") + .withDataType(DataType.VarChar) + .withMaxLength(chunkList.size() * 1024) // 根据实际情况修改 + .build(); + fieldTypes.add(contentField); + + FieldType kidField = FieldType.newBuilder() + .withName("kid") + .withDataType(DataType.VarChar) + .withMaxLength(256) // 根据实际情况修改 + .build(); + fieldTypes.add(kidField); + + FieldType docIdField = FieldType.newBuilder() + .withName("docId") + .withDataType(DataType.VarChar) + .withMaxLength(256) // 根据实际情况修改 + .build(); + fieldTypes.add(docIdField); + + FieldType fidField = FieldType.newBuilder() + .withName("fid") + .withDataType(DataType.VarChar) + .withMaxLength(256) // 根据实际情况修改 + .build(); + fieldTypes.add(fidField); + + CreateCollectionParam createCollectionParam = CreateCollectionParam.newBuilder() + .withCollectionName(fullCollectionName) + .withFieldTypes(fieldTypes) + .build(); + + R collection = milvusServiceClient.createCollection(createCollectionParam); + if (collection.getStatus() == R.Status.Success.getCode()) { + System.out.println("集合 " + fullCollectionName + " 创建成功"); + + // 创建索引 + CreateIndexParam createIndexParam = CreateIndexParam.newBuilder() + .withCollectionName(fullCollectionName) + .withFieldName("fv") // 向量字段名 + .withIndexType(IndexType.IVF_FLAT) // 索引类型 + .withMetricType(MetricType.IP) + .withExtraParam("{\"nlist\":1024}") // 索引参数 + .build(); + R indexResponse = milvusServiceClient.createIndex(createIndexParam); + if (indexResponse.getStatus() == R.Status.Success.getCode()) { + System.out.println("索引创建成功"); + } else { + System.err.println("索引创建失败: " + indexResponse.getMessage()); + return; + } + } else { + System.err.println("集合创建失败: " + collection.getMessage()); + return; + } + } + } else { + System.err.println("检查集合是否存在时出错: " + booleanR.getMessage()); + return; + } + + if (StringUtils.isNotBlank(docId)) { + milvusServiceClient.createPartition( + CreatePartitionParam.newBuilder() + .withCollectionName(fullCollectionName) + .withPartitionName(docId) + .build() + ); + } + + List> vectorFloatList = new ArrayList<>(); + List kidList = new ArrayList<>(); + List docIdList = new ArrayList<>(); + for (int i = 0; i < Math.min(chunkList.size(), vectorList.size()); i++) { + List vector = vectorList.get(i); + List vfList = new ArrayList<>(); + for (int j = 0; j < vector.size(); j++) { + Double value = vector.get(j); + vfList.add(value.floatValue()); + } + vectorFloatList.add(vfList); + kidList.add(kid); + docIdList.add(docId); + } + List fields = new ArrayList<>(); + fields.add(new InsertParam.Field("content", chunkList)); + fields.add(new InsertParam.Field("kid", kidList)); + fields.add(new InsertParam.Field("docId", docIdList)); + fields.add(new InsertParam.Field("fid", fidList)); + fields.add(new InsertParam.Field("fv", vectorFloatList)); + + InsertParam insertParam = InsertParam.newBuilder() + .withCollectionName(fullCollectionName) + .withPartitionName(docId) + .withFields(fields) + .build(); + System.out.println("========================="); + + R insert = milvusServiceClient.insert(insertParam); + if (insert.getStatus() == R.Status.Success.getCode()) { + System.out.println("插入成功,插入的行数: " + insert.getData().getInsertCnt()); + } else { + System.err.println("插入失败: " + insert.getMessage()); + } + System.out.println("========================="); + // milvus在将数据装载到内存后才能进行向量计算. + LoadCollectionParam loadCollectionParam = LoadCollectionParam.newBuilder() + .withCollectionName(fullCollectionName) + .build(); + R loadResponse = milvusServiceClient.loadCollection(loadCollectionParam); + if (loadResponse.getStatus() != R.Status.Success.getCode()) { + System.err.println("加载集合 " + fullCollectionName + " 到内存时出错:" + loadResponse.getMessage()); + } +// milvusServiceClient.loadCollection(LoadCollectionParam.newBuilder().withCollectionName(fullCollectionName).build()); + } + + + @Override + public void removeByDocId(String kid, String docId) { + milvusServiceClient.delete( + DeleteParam.newBuilder() + .withCollectionName(collectionName + kid) + .withExpr("1 == 1") + .withPartitionName(docId) + .build() + ); + } + + @Override + public void removeByKid(String kid) { + milvusServiceClient.dropCollection( + DropCollectionParam.newBuilder() + .withCollectionName(collectionName + kid) + .build() + ); + } + + @Override + public List nearest(List queryVector, String kid) { + String fullCollectionName = collectionName + kid; + + HasCollectionParam hasCollectionParam = HasCollectionParam.newBuilder() + .withCollectionName(fullCollectionName) + .build(); + + R booleanR = milvusServiceClient.hasCollection(hasCollectionParam); + if (booleanR.getStatus() != R.Status.Success.getCode() || !booleanR.getData().booleanValue()) { + System.err.println("集合 " + fullCollectionName + " 不存在或检查集合存在性时出错。"); + return new ArrayList<>(); + } + + DescribeIndexParam describeIndexParam = DescribeIndexParam.newBuilder().withCollectionName(fullCollectionName).build(); + + R describeIndexResponseR = milvusServiceClient.describeIndex(describeIndexParam); + + if (describeIndexResponseR.getStatus() == R.Status.Success.getCode()) { + System.out.println("索引信息: " + describeIndexResponseR.getData().getIndexDescriptionsCount()); + } else { + System.err.println("获取索引失败: " + describeIndexResponseR.getMessage()); + } + +// // 加载集合到内存 +// LoadCollectionParam loadCollectionParam = LoadCollectionParam.newBuilder() +// .withCollectionName(fullCollectionName) +// .build(); +// R loadResponse = milvusServiceClient.loadCollection(loadCollectionParam); +// if (loadResponse.getStatus() != R.Status.Success.getCode()) { +// System.err.println("加载集合 " + fullCollectionName + " 到内存时出错:" + loadResponse.getMessage()); +// return new ArrayList<>(); +// } + + List search_output_fields = Arrays.asList("content", "fv"); + List fv = new ArrayList<>(); + for (int i = 0; i < queryVector.size(); i++) { + fv.add(queryVector.get(i).floatValue()); + } + List> vectors = new ArrayList<>(); + vectors.add(fv); + String search_param = "{\"nprobe\":10, \"offset\":0}"; + SearchParam searchParam = SearchParam.newBuilder() + .withCollectionName(collectionName + kid) + .withMetricType(MetricType.IP) + .withOutFields(search_output_fields) + .withTopK(10) + .withVectors(vectors) + .withVectorFieldName("fv") + .withParams(search_param) + .build(); + System.out.println("SearchParam: " + searchParam.toString()); + R respSearch = milvusServiceClient.search(searchParam); + if (respSearch.getStatus() == R.Status.Success.getCode()) { + SearchResults searchResults = respSearch.getData(); + if (searchResults != null) { + System.out.println(searchResults.getResults()); + SearchResultsWrapper wrapperSearch = new SearchResultsWrapper(searchResults.getResults()); + List rowRecords = wrapperSearch.getRowRecords(); + + List resultList = new ArrayList<>(); + if (rowRecords != null && !rowRecords.isEmpty()) { + for (QueryResultsWrapper.RowRecord rowRecord : rowRecords) { + String content = rowRecord.get("content").toString(); + resultList.add(content); + } + } + return resultList; + } else { + System.err.println("搜索结果为空"); + } + } else { + System.err.println("搜索操作失败: " + respSearch.getMessage()); + } + return new ArrayList<>(); + + } + + /** + * milvus 不支持通过文本检索相似性 + * + * @param query + * @param kid + * @return + */ + @Override + public List nearest(String query, String kid) { + return null; + } + +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/VectorStore.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/VectorStore.java new file mode 100644 index 0000000..49675fc --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/VectorStore.java @@ -0,0 +1,23 @@ +package org.aibidding.knowledge.chain.vectorstore; + +import java.util.List; + +/** + * 向量存储 + */ +public interface VectorStore { + + void storeEmbeddings(List chunkList, List> vectorList, String kid, String docId, List fidList); + + void removeByDocId(String kid, String docId); + + void removeByKid(String kid); + + List nearest(List queryVector, String kid); + + List nearest(String query, String kid); + + void newSchema(String kid); + + void removeByKidAndFid(String kid, String fid); +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/VectorStoreFactory.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/VectorStoreFactory.java new file mode 100644 index 0000000..cbce192 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/VectorStoreFactory.java @@ -0,0 +1,41 @@ +package org.aibidding.knowledge.chain.vectorstore; + +import cn.hutool.core.util.StrUtil; +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.knowledge.domain.vo.KnowledgeInfoVo; +import org.aibidding.knowledge.mapper.KnowledgeInfoMapper; +import org.springframework.stereotype.Component; + +@Component +@Slf4j +public class VectorStoreFactory { + + private final WeaviateVectorStore weaviateVectorStore; + + private final MilvusVectorStore milvusVectorStore; + + @Resource + private KnowledgeInfoMapper knowledgeInfoMapper; + + public VectorStoreFactory(WeaviateVectorStore weaviateVectorStore, MilvusVectorStore milvusVectorStore) { + this.weaviateVectorStore = weaviateVectorStore; + this.milvusVectorStore = milvusVectorStore; + } + + public VectorStore getVectorStore(String kid){ + String vectorModel = "weaviate"; + if (StrUtil.isNotEmpty(kid)) { + KnowledgeInfoVo knowledgeInfoVo = knowledgeInfoMapper.selectVoById(Long.valueOf(kid)); + if (knowledgeInfoVo != null && StrUtil.isNotEmpty(knowledgeInfoVo.getVector())) { + vectorModel = knowledgeInfoVo.getVector(); + } + } + if ("weaviate".equals(vectorModel)){ + return weaviateVectorStore; + }else if ("milvus".equals(vectorModel)){ + return milvusVectorStore; + } + return null; + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/VectorStoreWrapper.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/VectorStoreWrapper.java new file mode 100644 index 0000000..5fa4e93 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/VectorStoreWrapper.java @@ -0,0 +1,59 @@ +package org.aibidding.knowledge.chain.vectorstore; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Primary; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@Slf4j +@Primary +@AllArgsConstructor +public class VectorStoreWrapper implements VectorStore { + + private final VectorStoreFactory vectorStoreFactory; + + @Override + public void storeEmbeddings(List chunkList, List> vectorList, String kid, String docId, List fidList) { + VectorStore vectorStore = vectorStoreFactory.getVectorStore(kid); + vectorStore.storeEmbeddings(chunkList, vectorList, kid, docId, fidList); + } + + @Override + public void removeByDocId(String kid, String docId) { + VectorStore vectorStore = vectorStoreFactory.getVectorStore(kid); + vectorStore.removeByDocId(kid, docId); + } + + @Override + public void removeByKid(String kid) { + VectorStore vectorStore = vectorStoreFactory.getVectorStore(kid); + vectorStore.removeByKid(kid); + } + + @Override + public List nearest(List queryVector, String kid) { + VectorStore vectorStore = vectorStoreFactory.getVectorStore(kid); + return vectorStore.nearest(queryVector, kid); + } + + @Override + public List nearest(String query, String kid) { + VectorStore vectorStore = vectorStoreFactory.getVectorStore(kid); + return vectorStore.nearest(query, kid); + } + + @Override + public void newSchema(String kid) { + VectorStore vectorStore = vectorStoreFactory.getVectorStore(kid); + vectorStore.newSchema(kid); + } + + @Override + public void removeByKidAndFid(String kid, String fid) { + VectorStore vectorStore = vectorStoreFactory.getVectorStore(kid); + vectorStore.removeByKidAndFid(kid, fid); + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/WeaviateVectorStore.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/WeaviateVectorStore.java new file mode 100644 index 0000000..ccb8a12 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/chain/vectorstore/WeaviateVectorStore.java @@ -0,0 +1,401 @@ +package org.aibidding.knowledge.chain.vectorstore; + +import cn.hutool.core.lang.UUID; +import com.alibaba.fastjson2.JSONObject; +import com.google.gson.internal.LinkedTreeMap; +import io.weaviate.client.Config; +import io.weaviate.client.WeaviateClient; +import io.weaviate.client.base.Result; +import io.weaviate.client.v1.data.model.WeaviateObject; +import io.weaviate.client.v1.data.replication.model.ConsistencyLevel; +import io.weaviate.client.v1.filters.Operator; +import io.weaviate.client.v1.filters.WhereFilter; +import io.weaviate.client.v1.graphql.model.GraphQLResponse; +import io.weaviate.client.v1.graphql.query.argument.NearTextArgument; +import io.weaviate.client.v1.graphql.query.argument.NearVectorArgument; +import io.weaviate.client.v1.graphql.query.fields.Field; +import io.weaviate.client.v1.misc.model.Meta; +import io.weaviate.client.v1.misc.model.ReplicationConfig; +import io.weaviate.client.v1.misc.model.ShardingConfig; +import io.weaviate.client.v1.misc.model.VectorIndexConfig; +import io.weaviate.client.v1.schema.model.DataType; +import io.weaviate.client.v1.schema.model.Property; +import io.weaviate.client.v1.schema.model.Schema; +import io.weaviate.client.v1.schema.model.WeaviateClass; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.aibidding.common.core.service.ConfigService; +import org.aibidding.knowledge.domain.vo.KnowledgeInfoVo; +import org.aibidding.knowledge.service.IKnowledgeInfoService; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +@Slf4j +public class WeaviateVectorStore implements VectorStore { + + private volatile String protocol; + private volatile String host; + private volatile String className; + + @Lazy + @Resource + private IKnowledgeInfoService knowledgeInfoService; + + @Lazy + @Resource + private ConfigService configService; + + @PostConstruct + public void loadConfig() { + this.protocol = configService.getConfigValue("weaviate", "protocol"); + this.host = configService.getConfigValue("weaviate", "host"); + this.className = configService.getConfigValue("weaviate", "classname"); + } + + public WeaviateClient getClient() { + Config config = new Config(protocol, host); + WeaviateClient client = new WeaviateClient(config); + return client; + } + + public Result getMeta() { + WeaviateClient client = getClient(); + Result meta = client.misc().metaGetter().run(); + if (meta.getError() == null) { + System.out.printf("meta.hostname: %s\n", meta.getResult().getHostname()); + System.out.printf("meta.version: %s\n", meta.getResult().getVersion()); + System.out.printf("meta.modules: %s\n", meta.getResult().getModules()); + } else { + System.out.printf("Error: %s\n", meta.getError().getMessages()); + } + return meta; + } + + public Result getSchemas() { + WeaviateClient client = getClient(); + Result result = client.schema().getter().run(); + if (result.hasErrors()) { + System.out.println(result.getError()); + } else { + System.out.println(result.getResult()); + } + return result; + } + + + public Result createSchema(String kid) { + WeaviateClient client = getClient(); + + VectorIndexConfig vectorIndexConfig = VectorIndexConfig.builder() + .distance("cosine") + .cleanupIntervalSeconds(300) + .efConstruction(128) + .maxConnections(64) + .vectorCacheMaxObjects(500000L) + .ef(-1) + .skip(false) + .dynamicEfFactor(8) + .dynamicEfMax(500) + .dynamicEfMin(100) + .flatSearchCutoff(40000) + .build(); + + ShardingConfig shardingConfig = ShardingConfig.builder() + .desiredCount(3) + .desiredVirtualCount(128) + .function("murmur3") + .key("_id") + .strategy("hash") + .virtualPerPhysical(128) + .build(); + + ReplicationConfig replicationConfig = ReplicationConfig.builder() + .factor(1) + .build(); + + JSONObject classModuleConfigValue = new JSONObject(); + classModuleConfigValue.put("vectorizeClassName", false); + JSONObject classModuleConfig = new JSONObject(); + classModuleConfig.put("text2vec-transformers", classModuleConfigValue); + + JSONObject propertyModuleConfigValueSkipTrue = new JSONObject(); + propertyModuleConfigValueSkipTrue.put("vectorizePropertyName", false); + propertyModuleConfigValueSkipTrue.put("skip", true); + JSONObject propertyModuleConfigSkipTrue = new JSONObject(); + propertyModuleConfigSkipTrue.put("text2vec-transformers", propertyModuleConfigValueSkipTrue); + + JSONObject propertyModuleConfigValueSkipFalse = new JSONObject(); + propertyModuleConfigValueSkipFalse.put("vectorizePropertyName", false); + propertyModuleConfigValueSkipFalse.put("skip", false); + JSONObject propertyModuleConfigSkipFalse = new JSONObject(); + propertyModuleConfigSkipFalse.put("text2vec-transformers", propertyModuleConfigValueSkipFalse); + + WeaviateClass clazz = WeaviateClass.builder() + .className(className + kid) + .description("local knowledge") + .vectorIndexType("hnsw") + .vectorizer("text2vec-transformers") + .shardingConfig(shardingConfig) + .vectorIndexConfig(vectorIndexConfig) + .replicationConfig(replicationConfig) + .moduleConfig(classModuleConfig) + .properties(new ArrayList() { + { + add(Property.builder() + .dataType(new ArrayList() { + { + add(DataType.TEXT); + } + }) + .name("content") + .description("The content of the local knowledge,for search") + .moduleConfig(propertyModuleConfigSkipFalse) + .build()); + add(Property.builder() + .dataType(new ArrayList() { + { + add(DataType.TEXT); + } + }) + .name("kid") + .description("The knowledge id of the local knowledge,for search") + .moduleConfig(propertyModuleConfigSkipTrue) + .build()); + add(Property.builder() + .dataType(new ArrayList() { + { + add(DataType.TEXT); + } + }) + .name("docId") + .description("The doc id of the local knowledge,for search") + .moduleConfig(propertyModuleConfigSkipTrue) + .build()); + add(Property.builder() + .dataType(new ArrayList() { + { + add(DataType.TEXT); + } + }) + .name("fid") + .description("The fragment id of the local knowledge,for search") + .moduleConfig(propertyModuleConfigSkipTrue) + .build()); + add(Property.builder() + .dataType(new ArrayList() { + { + add(DataType.TEXT); + } + }) + .name("uuid") + .description("The uuid id of the local knowledge fragment(same with id properties),for search") + .moduleConfig(propertyModuleConfigSkipTrue) + .build()); + } }) + .build(); + + Result result = client.schema().classCreator().withClass(clazz).run(); + if (result.hasErrors()) { + System.out.println(result.getError()); + } + System.out.println(result.getResult()); + return result; + } + + @Override + public void newSchema(String kid) { + createSchema(kid); + } + + @Override + public void removeByKidAndFid(String kid, String fid) { + List resultList = new ArrayList<>(); + WeaviateClient client = getClient(); + Field fieldId = Field.builder().name("uuid").build(); + WhereFilter where = WhereFilter.builder() + .path(new String[]{"fid"}) + .operator(Operator.Equal) + .valueString(fid) + .build(); + Result result = client.graphQL().get() + .withClassName(className + kid) + .withFields(fieldId) + .withWhere(where) + .run(); + LinkedTreeMap t = (LinkedTreeMap) result.getResult().getData(); + LinkedTreeMap> l = (LinkedTreeMap>) t.get("Get"); + ArrayList m = l.get(className + kid); + for (LinkedTreeMap linkedTreeMap : m) { + String uuid = linkedTreeMap.get("uuid").toString(); + resultList.add(uuid); + } + for (String uuid : resultList) { + Result deleteResult = client.data().deleter() + .withID(uuid) + .withClassName(className + kid) + .withConsistencyLevel(ConsistencyLevel.ALL) // default QUORUM + .run(); + } + } + + @Override + public void storeEmbeddings(List chunkList, List> vectorList, String kid, String docId, List fidList) { + WeaviateClient client = getClient(); + + for (int i = 0; i < Math.min(chunkList.size(), vectorList.size()); i++) { + List vector = vectorList.get(i); + Float[] vf = vector.stream().map(Double::floatValue).toArray(Float[]::new); + + Map dataSchema = new HashMap<>(); + dataSchema.put("content", chunkList.get(i)); + dataSchema.put("kid", kid); + dataSchema.put("docId", docId); + dataSchema.put("fid", fidList.get(i)); + String uuid = UUID.randomUUID().toString(); + dataSchema.put("uuid", uuid); + + Result result = client.data().creator() + .withClassName(className + kid) + .withID(uuid) + .withVector(vf) + .withProperties(dataSchema) + .run(); + } + + } + + @Override + public void removeByDocId(String kid, String docId) { + List resultList = new ArrayList<>(); + WeaviateClient client = getClient(); + Field fieldId = Field.builder().name("uuid").build(); + WhereFilter where = WhereFilter.builder() + .path(new String[]{"docId"}) + .operator(Operator.Equal) + .valueString(docId) + .build(); + Result result = client.graphQL().get() + .withClassName(className + kid) + .withFields(fieldId) + .withWhere(where) + .run(); + LinkedTreeMap t = (LinkedTreeMap) result.getResult().getData(); + LinkedTreeMap> l = (LinkedTreeMap>) t.get("Get"); + ArrayList m = l.get(className + kid); + for (LinkedTreeMap linkedTreeMap : m) { + String uuid = linkedTreeMap.get("uuid").toString(); + resultList.add(uuid); + } + for (String uuid : resultList) { + Result deleteResult = client.data().deleter() + .withID(uuid) + .withClassName(className + kid) + .withConsistencyLevel(ConsistencyLevel.ALL) // default QUORUM + .run(); + } + } + + @Override + public void removeByKid(String kid) { + WeaviateClient client = getClient(); + Result result = client.schema().classDeleter().withClassName(className + kid).run(); + if (result.hasErrors()) { + System.out.println("删除schema失败" + result.getError()); + } else { + System.out.println("删除schema成功" + result.getResult()); + } + log.info("drop schema by kid, result = {}", result); + } + + @Override + public List nearest(List queryVector, String kid) { + if (StringUtils.isBlank(kid)) { + return new ArrayList(); + } + List resultList = new ArrayList<>(); + Float[] vf = new Float[queryVector.size()]; + for (int j = 0; j < queryVector.size(); j++) { + Double value = queryVector.get(j); + vf[j] = value.floatValue(); + } + WeaviateClient client = getClient(); + Field contentField = Field.builder().name("content").build(); + Field _additional = Field.builder() + .name("_additional") + .fields(new Field[]{ + Field.builder().name("distance").build() + }).build(); + NearVectorArgument nearVector = NearVectorArgument.builder() + .vector(vf) + .distance(1.6f) // certainty = 1f - distance /2f + .build(); + KnowledgeInfoVo knowledgeInfoVo = knowledgeInfoService.queryById(Long.valueOf(kid)); + Result result = client.graphQL().get() + .withClassName(className + kid) + .withFields(contentField, _additional) + .withNearVector(nearVector) + .withLimit(knowledgeInfoVo.getRetrieveLimit()) + .run(); + LinkedTreeMap t = (LinkedTreeMap) result.getResult().getData(); + LinkedTreeMap> l = (LinkedTreeMap>) t.get("Get"); + ArrayList m = l.get(className + kid); + for (LinkedTreeMap linkedTreeMap : m) { + String content = linkedTreeMap.get("content").toString(); + resultList.add(content); + } + return resultList; + } + + @Override + public List nearest(String query, String kid) { + if (StringUtils.isBlank(kid)) { + return new ArrayList(); + } + List resultList = new ArrayList<>(); + WeaviateClient client = getClient(); + Field contentField = Field.builder().name("content").build(); + Field _additional = Field.builder() + .name("_additional") + .fields(new Field[]{ + Field.builder().name("distance").build() + }).build(); + NearTextArgument nearText = client.graphQL().arguments().nearTextArgBuilder() + .concepts(new String[]{query}) + .distance(1.6f) // certainty = 1f - distance /2f + .build(); + KnowledgeInfoVo knowledgeInfoVo = knowledgeInfoService.queryById(Long.valueOf(kid)); + Result result = client.graphQL().get() + .withClassName(className + kid) + .withFields(contentField, _additional) + .withNearText(nearText) + .withLimit(knowledgeInfoVo.getRetrieveLimit()) + .run(); + LinkedTreeMap t = (LinkedTreeMap) result.getResult().getData(); + LinkedTreeMap> l = (LinkedTreeMap>) t.get("Get"); + ArrayList m = l.get(className + kid); + for (LinkedTreeMap linkedTreeMap : m) { + String content = linkedTreeMap.get("content").toString(); + resultList.add(content); + } + return resultList; + } + + public Result deleteSchema(String kid) { + WeaviateClient client = getClient(); + Result result = client.schema().classDeleter().withClassName(className + kid).run(); + if (result.hasErrors()) { + System.out.println(result.getError()); + } else { + System.out.println(result.getResult()); + } + return result; + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/constant/FileType.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/constant/FileType.java new file mode 100644 index 0000000..9a7dcbd --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/constant/FileType.java @@ -0,0 +1,91 @@ +package org.aibidding.knowledge.constant; + +public class FileType { + public static final String TXT = "txt"; + public static final String CSV = "csv"; + public static final String MD = "md"; + public static final String DOC = "doc"; + public static final String DOCX = "docx"; + public static final String PDF = "pdf"; + + public static final String LOG = "log"; + public static final String XML = "xml"; + + public static final String JAVA = "java"; + public static final String HTML = "html"; + public static final String HTM = "htm"; + public static final String CSS = "css"; + public static final String JS = "js"; + public static final String PY = "py"; + public static final String CPP = "cpp"; + public static final String SQL = "sql"; + public static final String PHP = "php"; + public static final String RUBY = "ruby"; + public static final String C = "c"; + public static final String H = "h"; + public static final String HPP = "hpp"; + public static final String SWIFT = "swift"; + public static final String TS = "ts"; + public static final String RUST = "rs"; + public static final String PERL = "perl"; + public static final String SHELL = "shell"; + public static final String BAT = "bat"; + public static final String CMD = "cmd"; + + public static final String PROPERTIES = "properties"; + public static final String INI = "ini"; + public static final String YAML = "yaml"; + public static final String YML = "yml"; + + public static boolean isTextFile(String type){ + if (type.equalsIgnoreCase(TXT) || type.equalsIgnoreCase(CSV) || type.equalsIgnoreCase(PROPERTIES) + || type.equalsIgnoreCase(INI) || type.equalsIgnoreCase(YAML) || type.equalsIgnoreCase(YML) + || type.equalsIgnoreCase(LOG) || type.equalsIgnoreCase(XML)){ + return true; + } + else { + return false; + } + } + + public static boolean isCodeFile(String type){ + if (type.equalsIgnoreCase(JAVA) || type.equalsIgnoreCase(HTML) || type.equalsIgnoreCase(HTM) || type.equalsIgnoreCase(JS) || type.equalsIgnoreCase(PY) + || type.equalsIgnoreCase(CPP) || type.equalsIgnoreCase(SQL) || type.equalsIgnoreCase(PHP) || type.equalsIgnoreCase(RUBY) + || type.equalsIgnoreCase(C) || type.equalsIgnoreCase(H) || type.equalsIgnoreCase(HPP) || type.equalsIgnoreCase(SWIFT) + || type.equalsIgnoreCase(TS) || type.equalsIgnoreCase(RUST) || type.equalsIgnoreCase(PERL) || type.equalsIgnoreCase(SHELL) + || type.equalsIgnoreCase(BAT) || type.equalsIgnoreCase(CMD) || type.equalsIgnoreCase(CSS)){ + return true; + } + else { + return false; + } + } + + public static boolean isMdFile(String type){ + if (type.equalsIgnoreCase(MD)){ + return true; + } + else { + return false; + } + } + + public static boolean isWord(String type){ + if (type.equalsIgnoreCase(DOC) || type.equalsIgnoreCase(DOCX)){ + return true; + } + else { + return false; + } + } + + public static boolean isPdf(String type){ + if (type.equalsIgnoreCase(PDF)){ + return true; + } + else { + return false; + } + } + +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/KnowledgeAttach.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/KnowledgeAttach.java new file mode 100644 index 0000000..61d091f --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/KnowledgeAttach.java @@ -0,0 +1,60 @@ +package org.aibidding.knowledge.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 知识库附件对象 knowledge_attach + * + * @author Lion Li + * @date 2024-10-21 + */ +@Data + +@TableName("knowledge_attach") +public class KnowledgeAttach implements Serializable { + + + @TableId(value = "id") + private Long id; + + /** + * 知识库ID + */ + private String kid; + + /** + * 文档ID + */ + private String docId; + + /** + * 文档名称 + */ + private String docName; + + /** + * 文档类型 + */ + private String docType; + + /** + * 文档内容 + */ + private String content; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + private Date createTime; + +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/KnowledgeFragment.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/KnowledgeFragment.java new file mode 100644 index 0000000..fd4ec02 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/KnowledgeFragment.java @@ -0,0 +1,62 @@ +package org.aibidding.knowledge.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +/** + * 知识片段对象 knowledge_fragment + * + * @author Lion Li + * @date 2024-10-21 + */ +@Data +@TableName("knowledge_fragment") +public class KnowledgeFragment implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + @TableId(value = "id") + private Long id; + + /** + * 知识库ID + */ + private String kid; + + /** + * 文档ID + */ + private String docId; + + /** + * 知识片段ID + */ + private String fid; + + /** + * 片段索引下标 + */ + private Integer idx; + + /** + * 文档内容 + */ + private String content; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + private Date createTime; + +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/KnowledgeInfo.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/KnowledgeInfo.java new file mode 100644 index 0000000..230b6d8 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/KnowledgeInfo.java @@ -0,0 +1,101 @@ +package org.aibidding.knowledge.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + +/** + * 知识库对象 knowledge_info + * + * @author Lion Li + * @date 2024-10-21 + */ +@Data +@TableName("knowledge_info") +public class KnowledgeInfo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(value = "id") + private Long id; + + /** + * 知识库ID + */ + private String kid; + + /** + * 用户ID + */ + private Long uid; + + /** + * 知识库名称 + */ + private String kname; + + /** + * 是否公开知识库(0 否 1是) + */ + private String share; + + /** + * 描述 + */ + private String description; + + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 知识分隔符 + */ + private String knowledgeSeparator; + + /** + * 提问分隔符 + */ + private String questionSeparator; + + /** + * 重叠字符数 + */ + private Integer overlapChar; + + /** + * 知识库中检索的条数 + */ + private Integer retrieveLimit; + + /** + * 文本块大小 + */ + private Integer textBlockSize; + + /** + * 向量库 + */ + private String vector; + + /** + * 向量模型 + */ + private String vectorModel; +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/bo/KnowledgeAttachBo.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/bo/KnowledgeAttachBo.java new file mode 100644 index 0000000..53e9185 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/bo/KnowledgeAttachBo.java @@ -0,0 +1,56 @@ +package org.aibidding.knowledge.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.knowledge.domain.KnowledgeAttach; + +/** + * 知识库附件业务对象 knowledge_attach + * + * @author Lion Li + * @date 2024-10-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = KnowledgeAttach.class, reverseConvertGenerate = false) +public class KnowledgeAttachBo extends BaseEntity { + + @NotNull(message = "不能为空") + private Long id; + + /** + * 知识库ID + */ + @NotBlank(message = "知识库ID不能为空") + private String kid; + + /** + * 文档ID + */ + @NotBlank(message = "文档ID不能为空") + private String docId; + + /** + * 文档名称 + */ + @NotBlank(message = "文档名称不能为空") + private String docName; + + /** + * 文档类型 + */ + @NotBlank(message = "文档类型不能为空") + private String docType; + + /** + * 文档内容 + */ + @NotBlank(message = "文档内容不能为空") + private String content; + + +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/bo/KnowledgeFragmentBo.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/bo/KnowledgeFragmentBo.java new file mode 100644 index 0000000..efa4cf6 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/bo/KnowledgeFragmentBo.java @@ -0,0 +1,59 @@ +package org.aibidding.knowledge.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.knowledge.domain.KnowledgeFragment; + +/** + * 知识片段业务对象 knowledge_fragment + * + * @author Lion Li + * @date 2024-10-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = KnowledgeFragment.class, reverseConvertGenerate = false) +public class KnowledgeFragmentBo extends BaseEntity { + + /** + * + */ + @NotNull(message = "不能为空") + private Long id; + + /** + * 知识库ID + */ + @NotBlank(message = "知识库ID不能为空") + private String kid; + + /** + * 文档ID + */ + @NotBlank(message = "文档ID不能为空") + private String docId; + + /** + * 知识片段ID + */ + @NotBlank(message = "知识片段ID不能为空") + private String fid; + + /** + * 片段索引下标 + */ + @NotNull(message = "片段索引下标不能为空") + private Long idx; + + /** + * 文档内容 + */ + @NotBlank(message = "文档内容不能为空") + private String content; + + +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/bo/KnowledgeInfoBo.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/bo/KnowledgeInfoBo.java new file mode 100644 index 0000000..99b57fa --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/bo/KnowledgeInfoBo.java @@ -0,0 +1,99 @@ +package org.aibidding.knowledge.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.knowledge.domain.KnowledgeInfo; + +/** + * 知识库业务对象 knowledge_info + * + * @author Lion Li + * @date 2024-10-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = KnowledgeInfo.class, reverseConvertGenerate = false) +public class KnowledgeInfoBo extends BaseEntity { + + /** + * + */ + @NotNull(message = "不能为空") + private Long id; + + /** + * 知识库ID + */ + @NotBlank(message = "知识库ID不能为空") + private String kid; + + /** + * 用户ID + */ + @NotNull(message = "用户ID不能为空") + private Long uid; + + /** + * 知识库名称 + */ + @NotBlank(message = "知识库名称不能为空") + private String kname; + + /** + * 知识库名称 + */ + @NotBlank(message = "是否公开知识库") + private String share; + + /** + * 描述 + */ + @NotBlank(message = "描述不能为空") + private String description; + + /** + * 知识分隔符 + */ + @NotBlank(message = "知识分隔符不能为空") + private String knowledgeSeparator; + + /** + * 提问分隔符 + */ + @NotBlank(message = "提问分隔符不能为空") + private String questionSeparator; + + /** + * 重叠字符数 + */ + @NotNull(message = "重叠字符数不能为空") + private Integer overlapChar; + + /** + * 知识库中检索的条数 + */ + @NotNull(message = "知识库中检索的条数不能为空") + private Integer retrieveLimit; + + /** + * 文本块大小 + */ + @NotNull(message = "文本块大小不能为空") + private Integer textBlockSize; + + /** + * 向量库 + */ + @NotBlank(message = "向量库不能为空") + private String vector; + + /** + * 向量模型 + */ + @NotBlank(message = "向量模型不能为空") + private String vectorModel; +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/req/KnowledgeInfoUploadRequest.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/req/KnowledgeInfoUploadRequest.java new file mode 100644 index 0000000..2db53f9 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/req/KnowledgeInfoUploadRequest.java @@ -0,0 +1,13 @@ +package org.aibidding.knowledge.domain.req; + +import lombok.Data; +import org.springframework.web.multipart.MultipartFile; + +@Data +public class KnowledgeInfoUploadRequest { + + private String kid; + + private MultipartFile file; + +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/request.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/request.java new file mode 100644 index 0000000..6e03f4a --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/request.java @@ -0,0 +1,4 @@ +package org.aibidding.knowledge.domain; + +public class request { +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/vo/KnowledgeAttachVo.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/vo/KnowledgeAttachVo.java new file mode 100644 index 0000000..6f21b36 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/vo/KnowledgeAttachVo.java @@ -0,0 +1,63 @@ +package org.aibidding.knowledge.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.knowledge.domain.KnowledgeAttach; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 知识库附件视图对象 knowledge_attach + * + * @author Lion Li + * @date 2024-10-21 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = KnowledgeAttach.class) +public class KnowledgeAttachVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + private Long id; + + /** + * 知识库ID + */ + @ExcelProperty(value = "知识库ID") + private String kid; + + /** + * 文档ID + */ + @ExcelProperty(value = "文档ID") + private String docId; + + /** + * 文档名称 + */ + @ExcelProperty(value = "文档名称") + private String docName; + + /** + * 文档类型 + */ + @ExcelProperty(value = "文档类型") + private String docType; + + /** + * 文档内容 + */ + @ExcelProperty(value = "文档内容") + private String content; + + +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/vo/KnowledgeFragmentVo.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/vo/KnowledgeFragmentVo.java new file mode 100644 index 0000000..b2ad6e1 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/vo/KnowledgeFragmentVo.java @@ -0,0 +1,62 @@ +package org.aibidding.knowledge.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.knowledge.domain.KnowledgeFragment; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 知识片段视图对象 knowledge_fragment + * + * @author Lion Li + * @date 2024-10-21 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = KnowledgeFragment.class) +public class KnowledgeFragmentVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + private Long id; + + /** + * 知识库ID + */ + @ExcelProperty(value = "知识库ID") + private String kid; + + /** + * 文档ID + */ + @ExcelProperty(value = "文档ID") + private String docId; + + /** + * 知识片段ID + */ + @ExcelProperty(value = "知识片段ID") + private String fid; + + /** + * 片段索引下标 + */ + @ExcelProperty(value = "片段索引下标") + private Long idx; + + /** + * 文档内容 + */ + @ExcelProperty(value = "文档内容") + private String content; + +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/vo/KnowledgeInfoVo.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/vo/KnowledgeInfoVo.java new file mode 100644 index 0000000..dec30d6 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/domain/vo/KnowledgeInfoVo.java @@ -0,0 +1,102 @@ +package org.aibidding.knowledge.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.knowledge.domain.KnowledgeInfo; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 知识库视图对象 knowledge_info + * + * @author Lion Li + * @date 2024-10-21 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = KnowledgeInfo.class) +public class KnowledgeInfoVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + private Long id; + + /** + * 知识库ID + */ + @ExcelProperty(value = "知识库ID") + private String kid; + + /** + * 用户ID + */ + @ExcelProperty(value = "用户ID") + private Long uid; + + /** + * 知识库名称 + */ + @ExcelProperty(value = "知识库名称") + private String kname; + + /** + * 知识库名称 + */ + private String share; + + /** + * 描述 + */ + @ExcelProperty(value = "描述") + private String description; + + /** + * 知识分隔符 + */ + @ExcelProperty(value = "知识分隔符") + private String knowledgeSeparator; + + /** + * 提问分隔符 + */ + @ExcelProperty(value = "提问分隔符") + private String questionSeparator; + + /** + * 重叠字符数 + */ + @ExcelProperty(value = "重叠字符数") + private Integer overlapChar; + + /** + * 知识库中检索的条数 + */ + @ExcelProperty(value = "知识库中检索的条数") + private Integer retrieveLimit; + + /** + * 文本块大小 + */ + @ExcelProperty(value = "文本块大小") + private Integer textBlockSize; + + /** + * 向量库 + */ + @ExcelProperty(value = "向量库") + private String vector; + + /** + * 向量模型 + */ + @ExcelProperty(value = "向量模型") + private String vectorModel; +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/mapper/KnowledgeAttachMapper.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/mapper/KnowledgeAttachMapper.java new file mode 100644 index 0000000..a5bf9f9 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/mapper/KnowledgeAttachMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.knowledge.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.knowledge.domain.KnowledgeAttach; +import org.aibidding.knowledge.domain.vo.KnowledgeAttachVo; + +/** + * 知识库附件Mapper接口 + * + * @author Lion Li + * @date 2024-10-21 + */ +public interface KnowledgeAttachMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/mapper/KnowledgeFragmentMapper.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/mapper/KnowledgeFragmentMapper.java new file mode 100644 index 0000000..9f86caf --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/mapper/KnowledgeFragmentMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.knowledge.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.knowledge.domain.KnowledgeFragment; +import org.aibidding.knowledge.domain.vo.KnowledgeFragmentVo; + +/** + * 知识片段Mapper接口 + * + * @author Lion Li + * @date 2024-10-21 + */ +public interface KnowledgeFragmentMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/mapper/KnowledgeInfoMapper.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/mapper/KnowledgeInfoMapper.java new file mode 100644 index 0000000..72ac7e4 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/mapper/KnowledgeInfoMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.knowledge.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.knowledge.domain.KnowledgeInfo; +import org.aibidding.knowledge.domain.vo.KnowledgeInfoVo; + +/** + * 知识库Mapper接口 + * + * @author Lion Li + * @date 2024-10-21 + */ +public interface KnowledgeInfoMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/EmbeddingService.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/EmbeddingService.java new file mode 100644 index 0000000..1b59e27 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/EmbeddingService.java @@ -0,0 +1,20 @@ +package org.aibidding.knowledge.service; + +import java.util.List; + +public interface EmbeddingService { + + void storeEmbeddings(List chunkList, String kid, String docId,List fidList); + + void removeByDocId(String kid,String docId); + + void removeByKid(String kid); + + List getQueryVector(String query, String kid); + + void createSchema(String kid); + + void removeByKidAndFid(String kid, String fid); + + void saveFragment(String kid, String docId, String fid, String content); +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/IKnowledgeAttachService.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/IKnowledgeAttachService.java new file mode 100644 index 0000000..fd3abed --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/IKnowledgeAttachService.java @@ -0,0 +1,54 @@ +package org.aibidding.knowledge.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.knowledge.domain.bo.KnowledgeAttachBo; +import org.aibidding.knowledge.domain.vo.KnowledgeAttachVo; + +import java.util.Collection; +import java.util.List; + +/** + * 知识库附件Service接口 + * + * @author Lion Li + * @date 2024-10-21 + */ +public interface IKnowledgeAttachService { + + /** + * 查询知识库附件 + */ + KnowledgeAttachVo queryById(Long id); + + /** + * 查询知识库附件列表 + */ + TableDataInfo queryPageList(KnowledgeAttachBo bo, PageQuery pageQuery); + + /** + * 查询知识库附件列表 + */ + List queryList(KnowledgeAttachBo bo); + + /** + * 新增知识库附件 + */ + Boolean insertByBo(KnowledgeAttachBo bo); + + /** + * 修改知识库附件 + */ + Boolean updateByBo(KnowledgeAttachBo bo); + + /** + * 校验并批量删除知识库附件信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + + /** + * 删除知识附件 + */ + void removeKnowledgeAttach(String docId); +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/IKnowledgeFragmentService.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/IKnowledgeFragmentService.java new file mode 100644 index 0000000..856cf01 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/IKnowledgeFragmentService.java @@ -0,0 +1,48 @@ +package org.aibidding.knowledge.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.knowledge.domain.bo.KnowledgeFragmentBo; +import org.aibidding.knowledge.domain.vo.KnowledgeFragmentVo; + +import java.util.Collection; +import java.util.List; + +/** + * 知识片段Service接口 + * + * @author Lion Li + * @date 2024-10-21 + */ +public interface IKnowledgeFragmentService { + + /** + * 查询知识片段 + */ + KnowledgeFragmentVo queryById(Long id); + + /** + * 查询知识片段列表 + */ + TableDataInfo queryPageList(KnowledgeFragmentBo bo, PageQuery pageQuery); + + /** + * 查询知识片段列表 + */ + List queryList(KnowledgeFragmentBo bo); + + /** + * 新增知识片段 + */ + Boolean insertByBo(KnowledgeFragmentBo bo); + + /** + * 修改知识片段 + */ + Boolean updateByBo(KnowledgeFragmentBo bo); + + /** + * 校验并批量删除知识片段信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/IKnowledgeInfoService.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/IKnowledgeInfoService.java new file mode 100644 index 0000000..0dcde08 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/IKnowledgeInfoService.java @@ -0,0 +1,60 @@ +package org.aibidding.knowledge.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.knowledge.domain.bo.KnowledgeInfoBo; +import org.aibidding.knowledge.domain.req.KnowledgeInfoUploadRequest; +import org.aibidding.knowledge.domain.vo.KnowledgeInfoVo; + +import java.util.List; + +/** + * 知识库Service接口 + * + * @author Lion Li + * @date 2024-10-21 + */ +public interface IKnowledgeInfoService { + + /** + * 查询知识库 + */ + KnowledgeInfoVo queryById(Long id); + + /** + * 查询知识库列表 + */ + TableDataInfo queryPageList(KnowledgeInfoBo bo, PageQuery pageQuery); + + /** + * 查询知识库列表 + */ + List queryList(KnowledgeInfoBo bo); + + + /** + * 修改知识库 + */ + Boolean updateByBo(KnowledgeInfoBo bo); + + /** + * 新增知识库 + */ + void saveOne(KnowledgeInfoBo bo); + + /** + * 上传附件 + */ + void upload(KnowledgeInfoUploadRequest request); + + /** + * 删除知识库 + */ + void removeKnowledge(String id); + + /** + * 检查是否有删除权限 + * @param knowledgeInfoList 知识列表 + */ + void check(List knowledgeInfoList); +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/impl/EmbeddingServiceImpl.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/impl/EmbeddingServiceImpl.java new file mode 100644 index 0000000..8a7d63c --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/impl/EmbeddingServiceImpl.java @@ -0,0 +1,64 @@ +package org.aibidding.knowledge.service.impl; + +import lombok.AllArgsConstructor; +import org.aibidding.knowledge.chain.vectorizer.Vectorization; +import org.aibidding.knowledge.chain.vectorstore.VectorStore; +import org.aibidding.knowledge.service.EmbeddingService; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service +@AllArgsConstructor +public class EmbeddingServiceImpl implements EmbeddingService { + + private final VectorStore vectorStore; + private final Vectorization vectorization; + + /** + * 保存向量数据库 + * @param chunkList 文档按行切分的片段 + * @param kid 知识库ID + * @param docId 文档ID + */ + @Override + public void storeEmbeddings(List chunkList, String kid, String docId,List fidList) { + List> vectorList = vectorization.batchVectorization(chunkList, kid); + vectorStore.storeEmbeddings(chunkList,vectorList,kid,docId,fidList); + } + + @Override + public void removeByDocId(String kid,String docId) { + vectorStore.removeByDocId(kid,docId); + } + + @Override + public void removeByKid(String kid) { + vectorStore.removeByKid(kid); + } + + @Override + public List getQueryVector(String query, String kid) { + return vectorization.singleVectorization(query,kid); + } + + @Override + public void createSchema(String kid) { + vectorStore.newSchema(kid); + } + + @Override + public void removeByKidAndFid(String kid, String fid) { + vectorStore.removeByKidAndFid(kid,fid); + } + + @Override + public void saveFragment(String kid, String docId, String fid, String content) { + List chunkList = new ArrayList<>(); + List fidList = new ArrayList<>(); + chunkList.add(content); + fidList.add(fid); + storeEmbeddings(chunkList,kid,docId,fidList); + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/impl/KnowledgeAttachServiceImpl.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/impl/KnowledgeAttachServiceImpl.java new file mode 100644 index 0000000..1745da2 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/impl/KnowledgeAttachServiceImpl.java @@ -0,0 +1,132 @@ +package org.aibidding.knowledge.service.impl; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.knowledge.domain.KnowledgeAttach; +import org.aibidding.knowledge.domain.bo.KnowledgeAttachBo; +import org.aibidding.knowledge.domain.vo.KnowledgeAttachVo; +import org.aibidding.knowledge.mapper.KnowledgeAttachMapper; +import org.aibidding.knowledge.mapper.KnowledgeFragmentMapper; +import org.aibidding.knowledge.mapper.KnowledgeInfoMapper; +import org.aibidding.knowledge.service.IKnowledgeAttachService; +import org.aibidding.knowledge.service.IKnowledgeInfoService; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 知识库附件Service业务层处理 + * + * @author Lion Li + * @date 2024-10-21 + */ +@RequiredArgsConstructor +@Service +public class KnowledgeAttachServiceImpl implements IKnowledgeAttachService { + + private final KnowledgeAttachMapper baseMapper; + + private final KnowledgeFragmentMapper fragmentMapper; + + private final KnowledgeInfoMapper knowledgeInfoMapper; + + private final IKnowledgeInfoService knowledgeInfoService; + + + /** + * 查询知识库附件 + */ + @Override + public KnowledgeAttachVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询知识库附件列表 + */ + @Override + public TableDataInfo queryPageList(KnowledgeAttachBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询知识库附件列表 + */ + @Override + public List queryList(KnowledgeAttachBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(KnowledgeAttachBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getKid()), KnowledgeAttach::getKid, bo.getKid()); + lqw.eq(StringUtils.isNotBlank(bo.getDocId()), KnowledgeAttach::getDocId, bo.getDocId()); + lqw.like(StringUtils.isNotBlank(bo.getDocName()), KnowledgeAttach::getDocName, bo.getDocName()); + lqw.eq(StringUtils.isNotBlank(bo.getDocType()), KnowledgeAttach::getDocType, bo.getDocType()); + lqw.eq(StringUtils.isNotBlank(bo.getContent()), KnowledgeAttach::getContent, bo.getContent()); + return lqw; + } + + /** + * 新增知识库附件 + */ + @Override + public Boolean insertByBo(KnowledgeAttachBo bo) { + KnowledgeAttach add = MapstructUtils.convert(bo, KnowledgeAttach.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改知识库附件 + */ + @Override + public Boolean updateByBo(KnowledgeAttachBo bo) { + KnowledgeAttach update = MapstructUtils.convert(bo, KnowledgeAttach.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(KnowledgeAttach entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除知识库附件 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } + + @Override + public void removeKnowledgeAttach(String docId) { + Map map = new HashMap<>(); + map.put("doc_id",docId); + baseMapper.deleteByMap(map); + fragmentMapper.deleteByMap(map); + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/impl/KnowledgeFragmentServiceImpl.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/impl/KnowledgeFragmentServiceImpl.java new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/impl/KnowledgeFragmentServiceImpl.java @@ -0,0 +1,113 @@ +package org.aibidding.knowledge.service.impl; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.knowledge.domain.KnowledgeFragment; +import org.aibidding.knowledge.domain.bo.KnowledgeFragmentBo; +import org.aibidding.knowledge.domain.vo.KnowledgeFragmentVo; +import org.aibidding.knowledge.mapper.KnowledgeFragmentMapper; +import org.aibidding.knowledge.service.IKnowledgeFragmentService; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +/** + * 知识片段Service业务层处理 + * + * @author Lion Li + * @date 2024-10-21 + */ +@RequiredArgsConstructor +@Service +public class KnowledgeFragmentServiceImpl implements IKnowledgeFragmentService { + + private final KnowledgeFragmentMapper baseMapper; + + /** + * 查询知识片段 + */ + @Override + public KnowledgeFragmentVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询知识片段列表 + */ + @Override + public TableDataInfo queryPageList(KnowledgeFragmentBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + lqw.eq(KnowledgeFragment::getDocId, bo.getDocId()); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询知识片段列表 + */ + @Override + public List queryList(KnowledgeFragmentBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(KnowledgeFragmentBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getKid()), KnowledgeFragment::getKid, bo.getKid()); + lqw.eq(StringUtils.isNotBlank(bo.getDocId()), KnowledgeFragment::getDocId, bo.getDocId()); + lqw.eq(StringUtils.isNotBlank(bo.getFid()), KnowledgeFragment::getFid, bo.getFid()); + lqw.eq(bo.getIdx() != null, KnowledgeFragment::getIdx, bo.getIdx()); + lqw.eq(StringUtils.isNotBlank(bo.getContent()), KnowledgeFragment::getContent, bo.getContent()); + return lqw; + } + + /** + * 新增知识片段 + */ + @Override + public Boolean insertByBo(KnowledgeFragmentBo bo) { + KnowledgeFragment add = MapstructUtils.convert(bo, KnowledgeFragment.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改知识片段 + */ + @Override + public Boolean updateByBo(KnowledgeFragmentBo bo) { + KnowledgeFragment update = MapstructUtils.convert(bo, KnowledgeFragment.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(KnowledgeFragment entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除知识片段 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/impl/KnowledgeInfoServiceImpl.java b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/impl/KnowledgeInfoServiceImpl.java new file mode 100644 index 0000000..8fb481e --- /dev/null +++ b/aibidding-modules/aibidding-knowledge/src/main/java/org/aibidding/knowledge/service/impl/KnowledgeInfoServiceImpl.java @@ -0,0 +1,200 @@ +package org.aibidding.knowledge.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.RandomUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.knowledge.chain.loader.ResourceLoader; +import org.aibidding.knowledge.chain.loader.ResourceLoaderFactory; +import org.aibidding.knowledge.domain.KnowledgeAttach; +import org.aibidding.knowledge.domain.KnowledgeFragment; +import org.aibidding.knowledge.domain.KnowledgeInfo; +import org.aibidding.knowledge.domain.bo.KnowledgeInfoBo; +import org.aibidding.knowledge.domain.req.KnowledgeInfoUploadRequest; +import org.aibidding.knowledge.domain.vo.KnowledgeInfoVo; +import org.aibidding.knowledge.mapper.KnowledgeAttachMapper; +import org.aibidding.knowledge.mapper.KnowledgeFragmentMapper; +import org.aibidding.knowledge.mapper.KnowledgeInfoMapper; +import org.aibidding.knowledge.service.EmbeddingService; +import org.aibidding.knowledge.service.IKnowledgeInfoService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.*; + +/** + * 知识库Service业务层处理 + * + * @author Lion Li + * @date 2024-10-21 + */ +@Service +@RequiredArgsConstructor +public class KnowledgeInfoServiceImpl implements IKnowledgeInfoService { + + private final KnowledgeInfoMapper baseMapper; + + private final EmbeddingService embeddingService; + + private final ResourceLoaderFactory resourceLoaderFactory; + + private final KnowledgeFragmentMapper fragmentMapper; + + private final KnowledgeAttachMapper attachMapper; + + /** + * 查询知识库 + */ + @Override + public KnowledgeInfoVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询知识库列表 + */ + @Override + public TableDataInfo queryPageList(KnowledgeInfoBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询知识库列表 + */ + @Override + public List queryList(KnowledgeInfoBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(KnowledgeInfoBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getKid()), KnowledgeInfo::getKid, bo.getKid()); + lqw.eq(bo.getUid() != null, KnowledgeInfo::getUid, bo.getUid()); + lqw.like(StringUtils.isNotBlank(bo.getKname()), KnowledgeInfo::getKname, bo.getKname()); + lqw.eq(StringUtils.isNotBlank(bo.getDescription()), KnowledgeInfo::getDescription, bo.getDescription()); + // 查询公开的知识库 + lqw.or(wrapper -> wrapper.eq(KnowledgeInfo::getShare, "1")); + return lqw; + } + + /** + * 修改知识库 + */ + @Override + public Boolean updateByBo(KnowledgeInfoBo bo) { + KnowledgeInfo update = MapstructUtils.convert(bo, KnowledgeInfo.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(KnowledgeInfo entity){ + //TODO 做一些数据校验,如唯一约束 + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveOne(KnowledgeInfoBo bo) { + KnowledgeInfo knowledgeInfo = MapstructUtils.convert(bo, KnowledgeInfo.class); + if (StringUtils.isBlank(bo.getKid())){ + String kid = RandomUtil.randomString(10); + if (knowledgeInfo != null) { + knowledgeInfo.setKid(kid); + knowledgeInfo.setUid(LoginHelper.getLoginUser().getUserId()); + } + baseMapper.insert(knowledgeInfo); + embeddingService.createSchema(String.valueOf(knowledgeInfo.getId())); + }else { + baseMapper.updateById(knowledgeInfo); + } + } + + @Override + public void upload(KnowledgeInfoUploadRequest request) { + storeContent(request.getFile(), request.getKid()); + } + + public void storeContent(MultipartFile file, String kid) { + String fileName = file.getOriginalFilename(); + List chunkList = new ArrayList<>(); + KnowledgeAttach knowledgeAttach = new KnowledgeAttach(); + knowledgeAttach.setKid(kid); + String docId = RandomUtil.randomString(10); + knowledgeAttach.setDocId(docId); + knowledgeAttach.setDocName(fileName); + knowledgeAttach.setDocType(fileName.substring(fileName.lastIndexOf(".")+1)); + String content = ""; + ResourceLoader resourceLoader = resourceLoaderFactory.getLoaderByFileType(knowledgeAttach.getDocType()); + List fids = new ArrayList<>(); + try { + content = resourceLoader.getContent(file.getInputStream()); + chunkList = resourceLoader.getChunkList(content, kid); + List knowledgeFragmentList = new ArrayList<>(); + if (CollUtil.isNotEmpty(chunkList)) { + for (int i = 0; i < chunkList.size(); i++) { + String fid = RandomUtil.randomString(16); + fids.add(fid); + KnowledgeFragment knowledgeFragment = new KnowledgeFragment(); + knowledgeFragment.setKid(kid); + knowledgeFragment.setDocId(docId); + knowledgeFragment.setFid(fid); + knowledgeFragment.setIdx(i); + // String text = convertTextBlockToPretrainData(chunkList.get(i)); + knowledgeFragment.setContent(chunkList.get(i)); + knowledgeFragment.setCreateTime(new Date()); + knowledgeFragmentList.add(knowledgeFragment); + } + } + fragmentMapper.insertBatch(knowledgeFragmentList); + } catch (IOException e) { + e.printStackTrace(); + } + knowledgeAttach.setContent(content); + knowledgeAttach.setCreateTime(new Date()); + attachMapper.insert(knowledgeAttach); + embeddingService.storeEmbeddings(chunkList,kid,docId,fids); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void removeKnowledge(String id) { + Map map = new HashMap<>(); + map.put("kid",id); + List knowledgeInfoList = baseMapper.selectVoByMap(map); + check(knowledgeInfoList); + // 删除向量库信息 + knowledgeInfoList.forEach(knowledgeInfoVo -> { + embeddingService.removeByKid(String.valueOf(knowledgeInfoVo.getId())); + }); + // 删除附件和知识片段 + fragmentMapper.deleteByMap(map); + attachMapper.deleteByMap(map); + // 删除知识库 + baseMapper.deleteByMap(map); + } + + @Override + public void check(List knowledgeInfoList){ + LoginUser loginUser = LoginHelper.getLoginUser(); + for (KnowledgeInfoVo knowledgeInfoVo : knowledgeInfoList) { + if(!knowledgeInfoVo.getUid().equals(loginUser.getUserId())){ + throw new SecurityException("权限不足"); + } + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/pom.xml b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/pom.xml new file mode 100644 index 0000000..76af345 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/pom.xml @@ -0,0 +1,49 @@ + + + + 4.0.0 + + + org.ruoyi + live-chat-client-commons + ${revision} + ../pom.xml + + + live-chat-client-commons-base + ordinaryroad-live-chat-client-commons-base + + + UTF-8 + + + + + com.fasterxml.jackson.core + jackson-databind + + + diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/constant/Constants.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/constant/Constants.java new file mode 100644 index 0000000..faf4a69 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/constant/Constants.java @@ -0,0 +1,32 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.constant; + +/** + * @author mjz + * @date 2023/8/26 + */ +public class Constants { +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/exception/BaseException.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/exception/BaseException.java new file mode 100644 index 0000000..71248e7 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/exception/BaseException.java @@ -0,0 +1,51 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.exception; + +/** + * @author mjz + * @date 2023/9/5 + */ +public class BaseException extends RuntimeException { + + public BaseException() { + } + + public BaseException(String message) { + super(message); + } + + public BaseException(String message, Throwable cause) { + super(message, cause); + } + + public BaseException(Throwable cause) { + super(cause); + } + + public BaseException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IBaseConnectionListener.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IBaseConnectionListener.java new file mode 100644 index 0000000..4398cf9 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IBaseConnectionListener.java @@ -0,0 +1,60 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.listener; + + +/** + * 连接回调 + * + * @author mjz + * @date 2023/8/26 + */ +public interface IBaseConnectionListener { + + /** + * 连接建立成功 + */ + default void onConnected(T t) { + // ignore + } + + /** + * 连接建立失败 + * + * @param t + */ + default void onConnectFailed(T t) { + // ignore + } + + /** + * 连接断开 + * + * @param t + */ + default void onDisconnected(T t) { + // ignore + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IBaseMsgListener.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IBaseMsgListener.java new file mode 100644 index 0000000..7230d9d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IBaseMsgListener.java @@ -0,0 +1,149 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.listener; + + +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseCmdMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; + +/** + * Base消息回调 + * + * @author mjz + * @date 2023/8/26 + */ +public interface IBaseMsgListener> { + + /** + * 收到消息(所有消息) + * + * @param msg IMsg + */ + default void onMsg(T t, IMsg msg) { + this.onMsg(msg); + } + + default void onMsg(IMsg msg) { + // ignore + } + + /** + * 收到cmd消息(所有cmd) + * + * @param cmd CmdEnum + * @param cmdMsg BaseCmdMsg + */ + default void onCmdMsg(T t, CmdEnum cmd, ICmdMsg cmdMsg) { + this.onCmdMsg(cmd, cmdMsg); + } + + default void onCmdMsg(CmdEnum cmd, ICmdMsg cmdMsg) { + // ignore + } + + /** + * 收到其他cmd消息(存在Enum,但Listener没有对应的回调) + * + * @param cmd CmdEnum + * @param cmdMsg BaseCmdMsg + */ + default void onOtherCmdMsg(T t, CmdEnum cmd, ICmdMsg cmdMsg) { + this.onOtherCmdMsg(cmd, cmdMsg); + } + + default void onOtherCmdMsg(CmdEnum cmd, ICmdMsg cmdMsg) { + // ignore + } + + /** + * 收到未知cmd消息 + * + * @param cmdString 实际收到的cmd字符串 + * @param msg BaseMsg + */ + default void onUnknownCmd(T t, String cmdString, IMsg msg) { + this.onUnknownCmd(cmdString, msg); + } + + default void onUnknownCmd(String cmdString, IMsg msg) { + // ignore + } + + /** + * 收到cmd消息(所有cmd) + * + * @param cmd CmdEnum + * @param cmdMsg BaseCmdMsg + * @deprecated use {@link #onCmdMsg(T, Enum, ICmdMsg)} + */ + default void onCmdMsg(T t, CmdEnum cmd, BaseCmdMsg cmdMsg) { + this.onCmdMsg(cmd, cmdMsg); + } + + /** + * @deprecated use {@link #onCmdMsg(Enum, ICmdMsg)} + */ + default void onCmdMsg(CmdEnum cmd, BaseCmdMsg cmdMsg) { + // ignore + } + + /** + * 收到其他cmd消息(存在Enum,但Listener没有对应的回调) + * + * @param cmd CmdEnum + * @param cmdMsg BaseCmdMsg + * @deprecated use {@link #onOtherCmdMsg(T, Enum, ICmdMsg)} + */ + default void onOtherCmdMsg(T t, CmdEnum cmd, BaseCmdMsg cmdMsg) { + this.onOtherCmdMsg(cmd, cmdMsg); + } + + /** + * @deprecated use {@link #onOtherCmdMsg(Enum, ICmdMsg)} + */ + default void onOtherCmdMsg(CmdEnum cmd, BaseCmdMsg cmdMsg) { + // ignore + } + + /** + * 收到未知cmd消息 + * + * @param cmdString 实际收到的cmd字符串 + * @param msg BaseMsg + * @deprecated use {@link #onUnknownCmd(T, String, IMsg)} + */ + default void onUnknownCmd(T t, String cmdString, BaseMsg msg) { + this.onUnknownCmd(cmdString, msg); + } + + /** + * @deprecated use {@link #onUnknownCmd(String, IMsg)} + */ + default void onUnknownCmd(String cmdString, BaseMsg msg) { + // ignore + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IDanmuMsgListener.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IDanmuMsgListener.java new file mode 100644 index 0000000..52b8dac --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IDanmuMsgListener.java @@ -0,0 +1,46 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.listener; + + +/** + * 弹幕消息回调 + * + * @author mjz + * @since 0.0.6 + */ +public interface IDanmuMsgListener { + + /** + * 收到弹幕 + */ + default void onDanmuMsg(T t, DanmuMsg msg) { + this.onDanmuMsg(msg); + } + + default void onDanmuMsg(DanmuMsg msg) { + // ignore + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IEnterRoomMsgListener.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IEnterRoomMsgListener.java new file mode 100644 index 0000000..931f35f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IEnterRoomMsgListener.java @@ -0,0 +1,47 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.listener; + + +/** + * 进入房间消息回调 + * + * @author mjz + * @date 2023/12/14 + * @since 0.0.16 + */ +public interface IEnterRoomMsgListener { + + /** + * 用户进入房间 + */ + default void onEnterRoomMsg(T t, EnterRoomMsg msg) { + this.onEnterRoomMsg(msg); + } + + default void onEnterRoomMsg(EnterRoomMsg msg) { + // ignore + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IGiftMsgListener.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IGiftMsgListener.java new file mode 100644 index 0000000..f486b96 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/IGiftMsgListener.java @@ -0,0 +1,47 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.listener; + + +/** + * 礼物消息回调 + * + * @author mjz + * @since 0.0.8 + */ +public interface IGiftMsgListener { + + + /** + * 收到礼物 + */ + default void onGiftMsg(T t, GiftMsg msg) { + this.onGiftMsg(msg); + } + + default void onGiftMsg(GiftMsg msg) { + // ignore + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/ILikeMsgListener.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/ILikeMsgListener.java new file mode 100644 index 0000000..42cc886 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/ILikeMsgListener.java @@ -0,0 +1,46 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.listener; + + +/** + * 点赞消息回调 + * + * @author mjz + * @since 0.2.0 + */ +public interface ILikeMsgListener { + + /** + * 收到点赞 + */ + default void onLikeMsg(T t, LikeMsg msg) { + this.onLikeMsg(msg); + } + + default void onLikeMsg(LikeMsg msg) { + // ignore + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/ISuperChatMsgListener.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/ISuperChatMsgListener.java new file mode 100644 index 0000000..1a70b60 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/listener/ISuperChatMsgListener.java @@ -0,0 +1,47 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.listener; + + +/** + * 醒目留言消息回调 + * + * @author mjz + * @date 2023/9/24 + * @since 0.0.11 + */ +public interface ISuperChatMsgListener { + + /** + * 收到醒目留言 + */ + default void onSuperChatMsg(T t, SuperChatMsg msg) { + this.onSuperChatMsg(msg); + } + + default void onSuperChatMsg(SuperChatMsg msg) { + // ignore + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/BaseCmdMsg.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/BaseCmdMsg.java new file mode 100644 index 0000000..734c4b6 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/BaseCmdMsg.java @@ -0,0 +1,33 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.msg; + +/** + * @author mjz + * @date 2023/8/26 + */ +public abstract class BaseCmdMsg> extends BaseMsg + implements ICmdMsg { +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/BaseMsg.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/BaseMsg.java new file mode 100644 index 0000000..2135fa4 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/BaseMsg.java @@ -0,0 +1,74 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.msg; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author mjz + * @date 2023/8/26 + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public abstract class BaseMsg implements IMsg { + + public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + + @Override + public String toString() { + try { + return OBJECT_MAPPER.writeValueAsString(this); + } catch (JsonProcessingException e) { + throw new BaseException(e); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/ICmdMsg.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/ICmdMsg.java new file mode 100644 index 0000000..7a0b2cf --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/ICmdMsg.java @@ -0,0 +1,38 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.msg; + +/** + * @author mjz + * @date 2023/10/2 + */ +public interface ICmdMsg> extends IMsg { + + String getCmd(); + + void setCmd(String cmd); + + CmdEnum getCmdEnum(); +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IDanmuMsg.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IDanmuMsg.java new file mode 100644 index 0000000..7a4745c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IDanmuMsg.java @@ -0,0 +1,67 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.msg; + +/** + * @author mjz + * @date 2023/9/8 + */ +public interface IDanmuMsg extends IMsg { + + /** + * 粉丝牌名称 + */ + String getBadgeName(); + + /** + * 粉丝牌等级 + */ + byte getBadgeLevel(); + + /** + * 弹幕发送者id + */ + String getUid(); + + /** + * 弹幕发送者用户名 + */ + String getUsername(); + + /** + * 弹幕发送者头像地址 + * + * @since 0.0.11 + */ + default String getUserAvatar() { + return null; + } + + /** + * 弹幕内容 + */ + String getContent(); + +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IEnterRoomMsg.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IEnterRoomMsg.java new file mode 100644 index 0000000..a914e63 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IEnterRoomMsg.java @@ -0,0 +1,62 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.msg; + +/** + * 入房消息 + * + * @author mjz + * @date 2023/12/26 + * @since 0.0.16 + */ +public interface IEnterRoomMsg extends IMsg { + + /** + * 粉丝牌名称 + */ + String getBadgeName(); + + /** + * 粉丝牌等级 + */ + byte getBadgeLevel(); + + /** + * 用户id + */ + String getUid(); + + /** + * 用户名 + */ + String getUsername(); + + /** + * 头像地址 + */ + default String getUserAvatar() { + return null; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IGiftMsg.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IGiftMsg.java new file mode 100644 index 0000000..9b8d35d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IGiftMsg.java @@ -0,0 +1,100 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.msg; + +/** + * @author mjz + * @date 2023/9/8 + */ +public interface IGiftMsg extends IMsg { + + /** + * 粉丝牌名称 + */ + default String getBadgeName() { + return ""; + } + + /** + * 粉丝牌等级 + */ + default byte getBadgeLevel() { + return 0; + } + + /** + * 发送方id + */ + String getUid(); + + /** + * 发送方用户名 + */ + String getUsername(); + + /** + * 发送方头像地址 + * + * @since 0.0.11 + */ + default String getUserAvatar() { + return null; + } + + /** + * 礼物名称 + */ + String getGiftName(); + + /** + * 礼物图像地址 + */ + String getGiftImg(); + + /** + * 礼物id + */ + String getGiftId(); + + /** + * 礼物数量 + */ + int getGiftCount(); + + /** + * 单个礼物价格 + */ + int getGiftPrice(); + + /** + * 接收方id + */ + String getReceiveUid(); + + /** + * 接收方用户名 + */ + String getReceiveUsername(); +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/ILikeMsg.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/ILikeMsg.java new file mode 100644 index 0000000..c10fe97 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/ILikeMsg.java @@ -0,0 +1,71 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.msg; + +/** + * @author mjz + * @date 2024/1/31 + * @since 0.2.0 + */ +public interface ILikeMsg extends IMsg { + + /** + * 粉丝牌名称 + */ + default String getBadgeName(){ + return ""; + } + + /** + * 粉丝牌等级 + */ + default byte getBadgeLevel(){ + return 0; + } + + /** + * 点赞者id + */ + String getUid(); + + /** + * 点赞者用户名 + */ + String getUsername(); + + /** + * 点赞者头像地址 + */ + default String getUserAvatar() { + return null; + } + + /** + * 点赞数 + */ + default int getClickCount() { + return 1; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IMsg.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IMsg.java new file mode 100644 index 0000000..c02a336 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/IMsg.java @@ -0,0 +1,34 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.msg; + +import java.io.Serializable; + +/** + * @author mjz + * @date 2023/8/26 + */ +public interface IMsg extends Serializable { +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/ISuperChatMsg.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/ISuperChatMsg.java new file mode 100644 index 0000000..58c9491 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-base/src/main/java/tech/ordinaryroad/live/chat/client/commons/base/msg/ISuperChatMsg.java @@ -0,0 +1,49 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.base.msg; + +/** + * 醒目留言 + * + * @author mjz + * @date 2023/9/22 + */ +public interface ISuperChatMsg extends IDanmuMsg { + + /** + * 醒目留言持续时间,单位秒 + */ + int getDuration(); + + @Override + default String getBadgeName() { + return ""; + } + + @Override + default byte getBadgeLevel() { + return 0; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/pom.xml b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/pom.xml new file mode 100644 index 0000000..f25c822 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/pom.xml @@ -0,0 +1,55 @@ + + + + 4.0.0 + + + org.ruoyi + live-chat-client-commons + ${revision} + ../pom.xml + + jar + + live-chat-client-commons-client + live-chat-client-commons-client + + + UTF-8 + + + + + org.ruoyi + live-chat-client-commons-base + + + + org.ruoyi + live-chat-client-commons-util + + + diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/BaseLiveChatClient.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/BaseLiveChatClient.java new file mode 100644 index 0000000..f442b9c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/BaseLiveChatClient.java @@ -0,0 +1,200 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.client; + +import lombok.Getter; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseMsgListener; +import tech.ordinaryroad.live.chat.client.commons.client.config.BaseLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.commons.client.enums.ClientStatusEnums; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.function.Consumer; + +/** + * @author mjz + * @date 2023/8/26 + */ +public abstract class BaseLiveChatClient< + Config extends BaseLiveChatClientConfig, + MsgListener extends IBaseMsgListener + > implements IBaseLiveChatClient { + + private final Config config; + @Getter + private volatile ClientStatusEnums status = ClientStatusEnums.NEW; + protected PropertyChangeSupport statusChangeSupport = new PropertyChangeSupport(status); + protected volatile boolean cancelReconnect = false; + protected final List msgListeners = Collections.synchronizedList(new ArrayList<>()); + + protected BaseLiveChatClient(Config config) { + this.config = config; + } + + public Config getConfig() { + return config; + } + + @Override + public void connect(Runnable success) { + this.connect(success, null); + } + + @Override + public void connect() { + this.connect(null, null); + } + + @Override + public void disconnect(boolean cancelReconnect) { + this.cancelReconnect = cancelReconnect; + this.disconnect(); + } + + @Override + public void send(Object msg) { + this.send(msg, null, null); + } + + @Override + public void send(Object msg, Runnable success) { + this.send(msg, success, null); + } + + @Override + public void send(Object msg, Consumer failed) { + this.send(msg, null, failed); + } + + @Override + public void sendDanmu(Object danmu) { + this.sendDanmu(danmu, null, null); + } + + @Override + public void sendDanmu(Object danmu, Runnable success) { + this.sendDanmu(danmu, success, null); + } + + @Override + public void sendDanmu(Object danmu, Consumer failed) { + this.sendDanmu(danmu, null, failed); + } + + @Override + public void clickLike(int count) { + this.clickLike(count, null, null); + } + + @Override + public void clickLike(int count, Runnable success) { + this.clickLike(count, success, null); + } + + @Override + public void clickLike(int count, Consumer failed) { + this.clickLike(count, null, failed); + } + + protected abstract void tryReconnect(); + + protected abstract String getWebSocketUriString(); + + /** + * 判断是否处于某个状态,或者处于后续状态 + * + * @param status {@link ClientStatusEnums} + * @return false: 还没有到达该状态 + */ + protected boolean checkStatus(ClientStatusEnums status) { + return this.status.getCode() >= Objects.requireNonNull(status).getCode(); + } + + protected void setStatus(ClientStatusEnums status) { + ClientStatusEnums oldStatus = this.status; + if (oldStatus != status) { + this.status = status; + this.statusChangeSupport.firePropertyChange("status", oldStatus, status); + } + } + + public void addStatusChangeListener(PropertyChangeListener listener) { + this.statusChangeSupport.addPropertyChangeListener(listener); + } + + public void removeStatusChangeListener(PropertyChangeListener listener) { + this.statusChangeSupport.removePropertyChangeListener(listener); + } + + @Override + public void destroy() { + for (PropertyChangeListener propertyChangeListener : this.statusChangeSupport.getPropertyChangeListeners()) { + this.statusChangeSupport.removePropertyChangeListener(propertyChangeListener); + } + this.msgListeners.clear(); + } + + @Override + public boolean addMsgListener(MsgListener msgListener) { + if (msgListener == null) { + return false; + } + return this.msgListeners.add(msgListener); + } + + @Override + public boolean addMsgListeners(List msgListeners) { + if (msgListeners == null || msgListeners.isEmpty()) { + return false; + } + return this.msgListeners.addAll(msgListeners); + } + + @Override + public boolean removeMsgListener(MsgListener msgListener) { + if (msgListener == null) { + return false; + } + return this.msgListeners.remove(msgListener); + } + + @Override + public boolean removeMsgListeners(List msgListeners) { + if (msgListeners == null || msgListeners.isEmpty()) { + return false; + } + return this.msgListeners.removeAll(msgListeners); + } + + @Override + public void removeAllMsgListeners() { + this.msgListeners.clear(); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/IBaseLiveChatClient.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/IBaseLiveChatClient.java new file mode 100644 index 0000000..951b4bc --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/IBaseLiveChatClient.java @@ -0,0 +1,135 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.client; + +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseMsgListener; + +import java.util.List; +import java.util.function.Consumer; + +/** + * @author mjz + * @date 2023/9/5 + */ +public interface IBaseLiveChatClient> { + + void init(); + + boolean addMsgListener(MsgListener msgListener); + + boolean addMsgListeners(List msgListeners); + + boolean removeMsgListener(MsgListener msgListener); + + boolean removeMsgListeners(List msgListeners); + + void removeAllMsgListeners(); + + void connect(Runnable success, Consumer failed); + + void connect(Runnable success); + + void connect(); + + /** + * 手动断开连接 + * + * @param cancelReconnect 取消本次的自动重连(如果启用自动重连) + */ + void disconnect(boolean cancelReconnect); + + void disconnect(); + + void destroy(); + + void send(Object msg); + + void send(Object msg, Runnable success, Consumer failed); + + void send(Object msg, Runnable success); + + void send(Object msg, Consumer failed); + + /** + * 发送弹幕 + * + * @param danmu 弹幕内容 + * @since 0.0.6 + */ + void sendDanmu(Object danmu); + + /** + * 发送弹幕 + * + * @param danmu 弹幕内容 + * @since 0.0.6 + */ + void sendDanmu(Object danmu, Runnable success, Consumer failed); + + /** + * 发送弹幕 + * + * @param danmu 弹幕内容 + * @since 0.0.6 + */ + void sendDanmu(Object danmu, Runnable success); + + /** + * 发送弹幕 + * + * @param danmu 弹幕内容 + * @since 0.0.6 + */ + void sendDanmu(Object danmu, Consumer failed); + + /** + * 为直播间点赞 + * + * @since 0.2.0 + */ + void clickLike(int count); + + /** + * 为直播间点赞 + * + * @since 0.2.0 + */ + void clickLike(int count, Runnable success, Consumer failed); + + /** + * 为直播间点赞 + * + * @since 0.2.0 + */ + void clickLike(int count, Runnable success); + + /** + * 为直播间点赞 + * + * @since 0.2.0 + */ + void clickLike(int count, Consumer failed); + +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/config/BaseLiveChatClientConfig.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/config/BaseLiveChatClientConfig.java new file mode 100644 index 0000000..1fee0f7 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/config/BaseLiveChatClientConfig.java @@ -0,0 +1,139 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.client.config; + + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; + +/** + * 直播间弹幕客户端配置 + * + * @author mjz + * @date 2023/8/26 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@SuperBuilder(toBuilder = true) +public abstract class BaseLiveChatClientConfig { + + protected PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this); + public static final long DEFAULT_HEARTBEAT_INITIAL_DELAY = 15; + public static final long DEFAULT_HEARTBEAT_PERIOD = 25; + public static final long DEFAULT_MIN_SEND_DANMU_PERIOD = 3000L; + + private String websocketUri; + + /** + * 浏览器中的Cookie + */ + private String cookie; + + /** + * 直播间id + */ + private Object roomId; + + /** + * 是否启用自动重连 + */ + @Builder.Default + private boolean autoReconnect = Boolean.TRUE; + + /** + * 重试延迟时间(秒),默认5s后重试 + */ + @Builder.Default + private int reconnectDelay = 5; + + /** + * 首次发送心跳包的延迟时间(秒) + */ + @Builder.Default + private long heartbeatInitialDelay = DEFAULT_HEARTBEAT_INITIAL_DELAY; + + /** + * 心跳包发送周期(秒) + */ + @Builder.Default + private long heartbeatPeriod = DEFAULT_HEARTBEAT_PERIOD; + + /** + * 最小发送弹幕时间间隔(毫秒) + */ + @Builder.Default + private long minSendDanmuPeriod = DEFAULT_MIN_SEND_DANMU_PERIOD; + + public void setCookie(String cookie) { + String oldValue = this.cookie; + this.cookie = cookie; + this.propertyChangeSupport.firePropertyChange("cookie", oldValue, cookie); + } + + public void setRoomId(Object roomId) { + if (!(roomId instanceof Number || roomId instanceof String)) { + throw new BaseException("房间ID仅支持数字或字符串,所传参数类型:" + roomId.getClass() + "值:" + roomId); + } + Object oldValue = this.roomId; + this.roomId = roomId; + this.propertyChangeSupport.firePropertyChange("roomId", oldValue, roomId); + } + + public void setWebsocketUri(String websocketUri) { + String oldValue = this.websocketUri; + this.websocketUri = websocketUri; + this.propertyChangeSupport.firePropertyChange("websocketUri", oldValue, websocketUri); + } + + public void setMinSendDanmuPeriod(long minSendDanmuPeriod) { + long oldValue = this.minSendDanmuPeriod; + this.minSendDanmuPeriod = minSendDanmuPeriod; + this.propertyChangeSupport.firePropertyChange("minSendDanmuPeriod", oldValue, minSendDanmuPeriod); + } + + public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { + this.propertyChangeSupport.addPropertyChangeListener(propertyName, listener); + } + + public void addPropertyChangeListener(PropertyChangeListener listener) { + this.propertyChangeSupport.addPropertyChangeListener(listener); + } + + public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { + this.propertyChangeSupport.removePropertyChangeListener(propertyName, listener); + } + + public void removePropertyChangeListener(PropertyChangeListener listener) { + this.propertyChangeSupport.removePropertyChangeListener(listener); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/enums/ClientStatusEnums.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/enums/ClientStatusEnums.java new file mode 100644 index 0000000..29d2c75 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-client/src/main/java/tech/ordinaryroad/live/chat/client/commons/client/enums/ClientStatusEnums.java @@ -0,0 +1,83 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.client.enums; + +/** + * @author mjz + * @date 2023/8/26 + */ +public enum ClientStatusEnums { + /** + * 新创建 + */ + NEW(0), + + /** + * 已初始化 + */ + INITIALIZED(1), + + /** + * 连接中 + */ + CONNECTING(100), + + /** + * 重新连接中 + */ + RECONNECTING(101), + + /** + * 已连接 + */ + CONNECTED(200), + + /** + * 连接失败 + */ + CONNECT_FAILED(401), + + /** + * 已断开连接 + */ + DISCONNECTED(400), + + /** + * 已销毁 + */ + DESTROYED(-1), + ; + + public int getCode() { + return code; + } + + ClientStatusEnums(int order) { + this.code = order; + } + + private final int code; + +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/pom.xml b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/pom.xml new file mode 100644 index 0000000..190ca51 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + + org.ruoyi + live-chat-client-commons + ${revision} + ../pom.xml + + jar + + live-chat-client-commons-util + live-chat-client-commons-util + + + UTF-8 + + + + + cn.hutool + hutool-all + + + diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLiveChatCookieUtil.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLiveChatCookieUtil.java new file mode 100644 index 0000000..9ec118f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLiveChatCookieUtil.java @@ -0,0 +1,80 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.util; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.map.MapUtil; +import cn.hutool.core.util.StrUtil; + +import java.net.HttpCookie; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +/** + * @author mjz + * @date 2023/8/27 + */ +public class OrLiveChatCookieUtil { + + public static String toString(List cookies) { + if (CollUtil.isEmpty(cookies)) { + return StrUtil.EMPTY; + } + + return cookies.stream().map(httpCookie -> { + httpCookie.setVersion(0); + return httpCookie.toString(); + }).collect(Collectors.joining("; ")); + } + + public static Map parseCookieString(String cookies) { + Map map = new HashMap<>(); + if (StrUtil.isNotBlank(cookies) && !StrUtil.isNullOrUndefined(cookies)) { + try { + String[] split = cookies.split("; "); + for (String s : split) { + String[] split1 = s.split("="); + map.put(split1[0], split1[1]); + } + } catch (Exception e) { + throw new RuntimeException("cookie解析失败 " + cookies, e); + } + } + return map; + } + + public static String getCookieByName(Map cookieMap, String name, Supplier supplier) { + String str = MapUtil.getStr(cookieMap, name); + return str == null ? supplier.get() : str; + } + + public static String getCookieByName(String cookie, String name, Supplier supplier) { + String str = MapUtil.getStr(parseCookieString(cookie), name); + return str == null ? supplier.get() : str; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLiveChatNumberUtil.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLiveChatNumberUtil.java new file mode 100644 index 0000000..969cf00 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLiveChatNumberUtil.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.util; + +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.StrUtil; + +/** + * @author mjz + * @date 2023/12/2 + */ +public class OrLiveChatNumberUtil extends NumberUtil { + + public static long parseLong(Object object){ + return NumberUtil.parseLong(StrUtil.toStringOrNull(object)); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLiveChatReflectUtil.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLiveChatReflectUtil.java new file mode 100644 index 0000000..a4d8a5d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLiveChatReflectUtil.java @@ -0,0 +1,50 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.util; + +import cn.hutool.core.util.ReflectUtil; + +import java.lang.reflect.Method; + +/** + * @author mjz + * @date 2023/8/28 + */ +public class OrLiveChatReflectUtil extends ReflectUtil { + + public static Method getGetterMethod(Class objectClass, String key) { + Method method; + if (key.startsWith("is")) { + method = ReflectUtil.getMethodByNameIgnoreCase(objectClass, key); + if (method == null) { + ReflectUtil.getMethodByNameIgnoreCase(objectClass, "get" + key); + } + } else { + method = ReflectUtil.getMethodByNameIgnoreCase(objectClass, "get" + key); + } + return method; + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLocalDateTimeUtil.java b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLocalDateTimeUtil.java new file mode 100644 index 0000000..b09cded --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/live-chat-client-commons-util/src/main/java/tech/ordinaryroad/live/chat/client/commons/util/OrLocalDateTimeUtil.java @@ -0,0 +1,54 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.commons.util; + +import cn.hutool.core.date.LocalDateTimeUtil; + +import java.time.ZoneId; +import java.time.ZonedDateTime; + +/** + * @author mjz + * @date 2023/9/7 + */ +public class OrLocalDateTimeUtil extends LocalDateTimeUtil { + + public static ZoneId ZONE_ID_CTT = ZoneId.of(ZoneId.SHORT_IDS.get("CTT")); + + /** + * 获取中国标准时间的当前时间戳(毫秒) + */ + public static long zonedCurrentTimeMillis() { + ZonedDateTime now = ZonedDateTime.now(ZONE_ID_CTT); + return now.toEpochSecond() * 1000 + now.getNano() / 1_000_000; + } + + /** + * 获取中国标准时间的当前时间戳(秒) + */ + public static long zonedCurrentTimeSecs() { + return ZonedDateTime.now(ZONE_ID_CTT).toEpochSecond(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-commons/pom.xml b/aibidding-modules/aibidding-live/live-chat-client-commons/pom.xml new file mode 100644 index 0000000..8a60828 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-commons/pom.xml @@ -0,0 +1,44 @@ + + + + 4.0.0 + + org.ruoyi + aibidding-live + ${revision} + ../pom.xml + + + pom + + live-chat-client-commons + + + live-chat-client-commons-base + live-chat-client-commons-util + live-chat-client-commons-client + + diff --git a/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/pom.xml b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/pom.xml new file mode 100644 index 0000000..9ea335d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/pom.xml @@ -0,0 +1,55 @@ + + + + 4.0.0 + + org.ruoyi + live-chat-client-servers + ${revision} + ../pom.xml + + + jar + + live-chat-client-servers-netty-client + live-chat-client-servers-netty + + + UTF-8 + + + + + org.ruoyi + live-chat-client-commons-client + + + + org.ruoyi + live-chat-client-servers-netty + + + diff --git a/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/client/base/BaseNettyClient.java b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/client/base/BaseNettyClient.java new file mode 100644 index 0000000..c342b5b --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/client/base/BaseNettyClient.java @@ -0,0 +1,349 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.servers.netty.client.base; + +import io.netty.bootstrap.Bootstrap; +import io.netty.channel.*; +import io.netty.channel.socket.SocketChannel; +import io.netty.channel.socket.nio.NioSocketChannel; +import io.netty.handler.codec.http.HttpClientCodec; +import io.netty.handler.codec.http.HttpObjectAggregator; +import io.netty.handler.ssl.SslContext; +import io.netty.handler.ssl.SslContextBuilder; +import io.netty.handler.stream.ChunkedWriteHandler; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseMsgListener; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; +import tech.ordinaryroad.live.chat.client.commons.client.BaseLiveChatClient; +import tech.ordinaryroad.live.chat.client.commons.client.enums.ClientStatusEnums; +import tech.ordinaryroad.live.chat.client.servers.netty.client.config.BaseNettyClientConfig; +import tech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseConnectionHandler; + +import javax.net.ssl.SSLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; + +/** + * @author mjz + * @date 2023/8/26 + */ +@Slf4j +public abstract class BaseNettyClient + , + Msg extends IMsg, + MsgListener extends IBaseMsgListener, + ConnectionHandler extends BaseConnectionHandler, + BinaryFrameHandler extends BaseBinaryFrameHandler + > + extends BaseLiveChatClient { + + @Getter + private final EventLoopGroup workerGroup; + @Getter + private final Bootstrap bootstrap = new Bootstrap(); + private BinaryFrameHandler binaryFrameHandler; + private ConnectionHandler connectionHandler; + private IBaseConnectionListener connectionListener; + private Channel channel; + @Getter + private URI websocketUri; + protected IBaseConnectionListener clientConnectionListener; + /** + * 控制弹幕发送频率 + */ + private volatile long lastSendDanmuTimeInMillis; + + public abstract ConnectionHandler initConnectionHandler(IBaseConnectionListener clientConnectionListener); + + public abstract BinaryFrameHandler initBinaryFrameHandler(); + + protected BaseNettyClient(Config config, EventLoopGroup workerGroup, IBaseConnectionListener connectionListener) { + super(config); + this.workerGroup = workerGroup; + this.connectionListener = connectionListener; + } + + public void onConnected(ConnectionHandler connectionHandler) { + this.setStatus(ClientStatusEnums.CONNECTED); + if (this.connectionListener != null) { + this.connectionListener.onConnected(connectionHandler); + } + } + + public void onConnectFailed(ConnectionHandler connectionHandler) { + this.setStatus(ClientStatusEnums.CONNECT_FAILED); + tryReconnect(); + if (this.connectionListener != null) { + this.connectionListener.onConnectFailed(connectionHandler); + } + } + + public void onDisconnected(ConnectionHandler connectionHandler) { + this.setStatus(ClientStatusEnums.DISCONNECTED); + tryReconnect(); + if (this.connectionListener != null) { + this.connectionListener.onDisconnected(connectionHandler); + } + } + + @Override + public void init() { + if (checkStatus(ClientStatusEnums.INITIALIZED)) { + return; + } + try { + this.websocketUri = new URI(getWebSocketUriString()); + SslContext sslCtx = SslContextBuilder.forClient().build(); + + this.clientConnectionListener = new IBaseConnectionListener() { + @Override + public void onConnected(ConnectionHandler connectionHandler) { + BaseNettyClient.this.onConnected(connectionHandler); + } + + @Override + public void onConnectFailed(ConnectionHandler connectionHandler) { + BaseNettyClient.this.onConnectFailed(connectionHandler); + } + + @Override + public void onDisconnected(ConnectionHandler connectionHandler) { + BaseNettyClient.this.onDisconnected(connectionHandler); + } + }; + this.binaryFrameHandler = this.initBinaryFrameHandler(); + this.connectionHandler = this.initConnectionHandler(this.clientConnectionListener); + + this.bootstrap.group(this.workerGroup) + // 创建Channel + .channel(NioSocketChannel.class) + .remoteAddress(this.websocketUri.getHost(), getInetPort()) + .option(ChannelOption.TCP_NODELAY, true) + .option(ChannelOption.SO_KEEPALIVE, true) + // Channel配置 + .handler(new ChannelInitializer() { + @Override + protected void initChannel(SocketChannel ch) { + // 责任链 + ChannelPipeline pipeline = ch.pipeline(); + + // 放到第一位 addFirst 支持wss链接服务端 + pipeline.addFirst(sslCtx.newHandler(ch.alloc(), BaseNettyClient.this.websocketUri.getHost(), getInetPort())); + + // 添加一个http的编解码器 + pipeline.addLast(new HttpClientCodec()); + // 添加一个用于支持大数据流的支持 + pipeline.addLast(new ChunkedWriteHandler()); + // 添加一个聚合器,这个聚合器主要是将HttpMessage聚合成FullHttpRequest/Response + pipeline.addLast(new HttpObjectAggregator(BaseNettyClient.this.getConfig().getAggregatorMaxContentLength())); + + // 连接处理器 + pipeline.addLast(BaseNettyClient.this.connectionHandler); + // 弹幕处理器 + pipeline.addLast(BaseNettyClient.this.binaryFrameHandler); + } + }); + this.setStatus(ClientStatusEnums.INITIALIZED); + } catch (URISyntaxException e) { + throw new BaseException(e); + } catch (SSLException e) { + throw new BaseException(e); + } + } + + private int getInetPort() { + int port = this.websocketUri.getPort(); + return port == -1 ? "wss".equalsIgnoreCase(websocketUri.getScheme()) ? 443 : 80 : port; + } + + @Override + public void connect(Runnable success, Consumer failed) { + if (this.cancelReconnect) { + this.cancelReconnect = false; + } + if (!checkStatus(ClientStatusEnums.INITIALIZED)) { + return; + } + if (getStatus() == ClientStatusEnums.CONNECTED) { + return; + } + if (getStatus() != ClientStatusEnums.RECONNECTING) { + this.setStatus(ClientStatusEnums.CONNECTING); + } + this.bootstrap.connect().addListener((ChannelFutureListener) connectFuture -> { + if (connectFuture.isSuccess()) { + if (log.isDebugEnabled()) { + log.debug("连接建立成功!"); + } + this.channel = connectFuture.channel(); + // 监听是否握手成功 + this.connectionHandler.getHandshakeFuture().addListener((ChannelFutureListener) handshakeFuture -> { + try { + connectionHandler.sendAuthRequest(channel); + if (success != null) { + success.run(); + } + } catch (Exception e) { + log.error("认证包发送失败,断开连接", e); + this.disconnect(); + } + }); + } else { + log.error("连接建立失败", connectFuture.cause()); + this.onConnectFailed(this.connectionHandler); + if (failed != null) { + failed.accept(connectFuture.cause()); + } + } + }); + } + + @Override + public void disconnect() { + if (this.channel == null) { + return; + } + this.channel.close(); + } + + @Override + protected void tryReconnect() { + if (this.cancelReconnect) { + this.cancelReconnect = false; + return; + } + if (!getConfig().isAutoReconnect()) { + return; + } + if (log.isWarnEnabled()) { + log.warn("{}s后将重新连接 {}", getConfig().getReconnectDelay(), getConfig().getRoomId()); + } + workerGroup.schedule(() -> { + this.setStatus(ClientStatusEnums.RECONNECTING); + this.connect(); + }, getConfig().getReconnectDelay(), TimeUnit.SECONDS); + } + + @Override + public void send(Object msg, Runnable success, Consumer failed) { + ChannelFuture future = this.channel.writeAndFlush(msg); + if (success != null || failed != null) { + future.addListener((ChannelFutureListener) channelFuture -> { + if (channelFuture.isSuccess()) { + if (success != null) { + success.run(); + } + } else { + if (failed != null) { + failed.accept(channelFuture.cause()); + } + } + }); + } + } + + @Override + public void destroy() { + super.destroy(); + + // 销毁时不需要重连 + this.cancelReconnect = true; + workerGroup.shutdownGracefully().addListener(future -> { + if (future.isSuccess()) { + this.setStatus(ClientStatusEnums.DESTROYED); + } else { + throw new BaseException("client销毁失败", future.cause()); + } + }); + } + + @Override + protected String getWebSocketUriString() { + return getConfig().getWebsocketUri(); + } + + @Override + protected void setStatus(ClientStatusEnums status) { + if (log.isDebugEnabled()) { + if (getStatus() != status) { + log.debug("{} 状态变化 {} => {}\n", getClass().getSimpleName(), getStatus(), status); + } + } + super.setStatus(status); + } + + @Override + public void sendDanmu(Object danmu, Runnable success, Consumer failed) { + throw new BaseException("暂未支持该功能"); + } + + @Override + public void clickLike(int count, Runnable success, Consumer failed) { + throw new BaseException("暂未支持该功能"); + } + + /** + * 发送弹幕前判断是否可以发送 + * + * @param checkConnected 是否检查Client连接状态 + */ + protected boolean checkCanSendDanmu(boolean checkConnected) { + if (checkConnected && getStatus() != ClientStatusEnums.CONNECTED) { + throw new BaseException("连接未建立,无法发送弹幕"); + } + if (System.currentTimeMillis() - this.lastSendDanmuTimeInMillis <= getConfig().getMinSendDanmuPeriod()) { + if (log.isWarnEnabled()) { + log.warn("发送弹幕频率过快,忽略该次发送"); + } + return false; + } + return true; + } + + protected boolean checkCanSendDanmu() { + return checkCanSendDanmu(true); + } + + /** + * 发送弹幕后调用该方法 + */ + protected void finishSendDanmu() { + this.lastSendDanmuTimeInMillis = System.currentTimeMillis(); + if (log.isDebugEnabled()) { + log.debug("弹幕发送完成"); + } + } + + public void iteratorMsgListeners(Consumer consumer) { + binaryFrameHandler.iteratorMsgListeners(consumer); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/client/config/BaseNettyClientConfig.java b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/client/config/BaseNettyClientConfig.java new file mode 100644 index 0000000..c0ebf52 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/client/config/BaseNettyClientConfig.java @@ -0,0 +1,65 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.servers.netty.client.config; + +import io.netty.handler.codec.http.HttpHeaders; +import io.netty.handler.codec.http.HttpObjectAggregator; +import io.netty.handler.codec.http.websocketx.WebSocketClientHandshakerFactory; +import io.netty.handler.codec.http.websocketx.WebSocketVersion; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import tech.ordinaryroad.live.chat.client.commons.client.config.BaseLiveChatClientConfig; + +import java.net.URI; + +/** + * @author mjz + * @date 2023/8/26 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@SuperBuilder(toBuilder = true) +public abstract class BaseNettyClientConfig extends BaseLiveChatClientConfig { + + /** + * 聚合器允许的最大消息体长度,默认 64*1024 byte + * + * @see HttpObjectAggregator#HttpObjectAggregator(int) + */ + @Builder.Default + private int aggregatorMaxContentLength = 64 * 1024; + + /** + * WebSocketClientHandshaker最大消息体长度,默认 64*1024 byte + * + * @see WebSocketClientHandshakerFactory#newHandshaker(URI, WebSocketVersion, String, boolean, HttpHeaders, int) + */ + @Builder.Default + private int maxFramePayloadLength = 64 * 1024; +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/client/handler/BaseNettyClientBinaryFrameHandler.java b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/client/handler/BaseNettyClientBinaryFrameHandler.java new file mode 100644 index 0000000..278ce3f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/client/handler/BaseNettyClientBinaryFrameHandler.java @@ -0,0 +1,66 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.servers.netty.client.handler; + +import lombok.Getter; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseMsgListener; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; +import tech.ordinaryroad.live.chat.client.servers.netty.client.base.BaseNettyClient; +import tech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseBinaryFrameHandler; + +import java.util.List; + +/** + * BaseClientBinaryFrameHandler + * + * @author mjz + * @date 2023/8/30 + */ +public abstract class BaseNettyClientBinaryFrameHandler< + Client extends BaseNettyClient, + BinaryFrameHandler extends BaseBinaryFrameHandler, + CmdEnum extends Enum, + Msg extends IMsg, + MsgListener extends IBaseMsgListener> + extends BaseBinaryFrameHandler { + + @Getter + protected final Client client; + + public BaseNettyClientBinaryFrameHandler(List msgListeners, Client client, long roomId) { + super(msgListeners, roomId); + this.client = client; + } + + public BaseNettyClientBinaryFrameHandler(List msgListeners, Client client) { + super(msgListeners, client.getConfig().getRoomId()); + this.client = client; + } + + public BaseNettyClientBinaryFrameHandler(List msgListeners, long roomId) { + super(msgListeners, roomId); + this.client = null; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/client/handler/BaseNettyClientConnectionHandler.java b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/client/handler/BaseNettyClientConnectionHandler.java new file mode 100644 index 0000000..a9903f1 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty-client/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/client/handler/BaseNettyClientConnectionHandler.java @@ -0,0 +1,65 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.servers.netty.client.handler; + +import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker; +import lombok.Getter; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.servers.netty.client.base.BaseNettyClient; +import tech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseConnectionHandler; + +/** + * BaseClientConnectionHandler + * + * @author mjz + * @date 2023/8/27 + */ +public abstract class BaseNettyClientConnectionHandler< + Client extends BaseNettyClient, + ConnectionHandler extends BaseConnectionHandler> + extends BaseConnectionHandler { + + @Getter + protected final Client client; + + public BaseNettyClientConnectionHandler(WebSocketClientHandshaker handshaker, Client client, IBaseConnectionListener listener) { + super(handshaker, listener); + this.client = client; + } + + public BaseNettyClientConnectionHandler(WebSocketClientHandshaker handshaker, Client client) { + this(handshaker, client, null); + } + + public BaseNettyClientConnectionHandler(WebSocketClientHandshaker handshaker, IBaseConnectionListener listener) { + super(handshaker, listener); + this.client = null; + } + + public BaseNettyClientConnectionHandler(WebSocketClientHandshaker handshaker, long roomId) { + super(handshaker, null); + this.client = null; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty/pom.xml b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty/pom.xml new file mode 100644 index 0000000..1e4259a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty/pom.xml @@ -0,0 +1,59 @@ + + + + 4.0.0 + + org.ruoyi + live-chat-client-servers + ${revision} + ../pom.xml + + jar + + live-chat-client-servers-netty + live-chat-client-servers-netty + + + UTF-8 + + + + + org.ruoyi + live-chat-client-commons-base + + + + io.netty + netty-all + + + + ch.qos.logback + logback-classic + + + diff --git a/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/frame/base/BaseBinaryWebSocketFrame.java b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/frame/base/BaseBinaryWebSocketFrame.java new file mode 100644 index 0000000..984960a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/frame/base/BaseBinaryWebSocketFrame.java @@ -0,0 +1,39 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.servers.netty.frame.base; + +import io.netty.buffer.ByteBuf; +import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame; + +/** + * @author mjz + * @date 2023/1/5 + */ +public abstract class BaseBinaryWebSocketFrame extends BinaryWebSocketFrame { + + public BaseBinaryWebSocketFrame(ByteBuf byteBuf) { + super(byteBuf); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/handler/base/BaseBinaryFrameHandler.java b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/handler/base/BaseBinaryFrameHandler.java new file mode 100644 index 0000000..c7a683f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/handler/base/BaseBinaryFrameHandler.java @@ -0,0 +1,184 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.servers.netty.handler.base; + +import com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseMsgListener; +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseCmdMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; + +import java.util.List; +import java.util.function.Consumer; + + +/** + * 消息处理器 + * + * @author mjz + * @date 2023/1/4 + */ +@Slf4j +public abstract class BaseBinaryFrameHandler< + T extends BaseBinaryFrameHandler, + CmdEnum extends Enum, + Msg extends IMsg, + MsgListener extends IBaseMsgListener + > extends SimpleChannelInboundHandler + implements IBaseMsgListener { + + @Getter + private final Object roomId; + protected final List msgListeners; + + public BaseBinaryFrameHandler(List msgListeners, Object roomId) { + this.msgListeners = msgListeners; + this.roomId = roomId; + if (this.msgListeners == null || this.msgListeners.isEmpty()) { + if (log.isDebugEnabled()) { + log.debug("listener not set"); + } + } + } + + /** + * 解码收到的二进制流 + * + * @param byteBuf ByteBuf + * @return List + */ + protected abstract List decode(ByteBuf byteBuf); + + @SuppressWarnings("unchecked") + protected void channelRead0(ChannelHandlerContext ctx, BinaryWebSocketFrame message) { + ByteBuf byteBuf = message.content(); + List msgList = this.decode(byteBuf); + if (msgList == null || msgList.isEmpty()) { + if (log.isDebugEnabled()) { + log.debug("msgList is empty"); + } + return; + } + for (Msg msg : msgList) { + this.onMsg((T) BaseBinaryFrameHandler.this, msg); + if (msg instanceof ICmdMsg) { + ICmdMsg cmdMsg = (ICmdMsg) msg; + Enum cmdEnum = cmdMsg.getCmdEnum(); + if (cmdEnum == null) { + this.onUnknownCmd((T) BaseBinaryFrameHandler.this, cmdMsg.getCmd(), cmdMsg); + } else { + this.onCmdMsg((T) BaseBinaryFrameHandler.this, (CmdEnum) cmdEnum, (ICmdMsg) cmdMsg); + } + } + if (msg instanceof BaseCmdMsg) { + BaseCmdMsg cmdMsg = (BaseCmdMsg) msg; + Enum cmdEnum = cmdMsg.getCmdEnum(); + if (cmdEnum == null) { + this.onUnknownCmd((T) BaseBinaryFrameHandler.this, cmdMsg.getCmd(), cmdMsg); + } else { + this.onCmdMsg((T) BaseBinaryFrameHandler.this, (CmdEnum) cmdEnum, (BaseCmdMsg) cmdMsg); + } + } + } + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { + if (cause.getCause() instanceof UnrecognizedPropertyException) { + log.error("缺少字段:{}", cause.getMessage()); + } else { + super.exceptionCaught(ctx, cause); + } + } + + @Override + public void onMsg(T t, IMsg msg) { + IBaseMsgListener.super.onMsg(t, msg); + iteratorMsgListeners(msgListener -> msgListener.onMsg(t, msg)); + } + + /** + * 重写该方法,判断CMD,或者调用{@link IBaseMsgListener#onOtherCmdMsg(Object, Enum, ICmdMsg)} + * + * @param t BaseBinaryFrameHandler + * @param cmd CmdEnum + * @param cmdMsg BaseMsg + */ + @Override + public void onCmdMsg(T t, CmdEnum cmd, ICmdMsg cmdMsg) { + IBaseMsgListener.super.onCmdMsg(t, cmd, cmdMsg); + iteratorMsgListeners(msgListener -> msgListener.onCmdMsg(t, cmd, cmdMsg)); + } + + @Override + public void onUnknownCmd(T t, String cmdString, IMsg msg) { + IBaseMsgListener.super.onUnknownCmd(t, cmdString, msg); + iteratorMsgListeners(msgListener -> msgListener.onUnknownCmd(t, cmdString, msg)); + } + + @SuppressWarnings("ForLoopReplaceableByForEach") + public void iteratorMsgListeners(Consumer consumer) { + if (msgListeners.isEmpty()) { + return; + } + for (int i = 0; i < msgListeners.size(); i++) { + consumer.accept(msgListeners.get(i)); + } + } + + @Override + public void onCmdMsg(T t, CmdEnum cmd, BaseCmdMsg cmdMsg) { + IBaseMsgListener.super.onCmdMsg(t, cmd, cmdMsg); + iteratorMsgListeners(msgListener -> msgListener.onCmdMsg(t, cmd, cmdMsg)); + } + + @Override + public void onUnknownCmd(T t, String cmdString, BaseMsg msg) { + IBaseMsgListener.super.onUnknownCmd(t, cmdString, msg); + iteratorMsgListeners(msgListener -> msgListener.onUnknownCmd(t, cmdString, msg)); + } + + public String getRoomIdAsString() { + if (this.roomId == null) { + return ""; + } + return this.roomId.toString(); + } + + public long getRoomIdAsLong() { + String roomIdAsString = this.getRoomIdAsString(); + if (roomIdAsString.trim().isEmpty()) { + return 0L; + } + return Long.parseLong(roomIdAsString); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/handler/base/BaseConnectionHandler.java b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/handler/base/BaseConnectionHandler.java new file mode 100644 index 0000000..724dca4 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-servers/live-chat-client-servers-netty/src/main/java/tech/ordinaryroad/live/chat/client/servers/netty/handler/base/BaseConnectionHandler.java @@ -0,0 +1,168 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.servers.netty.handler.base; + +import io.netty.channel.Channel; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelPromise; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.handler.codec.http.FullHttpResponse; +import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker; +import io.netty.handler.codec.http.websocketx.WebSocketHandshakeException; +import io.netty.handler.ssl.SslCloseCompletionEvent; +import io.netty.handler.ssl.SslHandshakeCompletionEvent; +import io.netty.util.concurrent.ScheduledFuture; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; + +import java.util.concurrent.TimeUnit; + + +/** + * 连接处理器 + * + * @author mjz + * @date 2023/8/21 + */ +@Slf4j +public abstract class BaseConnectionHandler> extends SimpleChannelInboundHandler { + + private final WebSocketClientHandshaker handshaker; + @Getter + private ChannelPromise handshakeFuture; + private final IBaseConnectionListener listener; + /** + * 客户端发送心跳包 + */ + private ScheduledFuture scheduledFuture = null; + + public BaseConnectionHandler(WebSocketClientHandshaker handshaker, IBaseConnectionListener listener) { + this.handshaker = handshaker; + this.listener = listener; + } + + public BaseConnectionHandler(WebSocketClientHandshaker handshaker) { + this(handshaker, null); + } + + + @Override + public void handlerAdded(ChannelHandlerContext ctx) { + this.handshakeFuture = ctx.newPromise(); + } + + @Override + public void channelActive(ChannelHandlerContext ctx) { + this.handshaker.handshake(ctx.channel()); + } + + protected void channelRead0(ChannelHandlerContext ctx, FullHttpResponse msg) throws Exception { + // 判断是否正确握手 + if (this.handshaker.isHandshakeComplete()) { + handshakeSuccessfully(ctx, msg); + } else { + try { + handshakeSuccessfully(ctx, msg); + } catch (WebSocketHandshakeException e) { + handshakeFailed(msg, e); + } + } + } + + @Override + public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { + if (log.isDebugEnabled()) { + log.debug("userEventTriggered {}", evt.getClass()); + } + if (evt instanceof SslHandshakeCompletionEvent) { + heartbeatCancel(); + heartbeatStart(ctx); + if (this.listener != null) { + listener.onConnected((ConnectionHandler) BaseConnectionHandler.this); + } + } else if (evt instanceof SslCloseCompletionEvent) { + heartbeatCancel(); + if (this.listener != null) { + listener.onDisconnected((ConnectionHandler) BaseConnectionHandler.this); + } + } else { + log.error("待处理 {}", evt.getClass()); + } + super.userEventTriggered(ctx, evt); + } + + /** + * 开始发送心跳包 + */ + private void heartbeatStart(ChannelHandlerContext ctx) { + scheduledFuture = ctx.executor().scheduleAtFixedRate(() -> { + sendHeartbeat(ctx); + }, getHeartbeatInitialDelay(), getHeartbeatPeriod(), TimeUnit.SECONDS); + } + + /** + * 取消发送心跳包 + */ + private void heartbeatCancel() { + if (null != scheduledFuture && !scheduledFuture.isCancelled()) { + scheduledFuture.cancel(true); + scheduledFuture = null; + } + } + + protected abstract void sendHeartbeat(ChannelHandlerContext ctx); + + public abstract void sendAuthRequest(Channel channel); + + protected abstract long getHeartbeatPeriod(); + + protected abstract long getHeartbeatInitialDelay(); + + private void handshakeSuccessfully(ChannelHandlerContext ctx, FullHttpResponse msg) { + if (log.isDebugEnabled()) { + log.debug("握手完成!"); + } + this.handshaker.finishHandshake(ctx.channel(), msg); + this.handshakeFuture.setSuccess(); + } + + private void handshakeFailed(FullHttpResponse msg, WebSocketHandshakeException e) { + log.error("握手失败!status:" + msg.status(), e); + this.handshakeFuture.setFailure(e); + if (listener != null) { + this.listener.onConnectFailed((ConnectionHandler) this); + } + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { + log.error("exceptionCaught", cause); + if (!this.handshakeFuture.isDone()) { + this.handshakeFuture.setFailure(cause); + } + ctx.close(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-client-servers/pom.xml b/aibidding-modules/aibidding-live/live-chat-client-servers/pom.xml new file mode 100644 index 0000000..b7a8f8f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-client-servers/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + org.ruoyi + aibidding-live + ${revision} + ../pom.xml + + pom + + live-chat-client-servers + live-chat-client-servers + + + UTF-8 + + + + live-chat-client-servers-netty + live-chat-client-servers-netty-client + + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/pom.xml b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/pom.xml new file mode 100644 index 0000000..dcd4706 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/pom.xml @@ -0,0 +1,71 @@ + + + + 4.0.0 + + org.ruoyi + live-chat-clients + ${revision} + ../pom.xml + + jar + + live-chat-client-bilibili + live-chat-client-bilibili + + + UTF-8 + + + + + org.ruoyi + live-chat-client-servers-netty-client + + + + com.aayushatharva.brotli4j + brotli4j + + + + com.google.protobuf + protobuf-java-util + + + + ch.qos.logback + logback-classic + + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/api/BilibiliApis.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/api/BilibiliApis.java new file mode 100644 index 0000000..5fd081e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/api/BilibiliApis.java @@ -0,0 +1,247 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.api; + +import cn.hutool.cache.impl.TimedCache; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.thread.ThreadUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpUtil; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.*; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.bilibili.api.request.BilibiliLikeReportV3Request; +import tech.ordinaryroad.live.chat.client.bilibili.api.request.BilibiliSendMsgRequest; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.util.OrLiveChatCookieUtil; + +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import static tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg.OBJECT_MAPPER; + +/** + * B站API简易版 + * + * @author mjz + * @date 2023/5/5 + */ +@Slf4j +public class BilibiliApis { + + public static final TimedCache GIFT_IMG_CACHE = new TimedCache<>(TimeUnit.DAYS.toMillis(1)); + public static final String KEY_COOKIE_CSRF = "bili_jct"; + public static final String KEY_UID = "DedeUserID"; + + @SneakyThrows + public static RoomInitResult roomInit(long roomId, String cookie) { + @Cleanup + HttpResponse response = createGetRequest("https://api.live.bilibili.com/room/v1/Room/room_init?id=" + roomId, cookie).execute(); + JsonNode dataJsonNode = responseInterceptor(response.body()); + return OBJECT_MAPPER.readValue(dataJsonNode.toString(), RoomInitResult.class); + } + + public static JsonNode roomGiftConfig(long roomId, String cookie) { + @Cleanup + HttpResponse response = createGetRequest("https://api.live.bilibili.com/xlive/web-room/v1/giftPanel/roomGiftConfig?platform=pc&source=live&build=0&global_version=0&room_id=" + roomId, cookie).execute(); + return responseInterceptor(response.body()); + } + + /** + * @param roomId + * @param type 直播间用0 + * @return

{@code
+     * {
+     * 	"group": "live",
+     * 	"business_id": 0,
+     * 	"refresh_row_factor": 0.125,
+     * 	"refresh_rate": 100,
+     * 	"max_delay": 5000,
+     * 	"token": "-wm5-Qo4BBAztd1qp5ZJpgyTMRBhCc7yikz5d9rAd63PV46G9BMwl0R10kMM8Ilb-UieZGjLtipPrz4Cvi0DdhGFwOi8PJpFN9K-LoXh6Z_4yjEIwgRerDiMIstHzJ80J3B7wnRisAYkWA==",
+     * 	"host_list": [{
+     * 		"host": "ali-bj-live-comet-09.chat.bilibili.com",
+     * 		"port": 2243,
+     * 		"wss_port": 443,
+     * 		"ws_port": 2244
+     *        }, {
+     * 		"host": "ali-gz-live-comet-02.chat.bilibili.com",
+     * 		"port": 2243,
+     * 		"wss_port": 443,
+     * 		"ws_port": 2244
+     *    }, {
+     * 		"host": "broadcastlv.chat.bilibili.com",
+     * 		"port": 2243,
+     * 		"wss_port": 443,
+     * 		"ws_port": 2244
+     *    }]
+     * }
+     * }
+ */ + public static JsonNode getDanmuInfo(long roomId, int type, String cookie) { + @Cleanup + HttpResponse response = createGetRequest("https://api.live.bilibili.com/xlive/web-room/v1/index/getDanmuInfo?id=" + roomId + "&type=" + type, cookie).execute(); + return responseInterceptor(response.body()); + } + + public static String getGiftImgById(long giftId, long roomId) { + if (!GIFT_IMG_CACHE.containsKey(giftId)) { + ThreadUtil.execAsync(() -> { + updateGiftImgCache(roomId, null); + }); + } + + return GIFT_IMG_CACHE.get(giftId); + } + + /** + * 更新礼物图片缓存 + */ + public static void updateGiftImgCache(long roomId, String cookie) { + JsonNode jsonNode = roomGiftConfig(roomId, cookie); + for (JsonNode node : jsonNode.get("global_gift").get("list")) { + long giftId = node.get("id").asLong(); + String giftImgUrl = node.get("webp").asText(); + GIFT_IMG_CACHE.put(giftId, giftImgUrl); + } + } + + /** + * 发送弹幕 + * + * @param request {@link BilibiliSendMsgRequest} + * @param cookie Cookie + */ + public static void sendMsg(BilibiliSendMsgRequest request, String cookie) { + if (StrUtil.isBlank(cookie)) { + throw new BaseException("发送弹幕接口cookie不能为空"); + } + Map stringObjectMap = BeanUtil.beanToMap(request); + @Cleanup HttpResponse execute = HttpUtil.createPost("https://api.live.bilibili.com/msg/send") + .cookie(cookie) + .form(stringObjectMap) + .execute(); + responseInterceptor(execute.body()); + } + + /** + * 发送弹幕 + * + * @param msg 内容 + * @param realRoomId 真实房间id + * @param cookie Cookie + */ + public static void sendMsg(String msg, long realRoomId, String cookie) { + String biliJct = OrLiveChatCookieUtil.getCookieByName(cookie, KEY_COOKIE_CSRF, () -> { + throw new BaseException("cookie中缺少参数" + KEY_COOKIE_CSRF); + }); + BilibiliSendMsgRequest request = new BilibiliSendMsgRequest(msg, StrUtil.toString(ZonedDateTime.now(ZoneId.of("Asia/Shanghai")).toEpochSecond()), realRoomId, biliJct, biliJct); + sendMsg(request, cookie); + } + + /** + * 为主播点赞 + * + * @param request {@link BilibiliLikeReportV3Request} + * @param cookie Cookie + */ + public static void likeReportV3(BilibiliLikeReportV3Request request, String cookie) { + if (StrUtil.isBlank(cookie)) { + throw new BaseException("为主播点赞接口cookie不能为空"); + } + Map stringObjectMap = BeanUtil.beanToMap(request); + @Cleanup HttpResponse execute = HttpUtil.createPost("https://api.live.bilibili.com/xlive/app-ucenter/v1/like_info_v3/like/likeReportV3") + .cookie(cookie) + .form(stringObjectMap) + .execute(); + responseInterceptor(execute.body()); + } + + /** + * 为主播点赞 + * + * @param anchor_id 主播Uid {@link RoomInitResult#uid} + * @param realRoomId 真实房间Id {@link RoomInitResult#room_id} + * @param cookie Cookie + */ + public static void likeReportV3(long anchor_id, long realRoomId, String cookie) { + String uid = OrLiveChatCookieUtil.getCookieByName(cookie, KEY_UID, () -> { + throw new BaseException("cookie中缺少参数" + KEY_UID); + }); + String biliJct = OrLiveChatCookieUtil.getCookieByName(cookie, KEY_COOKIE_CSRF, () -> { + throw new BaseException("cookie中缺少参数" + KEY_COOKIE_CSRF); + }); + BilibiliLikeReportV3Request request = new BilibiliLikeReportV3Request(realRoomId, uid, anchor_id, biliJct, biliJct); + likeReportV3(request, cookie); + } + + public static HttpRequest createGetRequest(String url, String cookies) { + return HttpUtil.createGet(url) + .cookie(cookies); + } + + private static JsonNode responseInterceptor(String responseString) { + try { + JsonNode jsonNode = OBJECT_MAPPER.readTree(responseString); + int code = jsonNode.get("code").asInt(); + if (code == 0) { + // 成功 + return jsonNode.get("data"); + } else { + throw new BaseException(jsonNode.get("message").asText()); + } + } catch (JsonProcessingException e) { + throw new BaseException(e); + } + } + + @Data + @AllArgsConstructor + @NoArgsConstructor + @Builder + public static class RoomInitResult { + private long room_id; + private int short_id; + private long uid; + private int need_p2p; + private boolean is_hidden; + private boolean is_locked; + private boolean is_portrait; + private int live_status; + private int hidden_till; + private int lock_till; + private boolean encrypted; + private boolean pwd_verified; + private long live_time; + private int room_shield; + private int is_sp; + private int special_type; + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/api/request/BilibiliLikeReportV3Request.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/api/request/BilibiliLikeReportV3Request.java new file mode 100644 index 0000000..5979d89 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/api/request/BilibiliLikeReportV3Request.java @@ -0,0 +1,74 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.api.request; + +import cn.hutool.core.util.StrUtil; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author mjz + * @date 2024/1/31 + */ +@Data +@NoArgsConstructor +public class BilibiliLikeReportV3Request { + /** + * 本次点赞次数 + */ + private int click_time = 1; + /** + * 房间真实ID + */ + private long room_id; + /** + * Cookie中的DedeUserID + */ + private String uid; + /** + * RoomInitResult中的uid + */ + private long anchor_id; + /** + * Cookie中的bili_jct + */ + private String csrf; + /** + * Cookie中的bili_jct + */ + private String csrf_token; + /** + * 暂时留空 + */ + private String visit_id = StrUtil.EMPTY; + + public BilibiliLikeReportV3Request(long room_id, String uid, long anchor_id, String csrf, String csrf_token) { + this.room_id = room_id; + this.uid = uid; + this.anchor_id = anchor_id; + this.csrf = csrf; + this.csrf_token = csrf_token; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/api/request/BilibiliSendMsgRequest.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/api/request/BilibiliSendMsgRequest.java new file mode 100644 index 0000000..eca8d7b --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/api/request/BilibiliSendMsgRequest.java @@ -0,0 +1,77 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.api.request; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author mjz + * @date 2023/9/7 + */ +@Data +@NoArgsConstructor +public class BilibiliSendMsgRequest { + private String bubble = "0"; + /** + * 弹幕内容 + */ + private String msg; + /** + * 弹幕颜色 + */ + private String color = "16777215"; + private String mode = "1"; + private String room_type = "0"; + private String jumpfrom = "0"; + /** + * 字体大小 + */ + private String fontsize = "25"; + /** + * 时间戳(秒) + */ + private String rnd; + /** + * 房间真实ID + */ + private long roomid; + /** + * Cookie中的bili_jct + */ + private String csrf; + /** + * Cookie中的bili_jct + */ + private String csrf_token; + + public BilibiliSendMsgRequest(String msg, String rnd, long roomid, String csrf, String csrf_token) { + this.msg = msg; + this.rnd = rnd; + this.roomid = roomid; + this.csrf = csrf; + this.csrf_token = csrf_token; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/client/BilibiliLiveChatClient.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/client/BilibiliLiveChatClient.java new file mode 100644 index 0000000..6bca387 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/client/BilibiliLiveChatClient.java @@ -0,0 +1,184 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.client; + +import io.netty.channel.EventLoopGroup; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.handler.codec.http.DefaultHttpHeaders; +import io.netty.handler.codec.http.websocketx.WebSocketClientHandshakerFactory; +import io.netty.handler.codec.http.websocketx.WebSocketVersion; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.bilibili.api.BilibiliApis; +import tech.ordinaryroad.live.chat.client.bilibili.config.BilibiliLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.bilibili.constant.BilibiliCmdEnum; +import tech.ordinaryroad.live.chat.client.bilibili.listener.IBilibiliConnectionListener; +import tech.ordinaryroad.live.chat.client.bilibili.listener.IBilibiliMsgListener; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.IBilibiliMsg; +import tech.ordinaryroad.live.chat.client.bilibili.netty.handler.BilibiliBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.bilibili.netty.handler.BilibiliConnectionHandler; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.servers.netty.client.base.BaseNettyClient; + +import java.util.List; +import java.util.function.Consumer; + +/** + * B站直播间弹幕客户端 + * + * @author mjz + * @date 2023/8/20 + */ +@Slf4j +public class BilibiliLiveChatClient extends BaseNettyClient< + BilibiliLiveChatClientConfig, + BilibiliCmdEnum, + IBilibiliMsg, + IBilibiliMsgListener, + BilibiliConnectionHandler, + BilibiliBinaryFrameHandler + > { + + private BilibiliApis.RoomInitResult roomInitResult = new BilibiliApis.RoomInitResult(); + + public BilibiliLiveChatClient(BilibiliLiveChatClientConfig config, List msgListeners, IBilibiliConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(config, workerGroup, connectionListener); + addMsgListeners(msgListeners); + + // 初始化 + this.init(); + } + + public BilibiliLiveChatClient(BilibiliLiveChatClientConfig config, IBilibiliMsgListener msgListener, IBilibiliConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(config, workerGroup, connectionListener); + addMsgListener(msgListener); + + // 初始化 + this.init(); + } + + public BilibiliLiveChatClient(BilibiliLiveChatClientConfig config, IBilibiliMsgListener msgListener, IBilibiliConnectionListener connectionListener) { + this(config, msgListener, connectionListener, new NioEventLoopGroup()); + } + + public BilibiliLiveChatClient(BilibiliLiveChatClientConfig config, IBilibiliMsgListener msgListener) { + this(config, msgListener, null, new NioEventLoopGroup()); + } + + public BilibiliLiveChatClient(BilibiliLiveChatClientConfig config) { + this(config, null); + } + + @Override + public void init() { + roomInitResult = BilibiliApis.roomInit(getConfig().getRoomId(), getConfig().getCookie()); + super.init(); + } + + @Override + public BilibiliConnectionHandler initConnectionHandler(IBaseConnectionListener clientConnectionListener) { + return new BilibiliConnectionHandler( + WebSocketClientHandshakerFactory.newHandshaker(getWebsocketUri(), WebSocketVersion.V13, null, true, new DefaultHttpHeaders(), getConfig().getMaxFramePayloadLength()), + BilibiliLiveChatClient.this, clientConnectionListener + ); + } + + @Override + public BilibiliBinaryFrameHandler initBinaryFrameHandler() { + return new BilibiliBinaryFrameHandler(super.msgListeners, BilibiliLiveChatClient.this); + } + + @Override + public void sendDanmu(Object danmu, Runnable success, Consumer failed) { + if (!checkCanSendDanmu(false)) { + return; + } + if (danmu instanceof String) { + String msg = (String) danmu; + try { + if (log.isDebugEnabled()) { + log.debug("{} bilibili发送弹幕 {}", getConfig().getRoomId(), danmu); + } + + boolean sendSuccess = false; + try { + BilibiliApis.sendMsg(msg, roomInitResult.getRoom_id(), getConfig().getCookie()); + sendSuccess = true; + } catch (Exception e) { + log.error("bilibili弹幕发送失败", e); + if (failed != null) { + failed.accept(e); + } + } + if (!sendSuccess) { + return; + } + + if (log.isDebugEnabled()) { + log.debug("bilibili弹幕发送成功 {}", danmu); + } + if (success != null) { + success.run(); + } + finishSendDanmu(); + } catch (Exception e) { + log.error("bilibili弹幕发送失败", e); + if (failed != null) { + failed.accept(e); + } + } + } else { + super.sendDanmu(danmu, success, failed); + } + } + + @Override + public void clickLike(int count, Runnable success, Consumer failed) { + if (count <= 0) { + throw new BaseException("点赞次数必须大于0"); + } + + boolean successfullyClicked = false; + try { + BilibiliApis.likeReportV3(roomInitResult.getUid(), roomInitResult.getRoom_id(), getConfig().getCookie()); + successfullyClicked = true; + } catch (Exception e) { + log.error("Bilibili为直播间点赞失败", e); + if (failed != null) { + failed.accept(e); + } + } + if (!successfullyClicked) { + return; + } + + if (log.isDebugEnabled()) { + log.debug("Bilibili为直播间点赞成功"); + } + if (success != null) { + success.run(); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/config/BilibiliLiveChatClientConfig.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/config/BilibiliLiveChatClientConfig.java new file mode 100644 index 0000000..0f0b3b9 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/config/BilibiliLiveChatClientConfig.java @@ -0,0 +1,67 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.config; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import tech.ordinaryroad.live.chat.client.bilibili.constant.ProtoverEnum; +import tech.ordinaryroad.live.chat.client.commons.util.OrLiveChatNumberUtil; +import tech.ordinaryroad.live.chat.client.servers.netty.client.config.BaseNettyClientConfig; + +/** + * B站直播间弹幕客户端配置 + * + * @author mjz + * @date 2023/8/21 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@SuperBuilder(toBuilder = true) +public class BilibiliLiveChatClientConfig extends BaseNettyClientConfig { + + /** + * @see ProtoverEnum + */ + @Builder.Default + private ProtoverEnum protover = ProtoverEnum.NORMAL_ZLIB; + + @Builder.Default + private String websocketUri = "wss://broadcastlv.chat.bilibili.com:443/sub"; + + @Override + public Long getRoomId() { + return OrLiveChatNumberUtil.parseLong(super.getRoomId()); + } + + public void setProtover(ProtoverEnum protover) { + ProtoverEnum oldValue = this.protover; + this.protover = protover; + super.propertyChangeSupport.firePropertyChange("protover", oldValue, protover); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/constant/BilibiliCmdEnum.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/constant/BilibiliCmdEnum.java new file mode 100644 index 0000000..1b6edbc --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/constant/BilibiliCmdEnum.java @@ -0,0 +1,143 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.constant; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * @author mjz + * @date 2023/1/6 + */ +@Getter +@RequiredArgsConstructor +public enum BilibiliCmdEnum { + /** + * 游客状态下,5分钟后会出现登录提示,弹幕中的用户名、用户id等信息将不再可见 + */ + LOG_IN_NOTICE, + /** + * 收到弹幕 + */ + DANMU_MSG, + /** + * 收到礼物 + */ + SEND_GIFT, + /** + * 有人上舰 + */ + GUARD_BUY, + /** + * 欢迎舰长 + */ + WELCOME_GUARD, + WELCOME, + /** + * 礼物连击 + */ + COMBO_SEND, + /** + * 欢迎高能用户、(舰长?待验证)特殊消息 + */ + ENTRY_EFFECT, + HOT_RANK_CHANGED, + HOT_RANK_CHANGED_V2, + INTERACT_WORD, + /** + * 开始直播 + */ + LIVE, + LIVE_INTERACTIVE_GAME, + NOTICE_MSG, + /** + * 高能榜数量更新 + */ + ONLINE_RANK_COUNT, + ONLINE_RANK_TOP3, + ONLINE_RANK_V2, + PK_BATTLE_END, + PK_BATTLE_FINAL_PROCESS, + PK_BATTLE_PROCESS, + PK_BATTLE_PROCESS_NEW, + PK_BATTLE_SETTLE, + PK_BATTLE_SETTLE_USER, + PK_BATTLE_SETTLE_V2, + /** + * 主播准备中 + */ + PREPARING, + ROOM_REAL_TIME_MESSAGE_UPDATE, + /** + * 停止直播的房间ID列表 + */ + STOP_LIVE_ROOM_LIST, + /** + * 醒目留言 + */ + SUPER_CHAT_MESSAGE, + SUPER_CHAT_MESSAGE_JPN, + /** + * 删除醒目留言 + */ + SUPER_CHAT_MESSAGE_DELETE, + WIDGET_BANNER, + /** + * 点赞数更新 + */ + LIKE_INFO_V3_UPDATE, + /** + * 为主播点赞 + */ + LIKE_INFO_V3_CLICK, + HOT_ROOM_NOTIFY, + /** + * 观看人数变化 + */ + WATCHED_CHANGE, + POPULAR_RANK_CHANGED, + COMMON_NOTICE_DANMAKU, + LIVE_MULTI_VIEW_CHANGE, + RECOMMEND_CARD, + PK_BATTLE_START_NEW, + PK_BATTLE_ENTRANCE, + AREA_RANK_CHANGED, + ROOM_BLOCK_MSG, + USER_TOAST_MSG, + PK_BATTLE_PRE_NEW, + PK_BATTLE_RANK_CHANGE, + PK_BATTLE_START, + PK_BATTLE_PRE, + PLAY_TAG, + ; + + public static BilibiliCmdEnum getByString(String cmd) { + try { + return BilibiliCmdEnum.valueOf(cmd); + } catch (Exception e) { + return null; + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/constant/OperationEnum.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/constant/OperationEnum.java new file mode 100644 index 0000000..296abc3 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/constant/OperationEnum.java @@ -0,0 +1,86 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.constant; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * @author mjz + * @date 2023/1/5 + */ +@Getter +@RequiredArgsConstructor +public enum OperationEnum { + HANDSHAKE(0), + HANDSHAKE_REPLY(1), + /** + * 心跳包 + */ + HEARTBEAT(2), + /** + * 心跳包回复(人气值) + */ + HEARTBEAT_REPLY(3), + SEND_MSG(4), + + /** + * 普通包(命令) + */ + SEND_SMS_REPLY(5), + DISCONNECT_REPLY(6), + + /** + * 认证包 + */ + AUTH(7), + + /** + * 认证包回复 + */ + AUTH_REPLY(8), + RAW(9), + PROTO_READY(10), + PROTO_FINISH(11), + CHANGE_ROOM(12), + CHANGE_ROOM_REPLY(13), + REGISTER(14), + REGISTER_REPLY(15), + UNREGISTER(16), + UNREGISTER_REPLY(17), + ; + + private final int code; + + public static OperationEnum getByCode(int code) { + for (OperationEnum value : OperationEnum.values()) { + if (value.code == code) { + return value; + } + } + return null; + } + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/constant/ProtoverEnum.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/constant/ProtoverEnum.java new file mode 100644 index 0000000..bee3f2a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/constant/ProtoverEnum.java @@ -0,0 +1,67 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.constant; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * @author mjz + * @date 2023/1/5 + */ +@Getter +@RequiredArgsConstructor +public enum ProtoverEnum { + /** + * 普通包正文不使用压缩 + */ + NORMAL_NO_COMPRESSION(0), + /** + * 心跳及认证包正文不使用压缩 + */ + HEARTBEAT_AUTH_NO_COMPRESSION(1), + /** + * 普通包正文使用zlib压缩 + */ + NORMAL_ZLIB(2), + /** + * 普通包正文使用brotli压缩,解压为一个带头部的协议0普通包 + */ + NORMAL_BROTLI(3), + ; + + private final int code; + + + public static ProtoverEnum getByCode(int code) { + for (ProtoverEnum value : ProtoverEnum.values()) { + if (value.code == code) { + return value; + } + } + return null; + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/listener/IBilibiliConnectionListener.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/listener/IBilibiliConnectionListener.java new file mode 100644 index 0000000..74248b1 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/listener/IBilibiliConnectionListener.java @@ -0,0 +1,38 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.listener; + + +import tech.ordinaryroad.live.chat.client.bilibili.netty.handler.BilibiliConnectionHandler; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; + +/** + * 连接回调 + * + * @author mjz + * @date 2023/8/21 + */ +public interface IBilibiliConnectionListener extends IBaseConnectionListener { +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/listener/IBilibiliMsgListener.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/listener/IBilibiliMsgListener.java new file mode 100644 index 0000000..bb62956 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/listener/IBilibiliMsgListener.java @@ -0,0 +1,138 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.listener; + +import tech.ordinaryroad.live.chat.client.bilibili.constant.BilibiliCmdEnum; +import tech.ordinaryroad.live.chat.client.bilibili.msg.*; +import tech.ordinaryroad.live.chat.client.bilibili.netty.handler.BilibiliBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.commons.base.listener.*; + +/** + * @author mjz + * @date 2023/1/7 + */ +public interface IBilibiliMsgListener extends IBaseMsgListener, + IDanmuMsgListener, + IGiftMsgListener, + ISuperChatMsgListener, + IEnterRoomMsgListener, + ILikeMsgListener { + + /** + * 收到礼物 + * + * @param binaryFrameHandler BilibiliBinaryFrameHandler + * @param msg SendSmsReplyMsg + * @deprecated use {@link IGiftMsgListener#onGiftMsg(Object, Object)} + */ + default void onSendGift(BilibiliBinaryFrameHandler binaryFrameHandler, SendSmsReplyMsg msg) { + this.onSendGift(msg); + } + + /** + * @deprecated use {@link IGiftMsgListener#onGiftMsg(Object)} + */ + default void onSendGift(SendSmsReplyMsg msg) { + // ignore + } + + /** + * 普通用户进入直播间 + * + * @param binaryFrameHandler BilibiliBinaryFrameHandler + * @param msg SendSmsReplyMsg + * @deprecated use {@link IEnterRoomMsgListener#onEnterRoomMsg} + */ + default void onEnterRoom(BilibiliBinaryFrameHandler binaryFrameHandler, SendSmsReplyMsg msg) { + this.onEnterRoom(msg); + } + + /** + * @deprecated use {@link IEnterRoomMsgListener#onEnterRoomMsg} + */ + default void onEnterRoom(SendSmsReplyMsg msg) { + // ignore + } + + /** + * 入场效果(高能用户) + * + * @param binaryFrameHandler BilibiliBinaryFrameHandler + * @param sendSmsReplyMsg SendSmsReplyMsg + */ + default void onEntryEffect(BilibiliBinaryFrameHandler binaryFrameHandler, SendSmsReplyMsg sendSmsReplyMsg) { + this.onEntryEffect(sendSmsReplyMsg); + } + + default void onEntryEffect(SendSmsReplyMsg sendSmsReplyMsg) { + // ignore + } + + /** + * 观看人数变化 + * + * @param binaryFrameHandler BilibiliBinaryFrameHandler + * @param msg SendSmsReplyMsg + */ + default void onWatchedChange(BilibiliBinaryFrameHandler binaryFrameHandler, SendSmsReplyMsg msg) { + this.onWatchedChange(msg); + } + + default void onWatchedChange(SendSmsReplyMsg msg) { + // ignore + } + + /** + * 为主播点赞 + * + * @param binaryFrameHandler BilibiliBinaryFrameHandler + * @param msg SendSmsReplyMsg + * @deprecated use {@link ILikeMsgListener#onLikeMsg} + */ + default void onClickLike(BilibiliBinaryFrameHandler binaryFrameHandler, SendSmsReplyMsg msg) { + this.onClickLike(msg); + } + + /** + * @deprecated use {@link ILikeMsgListener#onLikeMsg} + */ + default void onClickLike(SendSmsReplyMsg msg) { + // ignore + } + + /** + * 点赞数更新 + * + * @param binaryFrameHandler BilibiliBinaryFrameHandler + * @param msg SendSmsReplyMsg + */ + default void onClickUpdate(BilibiliBinaryFrameHandler binaryFrameHandler, SendSmsReplyMsg msg) { + this.onClickUpdate(msg); + } + + default void onClickUpdate(SendSmsReplyMsg msg) { + // ignore + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/AuthMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/AuthMsg.java new file mode 100644 index 0000000..6a30d3b --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/AuthMsg.java @@ -0,0 +1,92 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.msg; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.bilibili.constant.OperationEnum; +import tech.ordinaryroad.live.chat.client.bilibili.constant.ProtoverEnum; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.BaseBilibiliMsg; + +/** + * @author mjz + * @date 2023/1/6 + */ +@Getter +@Setter +@RequiredArgsConstructor +public class AuthMsg extends BaseBilibiliMsg { + + /** + * 用户uid,0代表游客 + */ + private long uid; + + /** + * 房间id room_id,不是短id short_id + * 可以通过将url参数id改为直播地址中的数字来查询房间真实id + * example: https://api.live.bilibili.com/room/v1/Room/room_init?id=6 + */ + private final long roomid; + + /** + * 协议版本 + * + * @see ProtoverEnum#getCode() + */ + private final int protover; + + /** + * 平台标识 + */ + private String platform = "web"; + private int type = 2; + + /** + * 必须字段 + * + * @since 2023-08-19 + */ + private final String buvid; + + /** + * 认证秘钥(必须字段) + * + * @since @since 2023-08-19 + */ + private final String key; + + @Override + public ProtoverEnum getProtoverEnum() { + return ProtoverEnum.getByCode(this.protover); + } + + @Override + public OperationEnum getOperationEnum() { + return OperationEnum.AUTH; + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/AuthReplyMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/AuthReplyMsg.java new file mode 100644 index 0000000..5bb76ea --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/AuthReplyMsg.java @@ -0,0 +1,63 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.msg; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.bilibili.constant.OperationEnum; +import tech.ordinaryroad.live.chat.client.bilibili.constant.ProtoverEnum; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.BaseBilibiliMsg; + +/** + * @author mjz + * @date 2023/1/6 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class AuthReplyMsg extends BaseBilibiliMsg { + + /** + * 0: OK,-101: TOKEN_ERROR + */ + private int code; + + @JsonIgnore + private int protover; + + @Override + public ProtoverEnum getProtoverEnum() { + return ProtoverEnum.getByCode(protover); + } + + @Override + public OperationEnum getOperationEnum() { + return OperationEnum.AUTH_REPLY; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/DanmuMsgMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/DanmuMsgMsg.java new file mode 100644 index 0000000..8bf093c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/DanmuMsgMsg.java @@ -0,0 +1,102 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.msg; + +import cn.hutool.core.codec.Base64; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.bilibili.constant.OperationEnum; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.BaseBilibiliMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IDanmuMsg; + +/** + * @author mjz + * @date 2023/9/8 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class DanmuMsgMsg extends BaseBilibiliMsg implements IDanmuMsg { + + private JsonNode info; + private String dm_v2; + + @Override + public OperationEnum getOperationEnum() { + return OperationEnum.SEND_SMS_REPLY; + } + + @Override + public String getBadgeName() { + JsonNode jsonNode3 = info.get(3); + if (jsonNode3.isEmpty()) { + return ""; + } + return jsonNode3.get(1).asText(); + } + + @Override + public byte getBadgeLevel() { + JsonNode jsonNode3 = info.get(3); + if (jsonNode3.isEmpty()) { + return 0; + } + return (byte) jsonNode3.get(0).asInt(); + } + + @Override + public String getUid() { + JsonNode jsonNode2 = info.get(2); + return jsonNode2.get(0).asText(); + } + + @Override + public String getUsername() { + JsonNode jsonNode2 = info.get(2); + return jsonNode2.get(1).asText(); + } + + @Override + public String getUserAvatar() { + String avatar = null; + try { + tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2 dmV2 = tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2.parseFrom(Base64.decode(dm_v2)); + avatar = dmV2.getDmV220().getAvatar(); + } catch (Exception e) { + // ignore + } + return avatar; + } + + @Override + public String getContent() { + JsonNode jsonNode1 = info.get(1); + return jsonNode1.asText(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/HeartbeatMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/HeartbeatMsg.java new file mode 100644 index 0000000..dff52fc --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/HeartbeatMsg.java @@ -0,0 +1,58 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.msg; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.bilibili.constant.OperationEnum; +import tech.ordinaryroad.live.chat.client.bilibili.constant.ProtoverEnum; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.BaseBilibiliMsg; + +/** + * @author mjz + * @date 2023/1/6 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class HeartbeatMsg extends BaseBilibiliMsg { + + @JsonIgnore + private int protover; + + @Override + public ProtoverEnum getProtoverEnum() { + return ProtoverEnum.getByCode(protover); + } + + @Override + public OperationEnum getOperationEnum() { + return OperationEnum.HEARTBEAT; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/HeartbeatReplyMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/HeartbeatReplyMsg.java new file mode 100644 index 0000000..535aadd --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/HeartbeatReplyMsg.java @@ -0,0 +1,60 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.msg; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.bilibili.constant.OperationEnum; +import tech.ordinaryroad.live.chat.client.bilibili.constant.ProtoverEnum; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.BaseBilibiliMsg; + +/** + * @author mjz + * @date 2023/1/6 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class HeartbeatReplyMsg extends BaseBilibiliMsg { + + private int popularity; + + @JsonIgnore + private int protover; + + @Override + public ProtoverEnum getProtoverEnum() { + return ProtoverEnum.getByCode(protover); + } + + @Override + public OperationEnum getOperationEnum() { + return OperationEnum.HEARTBEAT_REPLY; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/InteractWordMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/InteractWordMsg.java new file mode 100644 index 0000000..8ef298a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/InteractWordMsg.java @@ -0,0 +1,396 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.msg; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.bilibili.constant.OperationEnum; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.BaseBilibiliMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IEnterRoomMsg; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author mjz + * @date 2023/12/26 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class InteractWordMsg extends BaseBilibiliMsg implements IEnterRoomMsg { + + private Data data; + + @Override + public OperationEnum getOperationEnum() { + return OperationEnum.SEND_SMS_REPLY; + } + + @Override + public String getBadgeName() { + if (data == null || data.fans_medal == null) { + return null; + } + return data.fans_medal.medal_name; + } + + @Override + public byte getBadgeLevel() { + if (data == null || data.fans_medal == null) { + return 0; + } + return data.fans_medal.medal_level; + } + + @Override + public String getUid() { + if (data == null) { + return null; + } + return Long.toString(data.uid); + } + + @Override + public String getUsername() { + if (data == null) { + return null; + } + return data.uname; + } + + @Override + public String getUserAvatar() { + if (data == null || data.uinfo == null || data.uinfo.base == null) { + return null; + } + return data.uinfo.base.face; + } + + @lombok.Data + public static class Data { + + private Contribution contribution; + private Contribution_v2 contribution_v2; + private int core_user_type; + private int dmscore; + private Fans_medal fans_medal; + private String group_medal; + private List identities; + private boolean is_mystery; + private int is_spread; + private int msg_type; + private int privilege_type; + private long roomid; + private long score; + private String spread_desc; + private String spread_info; + private int tail_icon; + private String tail_text; + private long timestamp; + private long trigger_time; + private long uid; + private Uinfo uinfo; + private String uname; + private String uname_color; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Contribution { + + private int grade; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Contribution_v2 { + + private int grade; + private String rank_type; + private String text; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Fans_medal { + + private long anchor_roomid; + private int guard_level; + private int icon_id; + private int is_lighted; + private long medal_color; + private long medal_color_border; + private long medal_color_end; + private long medal_color_start; + private byte medal_level; + private String medal_name; + private long score; + private String special; + private long target_id; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Origin_info { + + private String face; + private String name; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Risk_ctrl_info { + + private String face; + private String name; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Official_info { + + private int role; + private String title; + private String desc; + private int type; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Base { + + private String face; + private boolean is_mystery; + private String name; + private int name_color; + private Origin_info origin_info; + private Risk_ctrl_info risk_ctrl_info; + private Official_info official_info; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Medal { + + private String name; + private int level; + private long color_start; + private long color_end; + private long color_border; + private long color; + private int id; + private int typ; + private int is_light; + private long ruid; + private int guard_level; + private int score; + private String guard_icon; + private String honor_icon; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Guard { + + private int level; + private String expired_str; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + + @lombok.Data + public static class Uinfo { + + private long uid; + private Base base; + private Medal medal; + private String wealth; + private String title; + private Guard guard; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/LikeInfoV3ClickMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/LikeInfoV3ClickMsg.java new file mode 100644 index 0000000..191aab2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/LikeInfoV3ClickMsg.java @@ -0,0 +1,158 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.msg; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.bilibili.constant.OperationEnum; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.BaseBilibiliMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ILikeMsg; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author mjz + * @date 2024/1/31 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class LikeInfoV3ClickMsg extends BaseBilibiliMsg implements ILikeMsg { + + private Data data; + + @Override + public OperationEnum getOperationEnum() { + return OperationEnum.SEND_SMS_REPLY; + } + + @Override + public String getBadgeName() { + if (this.data == null || this.data.getFans_medal() == null) { + return null; + } + + return this.data.getFans_medal().getMedal_name(); + } + + @Override + public byte getBadgeLevel() { + if (this.data == null || this.data.getFans_medal() == null) { + return 0; + } + + return this.data.getFans_medal().getMedal_level(); + } + + @Override + public String getUid() { + if (this.data == null) { + return null; + } + + return Long.toString(this.data.getUid()); + } + + @Override + public String getUsername() { + if (this.data == null) { + return ""; + } + + return this.data.getUname(); + } + + @Override + public String getUserAvatar() { + if (this.data == null || this.data.getUinfo() == null || this.data.getUinfo().getBase() == null) { + return ""; + } + + return this.data.getUinfo().getBase().getFace(); + } + + @lombok.Data + public static class Data { + + private int show_area; + private int msg_type; + private String like_icon; + private long uid; + private String like_text; + private String uname; + private String uname_color; + private List identities; + private InteractWordMsg.Fans_medal fans_medal; + private Contribution_info contribution_info; + private int dmscore; + private String group_medal; + private boolean is_mystery; + private InteractWordMsg.Uinfo uinfo; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Contribution_info { + + private int grade; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/SendGiftMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/SendGiftMsg.java new file mode 100644 index 0000000..8879c8c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/SendGiftMsg.java @@ -0,0 +1,351 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.msg; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.bilibili.api.BilibiliApis; +import tech.ordinaryroad.live.chat.client.bilibili.constant.OperationEnum; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.BaseBilibiliMsg; +import tech.ordinaryroad.live.chat.client.bilibili.msg.dto.MedalInfo; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IGiftMsg; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author mjz + * @date 2023/9/8 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class SendGiftMsg extends BaseBilibiliMsg implements IGiftMsg { + + private Data data; + + /** + * 额外属性,获取礼物图片时可能会用到 + */ + private long roomId; + + @Override + public String getBadgeName() { + if (data == null || data.medal_info == null) { + return IGiftMsg.super.getBadgeName(); + } + + return data.medal_info.getMedal_name(); + } + + @Override + public byte getBadgeLevel() { + if (data == null || data.medal_info == null) { + return IGiftMsg.super.getBadgeLevel(); + } + + return data.medal_info.getMedal_level(); + } + + @Override + public String getUid() { + if (this.data == null) { + return null; + } + + return Long.toString(this.data.getUid()); + } + + @Override + public String getUsername() { + if (this.data == null) { + return ""; + } + + return this.data.getUname(); + } + + @Override + public String getUserAvatar() { + if (this.data == null) { + return ""; + } + + return this.data.getFace(); + } + + @Override + public String getGiftName() { + if (this.data == null) { + return "未知礼物"; + } + + return this.data.getGiftName(); + } + + @Override + public String getGiftImg() { + return BilibiliApis.getGiftImgById(this.data.giftId, this.roomId); + } + + @Override + public String getGiftId() { + if (this.data == null) { + return null; + } + + return Long.toString(data.getGiftId()); + } + + @Override + public int getGiftCount() { + if (this.data == null) { + return 0; + } + + return data.getNum(); + } + + @Override + public int getGiftPrice() { + if (this.data == null) { + return -1; + } + + return data.getPrice(); + } + + @Override + public String getReceiveUid() { + if (this.data == null || this.data.getReceive_user_info() == null) { + return null; + } + + return Long.toString(data.getReceive_user_info().getUid()); + } + + @Override + public String getReceiveUsername() { + if (this.data == null || this.data.getReceive_user_info() == null) { + return ""; + } + + return data.getReceive_user_info().getUname(); + } + + @Override + public OperationEnum getOperationEnum() { + return OperationEnum.SEND_SMS_REPLY; + } + + @lombok.Data + public static class Data { + + private int draw; + private int gold; + private int silver; + private int num; + private int total_coin; + private int effect; + private int broadcast_id; + private int crit_prob; + private int guard_level; + private long rcost; + private long uid; + private long timestamp; + private int giftId; + private int giftType; + @JsonProperty("super") + private int _super; + private int super_gift_num; + private int super_batch_gift_num; + private int remain; + private int discount_price; + private int price; + private String beatId; + private String biz_source; + private String action; + private String coin_type; + private String uname; + private String face; + private String batch_combo_id; + private String rnd; + private String giftName; + private String original_gift_name; + private Combo_send combo_send; + private Batch_combo_send batch_combo_send; + private String tag_image; + private String top_list; + private String send_master; + private boolean is_first; + private int demarcation; + private int combo_stay_time; + private int combo_total_coin; + private String tid; + private int effect_block; + private int is_special_batch; + private int combo_resources_id; + private int magnification; + private String name_color; + private MedalInfo medal_info; + private int svga_block; + private JsonNode blind_gift; + private int float_sc_resource_id; + @JsonProperty("switch") + private boolean _switch; + private int face_effect_type; + private int face_effect_id; + private boolean is_naming; + private Receive_user_info receive_user_info; + private boolean is_join_receiver; + private Bag_gift bag_gift; + private int wealth_level; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Combo_send { + + private long uid; + private int gift_num; + private int combo_num; + private int gift_id; + private String combo_id; + private String gift_name; + private String action; + private String uname; + private String send_master; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Receive_user_info { + + private String uname; + private long uid; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Batch_combo_send { + + private long uid; + private int gift_num; + private int batch_combo_num; + private int gift_id; + private String batch_combo_id; + private String gift_name; + private String action; + private String uname; + private String send_master; + private JsonNode blind_gift; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Bag_gift { + + private int show_price; + private int price_for_show; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/SendSmsReplyMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/SendSmsReplyMsg.java new file mode 100644 index 0000000..ae2c52d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/SendSmsReplyMsg.java @@ -0,0 +1,81 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.msg; + +import com.fasterxml.jackson.databind.JsonNode; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.bilibili.constant.OperationEnum; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.BaseBilibiliCmdMsg; + +/** + * @author mjz + * @date 2023/1/6 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class SendSmsReplyMsg extends BaseBilibiliCmdMsg { + + private Long id; + + private String name; + + private JsonNode full; + + private JsonNode half; + + private JsonNode side; + + private JsonNode data; + + private JsonNode info; + + private JsonNode msg_common; + + private JsonNode msg_self; + + private JsonNode link_url; + + private JsonNode msg_type; + + private JsonNode shield_uid; + + private JsonNode business_id; + + private JsonNode scatter; + + private long roomid; + + private long real_roomid; + + @Override + public OperationEnum getOperationEnum() { + return OperationEnum.SEND_SMS_REPLY; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/SuperChatMessageMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/SuperChatMessageMsg.java new file mode 100644 index 0000000..1842b78 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/SuperChatMessageMsg.java @@ -0,0 +1,202 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package tech.ordinaryroad.live.chat.client.bilibili.msg; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.bilibili.constant.OperationEnum; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.BaseBilibiliMsg; +import tech.ordinaryroad.live.chat.client.bilibili.msg.dto.MedalInfo; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ISuperChatMsg; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author mjz + * @date 2023/9/24 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class SuperChatMessageMsg extends BaseBilibiliMsg implements ISuperChatMsg { + + private long roomid; + private Data data; + + @Override + public OperationEnum getOperationEnum() { + return OperationEnum.SEND_SMS_REPLY; + } + + @Override + public String getUid() { + if (this.data == null) { + return null; + } + + return Long.toString(this.data.uid); + } + + @Override + public String getUsername() { + if (this.data == null || this.data.getUser_info() == null) { + return ""; + } + + return this.data.user_info.uname; + } + + @Override + public String getUserAvatar() { + if (this.data == null || this.data.getUser_info() == null) { + return ""; + } + + return this.data.user_info.face; + } + + @Override + public String getContent() { + if (this.data == null) { + return ""; + } + + return this.data.message; + } + + @Override + public int getDuration() { + if (this.data == null) { + return 0; + } + + return this.data.time; + } + + @lombok.Data + public static class Data { + private String background_bottom_color; + private String background_color; + private String background_color_end; + private String background_color_start; + private String background_icon; + private String background_image; + private String background_price_color; + private double color_point; + private int dmscore; + private long end_time; + private Gift gift; + private long id; + private int is_ranked; + private int is_send_audit; + private MedalInfo medal_info; + private String message; + private String message_font_color; + private String message_trans; + private int price; + private int rate; + private long start_time; + private int time; + private String token; + private int trans_mark; + private long ts; + private long uid; + private User_info user_info; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class Gift { + private int gift_id; + private String gift_name; + private int num; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @lombok.Data + public static class User_info { + private String face; + private String face_frame; + private int guard_level; + private int is_main_vip; + private int is_svip; + private int is_vip; + private String level_color; + private int manager; + private String name_color; + private String title; + private String uname; + private int user_level; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/base/BaseBilibiliCmdMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/base/BaseBilibiliCmdMsg.java new file mode 100644 index 0000000..5dd624f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/base/BaseBilibiliCmdMsg.java @@ -0,0 +1,68 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.msg.base; + + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.bilibili.constant.BilibiliCmdEnum; +import tech.ordinaryroad.live.chat.client.bilibili.constant.ProtoverEnum; +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseCmdMsg; + +/** + * @author mjz + * @date 2023/1/6 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public abstract class BaseBilibiliCmdMsg extends BaseCmdMsg implements IBilibiliMsg { + + private int protover; + private String cmd; + + @Override + public String getCmd() { + return this.cmd; + } + + @Override + public void setCmd(String cmd) { + this.cmd = cmd; + } + + @Override + public BilibiliCmdEnum getCmdEnum() { + return BilibiliCmdEnum.getByString(getCmd()); + } + + @Override + public ProtoverEnum getProtoverEnum() { + return ProtoverEnum.getByCode(this.protover); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/base/BaseBilibiliMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/base/BaseBilibiliMsg.java new file mode 100644 index 0000000..16ca652 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/base/BaseBilibiliMsg.java @@ -0,0 +1,50 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.msg.base; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.bilibili.constant.ProtoverEnum; +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg; + +/** + * @author mjz + * @date 2023/1/6 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public abstract class BaseBilibiliMsg extends BaseMsg implements IBilibiliMsg { + + private int protover; + + @Override + public ProtoverEnum getProtoverEnum() { + return ProtoverEnum.getByCode(protover); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/base/IBilibiliMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/base/IBilibiliMsg.java new file mode 100644 index 0000000..ff12eed --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/base/IBilibiliMsg.java @@ -0,0 +1,44 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.msg.base; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import tech.ordinaryroad.live.chat.client.bilibili.constant.OperationEnum; +import tech.ordinaryroad.live.chat.client.bilibili.constant.ProtoverEnum; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; + +/** + * @author mjz + * @date 2023/8/26 + */ +public interface IBilibiliMsg extends IMsg { + + @JsonIgnore + ProtoverEnum getProtoverEnum(); + + @JsonIgnore + OperationEnum getOperationEnum(); + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/dto/MedalInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/dto/MedalInfo.java new file mode 100644 index 0000000..15cd17a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/msg/dto/MedalInfo.java @@ -0,0 +1,66 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.msg.dto; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +@Data +public class MedalInfo { + + private long target_id; + private String special; + private int icon_id; + private String anchor_uname; + private int anchor_roomid; + private byte medal_level; + private String medal_name; + private String medal_color; + private long medal_color_start; + private long medal_color_end; + private long medal_color_border; + private int is_lighted; + private int guard_level; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/AuthWebSocketFrame.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/AuthWebSocketFrame.java new file mode 100644 index 0000000..c6436e2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/AuthWebSocketFrame.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.netty.frame; + +import io.netty.buffer.ByteBuf; +import tech.ordinaryroad.live.chat.client.bilibili.netty.frame.base.BaseBilibiliWebSocketFrame; + +/** + * @author mjz + * @date 2023/1/5 + */ +public class AuthWebSocketFrame extends BaseBilibiliWebSocketFrame { + + public AuthWebSocketFrame(ByteBuf byteBuf) { + super(byteBuf); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/HeartbeatWebSocketFrame.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/HeartbeatWebSocketFrame.java new file mode 100644 index 0000000..f2abecf --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/HeartbeatWebSocketFrame.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.netty.frame; + +import io.netty.buffer.ByteBuf; +import tech.ordinaryroad.live.chat.client.bilibili.netty.frame.base.BaseBilibiliWebSocketFrame; + +/** + * @author mjz + * @date 2023/1/5 + */ +public class HeartbeatWebSocketFrame extends BaseBilibiliWebSocketFrame { + + public HeartbeatWebSocketFrame(ByteBuf byteBuf) { + super(byteBuf); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/base/BaseBilibiliWebSocketFrame.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/base/BaseBilibiliWebSocketFrame.java new file mode 100644 index 0000000..a3556f6 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/base/BaseBilibiliWebSocketFrame.java @@ -0,0 +1,54 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.netty.frame.base; + +import io.netty.buffer.ByteBuf; +import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame; +import tech.ordinaryroad.live.chat.client.bilibili.constant.OperationEnum; +import tech.ordinaryroad.live.chat.client.bilibili.constant.ProtoverEnum; + +/** + * 实现Bilibili协议的BinaryWebSocketFrame + * 数据包格式 + * + * @author mjz + * @date 2023/1/5 + */ +public abstract class BaseBilibiliWebSocketFrame extends BinaryWebSocketFrame { + + public static int sequence = 0; + + public ProtoverEnum getProtoverEnum() { + return ProtoverEnum.getByCode(super.content().getShort(6)); + } + + public OperationEnum getOperationEnum() { + return OperationEnum.getByCode(super.content().getInt(8)); + } + + public BaseBilibiliWebSocketFrame(ByteBuf byteBuf) { + super(byteBuf); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/factory/BilibiliWebSocketFrameFactory.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/factory/BilibiliWebSocketFrameFactory.java new file mode 100644 index 0000000..63e62d7 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/frame/factory/BilibiliWebSocketFrameFactory.java @@ -0,0 +1,113 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.netty.frame.factory; + +import cn.hutool.core.lang.UUID; +import cn.hutool.core.util.NumberUtil; +import com.fasterxml.jackson.databind.JsonNode; +import tech.ordinaryroad.live.chat.client.bilibili.api.BilibiliApis; +import tech.ordinaryroad.live.chat.client.bilibili.constant.ProtoverEnum; +import tech.ordinaryroad.live.chat.client.bilibili.msg.AuthMsg; +import tech.ordinaryroad.live.chat.client.bilibili.msg.HeartbeatMsg; +import tech.ordinaryroad.live.chat.client.bilibili.netty.frame.AuthWebSocketFrame; +import tech.ordinaryroad.live.chat.client.bilibili.netty.frame.HeartbeatWebSocketFrame; +import tech.ordinaryroad.live.chat.client.bilibili.util.BilibiliCodecUtil; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.util.OrLiveChatCookieUtil; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author mjz + * @date 2023/1/5 + */ +public class BilibiliWebSocketFrameFactory { + + private static final ConcurrentHashMap CACHE = new ConcurrentHashMap<>(); + + /** + * 浏览器地址中的房间id,支持短id + */ + private final long roomId; + private volatile static HeartbeatMsg heartbeatMsg; + + public BilibiliWebSocketFrameFactory(long roomId) { + this.roomId = roomId; + } + + public synchronized static BilibiliWebSocketFrameFactory getInstance(long roomId) { + return CACHE.computeIfAbsent(roomId, aLong -> new BilibiliWebSocketFrameFactory(roomId)); + } + + /** + * 创建认证包 + * + * @param protover {@link ProtoverEnum} + * @param cookie 浏览器cookie,仅用来维持登录状态 + * @return AuthWebSocketFrame + */ + public AuthWebSocketFrame createAuth(ProtoverEnum protover, String cookie) { + try { + Map cookieMap = OrLiveChatCookieUtil.parseCookieString(cookie); + String buvid3 = OrLiveChatCookieUtil.getCookieByName(cookieMap, "buvid3", () -> UUID.randomUUID().toString()); + String uid = OrLiveChatCookieUtil.getCookieByName(cookieMap, "DedeUserID", () -> "0"); + BilibiliApis.RoomInitResult data = BilibiliApis.roomInit(roomId, cookie); + JsonNode danmuInfo = BilibiliApis.getDanmuInfo(roomId, 0, cookie); + long realRoomId = data.getRoom_id(); + AuthMsg authMsg = new AuthMsg(realRoomId, protover.getCode(), buvid3, danmuInfo.get("token").asText()); + authMsg.setUid(NumberUtil.parseLong(uid)); + return new AuthWebSocketFrame(BilibiliCodecUtil.encode(authMsg)); + } catch (Exception e) { + throw new BaseException(String.format("认证包创建失败,请检查房间号是否正确。roomId: %d, msg: %s", roomId, e.getMessage())); + } + } + + public AuthWebSocketFrame createAuth(ProtoverEnum protover) { + return this.createAuth(protover, null); + } + + public HeartbeatWebSocketFrame createHeartbeat(ProtoverEnum protover) { + return new HeartbeatWebSocketFrame(BilibiliCodecUtil.encode(this.getHeartbeatMsg(protover))); + } + + /** + * 心跳包单例模式 + * + * @param protover {@link ProtoverEnum} + * @return HeartbeatWebSocketFrame + */ + public HeartbeatMsg getHeartbeatMsg(ProtoverEnum protover) { + if (heartbeatMsg == null) { + synchronized (BilibiliWebSocketFrameFactory.this) { + if (heartbeatMsg == null) { + heartbeatMsg = new HeartbeatMsg(protover.getCode()); + } + } + } + return heartbeatMsg; + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/handler/BilibiliBinaryFrameHandler.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/handler/BilibiliBinaryFrameHandler.java new file mode 100644 index 0000000..d79efd0 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/handler/BilibiliBinaryFrameHandler.java @@ -0,0 +1,153 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.netty.handler; + +import cn.hutool.core.util.StrUtil; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandler; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.bilibili.client.BilibiliLiveChatClient; +import tech.ordinaryroad.live.chat.client.bilibili.constant.BilibiliCmdEnum; +import tech.ordinaryroad.live.chat.client.bilibili.listener.IBilibiliMsgListener; +import tech.ordinaryroad.live.chat.client.bilibili.msg.*; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.BaseBilibiliMsg; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.IBilibiliMsg; +import tech.ordinaryroad.live.chat.client.bilibili.util.BilibiliCodecUtil; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.servers.netty.client.handler.BaseNettyClientBinaryFrameHandler; + +import java.util.List; + + +/** + * 消息处理器 + * + * @author mjz + * @date 2023/1/4 + */ +@Slf4j +@ChannelHandler.Sharable +public class BilibiliBinaryFrameHandler extends BaseNettyClientBinaryFrameHandler { + + public BilibiliBinaryFrameHandler(List msgListeners, BilibiliLiveChatClient client) { + super(msgListeners, client); + } + + public BilibiliBinaryFrameHandler(List msgListeners, long roomId) { + super(msgListeners, roomId); + } + + @SneakyThrows + @Override + public void onCmdMsg(BilibiliCmdEnum cmd, ICmdMsg cmdMsg) { + if (super.msgListeners.isEmpty()) { + return; + } + + SendSmsReplyMsg sendSmsReplyMsg = (SendSmsReplyMsg) cmdMsg; + switch (cmd) { + case DANMU_MSG: { + DanmuMsgMsg danmuMsgMsg = new DanmuMsgMsg(); + danmuMsgMsg.setProtover(sendSmsReplyMsg.getProtover()); + danmuMsgMsg.setInfo(sendSmsReplyMsg.getInfo()); + danmuMsgMsg.setDm_v2(StrUtil.toStringOrNull(sendSmsReplyMsg.getUnknownProperties().get("dm_v2"))); + iteratorMsgListeners(msgListener -> msgListener.onDanmuMsg(BilibiliBinaryFrameHandler.this, danmuMsgMsg)); + break; + } + + case SEND_GIFT: { + SendGiftMsg sendGiftMsg = new SendGiftMsg(); + sendGiftMsg.setRoomId(getRoomIdAsLong()); + sendGiftMsg.setProtover(sendSmsReplyMsg.getProtover()); + SendGiftMsg.Data data = BaseBilibiliMsg.OBJECT_MAPPER.treeToValue(sendSmsReplyMsg.getData(), SendGiftMsg.Data.class); + sendGiftMsg.setData(data); + iteratorMsgListeners(msgListener -> { + msgListener.onGiftMsg(BilibiliBinaryFrameHandler.this, sendGiftMsg); + msgListener.onSendGift(BilibiliBinaryFrameHandler.this, sendSmsReplyMsg); + }); + break; + } + + case SUPER_CHAT_MESSAGE: { + SuperChatMessageMsg superChatMessageMsg = new SuperChatMessageMsg(); + superChatMessageMsg.setProtover(sendSmsReplyMsg.getProtover()); + superChatMessageMsg.setRoomid(sendSmsReplyMsg.getRoomid()); + SuperChatMessageMsg.Data data = BaseBilibiliMsg.OBJECT_MAPPER.treeToValue(sendSmsReplyMsg.getData(), SuperChatMessageMsg.Data.class); + superChatMessageMsg.setData(data); + iteratorMsgListeners(msgListener -> msgListener.onSuperChatMsg(BilibiliBinaryFrameHandler.this, superChatMessageMsg)); + break; + } + + case INTERACT_WORD: { + InteractWordMsg interactWordMsg = new InteractWordMsg(); + interactWordMsg.setProtover(sendSmsReplyMsg.getProtover()); + InteractWordMsg.Data data = BaseBilibiliMsg.OBJECT_MAPPER.treeToValue(sendSmsReplyMsg.getData(), InteractWordMsg.Data.class); + interactWordMsg.setData(data); + iteratorMsgListeners(msgListener -> { + msgListener.onEnterRoomMsg(BilibiliBinaryFrameHandler.this, interactWordMsg); + msgListener.onEnterRoom(BilibiliBinaryFrameHandler.this, sendSmsReplyMsg); + }); + break; + } + + case ENTRY_EFFECT: { + iteratorMsgListeners(msgListener -> msgListener.onEntryEffect(BilibiliBinaryFrameHandler.this, sendSmsReplyMsg)); + break; + } + + case WATCHED_CHANGE: { + iteratorMsgListeners(msgListener -> msgListener.onWatchedChange(BilibiliBinaryFrameHandler.this, sendSmsReplyMsg)); + break; + } + + case LIKE_INFO_V3_CLICK: { + LikeInfoV3ClickMsg likeInfoV3ClickMsg = new LikeInfoV3ClickMsg(); + likeInfoV3ClickMsg.setProtover(sendSmsReplyMsg.getProtover()); + LikeInfoV3ClickMsg.Data data = BaseBilibiliMsg.OBJECT_MAPPER.treeToValue(sendSmsReplyMsg.getData(), LikeInfoV3ClickMsg.Data.class); + likeInfoV3ClickMsg.setData(data); + iteratorMsgListeners(msgListener -> { + msgListener.onLikeMsg(BilibiliBinaryFrameHandler.this, likeInfoV3ClickMsg); + msgListener.onClickLike(BilibiliBinaryFrameHandler.this, sendSmsReplyMsg); + }); + break; + } + + case LIKE_INFO_V3_UPDATE: { + iteratorMsgListeners(msgListener -> msgListener.onClickUpdate(BilibiliBinaryFrameHandler.this, sendSmsReplyMsg)); + break; + } + + default: { + iteratorMsgListeners(msgListener -> msgListener.onOtherCmdMsg(BilibiliBinaryFrameHandler.this, cmd, cmdMsg)); + } + } + } + + @Override + protected List decode(ByteBuf byteBuf) { + return BilibiliCodecUtil.decode(byteBuf); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/handler/BilibiliConnectionHandler.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/handler/BilibiliConnectionHandler.java new file mode 100644 index 0000000..8bd886e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/netty/handler/BilibiliConnectionHandler.java @@ -0,0 +1,154 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.netty.handler; + +import io.netty.channel.Channel; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.bilibili.client.BilibiliLiveChatClient; +import tech.ordinaryroad.live.chat.client.bilibili.config.BilibiliLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.bilibili.constant.ProtoverEnum; +import tech.ordinaryroad.live.chat.client.bilibili.netty.frame.factory.BilibiliWebSocketFrameFactory; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.servers.netty.client.handler.BaseNettyClientConnectionHandler; + + +/** + * 连接处理器 + * + * @author mjz + * @date 2023/8/21 + */ +@Slf4j +@ChannelHandler.Sharable +public class BilibiliConnectionHandler extends BaseNettyClientConnectionHandler { + + /** + * 以ClientConfig为主 + */ + private final long roomId; + /** + * 以ClientConfig为主 + */ + private final ProtoverEnum protover; + /** + * 以ClientConfig为主 + */ + private String cookie; + + public BilibiliConnectionHandler(WebSocketClientHandshaker handshaker, BilibiliLiveChatClient client, IBaseConnectionListener listener) { + super(handshaker, client, listener); + this.roomId = client.getConfig().getRoomId(); + this.protover = client.getConfig().getProtover(); + this.cookie = client.getConfig().getCookie(); + } + + public BilibiliConnectionHandler(WebSocketClientHandshaker handshaker, BilibiliLiveChatClient client) { + this(handshaker, client, null); + } + + public BilibiliConnectionHandler(WebSocketClientHandshaker handshaker, long roomId, ProtoverEnum protover, IBaseConnectionListener listener, String cookie) { + super(handshaker, listener); + this.roomId = roomId; + this.protover = protover; + this.cookie = cookie; + } + + public BilibiliConnectionHandler(WebSocketClientHandshaker handshaker, long roomId, ProtoverEnum protover, IBaseConnectionListener listener) { + this(handshaker, roomId, protover, listener, null); + } + + public BilibiliConnectionHandler(WebSocketClientHandshaker handshaker, long roomId, ProtoverEnum protover, String cookie) { + this(handshaker, roomId, protover, null, cookie); + } + + public BilibiliConnectionHandler(WebSocketClientHandshaker handshaker, long roomId, ProtoverEnum protover) { + this(handshaker, roomId, protover, null, null); + } + + @Override + protected void sendHeartbeat(ChannelHandlerContext ctx) { + if (log.isDebugEnabled()) { + log.debug("发送心跳包"); + } + ctx.writeAndFlush( + getWebSocketFrameFactory(getRoomId()).createHeartbeat(getProtover()) + ).addListener((ChannelFutureListener) future -> { + if (future.isSuccess()) { + if (log.isDebugEnabled()) { + log.debug("心跳包发送完成"); + } + } else { + log.error("心跳包发送失败", future.cause()); + } + }); + } + + private static BilibiliWebSocketFrameFactory getWebSocketFrameFactory(long roomId) { + return BilibiliWebSocketFrameFactory.getInstance(roomId); + } + + @Override + public void sendAuthRequest(Channel channel) { + // 5s内认证 + if (log.isDebugEnabled()) { + log.debug("发送认证包"); + } + channel.writeAndFlush(getWebSocketFrameFactory(getRoomId()).createAuth(getProtover(), getCookie())); + } + + public long getRoomId() { + return client != null ? client.getConfig().getRoomId() : roomId; + } + + private ProtoverEnum getProtover() { + return client != null ? client.getConfig().getProtover() : protover; + } + + private String getCookie() { + return client != null ? client.getConfig().getCookie() : cookie; + } + + @Override + protected long getHeartbeatPeriod() { + if (client == null) { + return BilibiliLiveChatClientConfig.DEFAULT_HEARTBEAT_PERIOD; + } else { + return client.getConfig().getHeartbeatPeriod(); + } + } + + @Override + protected long getHeartbeatInitialDelay() { + if (client == null) { + return BilibiliLiveChatClientConfig.DEFAULT_HEARTBEAT_INITIAL_DELAY; + } else { + return client.getConfig().getHeartbeatInitialDelay(); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/Dm_v2Proto.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/Dm_v2Proto.java new file mode 100644 index 0000000..5666f45 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/Dm_v2Proto.java @@ -0,0 +1,78 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: dm_v2.proto + +package tech.ordinaryroad.live.chat.client.bilibili.protobuf; + +public final class Dm_v2Proto { + private Dm_v2Proto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + String[] descriptorData = { + "\n\013dm_v2.proto\0224tech.ordinaryroad.live.ch" + + "at.client.bilibili.protobuf\032\016dm_v2_20.pr" + + "oto\"Y\n\005dm_v2\022P\n\010dm_v2_20\030\024 \001(\0132>.tech.or" + + "dinaryroad.live.chat.client.bilibili.pro" + + "tobuf.dm_v2_20BJ\n4tech.ordinaryroad.live" + + ".chat.client.bilibili.protobufB\nDm_v2Pro" + + "toP\001\242\002\003GPBb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + Dm_v2_20Proto.getDescriptor(), + }); + internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_descriptor, + new String[] { "DmV220", }); + Dm_v2_20Proto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/Dm_v2_20Proto.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/Dm_v2_20Proto.java new file mode 100644 index 0000000..fab53e0 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/Dm_v2_20Proto.java @@ -0,0 +1,74 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: dm_v2_20.proto + +package tech.ordinaryroad.live.chat.client.bilibili.protobuf; + +public final class Dm_v2_20Proto { + private Dm_v2_20Proto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_20_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_20_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + String[] descriptorData = { + "\n\016dm_v2_20.proto\0224tech.ordinaryroad.live" + + ".chat.client.bilibili.protobuf\"\032\n\010dm_v2_" + + "20\022\016\n\006avatar\030\004 \001(\tBM\n4tech.ordinaryroad." + + "live.chat.client.bilibili.protobufB\rDm_v" + + "2_20ProtoP\001\242\002\003GPBb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_20_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_20_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_20_descriptor, + new String[] { "Avatar", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2.java new file mode 100644 index 0000000..9729277 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2.java @@ -0,0 +1,610 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: dm_v2.proto + +package tech.ordinaryroad.live.chat.client.bilibili.protobuf; + +/** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2} + */ +public final class dm_v2 extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2) + dm_v2OrBuilder { +private static final long serialVersionUID = 0L; + // Use dm_v2.newBuilder() to construct. + private dm_v2(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private dm_v2() { + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new dm_v2(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Dm_v2Proto.internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return Dm_v2Proto.internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dm_v2.class, Builder.class); + } + + public static final int DM_V2_20_FIELD_NUMBER = 20; + private dm_v2_20 dmV220_; + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + * @return Whether the dmV220 field is set. + */ + @Override + public boolean hasDmV220() { + return dmV220_ != null; + } + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + * @return The dmV220. + */ + @Override + public dm_v2_20 getDmV220() { + return dmV220_ == null ? dm_v2_20.getDefaultInstance() : dmV220_; + } + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + */ + @Override + public dm_v2_20OrBuilder getDmV220OrBuilder() { + return dmV220_ == null ? dm_v2_20.getDefaultInstance() : dmV220_; + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (dmV220_ != null) { + output.writeMessage(20, getDmV220()); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dmV220_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(20, getDmV220()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof dm_v2)) { + return super.equals(obj); + } + dm_v2 other = (dm_v2) obj; + + if (hasDmV220() != other.hasDmV220()) return false; + if (hasDmV220()) { + if (!getDmV220() + .equals(other.getDmV220())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDmV220()) { + hash = (37 * hash) + DM_V2_20_FIELD_NUMBER; + hash = (53 * hash) + getDmV220().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static dm_v2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dm_v2 parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dm_v2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dm_v2 parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dm_v2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dm_v2 parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dm_v2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dm_v2 parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static dm_v2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static dm_v2 parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static dm_v2 parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dm_v2 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(dm_v2 prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2) + dm_v2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Dm_v2Proto.internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return Dm_v2Proto.internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dm_v2.class, Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2.newBuilder() + private Builder() { + + } + + private Builder( + BuilderParent parent) { + super(parent); + + } + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dmV220_ = null; + if (dmV220Builder_ != null) { + dmV220Builder_.dispose(); + dmV220Builder_ = null; + } + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return Dm_v2Proto.internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_descriptor; + } + + @Override + public dm_v2 getDefaultInstanceForType() { + return dm_v2.getDefaultInstance(); + } + + @Override + public dm_v2 build() { + dm_v2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public dm_v2 buildPartial() { + dm_v2 result = new dm_v2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(dm_v2 result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dmV220_ = dmV220Builder_ == null + ? dmV220_ + : dmV220Builder_.build(); + } + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof dm_v2) { + return mergeFrom((dm_v2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(dm_v2 other) { + if (other == dm_v2.getDefaultInstance()) return this; + if (other.hasDmV220()) { + mergeDmV220(other.getDmV220()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 162: { + input.readMessage( + getDmV220FieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 162 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private dm_v2_20 dmV220_; + private com.google.protobuf.SingleFieldBuilderV3< + dm_v2_20, dm_v2_20.Builder, dm_v2_20OrBuilder> dmV220Builder_; + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + * @return Whether the dmV220 field is set. + */ + public boolean hasDmV220() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + * @return The dmV220. + */ + public dm_v2_20 getDmV220() { + if (dmV220Builder_ == null) { + return dmV220_ == null ? dm_v2_20.getDefaultInstance() : dmV220_; + } else { + return dmV220Builder_.getMessage(); + } + } + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + */ + public Builder setDmV220(dm_v2_20 value) { + if (dmV220Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dmV220_ = value; + } else { + dmV220Builder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + */ + public Builder setDmV220( + dm_v2_20.Builder builderForValue) { + if (dmV220Builder_ == null) { + dmV220_ = builderForValue.build(); + } else { + dmV220Builder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + */ + public Builder mergeDmV220(dm_v2_20 value) { + if (dmV220Builder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + dmV220_ != null && + dmV220_ != dm_v2_20.getDefaultInstance()) { + getDmV220Builder().mergeFrom(value); + } else { + dmV220_ = value; + } + } else { + dmV220Builder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + */ + public Builder clearDmV220() { + bitField0_ = (bitField0_ & ~0x00000001); + dmV220_ = null; + if (dmV220Builder_ != null) { + dmV220Builder_.dispose(); + dmV220Builder_ = null; + } + onChanged(); + return this; + } + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + */ + public dm_v2_20.Builder getDmV220Builder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDmV220FieldBuilder().getBuilder(); + } + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + */ + public dm_v2_20OrBuilder getDmV220OrBuilder() { + if (dmV220Builder_ != null) { + return dmV220Builder_.getMessageOrBuilder(); + } else { + return dmV220_ == null ? + dm_v2_20.getDefaultInstance() : dmV220_; + } + } + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + */ + private com.google.protobuf.SingleFieldBuilderV3< + dm_v2_20, dm_v2_20.Builder, dm_v2_20OrBuilder> + getDmV220FieldBuilder() { + if (dmV220Builder_ == null) { + dmV220Builder_ = new com.google.protobuf.SingleFieldBuilderV3< + dm_v2_20, dm_v2_20.Builder, dm_v2_20OrBuilder>( + getDmV220(), + getParentForChildren(), + isClean()); + dmV220_ = null; + } + return dmV220Builder_; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2) + } + + // @@protoc_insertion_point(class_scope:tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2) + private static final dm_v2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new dm_v2(); + } + + public static dm_v2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public dm_v2 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public dm_v2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2OrBuilder.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2OrBuilder.java new file mode 100644 index 0000000..f219e9e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2OrBuilder.java @@ -0,0 +1,48 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: dm_v2.proto + +package tech.ordinaryroad.live.chat.client.bilibili.protobuf; + +public interface dm_v2OrBuilder extends + // @@protoc_insertion_point(interface_extends:tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2) + com.google.protobuf.MessageOrBuilder { + + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + * @return Whether the dmV220 field is set. + */ + boolean hasDmV220(); + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + * @return The dmV220. + */ + dm_v2_20 getDmV220(); + /** + * .tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20 dm_v2_20 = 20; + */ + dm_v2_20OrBuilder getDmV220OrBuilder(); +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2_20.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2_20.java new file mode 100644 index 0000000..a10e7d3 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2_20.java @@ -0,0 +1,565 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: dm_v2_20.proto + +package tech.ordinaryroad.live.chat.client.bilibili.protobuf; + +/** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20} + */ +public final class dm_v2_20 extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20) + dm_v2_20OrBuilder { +private static final long serialVersionUID = 0L; + // Use dm_v2_20.newBuilder() to construct. + private dm_v2_20(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private dm_v2_20() { + avatar_ = ""; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new dm_v2_20(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Dm_v2_20Proto.internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_20_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return Dm_v2_20Proto.internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_20_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dm_v2_20.class, Builder.class); + } + + public static final int AVATAR_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile Object avatar_ = ""; + /** + * string avatar = 4; + * @return The avatar. + */ + @Override + public String getAvatar() { + Object ref = avatar_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + avatar_ = s; + return s; + } + } + /** + * string avatar = 4; + * @return The bytes for avatar. + */ + @Override + public com.google.protobuf.ByteString + getAvatarBytes() { + Object ref = avatar_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + avatar_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(avatar_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, avatar_); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(avatar_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, avatar_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof dm_v2_20)) { + return super.equals(obj); + } + dm_v2_20 other = (dm_v2_20) obj; + + if (!getAvatar() + .equals(other.getAvatar())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + AVATAR_FIELD_NUMBER; + hash = (53 * hash) + getAvatar().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static dm_v2_20 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dm_v2_20 parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dm_v2_20 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dm_v2_20 parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dm_v2_20 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dm_v2_20 parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dm_v2_20 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dm_v2_20 parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static dm_v2_20 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static dm_v2_20 parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static dm_v2_20 parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dm_v2_20 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(dm_v2_20 prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20) + dm_v2_20OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Dm_v2_20Proto.internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_20_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return Dm_v2_20Proto.internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_20_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dm_v2_20.class, Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20.newBuilder() + private Builder() { + + } + + private Builder( + BuilderParent parent) { + super(parent); + + } + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + avatar_ = ""; + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return Dm_v2_20Proto.internal_static_tech_ordinaryroad_live_chat_client_bilibili_protobuf_dm_v2_20_descriptor; + } + + @Override + public dm_v2_20 getDefaultInstanceForType() { + return dm_v2_20.getDefaultInstance(); + } + + @Override + public dm_v2_20 build() { + dm_v2_20 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public dm_v2_20 buildPartial() { + dm_v2_20 result = new dm_v2_20(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(dm_v2_20 result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.avatar_ = avatar_; + } + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof dm_v2_20) { + return mergeFrom((dm_v2_20)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(dm_v2_20 other) { + if (other == dm_v2_20.getDefaultInstance()) return this; + if (!other.getAvatar().isEmpty()) { + avatar_ = other.avatar_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 34: { + avatar_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private Object avatar_ = ""; + /** + * string avatar = 4; + * @return The avatar. + */ + public String getAvatar() { + Object ref = avatar_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + avatar_ = s; + return s; + } else { + return (String) ref; + } + } + /** + * string avatar = 4; + * @return The bytes for avatar. + */ + public com.google.protobuf.ByteString + getAvatarBytes() { + Object ref = avatar_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + avatar_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string avatar = 4; + * @param value The avatar to set. + * @return This builder for chaining. + */ + public Builder setAvatar( + String value) { + if (value == null) { throw new NullPointerException(); } + avatar_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string avatar = 4; + * @return This builder for chaining. + */ + public Builder clearAvatar() { + avatar_ = getDefaultInstance().getAvatar(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string avatar = 4; + * @param value The bytes for avatar to set. + * @return This builder for chaining. + */ + public Builder setAvatarBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + avatar_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20) + } + + // @@protoc_insertion_point(class_scope:tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20) + private static final dm_v2_20 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new dm_v2_20(); + } + + public static dm_v2_20 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public dm_v2_20 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public dm_v2_20 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2_20OrBuilder.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2_20OrBuilder.java new file mode 100644 index 0000000..d634567 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/protobuf/dm_v2_20OrBuilder.java @@ -0,0 +1,45 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: dm_v2_20.proto + +package tech.ordinaryroad.live.chat.client.bilibili.protobuf; + +public interface dm_v2_20OrBuilder extends + // @@protoc_insertion_point(interface_extends:tech.ordinaryroad.live.chat.client.bilibili.protobuf.dm_v2_20) + com.google.protobuf.MessageOrBuilder { + + /** + * string avatar = 4; + * @return The avatar. + */ + String getAvatar(); + /** + * string avatar = 4; + * @return The bytes for avatar. + */ + com.google.protobuf.ByteString + getAvatarBytes(); +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/util/BilibiliCodecUtil.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/util/BilibiliCodecUtil.java new file mode 100644 index 0000000..9841cae --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/java/tech/ordinaryroad/live/chat/client/bilibili/util/BilibiliCodecUtil.java @@ -0,0 +1,259 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.util; + +import cn.hutool.core.util.StrUtil; +import com.aayushatharva.brotli4j.Brotli4jLoader; +import com.aayushatharva.brotli4j.decoder.BrotliInputStream; +import com.fasterxml.jackson.core.JsonProcessingException; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.bilibili.constant.OperationEnum; +import tech.ordinaryroad.live.chat.client.bilibili.constant.ProtoverEnum; +import tech.ordinaryroad.live.chat.client.bilibili.msg.AuthReplyMsg; +import tech.ordinaryroad.live.chat.client.bilibili.msg.HeartbeatMsg; +import tech.ordinaryroad.live.chat.client.bilibili.msg.HeartbeatReplyMsg; +import tech.ordinaryroad.live.chat.client.bilibili.msg.SendSmsReplyMsg; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.BaseBilibiliMsg; +import tech.ordinaryroad.live.chat.client.bilibili.msg.base.IBilibiliMsg; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.math.BigInteger; +import java.nio.charset.StandardCharsets; +import java.util.*; +import java.util.zip.DataFormatException; +import java.util.zip.Inflater; + +/** + * @author mjz + * @date 2023/1/6 + */ +@Slf4j +public class BilibiliCodecUtil { + + public static int sequence = 0; + + public static final short FRAME_HEADER_LENGTH = 16; + + public static ByteBuf encode(BaseBilibiliMsg msg) { + ByteBuf out = Unpooled.buffer(FRAME_HEADER_LENGTH); + String bodyJsonString = StrUtil.EMPTY; + // HeartbeatMsg不需要正文,如果序列化后得到`{}`,则替换为空字符串 + if (!(msg instanceof HeartbeatMsg)) { + bodyJsonString = msg.toString(); + if (StrUtil.EMPTY_JSON.equals(bodyJsonString)) { + bodyJsonString = StrUtil.EMPTY; + } + } + byte[] bodyBytes = bodyJsonString.getBytes(StandardCharsets.UTF_8); + int length = bodyBytes.length + FRAME_HEADER_LENGTH; + out.writeInt(length); + out.writeShort(FRAME_HEADER_LENGTH); + out.writeShort(msg.getProtoverEnum().getCode()); + out.writeInt(msg.getOperationEnum().getCode()); + out.writeInt(sequence++); + out.writeBytes(bodyBytes); + return out; + } + + public static List decode(ByteBuf in) { + List msgList = new ArrayList<>(); + Queue pendingByteBuf = new LinkedList<>(); + + do { + Optional msg = doDecode(in, pendingByteBuf); + msg.ifPresent(msgList::add); + in = pendingByteBuf.poll(); + } while (in != null); + + return msgList; + } + + /** + * 执行解码操作,有压缩则先解压,解压后可能得到多条消息 + * + * @param in handler收到的一条消息 + * @param pendingByteBuf 用于存放未读取完的ByteBuf + * @return Optional 何时为空值:不支持的{@link OperationEnum},不支持的{@link ProtoverEnum},{@link #parse(OperationEnum, String)}反序列化失败 + * @see OperationEnum + * @see ProtoverEnum + */ + private static Optional doDecode(ByteBuf in, Queue pendingByteBuf) { + int length = in.readInt(); + short frameHeaderLength = in.readShort(); + short protoverCode = in.readShort(); + int operationCode = in.readInt(); + int sequence = in.readInt(); + int contentLength = length - frameHeaderLength; + byte[] inputBytes = new byte[contentLength]; + in.readBytes(inputBytes); + if (in.readableBytes() != 0) { + // log.error("in.readableBytes() {}", in.readableBytes()); + pendingByteBuf.offer(in); + } + + OperationEnum operationEnum = OperationEnum.getByCode(operationCode); + if (operationEnum == null) { + throw new BaseException(String.format("未知operation: %d", operationCode)); + } + if (protoverCode == ProtoverEnum.NORMAL_ZLIB.getCode()) { + switch (operationEnum) { + case SEND_SMS_REPLY: { + // Decompress the bytes + Inflater inflater = new Inflater(); + inflater.reset(); + inflater.setInput(inputBytes); + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(contentLength); + try { + byte[] bytes = new byte[1024]; + while (!inflater.finished()) { + int count = inflater.inflate(bytes); + byteArrayOutputStream.write(bytes, 0, count); + } + } catch (DataFormatException e) { + throw new BaseException(e); + } + inflater.end(); + + return doDecode(Unpooled.wrappedBuffer(byteArrayOutputStream.toByteArray()), pendingByteBuf); + } + case HEARTBEAT_REPLY: { + BigInteger bigInteger = new BigInteger(inputBytes); + return parse(operationEnum, String.format("{\"popularity\":%d}", bigInteger)); + } + default: { + String s = new String(inputBytes, StandardCharsets.UTF_8); + return parse(operationEnum, s); + } + } + } else if (protoverCode == ProtoverEnum.NORMAL_NO_COMPRESSION.getCode()) { + switch (operationEnum) { + case HEARTBEAT_REPLY: { + BigInteger bigInteger = new BigInteger(inputBytes); + return parse(operationEnum, String.format("{\"popularity\":%d}", bigInteger)); + } + default: { + String s = new String(inputBytes, StandardCharsets.UTF_8); + return parse(operationEnum, s); + } + } + } else if (protoverCode == ProtoverEnum.HEARTBEAT_AUTH_NO_COMPRESSION.getCode()) { + switch (operationEnum) { + case HEARTBEAT_REPLY: { + BigInteger bigInteger = new BigInteger(inputBytes); + return parse(operationEnum, String.format("{\"popularity\":%d}", bigInteger)); + } + default: { + String s = new String(inputBytes, StandardCharsets.UTF_8); + return parse(operationEnum, s); + } + } + } else if (protoverCode == ProtoverEnum.NORMAL_BROTLI.getCode()) { + switch (operationEnum) { + case SEND_SMS_REPLY: { + // Load the native library + Brotli4jLoader.ensureAvailability(); + + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(inputBytes); + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(contentLength); + byte[] bytes = new byte[1024]; + BrotliInputStream brotliInputStream = null; + ByteBuf wrappedBuffer = null; + try { + brotliInputStream = new BrotliInputStream(byteArrayInputStream); + int count; + while ((count = brotliInputStream.read(bytes)) > -1) { + byteArrayOutputStream.write(bytes, 0, count); + } + wrappedBuffer = Unpooled.wrappedBuffer(byteArrayOutputStream.toByteArray()); + } catch (IOException e) { + throw new BaseException(e); + } finally { + try { + // Close the BrotliInputStream. This also closes the InputStream. + if (brotliInputStream != null) { + brotliInputStream.close(); + } + byteArrayOutputStream.close(); + } catch (IOException e) { + log.error("解压失败", e); + } + } + return doDecode(wrappedBuffer, pendingByteBuf); + } + case HEARTBEAT_REPLY: { + BigInteger bigInteger = new BigInteger(inputBytes); + return parse(operationEnum, String.format("{\"popularity\":%d}", bigInteger)); + } + default: { + String s = new String(inputBytes, StandardCharsets.UTF_8); + return parse(operationEnum, s); + } + } + } else { + if (log.isWarnEnabled()) { + log.warn("暂不支持的版本:{}", protoverCode); + } + return Optional.empty(); + } + } + + public static Optional parse(OperationEnum operation, String jsonString) { + switch (operation) { + case SEND_SMS_REPLY: { + try { + return Optional.ofNullable(BaseBilibiliMsg.OBJECT_MAPPER.readValue(jsonString, SendSmsReplyMsg.class)); + } catch (JsonProcessingException e) { + throw new BaseException(e); + } + } + case AUTH_REPLY: { + try { + return Optional.ofNullable(BaseBilibiliMsg.OBJECT_MAPPER.readValue(jsonString, AuthReplyMsg.class)); + } catch (JsonProcessingException e) { + throw new BaseException(e); + } + } + case HEARTBEAT_REPLY: { + try { + return Optional.ofNullable(BaseBilibiliMsg.OBJECT_MAPPER.readValue(jsonString, HeartbeatReplyMsg.class)); + } catch (JsonProcessingException e) { + throw new BaseException(e); + } + } + default: { + if (log.isWarnEnabled()) { + log.warn("暂不支持 {}", operation); + } + return Optional.empty(); + } + } + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/resources/proto/dm_v2.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/resources/proto/dm_v2.proto new file mode 100644 index 0000000..53bf69c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/resources/proto/dm_v2.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package tech.ordinaryroad.live.chat.client.bilibili.protobuf; + +option java_package = "tech.ordinaryroad.live.chat.client.bilibili.protobuf"; +option java_outer_classname = "Dm_v2Proto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +import "dm_v2_20.proto"; + +message dm_v2 { + dm_v2_20 dm_v2_20 = 20; +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/resources/proto/dm_v2_20.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/resources/proto/dm_v2_20.proto new file mode 100644 index 0000000..3cb8779 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/main/resources/proto/dm_v2_20.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package tech.ordinaryroad.live.chat.client.bilibili.protobuf; + +option java_package = "tech.ordinaryroad.live.chat.client.bilibili.protobuf"; +option java_outer_classname = "Dm_v2_20Proto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +message dm_v2_20 { + string avatar = 4; +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/test/java/tech/ordinaryroad/live/chat/client/bilibili/api/BilibiliApisTest.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/test/java/tech/ordinaryroad/live/chat/client/bilibili/api/BilibiliApisTest.java new file mode 100644 index 0000000..f602e36 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/test/java/tech/ordinaryroad/live/chat/client/bilibili/api/BilibiliApisTest.java @@ -0,0 +1,16 @@ +package tech.ordinaryroad.live.chat.client.bilibili.api; + +import org.junit.jupiter.api.Test; + +/** + * @author mjz + * @date 2023/9/7 + */ +class BilibiliApisTest { + + @Test + void sendMsg() { + String cookie = System.getenv("cookie"); + BilibiliApis.sendMsg("666", 545068, cookie); + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/test/java/tech/ordinaryroad/live/chat/client/bilibili/client/BilibiliLiveChatClientTest.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/test/java/tech/ordinaryroad/live/chat/client/bilibili/client/BilibiliLiveChatClientTest.java new file mode 100644 index 0000000..1d3f6ca --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-bilibili/src/test/java/tech/ordinaryroad/live/chat/client/bilibili/client/BilibiliLiveChatClientTest.java @@ -0,0 +1,176 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.bilibili.client; + +import cn.hutool.core.thread.ThreadUtil; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Test; +import tech.ordinaryroad.live.chat.client.bilibili.config.BilibiliLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.bilibili.constant.BilibiliCmdEnum; +import tech.ordinaryroad.live.chat.client.bilibili.listener.IBilibiliMsgListener; +import tech.ordinaryroad.live.chat.client.bilibili.msg.*; +import tech.ordinaryroad.live.chat.client.bilibili.netty.handler.BilibiliBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; +import tech.ordinaryroad.live.chat.client.commons.client.enums.ClientStatusEnums; + +/** + * @author mjz + * @date 2023/8/26 + */ +@Slf4j +class BilibiliLiveChatClientTest { + + static Object lock = new Object(); + BilibiliLiveChatClient client; + + @Test + void example() throws InterruptedException { + String cookie = System.getenv("cookie"); + log.error("cookie: {}", cookie); + BilibiliLiveChatClientConfig config = BilibiliLiveChatClientConfig.builder() + // TODO 浏览器Cookie + .cookie(cookie) + .roomId(7777) + .roomId(697) + .build(); + + client = new BilibiliLiveChatClient(config, new IBilibiliMsgListener() { + @Override + public void onDanmuMsg(BilibiliBinaryFrameHandler binaryFrameHandler, DanmuMsgMsg msg) { + IBilibiliMsgListener.super.onDanmuMsg(binaryFrameHandler, msg); + log.info("{} 收到弹幕 {} {}({}):{}", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), msg.getContent()); + } + + @Override + public void onGiftMsg(BilibiliBinaryFrameHandler binaryFrameHandler, SendGiftMsg msg) { + IBilibiliMsgListener.super.onGiftMsg(binaryFrameHandler, msg); + log.info("{} 收到礼物 {} {}({}) {} {}({})x{}({})", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), msg.getData().getAction(), msg.getGiftName(), msg.getGiftId(), msg.getGiftCount(), msg.getGiftPrice()); + } + + @Override + public void onSuperChatMsg(BilibiliBinaryFrameHandler binaryFrameHandler, SuperChatMessageMsg msg) { + IBilibiliMsgListener.super.onSuperChatMsg(binaryFrameHandler, msg); + log.info("{} 收到醒目留言 {}({}):{}", binaryFrameHandler.getRoomId(), msg.getUsername(), msg.getUid(), msg.getContent()); + } + + @Override + public void onEnterRoomMsg(InteractWordMsg msg) { + log.info("{} {}({}) 进入直播间", msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid()); + } + + @Override + public void onLikeMsg(BilibiliBinaryFrameHandler binaryFrameHandler, LikeInfoV3ClickMsg msg) { + IBilibiliMsgListener.super.onLikeMsg(binaryFrameHandler, msg); + log.info("{} 收到点赞 {} {}({})", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid()); + } + + @Override + public void onEntryEffect(SendSmsReplyMsg msg) { + JsonNode data = msg.getData(); + String copyWriting = data.get("copy_writing").asText(); + log.info("入场效果 {}", copyWriting); + } + + @Override + public void onWatchedChange(SendSmsReplyMsg msg) { + JsonNode data = msg.getData(); + int num = data.get("num").asInt(); + String textSmall = data.get("text_small").asText(); + String textLarge = data.get("text_large").asText(); + log.debug("观看人数变化 {} {} {}", num, textSmall, textLarge); + } + + @Override + public void onClickLike(SendSmsReplyMsg msg) { + JsonNode data = msg.getData(); + String uname = data.get("uname").asText(); + String likeText = data.get("like_text").asText(); + log.debug("为主播点赞 {} {}", uname, likeText); + } + + @Override + public void onClickUpdate(SendSmsReplyMsg msg) { + JsonNode data = msg.getData(); + int clickCount = data.get("click_count").asInt(); + log.debug("点赞数更新 {}", clickCount); + } + + @Override + public void onMsg(IMsg msg) { + log.debug("收到{}消息 {}", msg.getClass(), msg); + } + + @Override + public void onCmdMsg(BilibiliCmdEnum cmd, ICmdMsg cmdMsg) { + log.debug("收到CMD消息{} {}", cmd, cmdMsg); + } + + @Override + public void onOtherCmdMsg(BilibiliCmdEnum cmd, ICmdMsg cmdMsg) { +// log.debug("收到其他CMD消息 {}", cmd); + switch (cmd) { + case GUARD_BUY: { + // 有人上舰 + SendSmsReplyMsg sendSmsReplyMsg = (SendSmsReplyMsg) cmdMsg; + break; + } + case SUPER_CHAT_MESSAGE_DELETE: { + // 删除醒目留言 + SendSmsReplyMsg sendSmsReplyMsg = (SendSmsReplyMsg) cmdMsg; + break; + } + } + } + + @Override + public void onUnknownCmd(String cmdString, IMsg msg) { + log.debug("收到未知CMD消息 {}", cmdString); + } + }); + client.connect(); + + client.addStatusChangeListener(evt -> { + ClientStatusEnums newValue = (ClientStatusEnums) evt.getNewValue(); + if (newValue == ClientStatusEnums.CONNECTED) { + ThreadUtil.execAsync(() -> { + ThreadUtil.sleep(5000); + client.clickLike(5, () -> { + log.warn("为主播点赞成功"); + }); + }); + } + }); + + // 防止测试时直接退出 + while (true) { + synchronized (lock) { + lock.wait(); + } + } + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/pom.xml b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/pom.xml new file mode 100644 index 0000000..a3690f8 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + + org.ruoyi + live-chat-clients + ${revision} + ../pom.xml + + jar + + live-chat-client-douyin + live-chat-client-douyin + + + UTF-8 + + + + + org.ruoyi + live-chat-client-servers-netty-client + + + + com.google.protobuf + protobuf-java-util + + + + ch.qos.logback + logback-classic + + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/ClientModeExample.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/ClientModeExample.java new file mode 100644 index 0000000..c2c8678 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/ClientModeExample.java @@ -0,0 +1,81 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin; + +import cn.hutool.core.util.RandomUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; +import tech.ordinaryroad.live.chat.client.commons.client.enums.ClientStatusEnums; +import tech.ordinaryroad.live.chat.client.douyin.client.DouyinLiveChatClient; +import tech.ordinaryroad.live.chat.client.douyin.config.DouyinLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.douyin.listener.IDouyinMsgListener; +import tech.ordinaryroad.live.chat.client.douyin.msg.DouyinDanmuMsg; +import tech.ordinaryroad.live.chat.client.douyin.netty.handler.DouyinBinaryFrameHandler; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + +public class ClientModeExample { + static Logger log = LoggerFactory.getLogger(ClientModeExample.class); + + public static void main(String[] args) { + // 1. 创建配置 + DouyinLiveChatClientConfig config = DouyinLiveChatClientConfig.builder() + // TODO 浏览器Cookie + .cookie("did=web_6c4ac2a8ef8855d35df4d564baeaa8e8; kuaishou.live.bfb1s=7206d814e5c089a58c910ed8bf52ace5; clientid=3; did=web_6c4ac2a8ef8855d35df4d564baeaa8e8; client_key=65890b29; kpn=GAME_ZONE; userId=3941614875; kuaishou.live.web_st=ChRrdWFpc2hvdS5saXZlLndlYi5zdBKgAbRhgemDxM_Z_lBn7EZ_-5unvtslsh7ci5VY_eg80qqjxy5yb7oBFrdcWSPlz6jMIBz9h_yoLzATE3ngj2WawpxvbJhmq0EnRYIHv308kTBmg4KN2JQf7w2mfrsp1vusFbZ3NkfsEO4PrGQfX0L6mJRbgXeBqyz4tUM5O0q2Jte_NzWkaOnezvIGRAG8Y6yA1dxGUmiA9syTrPrdnSOzZvAaEoJNhwQ4OUDtgURWN6k9Xgm8PSIgAfV-ZvahtgaYhopZno6OuS2pkaFZjrz4ymoEZ1DSnj0oBTAB; kuaishou.live.web_ph=a287be6ab01dce264c0554eed94c2d6ac991; userId=3941614875") + // TODO 直播间id(支持短id) + .roomId("Jiazi-9931") + .build(); + + // 2. 创建Client并传入配置、添加消息回调 + DouyinLiveChatClient client = new DouyinLiveChatClient(config, new IDouyinMsgListener() { +// @Override +// public void onMsg(IMsg msg) { +// log.debug("收到{}消息 {}", msg.getClass(), msg); +// } +// @Override +// public void onUnknownCmd(String cmdString, IMsg msg) { +// log.debug("收到未知CMD消息 {}", cmdString); +// } + + @Override + public void onDanmuMsg(DouyinBinaryFrameHandler douyinBinaryFrameHandler, DouyinDanmuMsg msg) { + log.info("{} 收到弹幕 [{}] {}({}):{}", douyinBinaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), msg.getContent()); + } + + }); + // 3. 开始监听直播间 + client.connect(); + + // 客户端连接状态回调 +// client.addStatusChangeListener(evt -> { +// if (evt.getNewValue().equals(ClientStatusEnums.CONNECTED)) { +// // TODO 要发送的弹幕内容,请注意控制发送频率;框架内置支持设置发送弹幕的最少时间间隔,小于时将忽略该次发送 +// client.sendDanmu("666666" + RandomUtil.randomNumbers(1)); +// } +// }); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/api/DouyinApis.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/api/DouyinApis.java new file mode 100644 index 0000000..d361e3a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/api/DouyinApis.java @@ -0,0 +1,108 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin.api; + +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.ReUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpStatus; +import cn.hutool.http.HttpUtil; +import lombok.*; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.util.OrLiveChatCookieUtil; + +import java.util.Map; + +/** + * @author mjz + * @date 2024/1/3 + */ +@Slf4j +public class DouyinApis { + + public static final String KEY_COOKIE_TTWID = "ttwid"; + public static final String KEY_COOKIE_MS_TOKEN = "msToken"; + public static final String KEY_COOKIE_AC_NONCE = "__ac_nonce"; + public static final String MS_TOKEN_BASE_STRING = RandomUtil.BASE_CHAR_NUMBER_LOWER + "=_"; + public static final int MS_TOKEN_LENGTH = 107; + public static final int AC_NONCE_LENGTH = 21; + public static final String PATTERN_USER_UNIQUE_ID = "\\\\\"user_unique_id\\\\\":\\\\\"(\\d+)\\\\\""; + public static final String PATTERN_ROOM_ID = "\\\\\"roomId\\\\\":\\\\\"(\\d+)\\\\\""; + + public static RoomInitResult roomInit(Object roomId, String cookie) { + Map cookieMap = OrLiveChatCookieUtil.parseCookieString(cookie); + + @Cleanup + HttpResponse response1 = HttpUtil.createGet("https://live.douyin.com/").cookie(cookie).execute(); + String ttwid = OrLiveChatCookieUtil.getCookieByName(cookieMap, KEY_COOKIE_TTWID, () -> response1.getCookie(KEY_COOKIE_TTWID).getValue()); + String msToken = OrLiveChatCookieUtil.getCookieByName(cookieMap, KEY_COOKIE_MS_TOKEN, () -> RandomUtil.randomString(MS_TOKEN_BASE_STRING, MS_TOKEN_LENGTH)); + String __ac_nonce = OrLiveChatCookieUtil.getCookieByName(cookieMap, KEY_COOKIE_AC_NONCE, () -> RandomUtil.randomString(AC_NONCE_LENGTH)); + + @Cleanup + HttpResponse response2 = HttpUtil.createGet("https://live.douyin.com/" + roomId) + .cookie(StrUtil.emptyToDefault(cookie, KEY_COOKIE_TTWID + "=" + ttwid + "; " + KEY_COOKIE_MS_TOKEN + "=" + msToken + "; " + KEY_COOKIE_AC_NONCE + "=" + __ac_nonce)) + .execute(); + if (response2.getStatus() != HttpStatus.HTTP_OK) { + throw new BaseException("获取" + roomId + "真实房间ID失败"); + } + String user_unique_id = StrUtil.emptyToDefault(ReUtil.getGroup1(PATTERN_USER_UNIQUE_ID, response2.body()), RandomUtil.randomNumbers(19)); + long realRoomId; + String realRoomIdString = ReUtil.getGroup1(PATTERN_ROOM_ID, response2.body()); + try { + realRoomId = NumberUtil.parseLong(realRoomIdString); + } catch (Exception e) { + throw new BaseException("获取" + roomId + "真实房间ID失败"); + } + + + return RoomInitResult.builder() + .ttwid(ttwid) + .msToken(msToken) + .acNonce(__ac_nonce) + .realRoomId(realRoomId) + .userUniqueId(user_unique_id) + .build(); + } + + public static RoomInitResult roomInit(Object roomId) { + return roomInit(roomId, null); + } + + @Getter + @Setter + @AllArgsConstructor + @NoArgsConstructor + @Builder + public static class RoomInitResult { + private String ttwid; + private String msToken; + private String acNonce; + private long realRoomId; + private String userUniqueId; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/client/DouyinLiveChatClient.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/client/DouyinLiveChatClient.java new file mode 100644 index 0000000..47767a1 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/client/DouyinLiveChatClient.java @@ -0,0 +1,174 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin.client; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.RandomUtil; +import cn.hutool.http.GlobalHeaders; +import cn.hutool.http.Header; +import cn.hutool.http.HttpUtil; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.handler.codec.http.DefaultHttpHeaders; +import io.netty.handler.codec.http.websocketx.WebSocketClientHandshakerFactory; +import io.netty.handler.codec.http.websocketx.WebSocketVersion; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.douyin.api.DouyinApis; +import tech.ordinaryroad.live.chat.client.douyin.config.DouyinLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.douyin.constant.DouyinCmdEnum; +import tech.ordinaryroad.live.chat.client.douyin.listener.IDouyinConnectionListener; +import tech.ordinaryroad.live.chat.client.douyin.listener.IDouyinMsgListener; +import tech.ordinaryroad.live.chat.client.douyin.msg.base.IDouyinMsg; +import tech.ordinaryroad.live.chat.client.douyin.netty.handler.DouyinBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.douyin.netty.handler.DouyinConnectionHandler; +import tech.ordinaryroad.live.chat.client.servers.netty.client.base.BaseNettyClient; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + +/** + * @author mjz + * @date 2024/1/2 + */ +@Slf4j +public class DouyinLiveChatClient extends BaseNettyClient< + DouyinLiveChatClientConfig, + DouyinCmdEnum, + IDouyinMsg, + IDouyinMsgListener, + DouyinConnectionHandler, + DouyinBinaryFrameHandler> { + + private DouyinApis.RoomInitResult roomInitResult = new DouyinApis.RoomInitResult(); + + public DouyinLiveChatClient(DouyinLiveChatClientConfig config, List msgListeners, IDouyinConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(config, workerGroup, connectionListener); + addMsgListeners(msgListeners); + + // 初始化 + this.init(); + } + + public DouyinLiveChatClient(DouyinLiveChatClientConfig config, IDouyinMsgListener msgListener, IDouyinConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(config, workerGroup, connectionListener); + addMsgListener(msgListener); + + // 初始化 + this.init(); + } + + public DouyinLiveChatClient(DouyinLiveChatClientConfig config, IDouyinMsgListener msgListener, IDouyinConnectionListener connectionListener) { + this(config, msgListener, connectionListener, new NioEventLoopGroup()); + } + + public DouyinLiveChatClient(DouyinLiveChatClientConfig config, IDouyinMsgListener msgListener) { + this(config, msgListener, null, new NioEventLoopGroup()); + } + + public DouyinLiveChatClient(DouyinLiveChatClientConfig config) { + this(config, null); + } + + @Override + public void init() { + roomInitResult = DouyinApis.roomInit(getConfig().getRoomId(), getConfig().getCookie()); + super.init(); + } + + @Override + public DouyinConnectionHandler initConnectionHandler(IBaseConnectionListener clientConnectionListener) { + DefaultHttpHeaders headers = new DefaultHttpHeaders(); + headers.add(Header.COOKIE.name(), DouyinApis.KEY_COOKIE_TTWID + "=" + roomInitResult.getTtwid()); + headers.add(Header.USER_AGENT.name(), GlobalHeaders.INSTANCE.header(Header.USER_AGENT)); + return new DouyinConnectionHandler( + WebSocketClientHandshakerFactory.newHandshaker(getWebsocketUri(), WebSocketVersion.V13, null, true, headers, getConfig().getMaxFramePayloadLength()), + DouyinLiveChatClient.this, clientConnectionListener + ); + } + + @Override + public DouyinBinaryFrameHandler initBinaryFrameHandler() { + return new DouyinBinaryFrameHandler(super.msgListeners, DouyinLiveChatClient.this); + } + + @Override + protected String getWebSocketUriString() { + long realRoomId = roomInitResult.getRealRoomId(); + String userUniqueId = roomInitResult.getUserUniqueId(); + + String webSocketUriString = super.getWebSocketUriString(); + Map queryParams = new HashMap<>(); + queryParams.put("app_name", "douyin_web"); + queryParams.put("version_code", getConfig().getVersionCode()); + queryParams.put("webcast_sdk_version", getConfig().getWebcastSdkVersion()); + queryParams.put("update_version_code", getConfig().getUpdateVersionCode()); + queryParams.put("compress", "gzip"); + queryParams.put("device_platform", "web"); + queryParams.put("cookie_enabled", "true"); + queryParams.put("screen_width", "800"); + queryParams.put("screen_height", "1280"); + queryParams.put("browser_language", "zh-CN"); + queryParams.put("browser_platform", "MacIntel"); + queryParams.put("browser_name", "Mozilla"); + queryParams.put("browser_version", "5.0%20(Macintosh;%20Intel%20Mac%20OS%20X%2010_15_7)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/116.0.0.0%20Safari/537.36"); + queryParams.put("browser_online", "true"); + queryParams.put("tz_name", "Asia/Shanghai"); + queryParams.put("host", "https://live.douyin.com"); + queryParams.put("im_path", "/webcast/im/fetch/"); + queryParams.put("endpoint", "live_pc"); + queryParams.put("identity", "audience"); + + queryParams.put("support_wrds", "1"); + queryParams.put("heartbeatDuration ", "0"); + queryParams.put("live_id", "1"); + queryParams.put("did_rule", "3"); + queryParams.put("aid", "6383"); + + queryParams.put("room_id", Long.toString(realRoomId)); + queryParams.put("user_unique_id", userUniqueId); + // TODO 生成signature + queryParams.put("signature", "00000000"); + queryParams.put("cursor", "t-" + System.currentTimeMillis() + "_r-1_d-1_u-1_h-1"); + queryParams.put("internal_ext", "internal_src:dim|" + + "wss_push_room_id:" + realRoomId + "|" + + "wss_push_did:" + userUniqueId + "|" + + "dim_log_id:" + DateUtil.format(new Date(), "yyyy-MM-dd") + RandomUtil.randomNumbers(6) + RandomUtil.randomString("0123456789ABCDEF", 20) + "|" + + "first_req_ms:" + System.currentTimeMillis() + "|" + + "fetch_time:" + System.currentTimeMillis() + "|" + + "seq:1|" + + "wss_info:0-" + System.currentTimeMillis() + "-0-0|" + + "wrds_kvs:WebcastRoomStatsMessage-" + System.nanoTime() + "_WebcastRoomRankMessage-" + System.nanoTime() + "_LotteryInfoSyncData-" + System.nanoTime() + "_WebcastActivityEmojiGroupsMessage-" + System.nanoTime()); + return webSocketUriString + "?" + HttpUtil.toParams(queryParams); + } + + public void sendDanmu(Object danmu, Runnable success, Consumer failed) { + super.sendDanmu(danmu, success, failed); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/config/DouyinLiveChatClientConfig.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/config/DouyinLiveChatClientConfig.java new file mode 100644 index 0000000..6958bb0 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/config/DouyinLiveChatClientConfig.java @@ -0,0 +1,93 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin.config; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import tech.ordinaryroad.live.chat.client.servers.netty.client.config.BaseNettyClientConfig; + +/** + * @author mjz + * @date 2024/1/2 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@SuperBuilder(toBuilder = true) +public class DouyinLiveChatClientConfig extends BaseNettyClientConfig { + + @Builder.Default + private int aggregatorMaxContentLength = 64 * 1024 * 1024; + + @Builder.Default + private int maxFramePayloadLength = 64 * 1024 * 1024; + + private String versionCode = "180800"; + + private String webcastSdkVersion = "1.0.12"; + + private String updateVersionCode = "1.0.12"; + + /** + * 示例 + * wss://webcast5-ws-web-lf.douyin.com/webcast/im/push/v2/ + * ?app_name=douyin_web + * &version_code=180800 + * &webcast_sdk_version=1.0.12 + * &update_version_code=1.0.12 + * &compress=gzip + * &device_platform=web + * &cookie_enabled=true + * &screen_width=1512 + * &screen_height=982 + * &browser_language=zh-CN + * &browser_platform=MacIntel + * &browser_name=Mozilla + * &browser_version=5.0%20(Macintosh;%20Intel%20Mac%20OS%20X%2010_15_7)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/118.0.0.0%20Safari/537.36 + * &browser_online=true + * &tz_name=Asia/Shanghai + * &cursor=u-1_h-1_t-1704202376885_r-1_d-1 + * &internal_ext=internal_src:dim|wss_push_room_id:7319486720022301449|wss_push_did:7319492411867170356|dim_log_id:20240102213256AAA5B735ADBE992BEF6A|first_req_ms:1704202376757|fetch_time:1704202376885|seq:1|wss_info:0-1704202376885-0-0|wrds_kvs:WebcastActivityEmojiGroupsMessage-1704200830782138545_WebcastRoomRankMessage-1704202270876589607_WebcastRoomStatsMessage-1704202372842388781 + * &host=https://live.douyin.com + * &aid=6383 + * &live_id=1 + * &did_rule=3 + * &endpoint=live_pc + * &support_wrds=1 + * &user_unique_id=7319492411867170356 + * &im_path=/webcast/im/fetch/ + * &identity=audience + * &need_persist_msg_count=15 + * &room_id=7319486720022301449 + * &heartbeatDuration=0 + * &signature=Wk407jV1/WbnoIGk + */ + @Builder.Default + private String websocketUri = "wss://webcast5-ws-web-lf.douyin.com:443/webcast/im/push/v2/"; + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/constant/DouyinCmdEnum.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/constant/DouyinCmdEnum.java new file mode 100644 index 0000000..d7335cd --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/constant/DouyinCmdEnum.java @@ -0,0 +1,73 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin.constant; + +import cn.hutool.core.util.StrUtil; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * @author mjz + * @date 2024/1/2 + */ +@Getter +@RequiredArgsConstructor +public enum DouyinCmdEnum { + + /** + * 弹幕 + */ + WebcastChatMessage, + /** + * 礼物 + */ + WebcastGiftMessage, + /** + * 点赞 + */ + WebcastLikeMessage, + /** + * 入房 + */ + WebcastMemberMessage, + WebcastSocialMessage, + WebcastRoomUserSeqMessage, + WebcastFansclubMessage, + WebcastControlMessage, + ; + + public static DouyinCmdEnum getByName(String name) { + if (StrUtil.isBlank(name)) { + return null; + } + + for (DouyinCmdEnum value : values()) { + if (value.name().equals(name)) { + return value; + } + } + return null; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/listener/IDouyinConnectionListener.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/listener/IDouyinConnectionListener.java new file mode 100644 index 0000000..9be4cea --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/listener/IDouyinConnectionListener.java @@ -0,0 +1,35 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin.listener; + +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.douyin.netty.handler.DouyinConnectionHandler; + +/** + * @author mjz + * @date 2024/1/2 + */ +public interface IDouyinConnectionListener extends IBaseConnectionListener { +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/listener/IDouyinMsgListener.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/listener/IDouyinMsgListener.java new file mode 100644 index 0000000..8f1c86f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/listener/IDouyinMsgListener.java @@ -0,0 +1,44 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin.listener; + +import tech.ordinaryroad.live.chat.client.commons.base.listener.*; +import tech.ordinaryroad.live.chat.client.douyin.constant.DouyinCmdEnum; +import tech.ordinaryroad.live.chat.client.douyin.msg.DouyinDanmuMsg; +import tech.ordinaryroad.live.chat.client.douyin.msg.DouyinEnterRoomMsg; +import tech.ordinaryroad.live.chat.client.douyin.msg.DouyinGiftMsg; +import tech.ordinaryroad.live.chat.client.douyin.msg.DouyinLikeMsg; +import tech.ordinaryroad.live.chat.client.douyin.netty.handler.DouyinBinaryFrameHandler; + +/** + * @author mjz + * @date 2024/1/2 + */ +public interface IDouyinMsgListener extends IBaseMsgListener, + IDanmuMsgListener, + IGiftMsgListener, + IEnterRoomMsgListener, + ILikeMsgListener { +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinDanmuMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinDanmuMsg.java new file mode 100644 index 0000000..32bb530 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinDanmuMsg.java @@ -0,0 +1,77 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin.msg; + +import cn.hutool.core.collection.CollUtil; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IDanmuMsg; +import tech.ordinaryroad.live.chat.client.douyin.msg.base.IDouyinMsg; +import tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg; + +/** + * @author mjz + * @date 2024/1/9 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class DouyinDanmuMsg implements IDouyinMsg, IDanmuMsg { + + private douyin_webcast_chat_message_msg msg; + + @Override + public String getBadgeName() { + return msg.getUser().getFansClub().getData().getClubName(); + } + + @Override + public byte getBadgeLevel() { + return (byte) msg.getUser().getFansClub().getData().getLevel(); + } + + @Override + public String getUid() { + return Long.toString(msg.getUser().getId()); + } + + @Override + public String getUsername() { + return msg.getUser().getNickname(); + } + + @Override + public String getUserAvatar() { + return CollUtil.getFirst(msg.getUser().getAvatarThumb().getUrlListListList()); + } + + @Override + public String getContent() { + return msg.getContent(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinEnterRoomMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinEnterRoomMsg.java new file mode 100644 index 0000000..6c394f5 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinEnterRoomMsg.java @@ -0,0 +1,72 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin.msg; + +import cn.hutool.core.collection.CollUtil; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IEnterRoomMsg; +import tech.ordinaryroad.live.chat.client.douyin.msg.base.IDouyinMsg; +import tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg; + +/** + * @author mjz + * @date 2024/1/9 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class DouyinEnterRoomMsg implements IDouyinMsg, IEnterRoomMsg { + + private douyin_webcast_member_message_msg msg; + + @Override + public String getBadgeName() { + return msg.getUser().getFansClub().getData().getClubName(); + } + + @Override + public byte getBadgeLevel() { + return (byte) msg.getUser().getFansClub().getData().getLevel(); + } + + @Override + public String getUid() { + return Long.toString(msg.getUser().getId()); + } + + @Override + public String getUsername() { + return msg.getUser().getNickname(); + } + + @Override + public String getUserAvatar() { + return CollUtil.getFirst(msg.getUser().getAvatarThumb().getUrlListListList()); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinGiftMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinGiftMsg.java new file mode 100644 index 0000000..0bd3535 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinGiftMsg.java @@ -0,0 +1,107 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin.msg; + +import cn.hutool.core.collection.CollUtil; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IGiftMsg; +import tech.ordinaryroad.live.chat.client.douyin.msg.base.IDouyinMsg; +import tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg; + +/** + * @author mjz + * @date 2024/1/9 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class DouyinGiftMsg implements IDouyinMsg, IGiftMsg { + + private douyin_webcast_gift_message_msg msg; + + @Override + public String getBadgeName() { + return msg.getUser().getFansClub().getData().getClubName(); + } + + @Override + public byte getBadgeLevel() { + return (byte) msg.getUser().getFansClub().getData().getLevel(); + } + + @Override + public String getUid() { + return Long.toString(msg.getUser().getId()); + } + + @Override + public String getUsername() { + return msg.getUser().getNickname(); + } + + @Override + public String getUserAvatar() { + return CollUtil.getFirst(msg.getUser().getAvatarThumb().getUrlListListList()); + } + + @Override + public String getGiftName() { + return msg.getGift().getName(); + } + + @Override + public String getGiftImg() { + return CollUtil.getFirst(msg.getGift().getImage().getUrlListListList()); + } + + @Override + public String getGiftId() { + return Long.toString(msg.getLongGiftId()); + } + + @Override + public int getGiftCount() { + return (int) msg.getTotalCount(); + } + + @Override + public int getGiftPrice() { + return msg.getGift().getDiamondCount(); + } + + @Override + public String getReceiveUid() { + return Long.toString(msg.getToUser().getId()); + } + + @Override + public String getReceiveUsername() { + return msg.getToUser().getNickname(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinLikeMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinLikeMsg.java new file mode 100644 index 0000000..ce02997 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/DouyinLikeMsg.java @@ -0,0 +1,77 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin.msg; + +import cn.hutool.core.collection.CollUtil; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ILikeMsg; +import tech.ordinaryroad.live.chat.client.douyin.msg.base.IDouyinMsg; +import tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg; + +/** + * @author mjz + * @date 2024/1/31 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class DouyinLikeMsg implements IDouyinMsg, ILikeMsg { + + private douyin_webcast_like_message_msg msg; + + @Override + public String getBadgeName() { + return msg.getUser().getFansClub().getData().getClubName(); + } + + @Override + public byte getBadgeLevel() { + return (byte) msg.getUser().getFansClub().getData().getLevel(); + } + + @Override + public String getUid() { + return Long.toString(msg.getUser().getId()); + } + + @Override + public String getUsername() { + return msg.getUser().getNickname(); + } + + @Override + public String getUserAvatar() { + return CollUtil.getFirst(msg.getUser().getAvatarThumb().getUrlListListList()); + } + + @Override + public int getClickCount() { + return (int) msg.getCount(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/base/IDouyinCmdMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/base/IDouyinCmdMsg.java new file mode 100644 index 0000000..aa264a1 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/base/IDouyinCmdMsg.java @@ -0,0 +1,35 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin.msg.base; + +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.douyin.constant.DouyinCmdEnum; + +/** + * @author mjz + * @date 2024/1/2 + */ +public interface IDouyinCmdMsg extends IDouyinMsg, ICmdMsg { +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/base/IDouyinMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/base/IDouyinMsg.java new file mode 100644 index 0000000..6dc1095 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/msg/base/IDouyinMsg.java @@ -0,0 +1,34 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin.msg.base; + +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; + +/** + * @author mjz + * @date 2024/1/2 + */ +public interface IDouyinMsg extends IMsg { +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/netty/handler/DouyinBinaryFrameHandler.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/netty/handler/DouyinBinaryFrameHandler.java new file mode 100644 index 0000000..bddf8de --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/netty/handler/DouyinBinaryFrameHandler.java @@ -0,0 +1,156 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin.netty.handler; + +import cn.hutool.core.util.ZipUtil; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.douyin.client.DouyinLiveChatClient; +import tech.ordinaryroad.live.chat.client.douyin.constant.DouyinCmdEnum; +import tech.ordinaryroad.live.chat.client.douyin.listener.IDouyinMsgListener; +import tech.ordinaryroad.live.chat.client.douyin.msg.DouyinDanmuMsg; +import tech.ordinaryroad.live.chat.client.douyin.msg.DouyinEnterRoomMsg; +import tech.ordinaryroad.live.chat.client.douyin.msg.DouyinGiftMsg; +import tech.ordinaryroad.live.chat.client.douyin.msg.DouyinLikeMsg; +import tech.ordinaryroad.live.chat.client.douyin.msg.base.IDouyinMsg; +import tech.ordinaryroad.live.chat.client.douyin.protobuf.*; +import tech.ordinaryroad.live.chat.client.servers.netty.client.handler.BaseNettyClientBinaryFrameHandler; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * @author mjz + * @date 2024/1/2 + */ +@Slf4j +@ChannelHandler.Sharable +public class DouyinBinaryFrameHandler extends BaseNettyClientBinaryFrameHandler { + + private ChannelHandlerContext channelHandlerContext; + + public DouyinBinaryFrameHandler(List iDouyinMsgListeners, DouyinLiveChatClient client) { + super(iDouyinMsgListeners, client); + } + + public DouyinBinaryFrameHandler(List iDouyinMsgListeners, long roomId) { + super(iDouyinMsgListeners, roomId); + } + + @Override + public void handlerAdded(ChannelHandlerContext ctx) throws Exception { + super.handlerAdded(ctx); + channelHandlerContext = ctx; + } + + @Override + public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { + super.handlerRemoved(ctx); + channelHandlerContext = null; + } + + @Override + public void onCmdMsg(DouyinCmdEnum cmd, ICmdMsg cmdMsg) { + if (super.msgListeners.isEmpty()) { + return; + } + + ByteString payload = ((douyin_cmd_msg) cmdMsg).getPayload(); + switch (cmd) { + case WebcastChatMessage: { + try { + douyin_webcast_chat_message_msg douyinWebcastChatMessageMsg = douyin_webcast_chat_message_msg.parseFrom(payload); + iteratorMsgListeners(msgListener -> msgListener.onDanmuMsg(DouyinBinaryFrameHandler.this, new DouyinDanmuMsg(douyinWebcastChatMessageMsg))); + } catch (IOException e) { + throw new BaseException(e); + } + break; + } + case WebcastGiftMessage: { + try { + douyin_webcast_gift_message_msg douyinWebcastGiftMessageMsg = douyin_webcast_gift_message_msg.parseFrom(payload); + iteratorMsgListeners(msgListener -> msgListener.onGiftMsg(DouyinBinaryFrameHandler.this, new DouyinGiftMsg(douyinWebcastGiftMessageMsg))); + } catch (InvalidProtocolBufferException e) { + throw new BaseException(e); + } + break; + } + case WebcastMemberMessage: { + try { + douyin_webcast_member_message_msg douyinWebcastMemberMessageMsg = douyin_webcast_member_message_msg.parseFrom(payload); + iteratorMsgListeners(msgListener -> msgListener.onEnterRoomMsg(DouyinBinaryFrameHandler.this, new DouyinEnterRoomMsg(douyinWebcastMemberMessageMsg))); + } catch (InvalidProtocolBufferException e) { + throw new BaseException(e); + } + break; + } + case WebcastLikeMessage: { + try { + douyin_webcast_like_message_msg douyinWebcastLikeMessageMsg = douyin_webcast_like_message_msg.parseFrom(payload); + iteratorMsgListeners(msgListener -> msgListener.onLikeMsg(DouyinBinaryFrameHandler.this, new DouyinLikeMsg(douyinWebcastLikeMessageMsg))); + } catch (InvalidProtocolBufferException e) { + throw new BaseException(e); + } + break; + } + default: { + iteratorMsgListeners(msgListener -> msgListener.onOtherCmdMsg(DouyinBinaryFrameHandler.this, cmd, cmdMsg)); + } + } + } + + @Override + protected List decode(ByteBuf byteBuf) { + try { + douyin_websocket_frame douyinWebsocketFrame = douyin_websocket_frame.parseFrom(byteBuf.nioBuffer()); + ByteString payload = douyinWebsocketFrame.getPayload(); + byte[] bytes = ZipUtil.unGzip(payload.newInput()); + douyin_websocket_frame_msg douyinWebsocketFrameMsg = douyin_websocket_frame_msg.parseFrom(bytes); + + // 抖音不是使用心跳,而是ACK + if (douyinWebsocketFrameMsg.getNeedAck()) { + douyin_websocket_frame ack = douyin_websocket_frame.newBuilder() + .setLogId(douyinWebsocketFrame.getLogId()) + .setPayloadType("ack") + .setPayload(douyinWebsocketFrameMsg.getInternalExtBytes()) + .build(); + channelHandlerContext.writeAndFlush(new BinaryWebSocketFrame(Unpooled.wrappedBuffer(ack.toByteArray()))); + } + + return new ArrayList<>(douyinWebsocketFrameMsg.getMessagesListList()); + } catch (InvalidProtocolBufferException e) { + throw new BaseException(e); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/netty/handler/DouyinConnectionHandler.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/netty/handler/DouyinConnectionHandler.java new file mode 100644 index 0000000..1b9c6f8 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/netty/handler/DouyinConnectionHandler.java @@ -0,0 +1,117 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyin.netty.handler; + +import io.netty.channel.Channel; +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.douyin.client.DouyinLiveChatClient; +import tech.ordinaryroad.live.chat.client.douyin.config.DouyinLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.servers.netty.client.handler.BaseNettyClientConnectionHandler; + +/** + * @author mjz + * @date 2024/1/2 + */ +@Slf4j +@ChannelHandler.Sharable +public class DouyinConnectionHandler extends BaseNettyClientConnectionHandler { + + /** + * 以ClientConfig为主 + */ + private final Object roomId; + /** + * 以ClientConfig为主 + */ + private String cookie; + + public DouyinConnectionHandler(WebSocketClientHandshaker handshaker, DouyinLiveChatClient client, IBaseConnectionListener listener) { + super(handshaker, client, listener); + this.roomId = client.getConfig().getRoomId(); + this.cookie = client.getConfig().getCookie(); + } + + public DouyinConnectionHandler(WebSocketClientHandshaker handshaker, DouyinLiveChatClient client) { + this(handshaker, client, null); + } + + public DouyinConnectionHandler(WebSocketClientHandshaker handshaker, long roomId, IBaseConnectionListener listener, String cookie) { + super(handshaker, listener); + this.roomId = roomId; + this.cookie = cookie; + } + + public DouyinConnectionHandler(WebSocketClientHandshaker handshaker, long roomId, IBaseConnectionListener listener) { + this(handshaker, roomId, listener, null); + } + + public DouyinConnectionHandler(WebSocketClientHandshaker handshaker, long roomId, String cookie) { + this(handshaker, roomId, null, cookie); + } + + public DouyinConnectionHandler(WebSocketClientHandshaker handshaker, long roomId) { + this(handshaker, roomId, null, null); + } + + @Override + protected void sendHeartbeat(ChannelHandlerContext ctx) { + // ignore + } + + @Override + public void sendAuthRequest(Channel channel) { + // ignore + } + + @Override + protected long getHeartbeatPeriod() { + if (client == null) { + return DouyinLiveChatClientConfig.DEFAULT_HEARTBEAT_PERIOD; + } else { + return client.getConfig().getHeartbeatPeriod(); + } + } + + @Override + protected long getHeartbeatInitialDelay() { + if (client == null) { + return DouyinLiveChatClientConfig.DEFAULT_HEARTBEAT_INITIAL_DELAY; + } else { + return client.getConfig().getHeartbeatInitialDelay(); + } + } + + public Object getRoomId() { + return client != null ? client.getConfig().getRoomId() : roomId; + } + + private String getCookie() { + return client != null ? client.getConfig().getCookie() : cookie; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_cmd_msgProto.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_cmd_msgProto.java new file mode 100644 index 0000000..f5ed4b4 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_cmd_msgProto.java @@ -0,0 +1,78 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_cmd_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +public final class Douyin_cmd_msgProto { + private Douyin_cmd_msgProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_cmd_msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_cmd_msg_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024douyin_cmd_msg.proto\0222tech.ordinaryroa" + + "d.live.chat.client.douyin.protobuf\"\250\001\n\016d" + + "ouyin_cmd_msg\022\016\n\006method\030\001 \001(\t\022\017\n\007payload" + + "\030\002 \001(\014\022\016\n\006msg_id\030\003 \001(\003\022\020\n\010msg_type\030\004 \001(\005" + + "\022\016\n\006offset\030\005 \001(\003\022\027\n\017need_wrds_store\030\006 \001(" + + "\010\022\024\n\014wrds_version\030\007 \001(\003\022\024\n\014wrds_sub_key\030" + + "\010 \001(\tBQ\n2tech.ordinaryroad.live.chat.cli" + + "ent.douyin.protobufB\023Douyin_cmd_msgProto" + + "P\001\242\002\003GPBb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_cmd_msg_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_cmd_msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_cmd_msg_descriptor, + new java.lang.String[] { "Method", "Payload", "MsgId", "MsgType", "Offset", "NeedWrdsStore", "WrdsVersion", "WrdsSubKey", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_webcast_chat_message_msgProto.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_webcast_chat_message_msgProto.java new file mode 100644 index 0000000..4e5a46d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_webcast_chat_message_msgProto.java @@ -0,0 +1,93 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_webcast_chat_message_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +public final class Douyin_webcast_chat_message_msgProto { + private Douyin_webcast_chat_message_msgProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_chat_message_msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_chat_message_msg_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n%douyin_webcast_chat_message_msg.proto\022" + + "2tech.ordinaryroad.live.chat.client.douy" + + "in.protobuf\032\014Common.proto\032\nUser.proto\032\013I" + + "mage.proto\"\300\003\n\037douyin_webcast_chat_messa" + + "ge_msg\022\027\n\006common\030\001 \001(\0132\007.Common\022\023\n\004user\030" + + "\002 \001(\0132\005.User\022\017\n\007content\030\003 \001(\t\022\031\n\021visible" + + "_to_sender\030\004 \001(\010\022 \n\020background_image\030\005 \001" + + "(\0132\006.Image\022\036\n\026full_screen_text_color\030\006 \001" + + "(\t\022#\n\023background_image_v2\030\007 \001(\0132\006.Image\022" + + "\032\n\ngift_image\030\n \001(\0132\006.Image\022\024\n\014agree_msg" + + "_id\030\013 \001(\004\022\026\n\016priority_level\030\014 \001(\r\022\022\n\neve" + + "nt_time\030\017 \001(\004\022\023\n\013send_review\030\020 \001(\010\022\025\n\rfr" + + "om_intercom\030\021 \001(\010\022\037\n\027intercom_hide_user_" + + "card\030\022 \001(\010\022\017\n\007chat_by\030\024 \001(\t\022 \n\030individua" + + "l_chat_priority\030\025 \001(\rBb\n2tech.ordinaryro" + + "ad.live.chat.client.douyin.protobufB$Dou" + + "yin_webcast_chat_message_msgProtoP\001\242\002\003GP" + + "Bb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.getDescriptor(), + }); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_chat_message_msg_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_chat_message_msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_chat_message_msg_descriptor, + new java.lang.String[] { "Common", "User", "Content", "VisibleToSender", "BackgroundImage", "FullScreenTextColor", "BackgroundImageV2", "GiftImage", "AgreeMsgId", "PriorityLevel", "EventTime", "SendReview", "FromIntercom", "IntercomHideUserCard", "ChatBy", "IndividualChatPriority", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_webcast_gift_message_msgProto.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_webcast_gift_message_msgProto.java new file mode 100644 index 0000000..69ed4f9 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_webcast_gift_message_msgProto.java @@ -0,0 +1,112 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_webcast_gift_message_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +public final class Douyin_webcast_gift_message_msgProto { + private Douyin_webcast_gift_message_msgProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_gift_message_msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_gift_message_msg_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n%douyin_webcast_gift_message_msg.proto\022" + + "2tech.ordinaryroad.live.chat.client.douy" + + "in.protobuf\032\014Common.proto\032\nUser.proto\032\020T" + + "extEffect.proto\032\nText.proto\032\024GiftIMPrior" + + "ity.proto\032\020GiftStruct.proto\032\026PublicAreaC" + + "ommon.proto\"\277\006\n\037douyin_webcast_gift_mess" + + "age_msg\022\027\n\006common\030\001 \001(\0132\007.Common\022\024\n\014long" + + "_gift_id\030\002 \001(\004\022\030\n\020fan_ticket_count\030\003 \001(\004" + + "\022\023\n\013group_count\030\004 \001(\004\022\024\n\014repeat_count\030\005 " + + "\001(\004\022\023\n\013combo_count\030\006 \001(\004\022\023\n\004user\030\007 \001(\0132\005" + + ".User\022\026\n\007to_user\030\010 \001(\0132\005.User\022\022\n\nrepeat_" + + "end\030\t \001(\r\022 \n\013text_effect\030\n \001(\0132\013.TextEff" + + "ect\022\020\n\010group_id\030\013 \001(\004\022\030\n\020income_taskgift" + + "s\030\014 \001(\004\022\035\n\025room_fan_ticket_count\030\r \001(\004\022!" + + "\n\010priority\030\016 \001(\0132\017.GiftIMPriority\022\031\n\004gif" + + "t\030\017 \001(\0132\013.GiftStruct\022\016\n\006log_id\030\020 \001(\t\022\021\n\t" + + "send_type\030\021 \001(\004\022-\n\022public_area_common\030\022 " + + "\001(\0132\021.PublicAreaCommon\022 \n\021tray_display_t" + + "ext\030\023 \001(\0132\005.Text\022\036\n\026banned_display_effec" + + "ts\030\024 \001(\004\022\030\n\020display_for_self\030\031 \001(\010\022\032\n\022in" + + "teract_gift_info\030\032 \001(\t\022\025\n\rdiy_item_info\030" + + "\033 \001(\t\022\032\n\022min_asset_set_list\030\034 \003(\004\022\023\n\013tot" + + "al_count\030\035 \001(\004\022\032\n\022client_gift_source\030\036 \001" + + "(\r\022\030\n\020to_user_ids_list\030 \003(\004\022\022\n\nsend_tim" + + "et\030! \001(\004\022\036\n\026force_display_effectst\030\" \001(\004" + + "\022\020\n\010trace_id\030# \001(\t\022\031\n\021effect_display_ts\030" + + "$ \001(\004Bb\n2tech.ordinaryroad.live.chat.cli" + + "ent.douyin.protobufB$Douyin_webcast_gift" + + "_message_msgProtoP\001\242\002\003GPBb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.getDescriptor(), + }); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_gift_message_msg_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_gift_message_msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_gift_message_msg_descriptor, + new java.lang.String[] { "Common", "LongGiftId", "FanTicketCount", "GroupCount", "RepeatCount", "ComboCount", "User", "ToUser", "RepeatEnd", "TextEffect", "GroupId", "IncomeTaskgifts", "RoomFanTicketCount", "Priority", "Gift", "LogId", "SendType", "PublicAreaCommon", "TrayDisplayText", "BannedDisplayEffects", "DisplayForSelf", "InteractGiftInfo", "DiyItemInfo", "MinAssetSetList", "TotalCount", "ClientGiftSource", "ToUserIdsList", "SendTimet", "ForceDisplayEffectst", "TraceId", "EffectDisplayTs", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_webcast_member_message_msgProto.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_webcast_member_message_msgProto.java new file mode 100644 index 0000000..ccdb008 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_webcast_member_message_msgProto.java @@ -0,0 +1,111 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_webcast_member_message_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +public final class Douyin_webcast_member_message_msgProto { + private Douyin_webcast_member_message_msgProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_BuriedPointMapEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_BuriedPointMapEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\'douyin_webcast_member_message_msg.prot" + + "o\0222tech.ordinaryroad.live.chat.client.do" + + "uyin.protobuf\032\014Common.proto\032\nUser.proto\032" + + "\013Image.proto\032\nText.proto\"\203\005\n!douyin_webc" + + "ast_member_message_msg\022\027\n\006common\030\001 \001(\0132\007" + + ".Common\022\023\n\004user\030\002 \001(\0132\005.User\022\023\n\013memberCo" + + "unt\030\003 \001(\004\022\027\n\010operator\030\004 \001(\0132\005.User\022\024\n\014is" + + "SetToAdmin\030\005 \001(\010\022\021\n\tisTopUser\030\006 \001(\010\022\021\n\tr" + + "ankScore\030\007 \001(\003\022\021\n\ttopUserNo\030\010 \001(\003\022\021\n\tent" + + "erType\030\t \001(\003\022\016\n\006action\030\n \001(\003\022\031\n\021actionDe" + + "scription\030\013 \001(\t\022\016\n\006userId\030\014 \001(\003\022\016\n\006popSt" + + "r\030\016 \001(\t\022\037\n\017backgroundImage\030\020 \001(\0132\006.Image" + + "\022!\n\021backgroundImageV2\030\021 \001(\0132\006.Image\022 \n\021a" + + "nchorDisplayText\030\022 \001(\0132\005.Text\022\030\n\020userEnt" + + "erTipType\030\024 \001(\003\022\032\n\022anchorEnterTipType\030\025 " + + "\001(\003\022\201\001\n\016buriedPointMap\030\026 \003(\0132i.tech.ordi" + + "naryroad.live.chat.client.douyin.protobu" + + "f.douyin_webcast_member_message_msg.Buri" + + "edPointMapEntry\0325\n\023BuriedPointMapEntry\022\013" + + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001Bd\n2tech.o" + + "rdinaryroad.live.chat.client.douyin.prot" + + "obufB&Douyin_webcast_member_message_msgP" + + "rotoP\001\242\002\003GPBb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.getDescriptor(), + }); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_descriptor, + new java.lang.String[] { "Common", "User", "MemberCount", "Operator", "IsSetToAdmin", "IsTopUser", "RankScore", "TopUserNo", "EnterType", "Action", "ActionDescription", "UserId", "PopStr", "BackgroundImage", "BackgroundImageV2", "AnchorDisplayText", "UserEnterTipType", "AnchorEnterTipType", "BuriedPointMap", }); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_BuriedPointMapEntry_descriptor = + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_descriptor.getNestedTypes().get(0); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_BuriedPointMapEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_BuriedPointMapEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_websocket_frameProto.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_websocket_frameProto.java new file mode 100644 index 0000000..620d99e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/Douyin_websocket_frameProto.java @@ -0,0 +1,93 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_websocket_frame.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +public final class Douyin_websocket_frameProto { + private Douyin_websocket_frameProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_HeadersListEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_HeadersListEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\034douyin_websocket_frame.proto\0222tech.ord" + + "inaryroad.live.chat.client.douyin.protob" + + "uf\"\301\002\n\026douyin_websocket_frame\022\016\n\006seq_id\030" + + "\001 \001(\004\022\016\n\006log_id\030\002 \001(\004\022\017\n\007service\030\003 \001(\004\022\016" + + "\n\006method\030\004 \001(\004\022q\n\014headers_list\030\005 \003(\0132[.t" + + "ech.ordinaryroad.live.chat.client.douyin" + + ".protobuf.douyin_websocket_frame.Headers" + + "ListEntry\022\030\n\020payload_encoding\030\006 \001(\t\022\024\n\014p" + + "ayload_type\030\007 \001(\t\022\017\n\007payload\030\010 \001(\014\0322\n\020He" + + "adersListEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" + + "(\t:\0028\001BY\n2tech.ordinaryroad.live.chat.cl" + + "ient.douyin.protobufB\033Douyin_websocket_f" + + "rameProtoP\001\242\002\003GPBb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_descriptor, + new java.lang.String[] { "SeqId", "LogId", "Service", "Method", "HeadersList", "PayloadEncoding", "PayloadType", "Payload", }); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_HeadersListEntry_descriptor = + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_descriptor.getNestedTypes().get(0); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_HeadersListEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_HeadersListEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_cmd_msg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_cmd_msg.java new file mode 100644 index 0000000..44f8e78 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_cmd_msg.java @@ -0,0 +1,1122 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_cmd_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +import tech.ordinaryroad.live.chat.client.douyin.constant.DouyinCmdEnum; +import tech.ordinaryroad.live.chat.client.douyin.msg.base.IDouyinCmdMsg; + +/** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg} + */ +public final class douyin_cmd_msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg) + douyin_cmd_msgOrBuilder, IDouyinCmdMsg { + + @Override + public String getCmd() { + return getMethod(); + } + + @Override + public void setCmd(String cmd) { + // ignore + // method_ = cmd; + } + + @Override + public DouyinCmdEnum getCmdEnum() { + return DouyinCmdEnum.getByName(getMethod()); + } + +private static final long serialVersionUID = 0L; + // Use douyin_cmd_msg.newBuilder() to construct. + private douyin_cmd_msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private douyin_cmd_msg() { + method_ = ""; + payload_ = com.google.protobuf.ByteString.EMPTY; + wrdsSubKey_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new douyin_cmd_msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_cmd_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_cmd_msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_cmd_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_cmd_msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.Builder.class); + } + + public static final int METHOD_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object method_ = ""; + /** + * string method = 1; + * @return The method. + */ + @java.lang.Override + public java.lang.String getMethod() { + java.lang.Object ref = method_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + method_ = s; + return s; + } + } + /** + * string method = 1; + * @return The bytes for method. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAYLOAD_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes payload = 2; + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + public static final int MSG_ID_FIELD_NUMBER = 3; + private long msgId_ = 0L; + /** + * int64 msg_id = 3; + * @return The msgId. + */ + @java.lang.Override + public long getMsgId() { + return msgId_; + } + + public static final int MSG_TYPE_FIELD_NUMBER = 4; + private int msgType_ = 0; + /** + * int32 msg_type = 4; + * @return The msgType. + */ + @java.lang.Override + public int getMsgType() { + return msgType_; + } + + public static final int OFFSET_FIELD_NUMBER = 5; + private long offset_ = 0L; + /** + * int64 offset = 5; + * @return The offset. + */ + @java.lang.Override + public long getOffset() { + return offset_; + } + + public static final int NEED_WRDS_STORE_FIELD_NUMBER = 6; + private boolean needWrdsStore_ = false; + /** + * bool need_wrds_store = 6; + * @return The needWrdsStore. + */ + @java.lang.Override + public boolean getNeedWrdsStore() { + return needWrdsStore_; + } + + public static final int WRDS_VERSION_FIELD_NUMBER = 7; + private long wrdsVersion_ = 0L; + /** + * int64 wrds_version = 7; + * @return The wrdsVersion. + */ + @java.lang.Override + public long getWrdsVersion() { + return wrdsVersion_; + } + + public static final int WRDS_SUB_KEY_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private volatile java.lang.Object wrdsSubKey_ = ""; + /** + * string wrds_sub_key = 8; + * @return The wrdsSubKey. + */ + @java.lang.Override + public java.lang.String getWrdsSubKey() { + java.lang.Object ref = wrdsSubKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + wrdsSubKey_ = s; + return s; + } + } + /** + * string wrds_sub_key = 8; + * @return The bytes for wrdsSubKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getWrdsSubKeyBytes() { + java.lang.Object ref = wrdsSubKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + wrdsSubKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(method_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, method_); + } + if (!payload_.isEmpty()) { + output.writeBytes(2, payload_); + } + if (msgId_ != 0L) { + output.writeInt64(3, msgId_); + } + if (msgType_ != 0) { + output.writeInt32(4, msgType_); + } + if (offset_ != 0L) { + output.writeInt64(5, offset_); + } + if (needWrdsStore_ != false) { + output.writeBool(6, needWrdsStore_); + } + if (wrdsVersion_ != 0L) { + output.writeInt64(7, wrdsVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(wrdsSubKey_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, wrdsSubKey_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(method_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, method_); + } + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, payload_); + } + if (msgId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, msgId_); + } + if (msgType_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, msgType_); + } + if (offset_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, offset_); + } + if (needWrdsStore_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(6, needWrdsStore_); + } + if (wrdsVersion_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(7, wrdsVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(wrdsSubKey_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, wrdsSubKey_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg) obj; + + if (!getMethod() + .equals(other.getMethod())) return false; + if (!getPayload() + .equals(other.getPayload())) return false; + if (getMsgId() + != other.getMsgId()) return false; + if (getMsgType() + != other.getMsgType()) return false; + if (getOffset() + != other.getOffset()) return false; + if (getNeedWrdsStore() + != other.getNeedWrdsStore()) return false; + if (getWrdsVersion() + != other.getWrdsVersion()) return false; + if (!getWrdsSubKey() + .equals(other.getWrdsSubKey())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + METHOD_FIELD_NUMBER; + hash = (53 * hash) + getMethod().hashCode(); + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (37 * hash) + MSG_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMsgId()); + hash = (37 * hash) + MSG_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMsgType(); + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOffset()); + hash = (37 * hash) + NEED_WRDS_STORE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getNeedWrdsStore()); + hash = (37 * hash) + WRDS_VERSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getWrdsVersion()); + hash = (37 * hash) + WRDS_SUB_KEY_FIELD_NUMBER; + hash = (53 * hash) + getWrdsSubKey().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg) + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_cmd_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_cmd_msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_cmd_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_cmd_msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + method_ = ""; + payload_ = com.google.protobuf.ByteString.EMPTY; + msgId_ = 0L; + msgType_ = 0; + offset_ = 0L; + needWrdsStore_ = false; + wrdsVersion_ = 0L; + wrdsSubKey_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_cmd_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_cmd_msg_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.method_ = method_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.payload_ = payload_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.msgId_ = msgId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.msgType_ = msgType_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.offset_ = offset_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.needWrdsStore_ = needWrdsStore_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.wrdsVersion_ = wrdsVersion_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.wrdsSubKey_ = wrdsSubKey_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.getDefaultInstance()) return this; + if (!other.getMethod().isEmpty()) { + method_ = other.method_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPayload() != com.google.protobuf.ByteString.EMPTY) { + setPayload(other.getPayload()); + } + if (other.getMsgId() != 0L) { + setMsgId(other.getMsgId()); + } + if (other.getMsgType() != 0) { + setMsgType(other.getMsgType()); + } + if (other.getOffset() != 0L) { + setOffset(other.getOffset()); + } + if (other.getNeedWrdsStore() != false) { + setNeedWrdsStore(other.getNeedWrdsStore()); + } + if (other.getWrdsVersion() != 0L) { + setWrdsVersion(other.getWrdsVersion()); + } + if (!other.getWrdsSubKey().isEmpty()) { + wrdsSubKey_ = other.wrdsSubKey_; + bitField0_ |= 0x00000080; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + method_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + payload_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + msgId_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + msgType_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + offset_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + needWrdsStore_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + wrdsVersion_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 66: { + wrdsSubKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object method_ = ""; + /** + * string method = 1; + * @return The method. + */ + public java.lang.String getMethod() { + java.lang.Object ref = method_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + method_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string method = 1; + * @return The bytes for method. + */ + public com.google.protobuf.ByteString + getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string method = 1; + * @param value The method to set. + * @return This builder for chaining. + */ + public Builder setMethod( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + method_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string method = 1; + * @return This builder for chaining. + */ + public Builder clearMethod() { + method_ = getDefaultInstance().getMethod(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string method = 1; + * @param value The bytes for method to set. + * @return This builder for chaining. + */ + public Builder setMethodBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + method_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes payload = 2; + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + /** + * bytes payload = 2; + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + payload_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * bytes payload = 2; + * @return This builder for chaining. + */ + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000002); + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + + private long msgId_ ; + /** + * int64 msg_id = 3; + * @return The msgId. + */ + @java.lang.Override + public long getMsgId() { + return msgId_; + } + /** + * int64 msg_id = 3; + * @param value The msgId to set. + * @return This builder for chaining. + */ + public Builder setMsgId(long value) { + + msgId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 msg_id = 3; + * @return This builder for chaining. + */ + public Builder clearMsgId() { + bitField0_ = (bitField0_ & ~0x00000004); + msgId_ = 0L; + onChanged(); + return this; + } + + private int msgType_ ; + /** + * int32 msg_type = 4; + * @return The msgType. + */ + @java.lang.Override + public int getMsgType() { + return msgType_; + } + /** + * int32 msg_type = 4; + * @param value The msgType to set. + * @return This builder for chaining. + */ + public Builder setMsgType(int value) { + + msgType_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int32 msg_type = 4; + * @return This builder for chaining. + */ + public Builder clearMsgType() { + bitField0_ = (bitField0_ & ~0x00000008); + msgType_ = 0; + onChanged(); + return this; + } + + private long offset_ ; + /** + * int64 offset = 5; + * @return The offset. + */ + @java.lang.Override + public long getOffset() { + return offset_; + } + /** + * int64 offset = 5; + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(long value) { + + offset_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int64 offset = 5; + * @return This builder for chaining. + */ + public Builder clearOffset() { + bitField0_ = (bitField0_ & ~0x00000010); + offset_ = 0L; + onChanged(); + return this; + } + + private boolean needWrdsStore_ ; + /** + * bool need_wrds_store = 6; + * @return The needWrdsStore. + */ + @java.lang.Override + public boolean getNeedWrdsStore() { + return needWrdsStore_; + } + /** + * bool need_wrds_store = 6; + * @param value The needWrdsStore to set. + * @return This builder for chaining. + */ + public Builder setNeedWrdsStore(boolean value) { + + needWrdsStore_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * bool need_wrds_store = 6; + * @return This builder for chaining. + */ + public Builder clearNeedWrdsStore() { + bitField0_ = (bitField0_ & ~0x00000020); + needWrdsStore_ = false; + onChanged(); + return this; + } + + private long wrdsVersion_ ; + /** + * int64 wrds_version = 7; + * @return The wrdsVersion. + */ + @java.lang.Override + public long getWrdsVersion() { + return wrdsVersion_; + } + /** + * int64 wrds_version = 7; + * @param value The wrdsVersion to set. + * @return This builder for chaining. + */ + public Builder setWrdsVersion(long value) { + + wrdsVersion_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * int64 wrds_version = 7; + * @return This builder for chaining. + */ + public Builder clearWrdsVersion() { + bitField0_ = (bitField0_ & ~0x00000040); + wrdsVersion_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object wrdsSubKey_ = ""; + /** + * string wrds_sub_key = 8; + * @return The wrdsSubKey. + */ + public java.lang.String getWrdsSubKey() { + java.lang.Object ref = wrdsSubKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + wrdsSubKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string wrds_sub_key = 8; + * @return The bytes for wrdsSubKey. + */ + public com.google.protobuf.ByteString + getWrdsSubKeyBytes() { + java.lang.Object ref = wrdsSubKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + wrdsSubKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string wrds_sub_key = 8; + * @param value The wrdsSubKey to set. + * @return This builder for chaining. + */ + public Builder setWrdsSubKey( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + wrdsSubKey_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * string wrds_sub_key = 8; + * @return This builder for chaining. + */ + public Builder clearWrdsSubKey() { + wrdsSubKey_ = getDefaultInstance().getWrdsSubKey(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * string wrds_sub_key = 8; + * @param value The bytes for wrdsSubKey to set. + * @return This builder for chaining. + */ + public Builder setWrdsSubKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + wrdsSubKey_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg) + } + + // @@protoc_insertion_point(class_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public douyin_cmd_msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_cmd_msgOrBuilder.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_cmd_msgOrBuilder.java new file mode 100644 index 0000000..ed0175d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_cmd_msgOrBuilder.java @@ -0,0 +1,93 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_cmd_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +public interface douyin_cmd_msgOrBuilder extends + // @@protoc_insertion_point(interface_extends:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg) + com.google.protobuf.MessageOrBuilder { + + /** + * string method = 1; + * @return The method. + */ + java.lang.String getMethod(); + /** + * string method = 1; + * @return The bytes for method. + */ + com.google.protobuf.ByteString + getMethodBytes(); + + /** + * bytes payload = 2; + * @return The payload. + */ + com.google.protobuf.ByteString getPayload(); + + /** + * int64 msg_id = 3; + * @return The msgId. + */ + long getMsgId(); + + /** + * int32 msg_type = 4; + * @return The msgType. + */ + int getMsgType(); + + /** + * int64 offset = 5; + * @return The offset. + */ + long getOffset(); + + /** + * bool need_wrds_store = 6; + * @return The needWrdsStore. + */ + boolean getNeedWrdsStore(); + + /** + * int64 wrds_version = 7; + * @return The wrdsVersion. + */ + long getWrdsVersion(); + + /** + * string wrds_sub_key = 8; + * @return The wrdsSubKey. + */ + java.lang.String getWrdsSubKey(); + /** + * string wrds_sub_key = 8; + * @return The bytes for wrdsSubKey. + */ + com.google.protobuf.ByteString + getWrdsSubKeyBytes(); +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_chat_message_msg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_chat_message_msg.java new file mode 100644 index 0000000..ae1a4d4 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_chat_message_msg.java @@ -0,0 +1,2384 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_webcast_chat_message_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +/** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg} + */ +public final class douyin_webcast_chat_message_msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg) + douyin_webcast_chat_message_msgOrBuilder { + private static final long serialVersionUID = 0L; + // Use douyin_webcast_chat_message_msg.newBuilder() to construct. + private douyin_webcast_chat_message_msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private douyin_webcast_chat_message_msg() { + content_ = ""; + fullScreenTextColor_ = ""; + chatBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new douyin_webcast_chat_message_msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_chat_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_chat_message_msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_chat_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_chat_message_msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg.Builder.class); + } + + public static final int COMMON_FIELD_NUMBER = 1; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common common_; + /** + * .Common common = 1; + * @return Whether the common field is set. + */ + @java.lang.Override + public boolean hasCommon() { + return common_ != null; + } + /** + * .Common common = 1; + * @return The common. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getCommon() { + return common_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } + /** + * .Common common = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder() { + return common_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } + + public static final int USER_FIELD_NUMBER = 2; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User user_; + /** + * .User user = 2; + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * .User user = 2; + * @return The user. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser() { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + /** + * .User user = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder() { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + + public static final int CONTENT_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + /** + * string content = 3; + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 3; + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VISIBLE_TO_SENDER_FIELD_NUMBER = 4; + private boolean visibleToSender_ = false; + /** + * bool visible_to_sender = 4; + * @return The visibleToSender. + */ + @java.lang.Override + public boolean getVisibleToSender() { + return visibleToSender_; + } + + public static final int BACKGROUND_IMAGE_FIELD_NUMBER = 5; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image backgroundImage_; + /** + * .Image background_image = 5; + * @return Whether the backgroundImage field is set. + */ + @java.lang.Override + public boolean hasBackgroundImage() { + return backgroundImage_ != null; + } + /** + * .Image background_image = 5; + * @return The backgroundImage. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundImage() { + return backgroundImage_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImage_; + } + /** + * .Image background_image = 5; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundImageOrBuilder() { + return backgroundImage_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImage_; + } + + public static final int FULL_SCREEN_TEXT_COLOR_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object fullScreenTextColor_ = ""; + /** + * string full_screen_text_color = 6; + * @return The fullScreenTextColor. + */ + @java.lang.Override + public java.lang.String getFullScreenTextColor() { + java.lang.Object ref = fullScreenTextColor_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fullScreenTextColor_ = s; + return s; + } + } + /** + * string full_screen_text_color = 6; + * @return The bytes for fullScreenTextColor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFullScreenTextColorBytes() { + java.lang.Object ref = fullScreenTextColor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fullScreenTextColor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKGROUND_IMAGE_V2_FIELD_NUMBER = 7; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image backgroundImageV2_; + /** + * .Image background_image_v2 = 7; + * @return Whether the backgroundImageV2 field is set. + */ + @java.lang.Override + public boolean hasBackgroundImageV2() { + return backgroundImageV2_ != null; + } + /** + * .Image background_image_v2 = 7; + * @return The backgroundImageV2. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundImageV2() { + return backgroundImageV2_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImageV2_; + } + /** + * .Image background_image_v2 = 7; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundImageV2OrBuilder() { + return backgroundImageV2_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImageV2_; + } + + public static final int GIFT_IMAGE_FIELD_NUMBER = 10; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image giftImage_; + /** + *
+   * PublicAreaCommon public_area_common = 9;
+   * 
+ * + * .Image gift_image = 10; + * @return Whether the giftImage field is set. + */ + @java.lang.Override + public boolean hasGiftImage() { + return giftImage_ != null; + } + /** + *
+   * PublicAreaCommon public_area_common = 9;
+   * 
+ * + * .Image gift_image = 10; + * @return The giftImage. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getGiftImage() { + return giftImage_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : giftImage_; + } + /** + *
+   * PublicAreaCommon public_area_common = 9;
+   * 
+ * + * .Image gift_image = 10; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getGiftImageOrBuilder() { + return giftImage_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : giftImage_; + } + + public static final int AGREE_MSG_ID_FIELD_NUMBER = 11; + private long agreeMsgId_ = 0L; + /** + * uint64 agree_msg_id = 11; + * @return The agreeMsgId. + */ + @java.lang.Override + public long getAgreeMsgId() { + return agreeMsgId_; + } + + public static final int PRIORITY_LEVEL_FIELD_NUMBER = 12; + private int priorityLevel_ = 0; + /** + * uint32 priority_level = 12; + * @return The priorityLevel. + */ + @java.lang.Override + public int getPriorityLevel() { + return priorityLevel_; + } + + public static final int EVENT_TIME_FIELD_NUMBER = 15; + private long eventTime_ = 0L; + /** + *
+   * LandscapeAreaCommon landscape_area_common = 13;
+   * 
+ * + * uint64 event_time = 15; + * @return The eventTime. + */ + @java.lang.Override + public long getEventTime() { + return eventTime_; + } + + public static final int SEND_REVIEW_FIELD_NUMBER = 16; + private boolean sendReview_ = false; + /** + * bool send_review = 16; + * @return The sendReview. + */ + @java.lang.Override + public boolean getSendReview() { + return sendReview_; + } + + public static final int FROM_INTERCOM_FIELD_NUMBER = 17; + private boolean fromIntercom_ = false; + /** + * bool from_intercom = 17; + * @return The fromIntercom. + */ + @java.lang.Override + public boolean getFromIntercom() { + return fromIntercom_; + } + + public static final int INTERCOM_HIDE_USER_CARD_FIELD_NUMBER = 18; + private boolean intercomHideUserCard_ = false; + /** + * bool intercom_hide_user_card = 18; + * @return The intercomHideUserCard. + */ + @java.lang.Override + public boolean getIntercomHideUserCard() { + return intercomHideUserCard_; + } + + public static final int CHAT_BY_FIELD_NUMBER = 20; + @SuppressWarnings("serial") + private volatile java.lang.Object chatBy_ = ""; + /** + *
+   * repeated string chatTagsList = 19;
+   * 
+ * + * string chat_by = 20; + * @return The chatBy. + */ + @java.lang.Override + public java.lang.String getChatBy() { + java.lang.Object ref = chatBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + chatBy_ = s; + return s; + } + } + /** + *
+   * repeated string chatTagsList = 19;
+   * 
+ * + * string chat_by = 20; + * @return The bytes for chatBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getChatByBytes() { + java.lang.Object ref = chatBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + chatBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDIVIDUAL_CHAT_PRIORITY_FIELD_NUMBER = 21; + private int individualChatPriority_ = 0; + /** + *
+   * Text rtf_content = 22 ;
+   * 
+ * + * uint32 individual_chat_priority = 21; + * @return The individualChatPriority. + */ + @java.lang.Override + public int getIndividualChatPriority() { + return individualChatPriority_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (common_ != null) { + output.writeMessage(1, getCommon()); + } + if (user_ != null) { + output.writeMessage(2, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (visibleToSender_ != false) { + output.writeBool(4, visibleToSender_); + } + if (backgroundImage_ != null) { + output.writeMessage(5, getBackgroundImage()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fullScreenTextColor_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, fullScreenTextColor_); + } + if (backgroundImageV2_ != null) { + output.writeMessage(7, getBackgroundImageV2()); + } + if (giftImage_ != null) { + output.writeMessage(10, getGiftImage()); + } + if (agreeMsgId_ != 0L) { + output.writeUInt64(11, agreeMsgId_); + } + if (priorityLevel_ != 0) { + output.writeUInt32(12, priorityLevel_); + } + if (eventTime_ != 0L) { + output.writeUInt64(15, eventTime_); + } + if (sendReview_ != false) { + output.writeBool(16, sendReview_); + } + if (fromIntercom_ != false) { + output.writeBool(17, fromIntercom_); + } + if (intercomHideUserCard_ != false) { + output.writeBool(18, intercomHideUserCard_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(chatBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 20, chatBy_); + } + if (individualChatPriority_ != 0) { + output.writeUInt32(21, individualChatPriority_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (common_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getCommon()); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (visibleToSender_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, visibleToSender_); + } + if (backgroundImage_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getBackgroundImage()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fullScreenTextColor_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, fullScreenTextColor_); + } + if (backgroundImageV2_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getBackgroundImageV2()); + } + if (giftImage_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, getGiftImage()); + } + if (agreeMsgId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(11, agreeMsgId_); + } + if (priorityLevel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(12, priorityLevel_); + } + if (eventTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(15, eventTime_); + } + if (sendReview_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(16, sendReview_); + } + if (fromIntercom_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(17, fromIntercom_); + } + if (intercomHideUserCard_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(18, intercomHideUserCard_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(chatBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(20, chatBy_); + } + if (individualChatPriority_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(21, individualChatPriority_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg) obj; + + if (hasCommon() != other.hasCommon()) return false; + if (hasCommon()) { + if (!getCommon() + .equals(other.getCommon())) return false; + } + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser() + .equals(other.getUser())) return false; + } + if (!getContent() + .equals(other.getContent())) return false; + if (getVisibleToSender() + != other.getVisibleToSender()) return false; + if (hasBackgroundImage() != other.hasBackgroundImage()) return false; + if (hasBackgroundImage()) { + if (!getBackgroundImage() + .equals(other.getBackgroundImage())) return false; + } + if (!getFullScreenTextColor() + .equals(other.getFullScreenTextColor())) return false; + if (hasBackgroundImageV2() != other.hasBackgroundImageV2()) return false; + if (hasBackgroundImageV2()) { + if (!getBackgroundImageV2() + .equals(other.getBackgroundImageV2())) return false; + } + if (hasGiftImage() != other.hasGiftImage()) return false; + if (hasGiftImage()) { + if (!getGiftImage() + .equals(other.getGiftImage())) return false; + } + if (getAgreeMsgId() + != other.getAgreeMsgId()) return false; + if (getPriorityLevel() + != other.getPriorityLevel()) return false; + if (getEventTime() + != other.getEventTime()) return false; + if (getSendReview() + != other.getSendReview()) return false; + if (getFromIntercom() + != other.getFromIntercom()) return false; + if (getIntercomHideUserCard() + != other.getIntercomHideUserCard()) return false; + if (!getChatBy() + .equals(other.getChatBy())) return false; + if (getIndividualChatPriority() + != other.getIndividualChatPriority()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCommon()) { + hash = (37 * hash) + COMMON_FIELD_NUMBER; + hash = (53 * hash) + getCommon().hashCode(); + } + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + VISIBLE_TO_SENDER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getVisibleToSender()); + if (hasBackgroundImage()) { + hash = (37 * hash) + BACKGROUND_IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getBackgroundImage().hashCode(); + } + hash = (37 * hash) + FULL_SCREEN_TEXT_COLOR_FIELD_NUMBER; + hash = (53 * hash) + getFullScreenTextColor().hashCode(); + if (hasBackgroundImageV2()) { + hash = (37 * hash) + BACKGROUND_IMAGE_V2_FIELD_NUMBER; + hash = (53 * hash) + getBackgroundImageV2().hashCode(); + } + if (hasGiftImage()) { + hash = (37 * hash) + GIFT_IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getGiftImage().hashCode(); + } + hash = (37 * hash) + AGREE_MSG_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAgreeMsgId()); + hash = (37 * hash) + PRIORITY_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getPriorityLevel(); + hash = (37 * hash) + EVENT_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getEventTime()); + hash = (37 * hash) + SEND_REVIEW_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSendReview()); + hash = (37 * hash) + FROM_INTERCOM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFromIntercom()); + hash = (37 * hash) + INTERCOM_HIDE_USER_CARD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIntercomHideUserCard()); + hash = (37 * hash) + CHAT_BY_FIELD_NUMBER; + hash = (53 * hash) + getChatBy().hashCode(); + hash = (37 * hash) + INDIVIDUAL_CHAT_PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getIndividualChatPriority(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg) + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_chat_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_chat_message_msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_chat_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_chat_message_msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); + commonBuilder_ = null; + } + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + content_ = ""; + visibleToSender_ = false; + backgroundImage_ = null; + if (backgroundImageBuilder_ != null) { + backgroundImageBuilder_.dispose(); + backgroundImageBuilder_ = null; + } + fullScreenTextColor_ = ""; + backgroundImageV2_ = null; + if (backgroundImageV2Builder_ != null) { + backgroundImageV2Builder_.dispose(); + backgroundImageV2Builder_ = null; + } + giftImage_ = null; + if (giftImageBuilder_ != null) { + giftImageBuilder_.dispose(); + giftImageBuilder_ = null; + } + agreeMsgId_ = 0L; + priorityLevel_ = 0; + eventTime_ = 0L; + sendReview_ = false; + fromIntercom_ = false; + intercomHideUserCard_ = false; + chatBy_ = ""; + individualChatPriority_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_chat_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_chat_message_msg_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.common_ = commonBuilder_ == null + ? common_ + : commonBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.user_ = userBuilder_ == null + ? user_ + : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.content_ = content_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.visibleToSender_ = visibleToSender_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.backgroundImage_ = backgroundImageBuilder_ == null + ? backgroundImage_ + : backgroundImageBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.fullScreenTextColor_ = fullScreenTextColor_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.backgroundImageV2_ = backgroundImageV2Builder_ == null + ? backgroundImageV2_ + : backgroundImageV2Builder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.giftImage_ = giftImageBuilder_ == null + ? giftImage_ + : giftImageBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.agreeMsgId_ = agreeMsgId_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.priorityLevel_ = priorityLevel_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.eventTime_ = eventTime_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.sendReview_ = sendReview_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.fromIntercom_ = fromIntercom_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.intercomHideUserCard_ = intercomHideUserCard_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.chatBy_ = chatBy_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.individualChatPriority_ = individualChatPriority_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg.getDefaultInstance()) return this; + if (other.hasCommon()) { + mergeCommon(other.getCommon()); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getVisibleToSender() != false) { + setVisibleToSender(other.getVisibleToSender()); + } + if (other.hasBackgroundImage()) { + mergeBackgroundImage(other.getBackgroundImage()); + } + if (!other.getFullScreenTextColor().isEmpty()) { + fullScreenTextColor_ = other.fullScreenTextColor_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasBackgroundImageV2()) { + mergeBackgroundImageV2(other.getBackgroundImageV2()); + } + if (other.hasGiftImage()) { + mergeGiftImage(other.getGiftImage()); + } + if (other.getAgreeMsgId() != 0L) { + setAgreeMsgId(other.getAgreeMsgId()); + } + if (other.getPriorityLevel() != 0) { + setPriorityLevel(other.getPriorityLevel()); + } + if (other.getEventTime() != 0L) { + setEventTime(other.getEventTime()); + } + if (other.getSendReview() != false) { + setSendReview(other.getSendReview()); + } + if (other.getFromIntercom() != false) { + setFromIntercom(other.getFromIntercom()); + } + if (other.getIntercomHideUserCard() != false) { + setIntercomHideUserCard(other.getIntercomHideUserCard()); + } + if (!other.getChatBy().isEmpty()) { + chatBy_ = other.chatBy_; + bitField0_ |= 0x00004000; + onChanged(); + } + if (other.getIndividualChatPriority() != 0) { + setIndividualChatPriority(other.getIndividualChatPriority()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getCommonFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getUserFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + visibleToSender_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + input.readMessage( + getBackgroundImageFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + fullScreenTextColor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + input.readMessage( + getBackgroundImageV2FieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 82: { + input.readMessage( + getGiftImageFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 82 + case 88: { + agreeMsgId_ = input.readUInt64(); + bitField0_ |= 0x00000100; + break; + } // case 88 + case 96: { + priorityLevel_ = input.readUInt32(); + bitField0_ |= 0x00000200; + break; + } // case 96 + case 120: { + eventTime_ = input.readUInt64(); + bitField0_ |= 0x00000400; + break; + } // case 120 + case 128: { + sendReview_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 128 + case 136: { + fromIntercom_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 136 + case 144: { + intercomHideUserCard_ = input.readBool(); + bitField0_ |= 0x00002000; + break; + } // case 144 + case 162: { + chatBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 162 + case 168: { + individualChatPriority_ = input.readUInt32(); + bitField0_ |= 0x00008000; + break; + } // case 168 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common common_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder> commonBuilder_; + /** + * .Common common = 1; + * @return Whether the common field is set. + */ + public boolean hasCommon() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .Common common = 1; + * @return The common. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getCommon() { + if (commonBuilder_ == null) { + return common_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } else { + return commonBuilder_.getMessage(); + } + } + /** + * .Common common = 1; + */ + public Builder setCommon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common value) { + if (commonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + common_ = value; + } else { + commonBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public Builder setCommon( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder builderForValue) { + if (commonBuilder_ == null) { + common_ = builderForValue.build(); + } else { + commonBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public Builder mergeCommon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common value) { + if (commonBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + common_ != null && + common_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance()) { + getCommonBuilder().mergeFrom(value); + } else { + common_ = value; + } + } else { + commonBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public Builder clearCommon() { + bitField0_ = (bitField0_ & ~0x00000001); + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); + commonBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder getCommonBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCommonFieldBuilder().getBuilder(); + } + /** + * .Common common = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder() { + if (commonBuilder_ != null) { + return commonBuilder_.getMessageOrBuilder(); + } else { + return common_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } + } + /** + * .Common common = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder> + getCommonFieldBuilder() { + if (commonBuilder_ == null) { + commonBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder>( + getCommon(), + getParentForChildren(), + isClean()); + common_ = null; + } + return commonBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> userBuilder_; + /** + * .User user = 2; + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .User user = 2; + * @return The user. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * .User user = 2; + */ + public Builder setUser(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .User user = 2; + */ + public Builder setUser( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .User user = 2; + */ + public Builder mergeUser(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + user_ != null && + user_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .User user = 2; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000002); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User user = 2; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder getUserBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * .User user = 2; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + } + /** + * .User user = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + + private java.lang.Object content_ = ""; + /** + * string content = 3; + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 3; + * @return The bytes for content. + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 3; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + content_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * string content = 3; + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * string content = 3; + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean visibleToSender_ ; + /** + * bool visible_to_sender = 4; + * @return The visibleToSender. + */ + @java.lang.Override + public boolean getVisibleToSender() { + return visibleToSender_; + } + /** + * bool visible_to_sender = 4; + * @param value The visibleToSender to set. + * @return This builder for chaining. + */ + public Builder setVisibleToSender(boolean value) { + + visibleToSender_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * bool visible_to_sender = 4; + * @return This builder for chaining. + */ + public Builder clearVisibleToSender() { + bitField0_ = (bitField0_ & ~0x00000008); + visibleToSender_ = false; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image backgroundImage_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> backgroundImageBuilder_; + /** + * .Image background_image = 5; + * @return Whether the backgroundImage field is set. + */ + public boolean hasBackgroundImage() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * .Image background_image = 5; + * @return The backgroundImage. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundImage() { + if (backgroundImageBuilder_ == null) { + return backgroundImage_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImage_; + } else { + return backgroundImageBuilder_.getMessage(); + } + } + /** + * .Image background_image = 5; + */ + public Builder setBackgroundImage(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (backgroundImageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backgroundImage_ = value; + } else { + backgroundImageBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .Image background_image = 5; + */ + public Builder setBackgroundImage( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (backgroundImageBuilder_ == null) { + backgroundImage_ = builderForValue.build(); + } else { + backgroundImageBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .Image background_image = 5; + */ + public Builder mergeBackgroundImage(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (backgroundImageBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + backgroundImage_ != null && + backgroundImage_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getBackgroundImageBuilder().mergeFrom(value); + } else { + backgroundImage_ = value; + } + } else { + backgroundImageBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .Image background_image = 5; + */ + public Builder clearBackgroundImage() { + bitField0_ = (bitField0_ & ~0x00000010); + backgroundImage_ = null; + if (backgroundImageBuilder_ != null) { + backgroundImageBuilder_.dispose(); + backgroundImageBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image background_image = 5; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getBackgroundImageBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getBackgroundImageFieldBuilder().getBuilder(); + } + /** + * .Image background_image = 5; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundImageOrBuilder() { + if (backgroundImageBuilder_ != null) { + return backgroundImageBuilder_.getMessageOrBuilder(); + } else { + return backgroundImage_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImage_; + } + } + /** + * .Image background_image = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getBackgroundImageFieldBuilder() { + if (backgroundImageBuilder_ == null) { + backgroundImageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getBackgroundImage(), + getParentForChildren(), + isClean()); + backgroundImage_ = null; + } + return backgroundImageBuilder_; + } + + private java.lang.Object fullScreenTextColor_ = ""; + /** + * string full_screen_text_color = 6; + * @return The fullScreenTextColor. + */ + public java.lang.String getFullScreenTextColor() { + java.lang.Object ref = fullScreenTextColor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fullScreenTextColor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string full_screen_text_color = 6; + * @return The bytes for fullScreenTextColor. + */ + public com.google.protobuf.ByteString + getFullScreenTextColorBytes() { + java.lang.Object ref = fullScreenTextColor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fullScreenTextColor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string full_screen_text_color = 6; + * @param value The fullScreenTextColor to set. + * @return This builder for chaining. + */ + public Builder setFullScreenTextColor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + fullScreenTextColor_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * string full_screen_text_color = 6; + * @return This builder for chaining. + */ + public Builder clearFullScreenTextColor() { + fullScreenTextColor_ = getDefaultInstance().getFullScreenTextColor(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * string full_screen_text_color = 6; + * @param value The bytes for fullScreenTextColor to set. + * @return This builder for chaining. + */ + public Builder setFullScreenTextColorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + fullScreenTextColor_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image backgroundImageV2_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> backgroundImageV2Builder_; + /** + * .Image background_image_v2 = 7; + * @return Whether the backgroundImageV2 field is set. + */ + public boolean hasBackgroundImageV2() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * .Image background_image_v2 = 7; + * @return The backgroundImageV2. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundImageV2() { + if (backgroundImageV2Builder_ == null) { + return backgroundImageV2_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImageV2_; + } else { + return backgroundImageV2Builder_.getMessage(); + } + } + /** + * .Image background_image_v2 = 7; + */ + public Builder setBackgroundImageV2(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (backgroundImageV2Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backgroundImageV2_ = value; + } else { + backgroundImageV2Builder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .Image background_image_v2 = 7; + */ + public Builder setBackgroundImageV2( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (backgroundImageV2Builder_ == null) { + backgroundImageV2_ = builderForValue.build(); + } else { + backgroundImageV2Builder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .Image background_image_v2 = 7; + */ + public Builder mergeBackgroundImageV2(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (backgroundImageV2Builder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + backgroundImageV2_ != null && + backgroundImageV2_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getBackgroundImageV2Builder().mergeFrom(value); + } else { + backgroundImageV2_ = value; + } + } else { + backgroundImageV2Builder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .Image background_image_v2 = 7; + */ + public Builder clearBackgroundImageV2() { + bitField0_ = (bitField0_ & ~0x00000040); + backgroundImageV2_ = null; + if (backgroundImageV2Builder_ != null) { + backgroundImageV2Builder_.dispose(); + backgroundImageV2Builder_ = null; + } + onChanged(); + return this; + } + /** + * .Image background_image_v2 = 7; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getBackgroundImageV2Builder() { + bitField0_ |= 0x00000040; + onChanged(); + return getBackgroundImageV2FieldBuilder().getBuilder(); + } + /** + * .Image background_image_v2 = 7; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundImageV2OrBuilder() { + if (backgroundImageV2Builder_ != null) { + return backgroundImageV2Builder_.getMessageOrBuilder(); + } else { + return backgroundImageV2_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImageV2_; + } + } + /** + * .Image background_image_v2 = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getBackgroundImageV2FieldBuilder() { + if (backgroundImageV2Builder_ == null) { + backgroundImageV2Builder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getBackgroundImageV2(), + getParentForChildren(), + isClean()); + backgroundImageV2_ = null; + } + return backgroundImageV2Builder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image giftImage_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> giftImageBuilder_; + /** + *
+     * PublicAreaCommon public_area_common = 9;
+     * 
+ * + * .Image gift_image = 10; + * @return Whether the giftImage field is set. + */ + public boolean hasGiftImage() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + *
+     * PublicAreaCommon public_area_common = 9;
+     * 
+ * + * .Image gift_image = 10; + * @return The giftImage. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getGiftImage() { + if (giftImageBuilder_ == null) { + return giftImage_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : giftImage_; + } else { + return giftImageBuilder_.getMessage(); + } + } + /** + *
+     * PublicAreaCommon public_area_common = 9;
+     * 
+ * + * .Image gift_image = 10; + */ + public Builder setGiftImage(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (giftImageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + giftImage_ = value; + } else { + giftImageBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * PublicAreaCommon public_area_common = 9;
+     * 
+ * + * .Image gift_image = 10; + */ + public Builder setGiftImage( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (giftImageBuilder_ == null) { + giftImage_ = builderForValue.build(); + } else { + giftImageBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * PublicAreaCommon public_area_common = 9;
+     * 
+ * + * .Image gift_image = 10; + */ + public Builder mergeGiftImage(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (giftImageBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) && + giftImage_ != null && + giftImage_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getGiftImageBuilder().mergeFrom(value); + } else { + giftImage_ = value; + } + } else { + giftImageBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * PublicAreaCommon public_area_common = 9;
+     * 
+ * + * .Image gift_image = 10; + */ + public Builder clearGiftImage() { + bitField0_ = (bitField0_ & ~0x00000080); + giftImage_ = null; + if (giftImageBuilder_ != null) { + giftImageBuilder_.dispose(); + giftImageBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * PublicAreaCommon public_area_common = 9;
+     * 
+ * + * .Image gift_image = 10; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getGiftImageBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getGiftImageFieldBuilder().getBuilder(); + } + /** + *
+     * PublicAreaCommon public_area_common = 9;
+     * 
+ * + * .Image gift_image = 10; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getGiftImageOrBuilder() { + if (giftImageBuilder_ != null) { + return giftImageBuilder_.getMessageOrBuilder(); + } else { + return giftImage_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : giftImage_; + } + } + /** + *
+     * PublicAreaCommon public_area_common = 9;
+     * 
+ * + * .Image gift_image = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getGiftImageFieldBuilder() { + if (giftImageBuilder_ == null) { + giftImageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getGiftImage(), + getParentForChildren(), + isClean()); + giftImage_ = null; + } + return giftImageBuilder_; + } + + private long agreeMsgId_ ; + /** + * uint64 agree_msg_id = 11; + * @return The agreeMsgId. + */ + @java.lang.Override + public long getAgreeMsgId() { + return agreeMsgId_; + } + /** + * uint64 agree_msg_id = 11; + * @param value The agreeMsgId to set. + * @return This builder for chaining. + */ + public Builder setAgreeMsgId(long value) { + + agreeMsgId_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * uint64 agree_msg_id = 11; + * @return This builder for chaining. + */ + public Builder clearAgreeMsgId() { + bitField0_ = (bitField0_ & ~0x00000100); + agreeMsgId_ = 0L; + onChanged(); + return this; + } + + private int priorityLevel_ ; + /** + * uint32 priority_level = 12; + * @return The priorityLevel. + */ + @java.lang.Override + public int getPriorityLevel() { + return priorityLevel_; + } + /** + * uint32 priority_level = 12; + * @param value The priorityLevel to set. + * @return This builder for chaining. + */ + public Builder setPriorityLevel(int value) { + + priorityLevel_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * uint32 priority_level = 12; + * @return This builder for chaining. + */ + public Builder clearPriorityLevel() { + bitField0_ = (bitField0_ & ~0x00000200); + priorityLevel_ = 0; + onChanged(); + return this; + } + + private long eventTime_ ; + /** + *
+     * LandscapeAreaCommon landscape_area_common = 13;
+     * 
+ * + * uint64 event_time = 15; + * @return The eventTime. + */ + @java.lang.Override + public long getEventTime() { + return eventTime_; + } + /** + *
+     * LandscapeAreaCommon landscape_area_common = 13;
+     * 
+ * + * uint64 event_time = 15; + * @param value The eventTime to set. + * @return This builder for chaining. + */ + public Builder setEventTime(long value) { + + eventTime_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
+     * LandscapeAreaCommon landscape_area_common = 13;
+     * 
+ * + * uint64 event_time = 15; + * @return This builder for chaining. + */ + public Builder clearEventTime() { + bitField0_ = (bitField0_ & ~0x00000400); + eventTime_ = 0L; + onChanged(); + return this; + } + + private boolean sendReview_ ; + /** + * bool send_review = 16; + * @return The sendReview. + */ + @java.lang.Override + public boolean getSendReview() { + return sendReview_; + } + /** + * bool send_review = 16; + * @param value The sendReview to set. + * @return This builder for chaining. + */ + public Builder setSendReview(boolean value) { + + sendReview_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * bool send_review = 16; + * @return This builder for chaining. + */ + public Builder clearSendReview() { + bitField0_ = (bitField0_ & ~0x00000800); + sendReview_ = false; + onChanged(); + return this; + } + + private boolean fromIntercom_ ; + /** + * bool from_intercom = 17; + * @return The fromIntercom. + */ + @java.lang.Override + public boolean getFromIntercom() { + return fromIntercom_; + } + /** + * bool from_intercom = 17; + * @param value The fromIntercom to set. + * @return This builder for chaining. + */ + public Builder setFromIntercom(boolean value) { + + fromIntercom_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * bool from_intercom = 17; + * @return This builder for chaining. + */ + public Builder clearFromIntercom() { + bitField0_ = (bitField0_ & ~0x00001000); + fromIntercom_ = false; + onChanged(); + return this; + } + + private boolean intercomHideUserCard_ ; + /** + * bool intercom_hide_user_card = 18; + * @return The intercomHideUserCard. + */ + @java.lang.Override + public boolean getIntercomHideUserCard() { + return intercomHideUserCard_; + } + /** + * bool intercom_hide_user_card = 18; + * @param value The intercomHideUserCard to set. + * @return This builder for chaining. + */ + public Builder setIntercomHideUserCard(boolean value) { + + intercomHideUserCard_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * bool intercom_hide_user_card = 18; + * @return This builder for chaining. + */ + public Builder clearIntercomHideUserCard() { + bitField0_ = (bitField0_ & ~0x00002000); + intercomHideUserCard_ = false; + onChanged(); + return this; + } + + private java.lang.Object chatBy_ = ""; + /** + *
+     * repeated string chatTagsList = 19;
+     * 
+ * + * string chat_by = 20; + * @return The chatBy. + */ + public java.lang.String getChatBy() { + java.lang.Object ref = chatBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + chatBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * repeated string chatTagsList = 19;
+     * 
+ * + * string chat_by = 20; + * @return The bytes for chatBy. + */ + public com.google.protobuf.ByteString + getChatByBytes() { + java.lang.Object ref = chatBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + chatBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * repeated string chatTagsList = 19;
+     * 
+ * + * string chat_by = 20; + * @param value The chatBy to set. + * @return This builder for chaining. + */ + public Builder setChatBy( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + chatBy_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
+     * repeated string chatTagsList = 19;
+     * 
+ * + * string chat_by = 20; + * @return This builder for chaining. + */ + public Builder clearChatBy() { + chatBy_ = getDefaultInstance().getChatBy(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + /** + *
+     * repeated string chatTagsList = 19;
+     * 
+ * + * string chat_by = 20; + * @param value The bytes for chatBy to set. + * @return This builder for chaining. + */ + public Builder setChatByBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + chatBy_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + private int individualChatPriority_ ; + /** + *
+     * Text rtf_content = 22 ;
+     * 
+ * + * uint32 individual_chat_priority = 21; + * @return The individualChatPriority. + */ + @java.lang.Override + public int getIndividualChatPriority() { + return individualChatPriority_; + } + /** + *
+     * Text rtf_content = 22 ;
+     * 
+ * + * uint32 individual_chat_priority = 21; + * @param value The individualChatPriority to set. + * @return This builder for chaining. + */ + public Builder setIndividualChatPriority(int value) { + + individualChatPriority_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + *
+     * Text rtf_content = 22 ;
+     * 
+ * + * uint32 individual_chat_priority = 21; + * @return This builder for chaining. + */ + public Builder clearIndividualChatPriority() { + bitField0_ = (bitField0_ & ~0x00008000); + individualChatPriority_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg) + } + + // @@protoc_insertion_point(class_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public douyin_webcast_chat_message_msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_chat_message_msgOrBuilder.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_chat_message_msgOrBuilder.java new file mode 100644 index 0000000..961938e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_chat_message_msgOrBuilder.java @@ -0,0 +1,220 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_webcast_chat_message_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +public interface douyin_webcast_chat_message_msgOrBuilder extends + // @@protoc_insertion_point(interface_extends:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_chat_message_msg) + com.google.protobuf.MessageOrBuilder { + + /** + * .Common common = 1; + * @return Whether the common field is set. + */ + boolean hasCommon(); + /** + * .Common common = 1; + * @return The common. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getCommon(); + /** + * .Common common = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder(); + + /** + * .User user = 2; + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * .User user = 2; + * @return The user. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser(); + /** + * .User user = 2; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder(); + + /** + * string content = 3; + * @return The content. + */ + java.lang.String getContent(); + /** + * string content = 3; + * @return The bytes for content. + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + * bool visible_to_sender = 4; + * @return The visibleToSender. + */ + boolean getVisibleToSender(); + + /** + * .Image background_image = 5; + * @return Whether the backgroundImage field is set. + */ + boolean hasBackgroundImage(); + /** + * .Image background_image = 5; + * @return The backgroundImage. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundImage(); + /** + * .Image background_image = 5; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundImageOrBuilder(); + + /** + * string full_screen_text_color = 6; + * @return The fullScreenTextColor. + */ + java.lang.String getFullScreenTextColor(); + /** + * string full_screen_text_color = 6; + * @return The bytes for fullScreenTextColor. + */ + com.google.protobuf.ByteString + getFullScreenTextColorBytes(); + + /** + * .Image background_image_v2 = 7; + * @return Whether the backgroundImageV2 field is set. + */ + boolean hasBackgroundImageV2(); + /** + * .Image background_image_v2 = 7; + * @return The backgroundImageV2. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundImageV2(); + /** + * .Image background_image_v2 = 7; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundImageV2OrBuilder(); + + /** + *
+   * PublicAreaCommon public_area_common = 9;
+   * 
+ * + * .Image gift_image = 10; + * @return Whether the giftImage field is set. + */ + boolean hasGiftImage(); + /** + *
+   * PublicAreaCommon public_area_common = 9;
+   * 
+ * + * .Image gift_image = 10; + * @return The giftImage. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getGiftImage(); + /** + *
+   * PublicAreaCommon public_area_common = 9;
+   * 
+ * + * .Image gift_image = 10; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getGiftImageOrBuilder(); + + /** + * uint64 agree_msg_id = 11; + * @return The agreeMsgId. + */ + long getAgreeMsgId(); + + /** + * uint32 priority_level = 12; + * @return The priorityLevel. + */ + int getPriorityLevel(); + + /** + *
+   * LandscapeAreaCommon landscape_area_common = 13;
+   * 
+ * + * uint64 event_time = 15; + * @return The eventTime. + */ + long getEventTime(); + + /** + * bool send_review = 16; + * @return The sendReview. + */ + boolean getSendReview(); + + /** + * bool from_intercom = 17; + * @return The fromIntercom. + */ + boolean getFromIntercom(); + + /** + * bool intercom_hide_user_card = 18; + * @return The intercomHideUserCard. + */ + boolean getIntercomHideUserCard(); + + /** + *
+   * repeated string chatTagsList = 19;
+   * 
+ * + * string chat_by = 20; + * @return The chatBy. + */ + java.lang.String getChatBy(); + /** + *
+   * repeated string chatTagsList = 19;
+   * 
+ * + * string chat_by = 20; + * @return The bytes for chatBy. + */ + com.google.protobuf.ByteString + getChatByBytes(); + + /** + *
+   * Text rtf_content = 22 ;
+   * 
+ * + * uint32 individual_chat_priority = 21; + * @return The individualChatPriority. + */ + int getIndividualChatPriority(); +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_gift_message_msg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_gift_message_msg.java new file mode 100644 index 0000000..d4098dd --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_gift_message_msg.java @@ -0,0 +1,3963 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_webcast_gift_message_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +/** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg} + */ +public final class douyin_webcast_gift_message_msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg) + douyin_webcast_gift_message_msgOrBuilder { + private static final long serialVersionUID = 0L; + // Use douyin_webcast_gift_message_msg.newBuilder() to construct. + private douyin_webcast_gift_message_msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private douyin_webcast_gift_message_msg() { + logId_ = ""; + interactGiftInfo_ = ""; + diyItemInfo_ = ""; + minAssetSetList_ = emptyLongList(); + toUserIdsList_ = emptyLongList(); + traceId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new douyin_webcast_gift_message_msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_gift_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_gift_message_msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_gift_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_gift_message_msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg.Builder.class); + } + + public static final int COMMON_FIELD_NUMBER = 1; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common common_; + /** + * .Common common = 1; + * @return Whether the common field is set. + */ + @java.lang.Override + public boolean hasCommon() { + return common_ != null; + } + /** + * .Common common = 1; + * @return The common. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getCommon() { + return common_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } + /** + * .Common common = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder() { + return common_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } + + public static final int LONG_GIFT_ID_FIELD_NUMBER = 2; + private long longGiftId_ = 0L; + /** + * uint64 long_gift_id = 2; + * @return The longGiftId. + */ + @java.lang.Override + public long getLongGiftId() { + return longGiftId_; + } + + public static final int FAN_TICKET_COUNT_FIELD_NUMBER = 3; + private long fanTicketCount_ = 0L; + /** + * uint64 fan_ticket_count = 3; + * @return The fanTicketCount. + */ + @java.lang.Override + public long getFanTicketCount() { + return fanTicketCount_; + } + + public static final int GROUP_COUNT_FIELD_NUMBER = 4; + private long groupCount_ = 0L; + /** + * uint64 group_count = 4; + * @return The groupCount. + */ + @java.lang.Override + public long getGroupCount() { + return groupCount_; + } + + public static final int REPEAT_COUNT_FIELD_NUMBER = 5; + private long repeatCount_ = 0L; + /** + * uint64 repeat_count = 5; + * @return The repeatCount. + */ + @java.lang.Override + public long getRepeatCount() { + return repeatCount_; + } + + public static final int COMBO_COUNT_FIELD_NUMBER = 6; + private long comboCount_ = 0L; + /** + * uint64 combo_count = 6; + * @return The comboCount. + */ + @java.lang.Override + public long getComboCount() { + return comboCount_; + } + + public static final int USER_FIELD_NUMBER = 7; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User user_; + /** + * .User user = 7; + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * .User user = 7; + * @return The user. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser() { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + /** + * .User user = 7; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder() { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + + public static final int TO_USER_FIELD_NUMBER = 8; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User toUser_; + /** + * .User to_user = 8; + * @return Whether the toUser field is set. + */ + @java.lang.Override + public boolean hasToUser() { + return toUser_ != null; + } + /** + * .User to_user = 8; + * @return The toUser. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getToUser() { + return toUser_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : toUser_; + } + /** + * .User to_user = 8; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getToUserOrBuilder() { + return toUser_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : toUser_; + } + + public static final int REPEAT_END_FIELD_NUMBER = 9; + private int repeatEnd_ = 0; + /** + * uint32 repeat_end = 9; + * @return The repeatEnd. + */ + @java.lang.Override + public int getRepeatEnd() { + return repeatEnd_; + } + + public static final int TEXT_EFFECT_FIELD_NUMBER = 10; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect textEffect_; + /** + * .TextEffect text_effect = 10; + * @return Whether the textEffect field is set. + */ + @java.lang.Override + public boolean hasTextEffect() { + return textEffect_ != null; + } + /** + * .TextEffect text_effect = 10; + * @return The textEffect. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect getTextEffect() { + return textEffect_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.getDefaultInstance() : textEffect_; + } + /** + * .TextEffect text_effect = 10; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffectOrBuilder getTextEffectOrBuilder() { + return textEffect_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.getDefaultInstance() : textEffect_; + } + + public static final int GROUP_ID_FIELD_NUMBER = 11; + private long groupId_ = 0L; + /** + * uint64 group_id = 11; + * @return The groupId. + */ + @java.lang.Override + public long getGroupId() { + return groupId_; + } + + public static final int INCOME_TASKGIFTS_FIELD_NUMBER = 12; + private long incomeTaskgifts_ = 0L; + /** + * uint64 income_taskgifts = 12; + * @return The incomeTaskgifts. + */ + @java.lang.Override + public long getIncomeTaskgifts() { + return incomeTaskgifts_; + } + + public static final int ROOM_FAN_TICKET_COUNT_FIELD_NUMBER = 13; + private long roomFanTicketCount_ = 0L; + /** + * uint64 room_fan_ticket_count = 13; + * @return The roomFanTicketCount. + */ + @java.lang.Override + public long getRoomFanTicketCount() { + return roomFanTicketCount_; + } + + public static final int PRIORITY_FIELD_NUMBER = 14; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority priority_; + /** + * .GiftIMPriority priority = 14; + * @return Whether the priority field is set. + */ + @java.lang.Override + public boolean hasPriority() { + return priority_ != null; + } + /** + * .GiftIMPriority priority = 14; + * @return The priority. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority getPriority() { + return priority_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.getDefaultInstance() : priority_; + } + /** + * .GiftIMPriority priority = 14; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriorityOrBuilder getPriorityOrBuilder() { + return priority_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.getDefaultInstance() : priority_; + } + + public static final int GIFT_FIELD_NUMBER = 15; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct gift_; + /** + * .GiftStruct gift = 15; + * @return Whether the gift field is set. + */ + @java.lang.Override + public boolean hasGift() { + return gift_ != null; + } + /** + * .GiftStruct gift = 15; + * @return The gift. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct getGift() { + return gift_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.getDefaultInstance() : gift_; + } + /** + * .GiftStruct gift = 15; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStructOrBuilder getGiftOrBuilder() { + return gift_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.getDefaultInstance() : gift_; + } + + public static final int LOG_ID_FIELD_NUMBER = 16; + @SuppressWarnings("serial") + private volatile java.lang.Object logId_ = ""; + /** + * string log_id = 16; + * @return The logId. + */ + @java.lang.Override + public java.lang.String getLogId() { + java.lang.Object ref = logId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logId_ = s; + return s; + } + } + /** + * string log_id = 16; + * @return The bytes for logId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLogIdBytes() { + java.lang.Object ref = logId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + logId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SEND_TYPE_FIELD_NUMBER = 17; + private long sendType_ = 0L; + /** + * uint64 send_type = 17; + * @return The sendType. + */ + @java.lang.Override + public long getSendType() { + return sendType_; + } + + public static final int PUBLIC_AREA_COMMON_FIELD_NUMBER = 18; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon publicAreaCommon_; + /** + * .PublicAreaCommon public_area_common = 18; + * @return Whether the publicAreaCommon field is set. + */ + @java.lang.Override + public boolean hasPublicAreaCommon() { + return publicAreaCommon_ != null; + } + /** + * .PublicAreaCommon public_area_common = 18; + * @return The publicAreaCommon. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon getPublicAreaCommon() { + return publicAreaCommon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.getDefaultInstance() : publicAreaCommon_; + } + /** + * .PublicAreaCommon public_area_common = 18; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommonOrBuilder getPublicAreaCommonOrBuilder() { + return publicAreaCommon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.getDefaultInstance() : publicAreaCommon_; + } + + public static final int TRAY_DISPLAY_TEXT_FIELD_NUMBER = 19; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text trayDisplayText_; + /** + * .Text tray_display_text = 19; + * @return Whether the trayDisplayText field is set. + */ + @java.lang.Override + public boolean hasTrayDisplayText() { + return trayDisplayText_ != null; + } + /** + * .Text tray_display_text = 19; + * @return The trayDisplayText. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text getTrayDisplayText() { + return trayDisplayText_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance() : trayDisplayText_; + } + /** + * .Text tray_display_text = 19; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder getTrayDisplayTextOrBuilder() { + return trayDisplayText_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance() : trayDisplayText_; + } + + public static final int BANNED_DISPLAY_EFFECTS_FIELD_NUMBER = 20; + private long bannedDisplayEffects_ = 0L; + /** + * uint64 banned_display_effects = 20; + * @return The bannedDisplayEffects. + */ + @java.lang.Override + public long getBannedDisplayEffects() { + return bannedDisplayEffects_; + } + + public static final int DISPLAY_FOR_SELF_FIELD_NUMBER = 25; + private boolean displayForSelf_ = false; + /** + *
+   * GiftTrayInfo trayInfo = 21;
+   * AssetEffectMixInfo assetEffectMixInfo = 22;
+   * 
+ * + * bool display_for_self = 25; + * @return The displayForSelf. + */ + @java.lang.Override + public boolean getDisplayForSelf() { + return displayForSelf_; + } + + public static final int INTERACT_GIFT_INFO_FIELD_NUMBER = 26; + @SuppressWarnings("serial") + private volatile java.lang.Object interactGiftInfo_ = ""; + /** + * string interact_gift_info = 26; + * @return The interactGiftInfo. + */ + @java.lang.Override + public java.lang.String getInteractGiftInfo() { + java.lang.Object ref = interactGiftInfo_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + interactGiftInfo_ = s; + return s; + } + } + /** + * string interact_gift_info = 26; + * @return The bytes for interactGiftInfo. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getInteractGiftInfoBytes() { + java.lang.Object ref = interactGiftInfo_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + interactGiftInfo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIY_ITEM_INFO_FIELD_NUMBER = 27; + @SuppressWarnings("serial") + private volatile java.lang.Object diyItemInfo_ = ""; + /** + * string diy_item_info = 27; + * @return The diyItemInfo. + */ + @java.lang.Override + public java.lang.String getDiyItemInfo() { + java.lang.Object ref = diyItemInfo_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + diyItemInfo_ = s; + return s; + } + } + /** + * string diy_item_info = 27; + * @return The bytes for diyItemInfo. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDiyItemInfoBytes() { + java.lang.Object ref = diyItemInfo_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + diyItemInfo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MIN_ASSET_SET_LIST_FIELD_NUMBER = 28; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList minAssetSetList_; + /** + * repeated uint64 min_asset_set_list = 28; + * @return A list containing the minAssetSetList. + */ + @java.lang.Override + public java.util.List + getMinAssetSetListList() { + return minAssetSetList_; + } + /** + * repeated uint64 min_asset_set_list = 28; + * @return The count of minAssetSetList. + */ + public int getMinAssetSetListCount() { + return minAssetSetList_.size(); + } + /** + * repeated uint64 min_asset_set_list = 28; + * @param index The index of the element to return. + * @return The minAssetSetList at the given index. + */ + public long getMinAssetSetList(int index) { + return minAssetSetList_.getLong(index); + } + private int minAssetSetListMemoizedSerializedSize = -1; + + public static final int TOTAL_COUNT_FIELD_NUMBER = 29; + private long totalCount_ = 0L; + /** + * uint64 total_count = 29; + * @return The totalCount. + */ + @java.lang.Override + public long getTotalCount() { + return totalCount_; + } + + public static final int CLIENT_GIFT_SOURCE_FIELD_NUMBER = 30; + private int clientGiftSource_ = 0; + /** + * uint32 client_gift_source = 30; + * @return The clientGiftSource. + */ + @java.lang.Override + public int getClientGiftSource() { + return clientGiftSource_; + } + + public static final int TO_USER_IDS_LIST_FIELD_NUMBER = 32; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList toUserIdsList_; + /** + *
+   * AnchorGiftData anchorGift = 31;
+   * 
+ * + * repeated uint64 to_user_ids_list = 32; + * @return A list containing the toUserIdsList. + */ + @java.lang.Override + public java.util.List + getToUserIdsListList() { + return toUserIdsList_; + } + /** + *
+   * AnchorGiftData anchorGift = 31;
+   * 
+ * + * repeated uint64 to_user_ids_list = 32; + * @return The count of toUserIdsList. + */ + public int getToUserIdsListCount() { + return toUserIdsList_.size(); + } + /** + *
+   * AnchorGiftData anchorGift = 31;
+   * 
+ * + * repeated uint64 to_user_ids_list = 32; + * @param index The index of the element to return. + * @return The toUserIdsList at the given index. + */ + public long getToUserIdsList(int index) { + return toUserIdsList_.getLong(index); + } + private int toUserIdsListMemoizedSerializedSize = -1; + + public static final int SEND_TIMET_FIELD_NUMBER = 33; + private long sendTimet_ = 0L; + /** + * uint64 send_timet = 33; + * @return The sendTimet. + */ + @java.lang.Override + public long getSendTimet() { + return sendTimet_; + } + + public static final int FORCE_DISPLAY_EFFECTST_FIELD_NUMBER = 34; + private long forceDisplayEffectst_ = 0L; + /** + * uint64 force_display_effectst = 34; + * @return The forceDisplayEffectst. + */ + @java.lang.Override + public long getForceDisplayEffectst() { + return forceDisplayEffectst_; + } + + public static final int TRACE_ID_FIELD_NUMBER = 35; + @SuppressWarnings("serial") + private volatile java.lang.Object traceId_ = ""; + /** + * string trace_id = 35; + * @return The traceId. + */ + @java.lang.Override + public java.lang.String getTraceId() { + java.lang.Object ref = traceId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + traceId_ = s; + return s; + } + } + /** + * string trace_id = 35; + * @return The bytes for traceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTraceIdBytes() { + java.lang.Object ref = traceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + traceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EFFECT_DISPLAY_TS_FIELD_NUMBER = 36; + private long effectDisplayTs_ = 0L; + /** + * uint64 effect_display_ts = 36; + * @return The effectDisplayTs. + */ + @java.lang.Override + public long getEffectDisplayTs() { + return effectDisplayTs_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (common_ != null) { + output.writeMessage(1, getCommon()); + } + if (longGiftId_ != 0L) { + output.writeUInt64(2, longGiftId_); + } + if (fanTicketCount_ != 0L) { + output.writeUInt64(3, fanTicketCount_); + } + if (groupCount_ != 0L) { + output.writeUInt64(4, groupCount_); + } + if (repeatCount_ != 0L) { + output.writeUInt64(5, repeatCount_); + } + if (comboCount_ != 0L) { + output.writeUInt64(6, comboCount_); + } + if (user_ != null) { + output.writeMessage(7, getUser()); + } + if (toUser_ != null) { + output.writeMessage(8, getToUser()); + } + if (repeatEnd_ != 0) { + output.writeUInt32(9, repeatEnd_); + } + if (textEffect_ != null) { + output.writeMessage(10, getTextEffect()); + } + if (groupId_ != 0L) { + output.writeUInt64(11, groupId_); + } + if (incomeTaskgifts_ != 0L) { + output.writeUInt64(12, incomeTaskgifts_); + } + if (roomFanTicketCount_ != 0L) { + output.writeUInt64(13, roomFanTicketCount_); + } + if (priority_ != null) { + output.writeMessage(14, getPriority()); + } + if (gift_ != null) { + output.writeMessage(15, getGift()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, logId_); + } + if (sendType_ != 0L) { + output.writeUInt64(17, sendType_); + } + if (publicAreaCommon_ != null) { + output.writeMessage(18, getPublicAreaCommon()); + } + if (trayDisplayText_ != null) { + output.writeMessage(19, getTrayDisplayText()); + } + if (bannedDisplayEffects_ != 0L) { + output.writeUInt64(20, bannedDisplayEffects_); + } + if (displayForSelf_ != false) { + output.writeBool(25, displayForSelf_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(interactGiftInfo_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 26, interactGiftInfo_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(diyItemInfo_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 27, diyItemInfo_); + } + if (getMinAssetSetListList().size() > 0) { + output.writeUInt32NoTag(226); + output.writeUInt32NoTag(minAssetSetListMemoizedSerializedSize); + } + for (int i = 0; i < minAssetSetList_.size(); i++) { + output.writeUInt64NoTag(minAssetSetList_.getLong(i)); + } + if (totalCount_ != 0L) { + output.writeUInt64(29, totalCount_); + } + if (clientGiftSource_ != 0) { + output.writeUInt32(30, clientGiftSource_); + } + if (getToUserIdsListList().size() > 0) { + output.writeUInt32NoTag(258); + output.writeUInt32NoTag(toUserIdsListMemoizedSerializedSize); + } + for (int i = 0; i < toUserIdsList_.size(); i++) { + output.writeUInt64NoTag(toUserIdsList_.getLong(i)); + } + if (sendTimet_ != 0L) { + output.writeUInt64(33, sendTimet_); + } + if (forceDisplayEffectst_ != 0L) { + output.writeUInt64(34, forceDisplayEffectst_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(traceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 35, traceId_); + } + if (effectDisplayTs_ != 0L) { + output.writeUInt64(36, effectDisplayTs_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (common_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getCommon()); + } + if (longGiftId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, longGiftId_); + } + if (fanTicketCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, fanTicketCount_); + } + if (groupCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, groupCount_); + } + if (repeatCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(5, repeatCount_); + } + if (comboCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(6, comboCount_); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getUser()); + } + if (toUser_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getToUser()); + } + if (repeatEnd_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(9, repeatEnd_); + } + if (textEffect_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, getTextEffect()); + } + if (groupId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(11, groupId_); + } + if (incomeTaskgifts_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(12, incomeTaskgifts_); + } + if (roomFanTicketCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(13, roomFanTicketCount_); + } + if (priority_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, getPriority()); + } + if (gift_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, getGift()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, logId_); + } + if (sendType_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(17, sendType_); + } + if (publicAreaCommon_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(18, getPublicAreaCommon()); + } + if (trayDisplayText_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(19, getTrayDisplayText()); + } + if (bannedDisplayEffects_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(20, bannedDisplayEffects_); + } + if (displayForSelf_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(25, displayForSelf_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(interactGiftInfo_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(26, interactGiftInfo_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(diyItemInfo_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(27, diyItemInfo_); + } + { + int dataSize = 0; + for (int i = 0; i < minAssetSetList_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeUInt64SizeNoTag(minAssetSetList_.getLong(i)); + } + size += dataSize; + if (!getMinAssetSetListList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + minAssetSetListMemoizedSerializedSize = dataSize; + } + if (totalCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(29, totalCount_); + } + if (clientGiftSource_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(30, clientGiftSource_); + } + { + int dataSize = 0; + for (int i = 0; i < toUserIdsList_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeUInt64SizeNoTag(toUserIdsList_.getLong(i)); + } + size += dataSize; + if (!getToUserIdsListList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + toUserIdsListMemoizedSerializedSize = dataSize; + } + if (sendTimet_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(33, sendTimet_); + } + if (forceDisplayEffectst_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(34, forceDisplayEffectst_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(traceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(35, traceId_); + } + if (effectDisplayTs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(36, effectDisplayTs_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg) obj; + + if (hasCommon() != other.hasCommon()) return false; + if (hasCommon()) { + if (!getCommon() + .equals(other.getCommon())) return false; + } + if (getLongGiftId() + != other.getLongGiftId()) return false; + if (getFanTicketCount() + != other.getFanTicketCount()) return false; + if (getGroupCount() + != other.getGroupCount()) return false; + if (getRepeatCount() + != other.getRepeatCount()) return false; + if (getComboCount() + != other.getComboCount()) return false; + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser() + .equals(other.getUser())) return false; + } + if (hasToUser() != other.hasToUser()) return false; + if (hasToUser()) { + if (!getToUser() + .equals(other.getToUser())) return false; + } + if (getRepeatEnd() + != other.getRepeatEnd()) return false; + if (hasTextEffect() != other.hasTextEffect()) return false; + if (hasTextEffect()) { + if (!getTextEffect() + .equals(other.getTextEffect())) return false; + } + if (getGroupId() + != other.getGroupId()) return false; + if (getIncomeTaskgifts() + != other.getIncomeTaskgifts()) return false; + if (getRoomFanTicketCount() + != other.getRoomFanTicketCount()) return false; + if (hasPriority() != other.hasPriority()) return false; + if (hasPriority()) { + if (!getPriority() + .equals(other.getPriority())) return false; + } + if (hasGift() != other.hasGift()) return false; + if (hasGift()) { + if (!getGift() + .equals(other.getGift())) return false; + } + if (!getLogId() + .equals(other.getLogId())) return false; + if (getSendType() + != other.getSendType()) return false; + if (hasPublicAreaCommon() != other.hasPublicAreaCommon()) return false; + if (hasPublicAreaCommon()) { + if (!getPublicAreaCommon() + .equals(other.getPublicAreaCommon())) return false; + } + if (hasTrayDisplayText() != other.hasTrayDisplayText()) return false; + if (hasTrayDisplayText()) { + if (!getTrayDisplayText() + .equals(other.getTrayDisplayText())) return false; + } + if (getBannedDisplayEffects() + != other.getBannedDisplayEffects()) return false; + if (getDisplayForSelf() + != other.getDisplayForSelf()) return false; + if (!getInteractGiftInfo() + .equals(other.getInteractGiftInfo())) return false; + if (!getDiyItemInfo() + .equals(other.getDiyItemInfo())) return false; + if (!getMinAssetSetListList() + .equals(other.getMinAssetSetListList())) return false; + if (getTotalCount() + != other.getTotalCount()) return false; + if (getClientGiftSource() + != other.getClientGiftSource()) return false; + if (!getToUserIdsListList() + .equals(other.getToUserIdsListList())) return false; + if (getSendTimet() + != other.getSendTimet()) return false; + if (getForceDisplayEffectst() + != other.getForceDisplayEffectst()) return false; + if (!getTraceId() + .equals(other.getTraceId())) return false; + if (getEffectDisplayTs() + != other.getEffectDisplayTs()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCommon()) { + hash = (37 * hash) + COMMON_FIELD_NUMBER; + hash = (53 * hash) + getCommon().hashCode(); + } + hash = (37 * hash) + LONG_GIFT_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLongGiftId()); + hash = (37 * hash) + FAN_TICKET_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFanTicketCount()); + hash = (37 * hash) + GROUP_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getGroupCount()); + hash = (37 * hash) + REPEAT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRepeatCount()); + hash = (37 * hash) + COMBO_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getComboCount()); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + if (hasToUser()) { + hash = (37 * hash) + TO_USER_FIELD_NUMBER; + hash = (53 * hash) + getToUser().hashCode(); + } + hash = (37 * hash) + REPEAT_END_FIELD_NUMBER; + hash = (53 * hash) + getRepeatEnd(); + if (hasTextEffect()) { + hash = (37 * hash) + TEXT_EFFECT_FIELD_NUMBER; + hash = (53 * hash) + getTextEffect().hashCode(); + } + hash = (37 * hash) + GROUP_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getGroupId()); + hash = (37 * hash) + INCOME_TASKGIFTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getIncomeTaskgifts()); + hash = (37 * hash) + ROOM_FAN_TICKET_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRoomFanTicketCount()); + if (hasPriority()) { + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getPriority().hashCode(); + } + if (hasGift()) { + hash = (37 * hash) + GIFT_FIELD_NUMBER; + hash = (53 * hash) + getGift().hashCode(); + } + hash = (37 * hash) + LOG_ID_FIELD_NUMBER; + hash = (53 * hash) + getLogId().hashCode(); + hash = (37 * hash) + SEND_TYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSendType()); + if (hasPublicAreaCommon()) { + hash = (37 * hash) + PUBLIC_AREA_COMMON_FIELD_NUMBER; + hash = (53 * hash) + getPublicAreaCommon().hashCode(); + } + if (hasTrayDisplayText()) { + hash = (37 * hash) + TRAY_DISPLAY_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getTrayDisplayText().hashCode(); + } + hash = (37 * hash) + BANNED_DISPLAY_EFFECTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBannedDisplayEffects()); + hash = (37 * hash) + DISPLAY_FOR_SELF_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDisplayForSelf()); + hash = (37 * hash) + INTERACT_GIFT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getInteractGiftInfo().hashCode(); + hash = (37 * hash) + DIY_ITEM_INFO_FIELD_NUMBER; + hash = (53 * hash) + getDiyItemInfo().hashCode(); + if (getMinAssetSetListCount() > 0) { + hash = (37 * hash) + MIN_ASSET_SET_LIST_FIELD_NUMBER; + hash = (53 * hash) + getMinAssetSetListList().hashCode(); + } + hash = (37 * hash) + TOTAL_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTotalCount()); + hash = (37 * hash) + CLIENT_GIFT_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getClientGiftSource(); + if (getToUserIdsListCount() > 0) { + hash = (37 * hash) + TO_USER_IDS_LIST_FIELD_NUMBER; + hash = (53 * hash) + getToUserIdsListList().hashCode(); + } + hash = (37 * hash) + SEND_TIMET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSendTimet()); + hash = (37 * hash) + FORCE_DISPLAY_EFFECTST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getForceDisplayEffectst()); + hash = (37 * hash) + TRACE_ID_FIELD_NUMBER; + hash = (53 * hash) + getTraceId().hashCode(); + hash = (37 * hash) + EFFECT_DISPLAY_TS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getEffectDisplayTs()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg) + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_gift_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_gift_message_msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_gift_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_gift_message_msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); + commonBuilder_ = null; + } + longGiftId_ = 0L; + fanTicketCount_ = 0L; + groupCount_ = 0L; + repeatCount_ = 0L; + comboCount_ = 0L; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + toUser_ = null; + if (toUserBuilder_ != null) { + toUserBuilder_.dispose(); + toUserBuilder_ = null; + } + repeatEnd_ = 0; + textEffect_ = null; + if (textEffectBuilder_ != null) { + textEffectBuilder_.dispose(); + textEffectBuilder_ = null; + } + groupId_ = 0L; + incomeTaskgifts_ = 0L; + roomFanTicketCount_ = 0L; + priority_ = null; + if (priorityBuilder_ != null) { + priorityBuilder_.dispose(); + priorityBuilder_ = null; + } + gift_ = null; + if (giftBuilder_ != null) { + giftBuilder_.dispose(); + giftBuilder_ = null; + } + logId_ = ""; + sendType_ = 0L; + publicAreaCommon_ = null; + if (publicAreaCommonBuilder_ != null) { + publicAreaCommonBuilder_.dispose(); + publicAreaCommonBuilder_ = null; + } + trayDisplayText_ = null; + if (trayDisplayTextBuilder_ != null) { + trayDisplayTextBuilder_.dispose(); + trayDisplayTextBuilder_ = null; + } + bannedDisplayEffects_ = 0L; + displayForSelf_ = false; + interactGiftInfo_ = ""; + diyItemInfo_ = ""; + minAssetSetList_ = emptyLongList(); + totalCount_ = 0L; + clientGiftSource_ = 0; + toUserIdsList_ = emptyLongList(); + sendTimet_ = 0L; + forceDisplayEffectst_ = 0L; + traceId_ = ""; + effectDisplayTs_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_gift_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_gift_message_msg_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg result) { + if (((bitField0_ & 0x00800000) != 0)) { + minAssetSetList_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00800000); + } + result.minAssetSetList_ = minAssetSetList_; + if (((bitField0_ & 0x04000000) != 0)) { + toUserIdsList_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x04000000); + } + result.toUserIdsList_ = toUserIdsList_; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.common_ = commonBuilder_ == null + ? common_ + : commonBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.longGiftId_ = longGiftId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.fanTicketCount_ = fanTicketCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.groupCount_ = groupCount_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.repeatCount_ = repeatCount_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.comboCount_ = comboCount_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.user_ = userBuilder_ == null + ? user_ + : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.toUser_ = toUserBuilder_ == null + ? toUser_ + : toUserBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.repeatEnd_ = repeatEnd_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.textEffect_ = textEffectBuilder_ == null + ? textEffect_ + : textEffectBuilder_.build(); + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.groupId_ = groupId_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.incomeTaskgifts_ = incomeTaskgifts_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.roomFanTicketCount_ = roomFanTicketCount_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.priority_ = priorityBuilder_ == null + ? priority_ + : priorityBuilder_.build(); + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.gift_ = giftBuilder_ == null + ? gift_ + : giftBuilder_.build(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.logId_ = logId_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.sendType_ = sendType_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.publicAreaCommon_ = publicAreaCommonBuilder_ == null + ? publicAreaCommon_ + : publicAreaCommonBuilder_.build(); + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.trayDisplayText_ = trayDisplayTextBuilder_ == null + ? trayDisplayText_ + : trayDisplayTextBuilder_.build(); + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.bannedDisplayEffects_ = bannedDisplayEffects_; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.displayForSelf_ = displayForSelf_; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.interactGiftInfo_ = interactGiftInfo_; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.diyItemInfo_ = diyItemInfo_; + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.totalCount_ = totalCount_; + } + if (((from_bitField0_ & 0x02000000) != 0)) { + result.clientGiftSource_ = clientGiftSource_; + } + if (((from_bitField0_ & 0x08000000) != 0)) { + result.sendTimet_ = sendTimet_; + } + if (((from_bitField0_ & 0x10000000) != 0)) { + result.forceDisplayEffectst_ = forceDisplayEffectst_; + } + if (((from_bitField0_ & 0x20000000) != 0)) { + result.traceId_ = traceId_; + } + if (((from_bitField0_ & 0x40000000) != 0)) { + result.effectDisplayTs_ = effectDisplayTs_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg.getDefaultInstance()) return this; + if (other.hasCommon()) { + mergeCommon(other.getCommon()); + } + if (other.getLongGiftId() != 0L) { + setLongGiftId(other.getLongGiftId()); + } + if (other.getFanTicketCount() != 0L) { + setFanTicketCount(other.getFanTicketCount()); + } + if (other.getGroupCount() != 0L) { + setGroupCount(other.getGroupCount()); + } + if (other.getRepeatCount() != 0L) { + setRepeatCount(other.getRepeatCount()); + } + if (other.getComboCount() != 0L) { + setComboCount(other.getComboCount()); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (other.hasToUser()) { + mergeToUser(other.getToUser()); + } + if (other.getRepeatEnd() != 0) { + setRepeatEnd(other.getRepeatEnd()); + } + if (other.hasTextEffect()) { + mergeTextEffect(other.getTextEffect()); + } + if (other.getGroupId() != 0L) { + setGroupId(other.getGroupId()); + } + if (other.getIncomeTaskgifts() != 0L) { + setIncomeTaskgifts(other.getIncomeTaskgifts()); + } + if (other.getRoomFanTicketCount() != 0L) { + setRoomFanTicketCount(other.getRoomFanTicketCount()); + } + if (other.hasPriority()) { + mergePriority(other.getPriority()); + } + if (other.hasGift()) { + mergeGift(other.getGift()); + } + if (!other.getLogId().isEmpty()) { + logId_ = other.logId_; + bitField0_ |= 0x00008000; + onChanged(); + } + if (other.getSendType() != 0L) { + setSendType(other.getSendType()); + } + if (other.hasPublicAreaCommon()) { + mergePublicAreaCommon(other.getPublicAreaCommon()); + } + if (other.hasTrayDisplayText()) { + mergeTrayDisplayText(other.getTrayDisplayText()); + } + if (other.getBannedDisplayEffects() != 0L) { + setBannedDisplayEffects(other.getBannedDisplayEffects()); + } + if (other.getDisplayForSelf() != false) { + setDisplayForSelf(other.getDisplayForSelf()); + } + if (!other.getInteractGiftInfo().isEmpty()) { + interactGiftInfo_ = other.interactGiftInfo_; + bitField0_ |= 0x00200000; + onChanged(); + } + if (!other.getDiyItemInfo().isEmpty()) { + diyItemInfo_ = other.diyItemInfo_; + bitField0_ |= 0x00400000; + onChanged(); + } + if (!other.minAssetSetList_.isEmpty()) { + if (minAssetSetList_.isEmpty()) { + minAssetSetList_ = other.minAssetSetList_; + bitField0_ = (bitField0_ & ~0x00800000); + } else { + ensureMinAssetSetListIsMutable(); + minAssetSetList_.addAll(other.minAssetSetList_); + } + onChanged(); + } + if (other.getTotalCount() != 0L) { + setTotalCount(other.getTotalCount()); + } + if (other.getClientGiftSource() != 0) { + setClientGiftSource(other.getClientGiftSource()); + } + if (!other.toUserIdsList_.isEmpty()) { + if (toUserIdsList_.isEmpty()) { + toUserIdsList_ = other.toUserIdsList_; + bitField0_ = (bitField0_ & ~0x04000000); + } else { + ensureToUserIdsListIsMutable(); + toUserIdsList_.addAll(other.toUserIdsList_); + } + onChanged(); + } + if (other.getSendTimet() != 0L) { + setSendTimet(other.getSendTimet()); + } + if (other.getForceDisplayEffectst() != 0L) { + setForceDisplayEffectst(other.getForceDisplayEffectst()); + } + if (!other.getTraceId().isEmpty()) { + traceId_ = other.traceId_; + bitField0_ |= 0x20000000; + onChanged(); + } + if (other.getEffectDisplayTs() != 0L) { + setEffectDisplayTs(other.getEffectDisplayTs()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getCommonFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + longGiftId_ = input.readUInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + fanTicketCount_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + groupCount_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + repeatCount_ = input.readUInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + comboCount_ = input.readUInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: { + input.readMessage( + getUserFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: { + input.readMessage( + getToUserFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: { + repeatEnd_ = input.readUInt32(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 82: { + input.readMessage( + getTextEffectFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 88: { + groupId_ = input.readUInt64(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 96: { + incomeTaskgifts_ = input.readUInt64(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 104: { + roomFanTicketCount_ = input.readUInt64(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 114: { + input.readMessage( + getPriorityFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 122: { + input.readMessage( + getGiftFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00004000; + break; + } // case 122 + case 130: { + logId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 130 + case 136: { + sendType_ = input.readUInt64(); + bitField0_ |= 0x00010000; + break; + } // case 136 + case 146: { + input.readMessage( + getPublicAreaCommonFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 146 + case 154: { + input.readMessage( + getTrayDisplayTextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 154 + case 160: { + bannedDisplayEffects_ = input.readUInt64(); + bitField0_ |= 0x00080000; + break; + } // case 160 + case 200: { + displayForSelf_ = input.readBool(); + bitField0_ |= 0x00100000; + break; + } // case 200 + case 210: { + interactGiftInfo_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00200000; + break; + } // case 210 + case 218: { + diyItemInfo_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00400000; + break; + } // case 218 + case 224: { + long v = input.readUInt64(); + ensureMinAssetSetListIsMutable(); + minAssetSetList_.addLong(v); + break; + } // case 224 + case 226: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureMinAssetSetListIsMutable(); + while (input.getBytesUntilLimit() > 0) { + minAssetSetList_.addLong(input.readUInt64()); + } + input.popLimit(limit); + break; + } // case 226 + case 232: { + totalCount_ = input.readUInt64(); + bitField0_ |= 0x01000000; + break; + } // case 232 + case 240: { + clientGiftSource_ = input.readUInt32(); + bitField0_ |= 0x02000000; + break; + } // case 240 + case 256: { + long v = input.readUInt64(); + ensureToUserIdsListIsMutable(); + toUserIdsList_.addLong(v); + break; + } // case 256 + case 258: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureToUserIdsListIsMutable(); + while (input.getBytesUntilLimit() > 0) { + toUserIdsList_.addLong(input.readUInt64()); + } + input.popLimit(limit); + break; + } // case 258 + case 264: { + sendTimet_ = input.readUInt64(); + bitField0_ |= 0x08000000; + break; + } // case 264 + case 272: { + forceDisplayEffectst_ = input.readUInt64(); + bitField0_ |= 0x10000000; + break; + } // case 272 + case 282: { + traceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x20000000; + break; + } // case 282 + case 288: { + effectDisplayTs_ = input.readUInt64(); + bitField0_ |= 0x40000000; + break; + } // case 288 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common common_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder> commonBuilder_; + /** + * .Common common = 1; + * @return Whether the common field is set. + */ + public boolean hasCommon() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .Common common = 1; + * @return The common. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getCommon() { + if (commonBuilder_ == null) { + return common_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } else { + return commonBuilder_.getMessage(); + } + } + /** + * .Common common = 1; + */ + public Builder setCommon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common value) { + if (commonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + common_ = value; + } else { + commonBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public Builder setCommon( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder builderForValue) { + if (commonBuilder_ == null) { + common_ = builderForValue.build(); + } else { + commonBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public Builder mergeCommon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common value) { + if (commonBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + common_ != null && + common_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance()) { + getCommonBuilder().mergeFrom(value); + } else { + common_ = value; + } + } else { + commonBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public Builder clearCommon() { + bitField0_ = (bitField0_ & ~0x00000001); + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); + commonBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder getCommonBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCommonFieldBuilder().getBuilder(); + } + /** + * .Common common = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder() { + if (commonBuilder_ != null) { + return commonBuilder_.getMessageOrBuilder(); + } else { + return common_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } + } + /** + * .Common common = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder> + getCommonFieldBuilder() { + if (commonBuilder_ == null) { + commonBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder>( + getCommon(), + getParentForChildren(), + isClean()); + common_ = null; + } + return commonBuilder_; + } + + private long longGiftId_ ; + /** + * uint64 long_gift_id = 2; + * @return The longGiftId. + */ + @java.lang.Override + public long getLongGiftId() { + return longGiftId_; + } + /** + * uint64 long_gift_id = 2; + * @param value The longGiftId to set. + * @return This builder for chaining. + */ + public Builder setLongGiftId(long value) { + + longGiftId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint64 long_gift_id = 2; + * @return This builder for chaining. + */ + public Builder clearLongGiftId() { + bitField0_ = (bitField0_ & ~0x00000002); + longGiftId_ = 0L; + onChanged(); + return this; + } + + private long fanTicketCount_ ; + /** + * uint64 fan_ticket_count = 3; + * @return The fanTicketCount. + */ + @java.lang.Override + public long getFanTicketCount() { + return fanTicketCount_; + } + /** + * uint64 fan_ticket_count = 3; + * @param value The fanTicketCount to set. + * @return This builder for chaining. + */ + public Builder setFanTicketCount(long value) { + + fanTicketCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 fan_ticket_count = 3; + * @return This builder for chaining. + */ + public Builder clearFanTicketCount() { + bitField0_ = (bitField0_ & ~0x00000004); + fanTicketCount_ = 0L; + onChanged(); + return this; + } + + private long groupCount_ ; + /** + * uint64 group_count = 4; + * @return The groupCount. + */ + @java.lang.Override + public long getGroupCount() { + return groupCount_; + } + /** + * uint64 group_count = 4; + * @param value The groupCount to set. + * @return This builder for chaining. + */ + public Builder setGroupCount(long value) { + + groupCount_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint64 group_count = 4; + * @return This builder for chaining. + */ + public Builder clearGroupCount() { + bitField0_ = (bitField0_ & ~0x00000008); + groupCount_ = 0L; + onChanged(); + return this; + } + + private long repeatCount_ ; + /** + * uint64 repeat_count = 5; + * @return The repeatCount. + */ + @java.lang.Override + public long getRepeatCount() { + return repeatCount_; + } + /** + * uint64 repeat_count = 5; + * @param value The repeatCount to set. + * @return This builder for chaining. + */ + public Builder setRepeatCount(long value) { + + repeatCount_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * uint64 repeat_count = 5; + * @return This builder for chaining. + */ + public Builder clearRepeatCount() { + bitField0_ = (bitField0_ & ~0x00000010); + repeatCount_ = 0L; + onChanged(); + return this; + } + + private long comboCount_ ; + /** + * uint64 combo_count = 6; + * @return The comboCount. + */ + @java.lang.Override + public long getComboCount() { + return comboCount_; + } + /** + * uint64 combo_count = 6; + * @param value The comboCount to set. + * @return This builder for chaining. + */ + public Builder setComboCount(long value) { + + comboCount_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * uint64 combo_count = 6; + * @return This builder for chaining. + */ + public Builder clearComboCount() { + bitField0_ = (bitField0_ & ~0x00000020); + comboCount_ = 0L; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> userBuilder_; + /** + * .User user = 7; + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * .User user = 7; + * @return The user. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * .User user = 7; + */ + public Builder setUser(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .User user = 7; + */ + public Builder setUser( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .User user = 7; + */ + public Builder mergeUser(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + user_ != null && + user_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .User user = 7; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000040); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User user = 7; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder getUserBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * .User user = 7; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + } + /** + * .User user = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User toUser_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> toUserBuilder_; + /** + * .User to_user = 8; + * @return Whether the toUser field is set. + */ + public boolean hasToUser() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * .User to_user = 8; + * @return The toUser. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getToUser() { + if (toUserBuilder_ == null) { + return toUser_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : toUser_; + } else { + return toUserBuilder_.getMessage(); + } + } + /** + * .User to_user = 8; + */ + public Builder setToUser(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (toUserBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + toUser_ = value; + } else { + toUserBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * .User to_user = 8; + */ + public Builder setToUser( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder builderForValue) { + if (toUserBuilder_ == null) { + toUser_ = builderForValue.build(); + } else { + toUserBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * .User to_user = 8; + */ + public Builder mergeToUser(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (toUserBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) && + toUser_ != null && + toUser_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance()) { + getToUserBuilder().mergeFrom(value); + } else { + toUser_ = value; + } + } else { + toUserBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * .User to_user = 8; + */ + public Builder clearToUser() { + bitField0_ = (bitField0_ & ~0x00000080); + toUser_ = null; + if (toUserBuilder_ != null) { + toUserBuilder_.dispose(); + toUserBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User to_user = 8; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder getToUserBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getToUserFieldBuilder().getBuilder(); + } + /** + * .User to_user = 8; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getToUserOrBuilder() { + if (toUserBuilder_ != null) { + return toUserBuilder_.getMessageOrBuilder(); + } else { + return toUser_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : toUser_; + } + } + /** + * .User to_user = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> + getToUserFieldBuilder() { + if (toUserBuilder_ == null) { + toUserBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder>( + getToUser(), + getParentForChildren(), + isClean()); + toUser_ = null; + } + return toUserBuilder_; + } + + private int repeatEnd_ ; + /** + * uint32 repeat_end = 9; + * @return The repeatEnd. + */ + @java.lang.Override + public int getRepeatEnd() { + return repeatEnd_; + } + /** + * uint32 repeat_end = 9; + * @param value The repeatEnd to set. + * @return This builder for chaining. + */ + public Builder setRepeatEnd(int value) { + + repeatEnd_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * uint32 repeat_end = 9; + * @return This builder for chaining. + */ + public Builder clearRepeatEnd() { + bitField0_ = (bitField0_ & ~0x00000100); + repeatEnd_ = 0; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect textEffect_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffectOrBuilder> textEffectBuilder_; + /** + * .TextEffect text_effect = 10; + * @return Whether the textEffect field is set. + */ + public boolean hasTextEffect() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * .TextEffect text_effect = 10; + * @return The textEffect. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect getTextEffect() { + if (textEffectBuilder_ == null) { + return textEffect_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.getDefaultInstance() : textEffect_; + } else { + return textEffectBuilder_.getMessage(); + } + } + /** + * .TextEffect text_effect = 10; + */ + public Builder setTextEffect(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect value) { + if (textEffectBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + textEffect_ = value; + } else { + textEffectBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .TextEffect text_effect = 10; + */ + public Builder setTextEffect( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.Builder builderForValue) { + if (textEffectBuilder_ == null) { + textEffect_ = builderForValue.build(); + } else { + textEffectBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .TextEffect text_effect = 10; + */ + public Builder mergeTextEffect(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect value) { + if (textEffectBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) && + textEffect_ != null && + textEffect_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.getDefaultInstance()) { + getTextEffectBuilder().mergeFrom(value); + } else { + textEffect_ = value; + } + } else { + textEffectBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .TextEffect text_effect = 10; + */ + public Builder clearTextEffect() { + bitField0_ = (bitField0_ & ~0x00000200); + textEffect_ = null; + if (textEffectBuilder_ != null) { + textEffectBuilder_.dispose(); + textEffectBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .TextEffect text_effect = 10; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.Builder getTextEffectBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getTextEffectFieldBuilder().getBuilder(); + } + /** + * .TextEffect text_effect = 10; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffectOrBuilder getTextEffectOrBuilder() { + if (textEffectBuilder_ != null) { + return textEffectBuilder_.getMessageOrBuilder(); + } else { + return textEffect_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.getDefaultInstance() : textEffect_; + } + } + /** + * .TextEffect text_effect = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffectOrBuilder> + getTextEffectFieldBuilder() { + if (textEffectBuilder_ == null) { + textEffectBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffectOrBuilder>( + getTextEffect(), + getParentForChildren(), + isClean()); + textEffect_ = null; + } + return textEffectBuilder_; + } + + private long groupId_ ; + /** + * uint64 group_id = 11; + * @return The groupId. + */ + @java.lang.Override + public long getGroupId() { + return groupId_; + } + /** + * uint64 group_id = 11; + * @param value The groupId to set. + * @return This builder for chaining. + */ + public Builder setGroupId(long value) { + + groupId_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * uint64 group_id = 11; + * @return This builder for chaining. + */ + public Builder clearGroupId() { + bitField0_ = (bitField0_ & ~0x00000400); + groupId_ = 0L; + onChanged(); + return this; + } + + private long incomeTaskgifts_ ; + /** + * uint64 income_taskgifts = 12; + * @return The incomeTaskgifts. + */ + @java.lang.Override + public long getIncomeTaskgifts() { + return incomeTaskgifts_; + } + /** + * uint64 income_taskgifts = 12; + * @param value The incomeTaskgifts to set. + * @return This builder for chaining. + */ + public Builder setIncomeTaskgifts(long value) { + + incomeTaskgifts_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * uint64 income_taskgifts = 12; + * @return This builder for chaining. + */ + public Builder clearIncomeTaskgifts() { + bitField0_ = (bitField0_ & ~0x00000800); + incomeTaskgifts_ = 0L; + onChanged(); + return this; + } + + private long roomFanTicketCount_ ; + /** + * uint64 room_fan_ticket_count = 13; + * @return The roomFanTicketCount. + */ + @java.lang.Override + public long getRoomFanTicketCount() { + return roomFanTicketCount_; + } + /** + * uint64 room_fan_ticket_count = 13; + * @param value The roomFanTicketCount to set. + * @return This builder for chaining. + */ + public Builder setRoomFanTicketCount(long value) { + + roomFanTicketCount_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * uint64 room_fan_ticket_count = 13; + * @return This builder for chaining. + */ + public Builder clearRoomFanTicketCount() { + bitField0_ = (bitField0_ & ~0x00001000); + roomFanTicketCount_ = 0L; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority priority_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriorityOrBuilder> priorityBuilder_; + /** + * .GiftIMPriority priority = 14; + * @return Whether the priority field is set. + */ + public boolean hasPriority() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * .GiftIMPriority priority = 14; + * @return The priority. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority getPriority() { + if (priorityBuilder_ == null) { + return priority_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.getDefaultInstance() : priority_; + } else { + return priorityBuilder_.getMessage(); + } + } + /** + * .GiftIMPriority priority = 14; + */ + public Builder setPriority(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority value) { + if (priorityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priority_ = value; + } else { + priorityBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * .GiftIMPriority priority = 14; + */ + public Builder setPriority( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.Builder builderForValue) { + if (priorityBuilder_ == null) { + priority_ = builderForValue.build(); + } else { + priorityBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * .GiftIMPriority priority = 14; + */ + public Builder mergePriority(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority value) { + if (priorityBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) && + priority_ != null && + priority_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.getDefaultInstance()) { + getPriorityBuilder().mergeFrom(value); + } else { + priority_ = value; + } + } else { + priorityBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * .GiftIMPriority priority = 14; + */ + public Builder clearPriority() { + bitField0_ = (bitField0_ & ~0x00002000); + priority_ = null; + if (priorityBuilder_ != null) { + priorityBuilder_.dispose(); + priorityBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .GiftIMPriority priority = 14; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.Builder getPriorityBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getPriorityFieldBuilder().getBuilder(); + } + /** + * .GiftIMPriority priority = 14; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriorityOrBuilder getPriorityOrBuilder() { + if (priorityBuilder_ != null) { + return priorityBuilder_.getMessageOrBuilder(); + } else { + return priority_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.getDefaultInstance() : priority_; + } + } + /** + * .GiftIMPriority priority = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriorityOrBuilder> + getPriorityFieldBuilder() { + if (priorityBuilder_ == null) { + priorityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriorityOrBuilder>( + getPriority(), + getParentForChildren(), + isClean()); + priority_ = null; + } + return priorityBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct gift_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStructOrBuilder> giftBuilder_; + /** + * .GiftStruct gift = 15; + * @return Whether the gift field is set. + */ + public boolean hasGift() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + * .GiftStruct gift = 15; + * @return The gift. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct getGift() { + if (giftBuilder_ == null) { + return gift_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.getDefaultInstance() : gift_; + } else { + return giftBuilder_.getMessage(); + } + } + /** + * .GiftStruct gift = 15; + */ + public Builder setGift(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct value) { + if (giftBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gift_ = value; + } else { + giftBuilder_.setMessage(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * .GiftStruct gift = 15; + */ + public Builder setGift( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.Builder builderForValue) { + if (giftBuilder_ == null) { + gift_ = builderForValue.build(); + } else { + giftBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * .GiftStruct gift = 15; + */ + public Builder mergeGift(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct value) { + if (giftBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0) && + gift_ != null && + gift_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.getDefaultInstance()) { + getGiftBuilder().mergeFrom(value); + } else { + gift_ = value; + } + } else { + giftBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * .GiftStruct gift = 15; + */ + public Builder clearGift() { + bitField0_ = (bitField0_ & ~0x00004000); + gift_ = null; + if (giftBuilder_ != null) { + giftBuilder_.dispose(); + giftBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .GiftStruct gift = 15; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.Builder getGiftBuilder() { + bitField0_ |= 0x00004000; + onChanged(); + return getGiftFieldBuilder().getBuilder(); + } + /** + * .GiftStruct gift = 15; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStructOrBuilder getGiftOrBuilder() { + if (giftBuilder_ != null) { + return giftBuilder_.getMessageOrBuilder(); + } else { + return gift_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.getDefaultInstance() : gift_; + } + } + /** + * .GiftStruct gift = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStructOrBuilder> + getGiftFieldBuilder() { + if (giftBuilder_ == null) { + giftBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStructOrBuilder>( + getGift(), + getParentForChildren(), + isClean()); + gift_ = null; + } + return giftBuilder_; + } + + private java.lang.Object logId_ = ""; + /** + * string log_id = 16; + * @return The logId. + */ + public java.lang.String getLogId() { + java.lang.Object ref = logId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string log_id = 16; + * @return The bytes for logId. + */ + public com.google.protobuf.ByteString + getLogIdBytes() { + java.lang.Object ref = logId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + logId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string log_id = 16; + * @param value The logId to set. + * @return This builder for chaining. + */ + public Builder setLogId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + logId_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * string log_id = 16; + * @return This builder for chaining. + */ + public Builder clearLogId() { + logId_ = getDefaultInstance().getLogId(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + /** + * string log_id = 16; + * @param value The bytes for logId to set. + * @return This builder for chaining. + */ + public Builder setLogIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + logId_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private long sendType_ ; + /** + * uint64 send_type = 17; + * @return The sendType. + */ + @java.lang.Override + public long getSendType() { + return sendType_; + } + /** + * uint64 send_type = 17; + * @param value The sendType to set. + * @return This builder for chaining. + */ + public Builder setSendType(long value) { + + sendType_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * uint64 send_type = 17; + * @return This builder for chaining. + */ + public Builder clearSendType() { + bitField0_ = (bitField0_ & ~0x00010000); + sendType_ = 0L; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon publicAreaCommon_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommonOrBuilder> publicAreaCommonBuilder_; + /** + * .PublicAreaCommon public_area_common = 18; + * @return Whether the publicAreaCommon field is set. + */ + public boolean hasPublicAreaCommon() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * .PublicAreaCommon public_area_common = 18; + * @return The publicAreaCommon. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon getPublicAreaCommon() { + if (publicAreaCommonBuilder_ == null) { + return publicAreaCommon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.getDefaultInstance() : publicAreaCommon_; + } else { + return publicAreaCommonBuilder_.getMessage(); + } + } + /** + * .PublicAreaCommon public_area_common = 18; + */ + public Builder setPublicAreaCommon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon value) { + if (publicAreaCommonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + publicAreaCommon_ = value; + } else { + publicAreaCommonBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * .PublicAreaCommon public_area_common = 18; + */ + public Builder setPublicAreaCommon( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.Builder builderForValue) { + if (publicAreaCommonBuilder_ == null) { + publicAreaCommon_ = builderForValue.build(); + } else { + publicAreaCommonBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * .PublicAreaCommon public_area_common = 18; + */ + public Builder mergePublicAreaCommon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon value) { + if (publicAreaCommonBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) && + publicAreaCommon_ != null && + publicAreaCommon_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.getDefaultInstance()) { + getPublicAreaCommonBuilder().mergeFrom(value); + } else { + publicAreaCommon_ = value; + } + } else { + publicAreaCommonBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * .PublicAreaCommon public_area_common = 18; + */ + public Builder clearPublicAreaCommon() { + bitField0_ = (bitField0_ & ~0x00020000); + publicAreaCommon_ = null; + if (publicAreaCommonBuilder_ != null) { + publicAreaCommonBuilder_.dispose(); + publicAreaCommonBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .PublicAreaCommon public_area_common = 18; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.Builder getPublicAreaCommonBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return getPublicAreaCommonFieldBuilder().getBuilder(); + } + /** + * .PublicAreaCommon public_area_common = 18; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommonOrBuilder getPublicAreaCommonOrBuilder() { + if (publicAreaCommonBuilder_ != null) { + return publicAreaCommonBuilder_.getMessageOrBuilder(); + } else { + return publicAreaCommon_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.getDefaultInstance() : publicAreaCommon_; + } + } + /** + * .PublicAreaCommon public_area_common = 18; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommonOrBuilder> + getPublicAreaCommonFieldBuilder() { + if (publicAreaCommonBuilder_ == null) { + publicAreaCommonBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommonOrBuilder>( + getPublicAreaCommon(), + getParentForChildren(), + isClean()); + publicAreaCommon_ = null; + } + return publicAreaCommonBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text trayDisplayText_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder> trayDisplayTextBuilder_; + /** + * .Text tray_display_text = 19; + * @return Whether the trayDisplayText field is set. + */ + public boolean hasTrayDisplayText() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * .Text tray_display_text = 19; + * @return The trayDisplayText. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text getTrayDisplayText() { + if (trayDisplayTextBuilder_ == null) { + return trayDisplayText_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance() : trayDisplayText_; + } else { + return trayDisplayTextBuilder_.getMessage(); + } + } + /** + * .Text tray_display_text = 19; + */ + public Builder setTrayDisplayText(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text value) { + if (trayDisplayTextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + trayDisplayText_ = value; + } else { + trayDisplayTextBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .Text tray_display_text = 19; + */ + public Builder setTrayDisplayText( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder builderForValue) { + if (trayDisplayTextBuilder_ == null) { + trayDisplayText_ = builderForValue.build(); + } else { + trayDisplayTextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .Text tray_display_text = 19; + */ + public Builder mergeTrayDisplayText(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text value) { + if (trayDisplayTextBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) && + trayDisplayText_ != null && + trayDisplayText_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance()) { + getTrayDisplayTextBuilder().mergeFrom(value); + } else { + trayDisplayText_ = value; + } + } else { + trayDisplayTextBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .Text tray_display_text = 19; + */ + public Builder clearTrayDisplayText() { + bitField0_ = (bitField0_ & ~0x00040000); + trayDisplayText_ = null; + if (trayDisplayTextBuilder_ != null) { + trayDisplayTextBuilder_.dispose(); + trayDisplayTextBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Text tray_display_text = 19; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder getTrayDisplayTextBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return getTrayDisplayTextFieldBuilder().getBuilder(); + } + /** + * .Text tray_display_text = 19; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder getTrayDisplayTextOrBuilder() { + if (trayDisplayTextBuilder_ != null) { + return trayDisplayTextBuilder_.getMessageOrBuilder(); + } else { + return trayDisplayText_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance() : trayDisplayText_; + } + } + /** + * .Text tray_display_text = 19; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder> + getTrayDisplayTextFieldBuilder() { + if (trayDisplayTextBuilder_ == null) { + trayDisplayTextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder>( + getTrayDisplayText(), + getParentForChildren(), + isClean()); + trayDisplayText_ = null; + } + return trayDisplayTextBuilder_; + } + + private long bannedDisplayEffects_ ; + /** + * uint64 banned_display_effects = 20; + * @return The bannedDisplayEffects. + */ + @java.lang.Override + public long getBannedDisplayEffects() { + return bannedDisplayEffects_; + } + /** + * uint64 banned_display_effects = 20; + * @param value The bannedDisplayEffects to set. + * @return This builder for chaining. + */ + public Builder setBannedDisplayEffects(long value) { + + bannedDisplayEffects_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * uint64 banned_display_effects = 20; + * @return This builder for chaining. + */ + public Builder clearBannedDisplayEffects() { + bitField0_ = (bitField0_ & ~0x00080000); + bannedDisplayEffects_ = 0L; + onChanged(); + return this; + } + + private boolean displayForSelf_ ; + /** + *
+     * GiftTrayInfo trayInfo = 21;
+     * AssetEffectMixInfo assetEffectMixInfo = 22;
+     * 
+ * + * bool display_for_self = 25; + * @return The displayForSelf. + */ + @java.lang.Override + public boolean getDisplayForSelf() { + return displayForSelf_; + } + /** + *
+     * GiftTrayInfo trayInfo = 21;
+     * AssetEffectMixInfo assetEffectMixInfo = 22;
+     * 
+ * + * bool display_for_self = 25; + * @param value The displayForSelf to set. + * @return This builder for chaining. + */ + public Builder setDisplayForSelf(boolean value) { + + displayForSelf_ = value; + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + *
+     * GiftTrayInfo trayInfo = 21;
+     * AssetEffectMixInfo assetEffectMixInfo = 22;
+     * 
+ * + * bool display_for_self = 25; + * @return This builder for chaining. + */ + public Builder clearDisplayForSelf() { + bitField0_ = (bitField0_ & ~0x00100000); + displayForSelf_ = false; + onChanged(); + return this; + } + + private java.lang.Object interactGiftInfo_ = ""; + /** + * string interact_gift_info = 26; + * @return The interactGiftInfo. + */ + public java.lang.String getInteractGiftInfo() { + java.lang.Object ref = interactGiftInfo_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + interactGiftInfo_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string interact_gift_info = 26; + * @return The bytes for interactGiftInfo. + */ + public com.google.protobuf.ByteString + getInteractGiftInfoBytes() { + java.lang.Object ref = interactGiftInfo_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + interactGiftInfo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string interact_gift_info = 26; + * @param value The interactGiftInfo to set. + * @return This builder for chaining. + */ + public Builder setInteractGiftInfo( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + interactGiftInfo_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * string interact_gift_info = 26; + * @return This builder for chaining. + */ + public Builder clearInteractGiftInfo() { + interactGiftInfo_ = getDefaultInstance().getInteractGiftInfo(); + bitField0_ = (bitField0_ & ~0x00200000); + onChanged(); + return this; + } + /** + * string interact_gift_info = 26; + * @param value The bytes for interactGiftInfo to set. + * @return This builder for chaining. + */ + public Builder setInteractGiftInfoBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + interactGiftInfo_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + private java.lang.Object diyItemInfo_ = ""; + /** + * string diy_item_info = 27; + * @return The diyItemInfo. + */ + public java.lang.String getDiyItemInfo() { + java.lang.Object ref = diyItemInfo_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + diyItemInfo_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string diy_item_info = 27; + * @return The bytes for diyItemInfo. + */ + public com.google.protobuf.ByteString + getDiyItemInfoBytes() { + java.lang.Object ref = diyItemInfo_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + diyItemInfo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string diy_item_info = 27; + * @param value The diyItemInfo to set. + * @return This builder for chaining. + */ + public Builder setDiyItemInfo( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + diyItemInfo_ = value; + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * string diy_item_info = 27; + * @return This builder for chaining. + */ + public Builder clearDiyItemInfo() { + diyItemInfo_ = getDefaultInstance().getDiyItemInfo(); + bitField0_ = (bitField0_ & ~0x00400000); + onChanged(); + return this; + } + /** + * string diy_item_info = 27; + * @param value The bytes for diyItemInfo to set. + * @return This builder for chaining. + */ + public Builder setDiyItemInfoBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + diyItemInfo_ = value; + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList minAssetSetList_ = emptyLongList(); + private void ensureMinAssetSetListIsMutable() { + if (!((bitField0_ & 0x00800000) != 0)) { + minAssetSetList_ = mutableCopy(minAssetSetList_); + bitField0_ |= 0x00800000; + } + } + /** + * repeated uint64 min_asset_set_list = 28; + * @return A list containing the minAssetSetList. + */ + public java.util.List + getMinAssetSetListList() { + return ((bitField0_ & 0x00800000) != 0) ? + java.util.Collections.unmodifiableList(minAssetSetList_) : minAssetSetList_; + } + /** + * repeated uint64 min_asset_set_list = 28; + * @return The count of minAssetSetList. + */ + public int getMinAssetSetListCount() { + return minAssetSetList_.size(); + } + /** + * repeated uint64 min_asset_set_list = 28; + * @param index The index of the element to return. + * @return The minAssetSetList at the given index. + */ + public long getMinAssetSetList(int index) { + return minAssetSetList_.getLong(index); + } + /** + * repeated uint64 min_asset_set_list = 28; + * @param index The index to set the value at. + * @param value The minAssetSetList to set. + * @return This builder for chaining. + */ + public Builder setMinAssetSetList( + int index, long value) { + + ensureMinAssetSetListIsMutable(); + minAssetSetList_.setLong(index, value); + onChanged(); + return this; + } + /** + * repeated uint64 min_asset_set_list = 28; + * @param value The minAssetSetList to add. + * @return This builder for chaining. + */ + public Builder addMinAssetSetList(long value) { + + ensureMinAssetSetListIsMutable(); + minAssetSetList_.addLong(value); + onChanged(); + return this; + } + /** + * repeated uint64 min_asset_set_list = 28; + * @param values The minAssetSetList to add. + * @return This builder for chaining. + */ + public Builder addAllMinAssetSetList( + java.lang.Iterable values) { + ensureMinAssetSetListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, minAssetSetList_); + onChanged(); + return this; + } + /** + * repeated uint64 min_asset_set_list = 28; + * @return This builder for chaining. + */ + public Builder clearMinAssetSetList() { + minAssetSetList_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00800000); + onChanged(); + return this; + } + + private long totalCount_ ; + /** + * uint64 total_count = 29; + * @return The totalCount. + */ + @java.lang.Override + public long getTotalCount() { + return totalCount_; + } + /** + * uint64 total_count = 29; + * @param value The totalCount to set. + * @return This builder for chaining. + */ + public Builder setTotalCount(long value) { + + totalCount_ = value; + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * uint64 total_count = 29; + * @return This builder for chaining. + */ + public Builder clearTotalCount() { + bitField0_ = (bitField0_ & ~0x01000000); + totalCount_ = 0L; + onChanged(); + return this; + } + + private int clientGiftSource_ ; + /** + * uint32 client_gift_source = 30; + * @return The clientGiftSource. + */ + @java.lang.Override + public int getClientGiftSource() { + return clientGiftSource_; + } + /** + * uint32 client_gift_source = 30; + * @param value The clientGiftSource to set. + * @return This builder for chaining. + */ + public Builder setClientGiftSource(int value) { + + clientGiftSource_ = value; + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + /** + * uint32 client_gift_source = 30; + * @return This builder for chaining. + */ + public Builder clearClientGiftSource() { + bitField0_ = (bitField0_ & ~0x02000000); + clientGiftSource_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList toUserIdsList_ = emptyLongList(); + private void ensureToUserIdsListIsMutable() { + if (!((bitField0_ & 0x04000000) != 0)) { + toUserIdsList_ = mutableCopy(toUserIdsList_); + bitField0_ |= 0x04000000; + } + } + /** + *
+     * AnchorGiftData anchorGift = 31;
+     * 
+ * + * repeated uint64 to_user_ids_list = 32; + * @return A list containing the toUserIdsList. + */ + public java.util.List + getToUserIdsListList() { + return ((bitField0_ & 0x04000000) != 0) ? + java.util.Collections.unmodifiableList(toUserIdsList_) : toUserIdsList_; + } + /** + *
+     * AnchorGiftData anchorGift = 31;
+     * 
+ * + * repeated uint64 to_user_ids_list = 32; + * @return The count of toUserIdsList. + */ + public int getToUserIdsListCount() { + return toUserIdsList_.size(); + } + /** + *
+     * AnchorGiftData anchorGift = 31;
+     * 
+ * + * repeated uint64 to_user_ids_list = 32; + * @param index The index of the element to return. + * @return The toUserIdsList at the given index. + */ + public long getToUserIdsList(int index) { + return toUserIdsList_.getLong(index); + } + /** + *
+     * AnchorGiftData anchorGift = 31;
+     * 
+ * + * repeated uint64 to_user_ids_list = 32; + * @param index The index to set the value at. + * @param value The toUserIdsList to set. + * @return This builder for chaining. + */ + public Builder setToUserIdsList( + int index, long value) { + + ensureToUserIdsListIsMutable(); + toUserIdsList_.setLong(index, value); + onChanged(); + return this; + } + /** + *
+     * AnchorGiftData anchorGift = 31;
+     * 
+ * + * repeated uint64 to_user_ids_list = 32; + * @param value The toUserIdsList to add. + * @return This builder for chaining. + */ + public Builder addToUserIdsList(long value) { + + ensureToUserIdsListIsMutable(); + toUserIdsList_.addLong(value); + onChanged(); + return this; + } + /** + *
+     * AnchorGiftData anchorGift = 31;
+     * 
+ * + * repeated uint64 to_user_ids_list = 32; + * @param values The toUserIdsList to add. + * @return This builder for chaining. + */ + public Builder addAllToUserIdsList( + java.lang.Iterable values) { + ensureToUserIdsListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, toUserIdsList_); + onChanged(); + return this; + } + /** + *
+     * AnchorGiftData anchorGift = 31;
+     * 
+ * + * repeated uint64 to_user_ids_list = 32; + * @return This builder for chaining. + */ + public Builder clearToUserIdsList() { + toUserIdsList_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x04000000); + onChanged(); + return this; + } + + private long sendTimet_ ; + /** + * uint64 send_timet = 33; + * @return The sendTimet. + */ + @java.lang.Override + public long getSendTimet() { + return sendTimet_; + } + /** + * uint64 send_timet = 33; + * @param value The sendTimet to set. + * @return This builder for chaining. + */ + public Builder setSendTimet(long value) { + + sendTimet_ = value; + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + /** + * uint64 send_timet = 33; + * @return This builder for chaining. + */ + public Builder clearSendTimet() { + bitField0_ = (bitField0_ & ~0x08000000); + sendTimet_ = 0L; + onChanged(); + return this; + } + + private long forceDisplayEffectst_ ; + /** + * uint64 force_display_effectst = 34; + * @return The forceDisplayEffectst. + */ + @java.lang.Override + public long getForceDisplayEffectst() { + return forceDisplayEffectst_; + } + /** + * uint64 force_display_effectst = 34; + * @param value The forceDisplayEffectst to set. + * @return This builder for chaining. + */ + public Builder setForceDisplayEffectst(long value) { + + forceDisplayEffectst_ = value; + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + /** + * uint64 force_display_effectst = 34; + * @return This builder for chaining. + */ + public Builder clearForceDisplayEffectst() { + bitField0_ = (bitField0_ & ~0x10000000); + forceDisplayEffectst_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object traceId_ = ""; + /** + * string trace_id = 35; + * @return The traceId. + */ + public java.lang.String getTraceId() { + java.lang.Object ref = traceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + traceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string trace_id = 35; + * @return The bytes for traceId. + */ + public com.google.protobuf.ByteString + getTraceIdBytes() { + java.lang.Object ref = traceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + traceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string trace_id = 35; + * @param value The traceId to set. + * @return This builder for chaining. + */ + public Builder setTraceId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + traceId_ = value; + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + /** + * string trace_id = 35; + * @return This builder for chaining. + */ + public Builder clearTraceId() { + traceId_ = getDefaultInstance().getTraceId(); + bitField0_ = (bitField0_ & ~0x20000000); + onChanged(); + return this; + } + /** + * string trace_id = 35; + * @param value The bytes for traceId to set. + * @return This builder for chaining. + */ + public Builder setTraceIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + traceId_ = value; + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + + private long effectDisplayTs_ ; + /** + * uint64 effect_display_ts = 36; + * @return The effectDisplayTs. + */ + @java.lang.Override + public long getEffectDisplayTs() { + return effectDisplayTs_; + } + /** + * uint64 effect_display_ts = 36; + * @param value The effectDisplayTs to set. + * @return This builder for chaining. + */ + public Builder setEffectDisplayTs(long value) { + + effectDisplayTs_ = value; + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + /** + * uint64 effect_display_ts = 36; + * @return This builder for chaining. + */ + public Builder clearEffectDisplayTs() { + bitField0_ = (bitField0_ & ~0x40000000); + effectDisplayTs_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg) + } + + // @@protoc_insertion_point(class_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public douyin_webcast_gift_message_msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_gift_message_msgOrBuilder.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_gift_message_msgOrBuilder.java new file mode 100644 index 0000000..4830199 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_gift_message_msgOrBuilder.java @@ -0,0 +1,354 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_webcast_gift_message_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +public interface douyin_webcast_gift_message_msgOrBuilder extends + // @@protoc_insertion_point(interface_extends:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_gift_message_msg) + com.google.protobuf.MessageOrBuilder { + + /** + * .Common common = 1; + * @return Whether the common field is set. + */ + boolean hasCommon(); + /** + * .Common common = 1; + * @return The common. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getCommon(); + /** + * .Common common = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder(); + + /** + * uint64 long_gift_id = 2; + * @return The longGiftId. + */ + long getLongGiftId(); + + /** + * uint64 fan_ticket_count = 3; + * @return The fanTicketCount. + */ + long getFanTicketCount(); + + /** + * uint64 group_count = 4; + * @return The groupCount. + */ + long getGroupCount(); + + /** + * uint64 repeat_count = 5; + * @return The repeatCount. + */ + long getRepeatCount(); + + /** + * uint64 combo_count = 6; + * @return The comboCount. + */ + long getComboCount(); + + /** + * .User user = 7; + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * .User user = 7; + * @return The user. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser(); + /** + * .User user = 7; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder(); + + /** + * .User to_user = 8; + * @return Whether the toUser field is set. + */ + boolean hasToUser(); + /** + * .User to_user = 8; + * @return The toUser. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getToUser(); + /** + * .User to_user = 8; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getToUserOrBuilder(); + + /** + * uint32 repeat_end = 9; + * @return The repeatEnd. + */ + int getRepeatEnd(); + + /** + * .TextEffect text_effect = 10; + * @return Whether the textEffect field is set. + */ + boolean hasTextEffect(); + /** + * .TextEffect text_effect = 10; + * @return The textEffect. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect getTextEffect(); + /** + * .TextEffect text_effect = 10; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffectOrBuilder getTextEffectOrBuilder(); + + /** + * uint64 group_id = 11; + * @return The groupId. + */ + long getGroupId(); + + /** + * uint64 income_taskgifts = 12; + * @return The incomeTaskgifts. + */ + long getIncomeTaskgifts(); + + /** + * uint64 room_fan_ticket_count = 13; + * @return The roomFanTicketCount. + */ + long getRoomFanTicketCount(); + + /** + * .GiftIMPriority priority = 14; + * @return Whether the priority field is set. + */ + boolean hasPriority(); + /** + * .GiftIMPriority priority = 14; + * @return The priority. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority getPriority(); + /** + * .GiftIMPriority priority = 14; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriorityOrBuilder getPriorityOrBuilder(); + + /** + * .GiftStruct gift = 15; + * @return Whether the gift field is set. + */ + boolean hasGift(); + /** + * .GiftStruct gift = 15; + * @return The gift. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct getGift(); + /** + * .GiftStruct gift = 15; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStructOrBuilder getGiftOrBuilder(); + + /** + * string log_id = 16; + * @return The logId. + */ + java.lang.String getLogId(); + /** + * string log_id = 16; + * @return The bytes for logId. + */ + com.google.protobuf.ByteString + getLogIdBytes(); + + /** + * uint64 send_type = 17; + * @return The sendType. + */ + long getSendType(); + + /** + * .PublicAreaCommon public_area_common = 18; + * @return Whether the publicAreaCommon field is set. + */ + boolean hasPublicAreaCommon(); + /** + * .PublicAreaCommon public_area_common = 18; + * @return The publicAreaCommon. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon getPublicAreaCommon(); + /** + * .PublicAreaCommon public_area_common = 18; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommonOrBuilder getPublicAreaCommonOrBuilder(); + + /** + * .Text tray_display_text = 19; + * @return Whether the trayDisplayText field is set. + */ + boolean hasTrayDisplayText(); + /** + * .Text tray_display_text = 19; + * @return The trayDisplayText. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text getTrayDisplayText(); + /** + * .Text tray_display_text = 19; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder getTrayDisplayTextOrBuilder(); + + /** + * uint64 banned_display_effects = 20; + * @return The bannedDisplayEffects. + */ + long getBannedDisplayEffects(); + + /** + *
+   * GiftTrayInfo trayInfo = 21;
+   * AssetEffectMixInfo assetEffectMixInfo = 22;
+   * 
+ * + * bool display_for_self = 25; + * @return The displayForSelf. + */ + boolean getDisplayForSelf(); + + /** + * string interact_gift_info = 26; + * @return The interactGiftInfo. + */ + java.lang.String getInteractGiftInfo(); + /** + * string interact_gift_info = 26; + * @return The bytes for interactGiftInfo. + */ + com.google.protobuf.ByteString + getInteractGiftInfoBytes(); + + /** + * string diy_item_info = 27; + * @return The diyItemInfo. + */ + java.lang.String getDiyItemInfo(); + /** + * string diy_item_info = 27; + * @return The bytes for diyItemInfo. + */ + com.google.protobuf.ByteString + getDiyItemInfoBytes(); + + /** + * repeated uint64 min_asset_set_list = 28; + * @return A list containing the minAssetSetList. + */ + java.util.List getMinAssetSetListList(); + /** + * repeated uint64 min_asset_set_list = 28; + * @return The count of minAssetSetList. + */ + int getMinAssetSetListCount(); + /** + * repeated uint64 min_asset_set_list = 28; + * @param index The index of the element to return. + * @return The minAssetSetList at the given index. + */ + long getMinAssetSetList(int index); + + /** + * uint64 total_count = 29; + * @return The totalCount. + */ + long getTotalCount(); + + /** + * uint32 client_gift_source = 30; + * @return The clientGiftSource. + */ + int getClientGiftSource(); + + /** + *
+   * AnchorGiftData anchorGift = 31;
+   * 
+ * + * repeated uint64 to_user_ids_list = 32; + * @return A list containing the toUserIdsList. + */ + java.util.List getToUserIdsListList(); + /** + *
+   * AnchorGiftData anchorGift = 31;
+   * 
+ * + * repeated uint64 to_user_ids_list = 32; + * @return The count of toUserIdsList. + */ + int getToUserIdsListCount(); + /** + *
+   * AnchorGiftData anchorGift = 31;
+   * 
+ * + * repeated uint64 to_user_ids_list = 32; + * @param index The index of the element to return. + * @return The toUserIdsList at the given index. + */ + long getToUserIdsList(int index); + + /** + * uint64 send_timet = 33; + * @return The sendTimet. + */ + long getSendTimet(); + + /** + * uint64 force_display_effectst = 34; + * @return The forceDisplayEffectst. + */ + long getForceDisplayEffectst(); + + /** + * string trace_id = 35; + * @return The traceId. + */ + java.lang.String getTraceId(); + /** + * string trace_id = 35; + * @return The bytes for traceId. + */ + com.google.protobuf.ByteString + getTraceIdBytes(); + + /** + * uint64 effect_display_ts = 36; + * @return The effectDisplayTs. + */ + long getEffectDisplayTs(); +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_like_message_msg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_like_message_msg.java new file mode 100644 index 0000000..8e79778 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_like_message_msg.java @@ -0,0 +1,1563 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_webcast_like_message_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +/** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg} + */ +public final class douyin_webcast_like_message_msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg) + douyin_webcast_like_message_msgOrBuilder { +private static final long serialVersionUID = 0L; + // Use douyin_webcast_like_message_msg.newBuilder() to construct. + private douyin_webcast_like_message_msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private douyin_webcast_like_message_msg() { + icon_ = ""; + scene_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new douyin_webcast_like_message_msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_like_message_msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_like_message_msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg.Builder.class); + } + + public static final int COMMON_FIELD_NUMBER = 1; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common common_; + /** + * .Common common = 1; + * @return Whether the common field is set. + */ + @java.lang.Override + public boolean hasCommon() { + return common_ != null; + } + /** + * .Common common = 1; + * @return The common. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getCommon() { + return common_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } + /** + * .Common common = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder() { + return common_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } + + public static final int COUNT_FIELD_NUMBER = 2; + private long count_ = 0L; + /** + * uint64 count = 2; + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + + public static final int TOTAL_FIELD_NUMBER = 3; + private long total_ = 0L; + /** + * uint64 total = 3; + * @return The total. + */ + @java.lang.Override + public long getTotal() { + return total_; + } + + public static final int COLOR_FIELD_NUMBER = 4; + private long color_ = 0L; + /** + * uint64 color = 4; + * @return The color. + */ + @java.lang.Override + public long getColor() { + return color_; + } + + public static final int USER_FIELD_NUMBER = 5; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User user_; + /** + * .User user = 5; + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * .User user = 5; + * @return The user. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser() { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + /** + * .User user = 5; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder() { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + + public static final int ICON_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object icon_ = ""; + /** + * string icon = 6; + * @return The icon. + */ + @java.lang.Override + public java.lang.String getIcon() { + java.lang.Object ref = icon_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + icon_ = s; + return s; + } + } + /** + * string icon = 6; + * @return The bytes for icon. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIconBytes() { + java.lang.Object ref = icon_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + icon_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOUBLELIKEDETAIL_FIELD_NUMBER = 7; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail doubleLikeDetail_; + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + * @return Whether the doubleLikeDetail field is set. + */ + @java.lang.Override + public boolean hasDoubleLikeDetail() { + return doubleLikeDetail_ != null; + } + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + * @return The doubleLikeDetail. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail getDoubleLikeDetail() { + return doubleLikeDetail_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.getDefaultInstance() : doubleLikeDetail_; + } + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetailOrBuilder getDoubleLikeDetailOrBuilder() { + return doubleLikeDetail_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.getDefaultInstance() : doubleLikeDetail_; + } + + public static final int LINKMICGUESTUID_FIELD_NUMBER = 9; + private long linkmicGuestUid_ = 0L; + /** + *
+   * DisplayControlInfo displayControlInfo = 8;
+   * 
+ * + * uint64 linkmicGuestUid = 9; + * @return The linkmicGuestUid. + */ + @java.lang.Override + public long getLinkmicGuestUid() { + return linkmicGuestUid_; + } + + public static final int SCENE_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private volatile java.lang.Object scene_ = ""; + /** + *
+   * PicoDisplayInfo picoDisplayInfo = 11;
+   * = 12;
+   * 
+ * + * string scene = 10; + * @return The scene. + */ + @java.lang.Override + public java.lang.String getScene() { + java.lang.Object ref = scene_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + scene_ = s; + return s; + } + } + /** + *
+   * PicoDisplayInfo picoDisplayInfo = 11;
+   * = 12;
+   * 
+ * + * string scene = 10; + * @return The bytes for scene. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSceneBytes() { + java.lang.Object ref = scene_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + scene_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (common_ != null) { + output.writeMessage(1, getCommon()); + } + if (count_ != 0L) { + output.writeUInt64(2, count_); + } + if (total_ != 0L) { + output.writeUInt64(3, total_); + } + if (color_ != 0L) { + output.writeUInt64(4, color_); + } + if (user_ != null) { + output.writeMessage(5, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(icon_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, icon_); + } + if (doubleLikeDetail_ != null) { + output.writeMessage(7, getDoubleLikeDetail()); + } + if (linkmicGuestUid_ != 0L) { + output.writeUInt64(9, linkmicGuestUid_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(scene_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, scene_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (common_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getCommon()); + } + if (count_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, count_); + } + if (total_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, total_); + } + if (color_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, color_); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(icon_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, icon_); + } + if (doubleLikeDetail_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getDoubleLikeDetail()); + } + if (linkmicGuestUid_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(9, linkmicGuestUid_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(scene_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, scene_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg) obj; + + if (hasCommon() != other.hasCommon()) return false; + if (hasCommon()) { + if (!getCommon() + .equals(other.getCommon())) return false; + } + if (getCount() + != other.getCount()) return false; + if (getTotal() + != other.getTotal()) return false; + if (getColor() + != other.getColor()) return false; + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser() + .equals(other.getUser())) return false; + } + if (!getIcon() + .equals(other.getIcon())) return false; + if (hasDoubleLikeDetail() != other.hasDoubleLikeDetail()) return false; + if (hasDoubleLikeDetail()) { + if (!getDoubleLikeDetail() + .equals(other.getDoubleLikeDetail())) return false; + } + if (getLinkmicGuestUid() + != other.getLinkmicGuestUid()) return false; + if (!getScene() + .equals(other.getScene())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCommon()) { + hash = (37 * hash) + COMMON_FIELD_NUMBER; + hash = (53 * hash) + getCommon().hashCode(); + } + hash = (37 * hash) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCount()); + hash = (37 * hash) + TOTAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTotal()); + hash = (37 * hash) + COLOR_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getColor()); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + ICON_FIELD_NUMBER; + hash = (53 * hash) + getIcon().hashCode(); + if (hasDoubleLikeDetail()) { + hash = (37 * hash) + DOUBLELIKEDETAIL_FIELD_NUMBER; + hash = (53 * hash) + getDoubleLikeDetail().hashCode(); + } + hash = (37 * hash) + LINKMICGUESTUID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLinkmicGuestUid()); + hash = (37 * hash) + SCENE_FIELD_NUMBER; + hash = (53 * hash) + getScene().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg) + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_like_message_msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_like_message_msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); + commonBuilder_ = null; + } + count_ = 0L; + total_ = 0L; + color_ = 0L; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + icon_ = ""; + doubleLikeDetail_ = null; + if (doubleLikeDetailBuilder_ != null) { + doubleLikeDetailBuilder_.dispose(); + doubleLikeDetailBuilder_ = null; + } + linkmicGuestUid_ = 0L; + scene_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_like_message_msg_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.common_ = commonBuilder_ == null + ? common_ + : commonBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.count_ = count_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.total_ = total_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.color_ = color_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.user_ = userBuilder_ == null + ? user_ + : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.icon_ = icon_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.doubleLikeDetail_ = doubleLikeDetailBuilder_ == null + ? doubleLikeDetail_ + : doubleLikeDetailBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.linkmicGuestUid_ = linkmicGuestUid_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.scene_ = scene_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg.getDefaultInstance()) return this; + if (other.hasCommon()) { + mergeCommon(other.getCommon()); + } + if (other.getCount() != 0L) { + setCount(other.getCount()); + } + if (other.getTotal() != 0L) { + setTotal(other.getTotal()); + } + if (other.getColor() != 0L) { + setColor(other.getColor()); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (!other.getIcon().isEmpty()) { + icon_ = other.icon_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasDoubleLikeDetail()) { + mergeDoubleLikeDetail(other.getDoubleLikeDetail()); + } + if (other.getLinkmicGuestUid() != 0L) { + setLinkmicGuestUid(other.getLinkmicGuestUid()); + } + if (!other.getScene().isEmpty()) { + scene_ = other.scene_; + bitField0_ |= 0x00000100; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getCommonFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + count_ = input.readUInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + total_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + color_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + input.readMessage( + getUserFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + icon_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + input.readMessage( + getDoubleLikeDetailFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 72: { + linkmicGuestUid_ = input.readUInt64(); + bitField0_ |= 0x00000080; + break; + } // case 72 + case 82: { + scene_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 82 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common common_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder> commonBuilder_; + /** + * .Common common = 1; + * @return Whether the common field is set. + */ + public boolean hasCommon() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .Common common = 1; + * @return The common. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getCommon() { + if (commonBuilder_ == null) { + return common_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } else { + return commonBuilder_.getMessage(); + } + } + /** + * .Common common = 1; + */ + public Builder setCommon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common value) { + if (commonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + common_ = value; + } else { + commonBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public Builder setCommon( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder builderForValue) { + if (commonBuilder_ == null) { + common_ = builderForValue.build(); + } else { + commonBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public Builder mergeCommon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common value) { + if (commonBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + common_ != null && + common_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance()) { + getCommonBuilder().mergeFrom(value); + } else { + common_ = value; + } + } else { + commonBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public Builder clearCommon() { + bitField0_ = (bitField0_ & ~0x00000001); + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); + commonBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder getCommonBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCommonFieldBuilder().getBuilder(); + } + /** + * .Common common = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder() { + if (commonBuilder_ != null) { + return commonBuilder_.getMessageOrBuilder(); + } else { + return common_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } + } + /** + * .Common common = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder> + getCommonFieldBuilder() { + if (commonBuilder_ == null) { + commonBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder>( + getCommon(), + getParentForChildren(), + isClean()); + common_ = null; + } + return commonBuilder_; + } + + private long count_ ; + /** + * uint64 count = 2; + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + /** + * uint64 count = 2; + * @param value The count to set. + * @return This builder for chaining. + */ + public Builder setCount(long value) { + + count_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint64 count = 2; + * @return This builder for chaining. + */ + public Builder clearCount() { + bitField0_ = (bitField0_ & ~0x00000002); + count_ = 0L; + onChanged(); + return this; + } + + private long total_ ; + /** + * uint64 total = 3; + * @return The total. + */ + @java.lang.Override + public long getTotal() { + return total_; + } + /** + * uint64 total = 3; + * @param value The total to set. + * @return This builder for chaining. + */ + public Builder setTotal(long value) { + + total_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 total = 3; + * @return This builder for chaining. + */ + public Builder clearTotal() { + bitField0_ = (bitField0_ & ~0x00000004); + total_ = 0L; + onChanged(); + return this; + } + + private long color_ ; + /** + * uint64 color = 4; + * @return The color. + */ + @java.lang.Override + public long getColor() { + return color_; + } + /** + * uint64 color = 4; + * @param value The color to set. + * @return This builder for chaining. + */ + public Builder setColor(long value) { + + color_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint64 color = 4; + * @return This builder for chaining. + */ + public Builder clearColor() { + bitField0_ = (bitField0_ & ~0x00000008); + color_ = 0L; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> userBuilder_; + /** + * .User user = 5; + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * .User user = 5; + * @return The user. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * .User user = 5; + */ + public Builder setUser(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .User user = 5; + */ + public Builder setUser( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .User user = 5; + */ + public Builder mergeUser(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + user_ != null && + user_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .User user = 5; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000010); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User user = 5; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder getUserBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * .User user = 5; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + } + /** + * .User user = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + + private java.lang.Object icon_ = ""; + /** + * string icon = 6; + * @return The icon. + */ + public java.lang.String getIcon() { + java.lang.Object ref = icon_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + icon_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string icon = 6; + * @return The bytes for icon. + */ + public com.google.protobuf.ByteString + getIconBytes() { + java.lang.Object ref = icon_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + icon_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string icon = 6; + * @param value The icon to set. + * @return This builder for chaining. + */ + public Builder setIcon( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + icon_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * string icon = 6; + * @return This builder for chaining. + */ + public Builder clearIcon() { + icon_ = getDefaultInstance().getIcon(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * string icon = 6; + * @param value The bytes for icon to set. + * @return This builder for chaining. + */ + public Builder setIconBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + icon_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail doubleLikeDetail_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetailOrBuilder> doubleLikeDetailBuilder_; + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + * @return Whether the doubleLikeDetail field is set. + */ + public boolean hasDoubleLikeDetail() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + * @return The doubleLikeDetail. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail getDoubleLikeDetail() { + if (doubleLikeDetailBuilder_ == null) { + return doubleLikeDetail_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.getDefaultInstance() : doubleLikeDetail_; + } else { + return doubleLikeDetailBuilder_.getMessage(); + } + } + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + */ + public Builder setDoubleLikeDetail(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail value) { + if (doubleLikeDetailBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + doubleLikeDetail_ = value; + } else { + doubleLikeDetailBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + */ + public Builder setDoubleLikeDetail( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.Builder builderForValue) { + if (doubleLikeDetailBuilder_ == null) { + doubleLikeDetail_ = builderForValue.build(); + } else { + doubleLikeDetailBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + */ + public Builder mergeDoubleLikeDetail(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail value) { + if (doubleLikeDetailBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + doubleLikeDetail_ != null && + doubleLikeDetail_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.getDefaultInstance()) { + getDoubleLikeDetailBuilder().mergeFrom(value); + } else { + doubleLikeDetail_ = value; + } + } else { + doubleLikeDetailBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + */ + public Builder clearDoubleLikeDetail() { + bitField0_ = (bitField0_ & ~0x00000040); + doubleLikeDetail_ = null; + if (doubleLikeDetailBuilder_ != null) { + doubleLikeDetailBuilder_.dispose(); + doubleLikeDetailBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.Builder getDoubleLikeDetailBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getDoubleLikeDetailFieldBuilder().getBuilder(); + } + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetailOrBuilder getDoubleLikeDetailOrBuilder() { + if (doubleLikeDetailBuilder_ != null) { + return doubleLikeDetailBuilder_.getMessageOrBuilder(); + } else { + return doubleLikeDetail_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.getDefaultInstance() : doubleLikeDetail_; + } + } + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetailOrBuilder> + getDoubleLikeDetailFieldBuilder() { + if (doubleLikeDetailBuilder_ == null) { + doubleLikeDetailBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetailOrBuilder>( + getDoubleLikeDetail(), + getParentForChildren(), + isClean()); + doubleLikeDetail_ = null; + } + return doubleLikeDetailBuilder_; + } + + private long linkmicGuestUid_ ; + /** + *
+     * DisplayControlInfo displayControlInfo = 8;
+     * 
+ * + * uint64 linkmicGuestUid = 9; + * @return The linkmicGuestUid. + */ + @java.lang.Override + public long getLinkmicGuestUid() { + return linkmicGuestUid_; + } + /** + *
+     * DisplayControlInfo displayControlInfo = 8;
+     * 
+ * + * uint64 linkmicGuestUid = 9; + * @param value The linkmicGuestUid to set. + * @return This builder for chaining. + */ + public Builder setLinkmicGuestUid(long value) { + + linkmicGuestUid_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * DisplayControlInfo displayControlInfo = 8;
+     * 
+ * + * uint64 linkmicGuestUid = 9; + * @return This builder for chaining. + */ + public Builder clearLinkmicGuestUid() { + bitField0_ = (bitField0_ & ~0x00000080); + linkmicGuestUid_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object scene_ = ""; + /** + *
+     * PicoDisplayInfo picoDisplayInfo = 11;
+     * = 12;
+     * 
+ * + * string scene = 10; + * @return The scene. + */ + public java.lang.String getScene() { + java.lang.Object ref = scene_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + scene_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * PicoDisplayInfo picoDisplayInfo = 11;
+     * = 12;
+     * 
+ * + * string scene = 10; + * @return The bytes for scene. + */ + public com.google.protobuf.ByteString + getSceneBytes() { + java.lang.Object ref = scene_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + scene_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * PicoDisplayInfo picoDisplayInfo = 11;
+     * = 12;
+     * 
+ * + * string scene = 10; + * @param value The scene to set. + * @return This builder for chaining. + */ + public Builder setScene( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + scene_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
+     * PicoDisplayInfo picoDisplayInfo = 11;
+     * = 12;
+     * 
+ * + * string scene = 10; + * @return This builder for chaining. + */ + public Builder clearScene() { + scene_ = getDefaultInstance().getScene(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + *
+     * PicoDisplayInfo picoDisplayInfo = 11;
+     * = 12;
+     * 
+ * + * string scene = 10; + * @param value The bytes for scene to set. + * @return This builder for chaining. + */ + public Builder setSceneBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + scene_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg) + } + + // @@protoc_insertion_point(class_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public douyin_webcast_like_message_msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_like_message_msgOrBuilder.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_like_message_msgOrBuilder.java new file mode 100644 index 0000000..b5b088a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_like_message_msgOrBuilder.java @@ -0,0 +1,140 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_webcast_like_message_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +public interface douyin_webcast_like_message_msgOrBuilder extends + // @@protoc_insertion_point(interface_extends:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_like_message_msg) + com.google.protobuf.MessageOrBuilder { + + /** + * .Common common = 1; + * @return Whether the common field is set. + */ + boolean hasCommon(); + /** + * .Common common = 1; + * @return The common. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getCommon(); + /** + * .Common common = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder(); + + /** + * uint64 count = 2; + * @return The count. + */ + long getCount(); + + /** + * uint64 total = 3; + * @return The total. + */ + long getTotal(); + + /** + * uint64 color = 4; + * @return The color. + */ + long getColor(); + + /** + * .User user = 5; + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * .User user = 5; + * @return The user. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser(); + /** + * .User user = 5; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder(); + + /** + * string icon = 6; + * @return The icon. + */ + java.lang.String getIcon(); + /** + * string icon = 6; + * @return The bytes for icon. + */ + com.google.protobuf.ByteString + getIconBytes(); + + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + * @return Whether the doubleLikeDetail field is set. + */ + boolean hasDoubleLikeDetail(); + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + * @return The doubleLikeDetail. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail getDoubleLikeDetail(); + /** + * .DoubleLikeDetail doubleLikeDetail = 7; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetailOrBuilder getDoubleLikeDetailOrBuilder(); + + /** + *
+   * DisplayControlInfo displayControlInfo = 8;
+   * 
+ * + * uint64 linkmicGuestUid = 9; + * @return The linkmicGuestUid. + */ + long getLinkmicGuestUid(); + + /** + *
+   * PicoDisplayInfo picoDisplayInfo = 11;
+   * = 12;
+   * 
+ * + * string scene = 10; + * @return The scene. + */ + java.lang.String getScene(); + /** + *
+   * PicoDisplayInfo picoDisplayInfo = 11;
+   * = 12;
+   * 
+ * + * string scene = 10; + * @return The bytes for scene. + */ + com.google.protobuf.ByteString + getSceneBytes(); +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_like_message_msgProto.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_like_message_msgProto.java new file mode 100644 index 0000000..153557b --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_like_message_msgProto.java @@ -0,0 +1,87 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_webcast_like_message_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +public final class douyin_webcast_like_message_msgProto { + private douyin_webcast_like_message_msgProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_like_message_msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_like_message_msg_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n%douyin_webcast_like_message_msg.proto\022" + + "2tech.ordinaryroad.live.chat.client.douy" + + "in.protobuf\032\014Common.proto\032\nUser.proto\032\026D" + + "oubleLikeDetail.proto\"\337\001\n\037douyin_webcast" + + "_like_message_msg\022\027\n\006common\030\001 \001(\0132\007.Comm" + + "on\022\r\n\005count\030\002 \001(\004\022\r\n\005total\030\003 \001(\004\022\r\n\005colo" + + "r\030\004 \001(\004\022\023\n\004user\030\005 \001(\0132\005.User\022\014\n\004icon\030\006 \001" + + "(\t\022+\n\020doubleLikeDetail\030\007 \001(\0132\021.DoubleLik" + + "eDetail\022\027\n\017linkmicGuestUid\030\t \001(\004\022\r\n\005scen" + + "e\030\n \001(\tBb\n2tech.ordinaryroad.live.chat.c" + + "lient.douyin.protobufB$douyin_webcast_li" + + "ke_message_msgProtoP\001\242\002\003GPBb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.getDescriptor(), + }); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_like_message_msg_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_like_message_msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_like_message_msg_descriptor, + new java.lang.String[] { "Common", "Count", "Total", "Color", "User", "Icon", "DoubleLikeDetail", "LinkmicGuestUid", "Scene", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_member_message_msg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_member_message_msg.java new file mode 100644 index 0000000..63c75d6 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_member_message_msg.java @@ -0,0 +1,2828 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_webcast_member_message_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +/** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg} + */ +public final class douyin_webcast_member_message_msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg) + douyin_webcast_member_message_msgOrBuilder { + private static final long serialVersionUID = 0L; + // Use douyin_webcast_member_message_msg.newBuilder() to construct. + private douyin_webcast_member_message_msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private douyin_webcast_member_message_msg() { + actionDescription_ = ""; + popStr_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new douyin_webcast_member_message_msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_member_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 22: + return internalGetBuriedPointMap(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_member_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg.Builder.class); + } + + public static final int COMMON_FIELD_NUMBER = 1; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common common_; + /** + * .Common common = 1; + * @return Whether the common field is set. + */ + @java.lang.Override + public boolean hasCommon() { + return common_ != null; + } + /** + * .Common common = 1; + * @return The common. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getCommon() { + return common_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } + /** + * .Common common = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder() { + return common_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } + + public static final int USER_FIELD_NUMBER = 2; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User user_; + /** + * .User user = 2; + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * .User user = 2; + * @return The user. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser() { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + /** + * .User user = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder() { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + + public static final int MEMBERCOUNT_FIELD_NUMBER = 3; + private long memberCount_ = 0L; + /** + * uint64 memberCount = 3; + * @return The memberCount. + */ + @java.lang.Override + public long getMemberCount() { + return memberCount_; + } + + public static final int OPERATOR_FIELD_NUMBER = 4; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User operator_; + /** + * .User operator = 4; + * @return Whether the operator field is set. + */ + @java.lang.Override + public boolean hasOperator() { + return operator_ != null; + } + /** + * .User operator = 4; + * @return The operator. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getOperator() { + return operator_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : operator_; + } + /** + * .User operator = 4; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getOperatorOrBuilder() { + return operator_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : operator_; + } + + public static final int ISSETTOADMIN_FIELD_NUMBER = 5; + private boolean isSetToAdmin_ = false; + /** + * bool isSetToAdmin = 5; + * @return The isSetToAdmin. + */ + @java.lang.Override + public boolean getIsSetToAdmin() { + return isSetToAdmin_; + } + + public static final int ISTOPUSER_FIELD_NUMBER = 6; + private boolean isTopUser_ = false; + /** + * bool isTopUser = 6; + * @return The isTopUser. + */ + @java.lang.Override + public boolean getIsTopUser() { + return isTopUser_; + } + + public static final int RANKSCORE_FIELD_NUMBER = 7; + private long rankScore_ = 0L; + /** + * int64 rankScore = 7; + * @return The rankScore. + */ + @java.lang.Override + public long getRankScore() { + return rankScore_; + } + + public static final int TOPUSERNO_FIELD_NUMBER = 8; + private long topUserNo_ = 0L; + /** + * int64 topUserNo = 8; + * @return The topUserNo. + */ + @java.lang.Override + public long getTopUserNo() { + return topUserNo_; + } + + public static final int ENTERTYPE_FIELD_NUMBER = 9; + private long enterType_ = 0L; + /** + * int64 enterType = 9; + * @return The enterType. + */ + @java.lang.Override + public long getEnterType() { + return enterType_; + } + + public static final int ACTION_FIELD_NUMBER = 10; + private long action_ = 0L; + /** + * int64 action = 10; + * @return The action. + */ + @java.lang.Override + public long getAction() { + return action_; + } + + public static final int ACTIONDESCRIPTION_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private volatile java.lang.Object actionDescription_ = ""; + /** + * string actionDescription = 11; + * @return The actionDescription. + */ + @java.lang.Override + public java.lang.String getActionDescription() { + java.lang.Object ref = actionDescription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + actionDescription_ = s; + return s; + } + } + /** + * string actionDescription = 11; + * @return The bytes for actionDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getActionDescriptionBytes() { + java.lang.Object ref = actionDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + actionDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERID_FIELD_NUMBER = 12; + private long userId_ = 0L; + /** + * int64 userId = 12; + * @return The userId. + */ + @java.lang.Override + public long getUserId() { + return userId_; + } + + public static final int POPSTR_FIELD_NUMBER = 14; + @SuppressWarnings("serial") + private volatile java.lang.Object popStr_ = ""; + /** + *
+   * EffectConfig effectConfig = 13;
+   * 
+ * + * string popStr = 14; + * @return The popStr. + */ + @java.lang.Override + public java.lang.String getPopStr() { + java.lang.Object ref = popStr_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + popStr_ = s; + return s; + } + } + /** + *
+   * EffectConfig effectConfig = 13;
+   * 
+ * + * string popStr = 14; + * @return The bytes for popStr. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPopStrBytes() { + java.lang.Object ref = popStr_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + popStr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKGROUNDIMAGE_FIELD_NUMBER = 16; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image backgroundImage_; + /** + *
+   * EffectConfig enterEffectConfig = 15;
+   * 
+ * + * .Image backgroundImage = 16; + * @return Whether the backgroundImage field is set. + */ + @java.lang.Override + public boolean hasBackgroundImage() { + return backgroundImage_ != null; + } + /** + *
+   * EffectConfig enterEffectConfig = 15;
+   * 
+ * + * .Image backgroundImage = 16; + * @return The backgroundImage. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundImage() { + return backgroundImage_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImage_; + } + /** + *
+   * EffectConfig enterEffectConfig = 15;
+   * 
+ * + * .Image backgroundImage = 16; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundImageOrBuilder() { + return backgroundImage_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImage_; + } + + public static final int BACKGROUNDIMAGEV2_FIELD_NUMBER = 17; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image backgroundImageV2_; + /** + * .Image backgroundImageV2 = 17; + * @return Whether the backgroundImageV2 field is set. + */ + @java.lang.Override + public boolean hasBackgroundImageV2() { + return backgroundImageV2_ != null; + } + /** + * .Image backgroundImageV2 = 17; + * @return The backgroundImageV2. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundImageV2() { + return backgroundImageV2_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImageV2_; + } + /** + * .Image backgroundImageV2 = 17; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundImageV2OrBuilder() { + return backgroundImageV2_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImageV2_; + } + + public static final int ANCHORDISPLAYTEXT_FIELD_NUMBER = 18; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text anchorDisplayText_; + /** + * .Text anchorDisplayText = 18; + * @return Whether the anchorDisplayText field is set. + */ + @java.lang.Override + public boolean hasAnchorDisplayText() { + return anchorDisplayText_ != null; + } + /** + * .Text anchorDisplayText = 18; + * @return The anchorDisplayText. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text getAnchorDisplayText() { + return anchorDisplayText_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance() : anchorDisplayText_; + } + /** + * .Text anchorDisplayText = 18; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder getAnchorDisplayTextOrBuilder() { + return anchorDisplayText_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance() : anchorDisplayText_; + } + + public static final int USERENTERTIPTYPE_FIELD_NUMBER = 20; + private long userEnterTipType_ = 0L; + /** + *
+   * PublicAreaCommon publicAreaCommon = 19;
+   * 
+ * + * int64 userEnterTipType = 20; + * @return The userEnterTipType. + */ + @java.lang.Override + public long getUserEnterTipType() { + return userEnterTipType_; + } + + public static final int ANCHORENTERTIPTYPE_FIELD_NUMBER = 21; + private long anchorEnterTipType_ = 0L; + /** + * int64 anchorEnterTipType = 21; + * @return The anchorEnterTipType. + */ + @java.lang.Override + public long getAnchorEnterTipType() { + return anchorEnterTipType_; + } + + public static final int BURIEDPOINTMAP_FIELD_NUMBER = 22; + private static final class BuriedPointMapDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_member_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_BuriedPointMapEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> buriedPointMap_; + private com.google.protobuf.MapField + internalGetBuriedPointMap() { + if (buriedPointMap_ == null) { + return com.google.protobuf.MapField.emptyMapField( + BuriedPointMapDefaultEntryHolder.defaultEntry); + } + return buriedPointMap_; + } + public int getBuriedPointMapCount() { + return internalGetBuriedPointMap().getMap().size(); + } + /** + * map<string, string> buriedPointMap = 22; + */ + @java.lang.Override + public boolean containsBuriedPointMap( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetBuriedPointMap().getMap().containsKey(key); + } + /** + * Use {@link #getBuriedPointMapMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getBuriedPointMap() { + return getBuriedPointMapMap(); + } + /** + * map<string, string> buriedPointMap = 22; + */ + @java.lang.Override + public java.util.Map getBuriedPointMapMap() { + return internalGetBuriedPointMap().getMap(); + } + /** + * map<string, string> buriedPointMap = 22; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getBuriedPointMapOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetBuriedPointMap().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> buriedPointMap = 22; + */ + @java.lang.Override + public java.lang.String getBuriedPointMapOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetBuriedPointMap().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (common_ != null) { + output.writeMessage(1, getCommon()); + } + if (user_ != null) { + output.writeMessage(2, getUser()); + } + if (memberCount_ != 0L) { + output.writeUInt64(3, memberCount_); + } + if (operator_ != null) { + output.writeMessage(4, getOperator()); + } + if (isSetToAdmin_ != false) { + output.writeBool(5, isSetToAdmin_); + } + if (isTopUser_ != false) { + output.writeBool(6, isTopUser_); + } + if (rankScore_ != 0L) { + output.writeInt64(7, rankScore_); + } + if (topUserNo_ != 0L) { + output.writeInt64(8, topUserNo_); + } + if (enterType_ != 0L) { + output.writeInt64(9, enterType_); + } + if (action_ != 0L) { + output.writeInt64(10, action_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(actionDescription_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, actionDescription_); + } + if (userId_ != 0L) { + output.writeInt64(12, userId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(popStr_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, popStr_); + } + if (backgroundImage_ != null) { + output.writeMessage(16, getBackgroundImage()); + } + if (backgroundImageV2_ != null) { + output.writeMessage(17, getBackgroundImageV2()); + } + if (anchorDisplayText_ != null) { + output.writeMessage(18, getAnchorDisplayText()); + } + if (userEnterTipType_ != 0L) { + output.writeInt64(20, userEnterTipType_); + } + if (anchorEnterTipType_ != 0L) { + output.writeInt64(21, anchorEnterTipType_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetBuriedPointMap(), + BuriedPointMapDefaultEntryHolder.defaultEntry, + 22); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (common_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getCommon()); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUser()); + } + if (memberCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, memberCount_); + } + if (operator_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getOperator()); + } + if (isSetToAdmin_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, isSetToAdmin_); + } + if (isTopUser_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(6, isTopUser_); + } + if (rankScore_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(7, rankScore_); + } + if (topUserNo_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(8, topUserNo_); + } + if (enterType_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, enterType_); + } + if (action_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(10, action_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(actionDescription_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, actionDescription_); + } + if (userId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(12, userId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(popStr_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, popStr_); + } + if (backgroundImage_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(16, getBackgroundImage()); + } + if (backgroundImageV2_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(17, getBackgroundImageV2()); + } + if (anchorDisplayText_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(18, getAnchorDisplayText()); + } + if (userEnterTipType_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(20, userEnterTipType_); + } + if (anchorEnterTipType_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(21, anchorEnterTipType_); + } + for (java.util.Map.Entry entry + : internalGetBuriedPointMap().getMap().entrySet()) { + com.google.protobuf.MapEntry + buriedPointMap__ = BuriedPointMapDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(22, buriedPointMap__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg) obj; + + if (hasCommon() != other.hasCommon()) return false; + if (hasCommon()) { + if (!getCommon() + .equals(other.getCommon())) return false; + } + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser() + .equals(other.getUser())) return false; + } + if (getMemberCount() + != other.getMemberCount()) return false; + if (hasOperator() != other.hasOperator()) return false; + if (hasOperator()) { + if (!getOperator() + .equals(other.getOperator())) return false; + } + if (getIsSetToAdmin() + != other.getIsSetToAdmin()) return false; + if (getIsTopUser() + != other.getIsTopUser()) return false; + if (getRankScore() + != other.getRankScore()) return false; + if (getTopUserNo() + != other.getTopUserNo()) return false; + if (getEnterType() + != other.getEnterType()) return false; + if (getAction() + != other.getAction()) return false; + if (!getActionDescription() + .equals(other.getActionDescription())) return false; + if (getUserId() + != other.getUserId()) return false; + if (!getPopStr() + .equals(other.getPopStr())) return false; + if (hasBackgroundImage() != other.hasBackgroundImage()) return false; + if (hasBackgroundImage()) { + if (!getBackgroundImage() + .equals(other.getBackgroundImage())) return false; + } + if (hasBackgroundImageV2() != other.hasBackgroundImageV2()) return false; + if (hasBackgroundImageV2()) { + if (!getBackgroundImageV2() + .equals(other.getBackgroundImageV2())) return false; + } + if (hasAnchorDisplayText() != other.hasAnchorDisplayText()) return false; + if (hasAnchorDisplayText()) { + if (!getAnchorDisplayText() + .equals(other.getAnchorDisplayText())) return false; + } + if (getUserEnterTipType() + != other.getUserEnterTipType()) return false; + if (getAnchorEnterTipType() + != other.getAnchorEnterTipType()) return false; + if (!internalGetBuriedPointMap().equals( + other.internalGetBuriedPointMap())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCommon()) { + hash = (37 * hash) + COMMON_FIELD_NUMBER; + hash = (53 * hash) + getCommon().hashCode(); + } + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + MEMBERCOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMemberCount()); + if (hasOperator()) { + hash = (37 * hash) + OPERATOR_FIELD_NUMBER; + hash = (53 * hash) + getOperator().hashCode(); + } + hash = (37 * hash) + ISSETTOADMIN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsSetToAdmin()); + hash = (37 * hash) + ISTOPUSER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsTopUser()); + hash = (37 * hash) + RANKSCORE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRankScore()); + hash = (37 * hash) + TOPUSERNO_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTopUserNo()); + hash = (37 * hash) + ENTERTYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getEnterType()); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAction()); + hash = (37 * hash) + ACTIONDESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getActionDescription().hashCode(); + hash = (37 * hash) + USERID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getUserId()); + hash = (37 * hash) + POPSTR_FIELD_NUMBER; + hash = (53 * hash) + getPopStr().hashCode(); + if (hasBackgroundImage()) { + hash = (37 * hash) + BACKGROUNDIMAGE_FIELD_NUMBER; + hash = (53 * hash) + getBackgroundImage().hashCode(); + } + if (hasBackgroundImageV2()) { + hash = (37 * hash) + BACKGROUNDIMAGEV2_FIELD_NUMBER; + hash = (53 * hash) + getBackgroundImageV2().hashCode(); + } + if (hasAnchorDisplayText()) { + hash = (37 * hash) + ANCHORDISPLAYTEXT_FIELD_NUMBER; + hash = (53 * hash) + getAnchorDisplayText().hashCode(); + } + hash = (37 * hash) + USERENTERTIPTYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getUserEnterTipType()); + hash = (37 * hash) + ANCHORENTERTIPTYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAnchorEnterTipType()); + if (!internalGetBuriedPointMap().getMap().isEmpty()) { + hash = (37 * hash) + BURIEDPOINTMAP_FIELD_NUMBER; + hash = (53 * hash) + internalGetBuriedPointMap().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg) + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_member_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 22: + return internalGetBuriedPointMap(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 22: + return internalGetMutableBuriedPointMap(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_member_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); + commonBuilder_ = null; + } + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + memberCount_ = 0L; + operator_ = null; + if (operatorBuilder_ != null) { + operatorBuilder_.dispose(); + operatorBuilder_ = null; + } + isSetToAdmin_ = false; + isTopUser_ = false; + rankScore_ = 0L; + topUserNo_ = 0L; + enterType_ = 0L; + action_ = 0L; + actionDescription_ = ""; + userId_ = 0L; + popStr_ = ""; + backgroundImage_ = null; + if (backgroundImageBuilder_ != null) { + backgroundImageBuilder_.dispose(); + backgroundImageBuilder_ = null; + } + backgroundImageV2_ = null; + if (backgroundImageV2Builder_ != null) { + backgroundImageV2Builder_.dispose(); + backgroundImageV2Builder_ = null; + } + anchorDisplayText_ = null; + if (anchorDisplayTextBuilder_ != null) { + anchorDisplayTextBuilder_.dispose(); + anchorDisplayTextBuilder_ = null; + } + userEnterTipType_ = 0L; + anchorEnterTipType_ = 0L; + internalGetMutableBuriedPointMap().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_webcast_member_message_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_webcast_member_message_msg_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.common_ = commonBuilder_ == null + ? common_ + : commonBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.user_ = userBuilder_ == null + ? user_ + : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.memberCount_ = memberCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.operator_ = operatorBuilder_ == null + ? operator_ + : operatorBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.isSetToAdmin_ = isSetToAdmin_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.isTopUser_ = isTopUser_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.rankScore_ = rankScore_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.topUserNo_ = topUserNo_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.enterType_ = enterType_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.action_ = action_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.actionDescription_ = actionDescription_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.userId_ = userId_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.popStr_ = popStr_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.backgroundImage_ = backgroundImageBuilder_ == null + ? backgroundImage_ + : backgroundImageBuilder_.build(); + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.backgroundImageV2_ = backgroundImageV2Builder_ == null + ? backgroundImageV2_ + : backgroundImageV2Builder_.build(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.anchorDisplayText_ = anchorDisplayTextBuilder_ == null + ? anchorDisplayText_ + : anchorDisplayTextBuilder_.build(); + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.userEnterTipType_ = userEnterTipType_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.anchorEnterTipType_ = anchorEnterTipType_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.buriedPointMap_ = internalGetBuriedPointMap(); + result.buriedPointMap_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg.getDefaultInstance()) return this; + if (other.hasCommon()) { + mergeCommon(other.getCommon()); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (other.getMemberCount() != 0L) { + setMemberCount(other.getMemberCount()); + } + if (other.hasOperator()) { + mergeOperator(other.getOperator()); + } + if (other.getIsSetToAdmin() != false) { + setIsSetToAdmin(other.getIsSetToAdmin()); + } + if (other.getIsTopUser() != false) { + setIsTopUser(other.getIsTopUser()); + } + if (other.getRankScore() != 0L) { + setRankScore(other.getRankScore()); + } + if (other.getTopUserNo() != 0L) { + setTopUserNo(other.getTopUserNo()); + } + if (other.getEnterType() != 0L) { + setEnterType(other.getEnterType()); + } + if (other.getAction() != 0L) { + setAction(other.getAction()); + } + if (!other.getActionDescription().isEmpty()) { + actionDescription_ = other.actionDescription_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (other.getUserId() != 0L) { + setUserId(other.getUserId()); + } + if (!other.getPopStr().isEmpty()) { + popStr_ = other.popStr_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (other.hasBackgroundImage()) { + mergeBackgroundImage(other.getBackgroundImage()); + } + if (other.hasBackgroundImageV2()) { + mergeBackgroundImageV2(other.getBackgroundImageV2()); + } + if (other.hasAnchorDisplayText()) { + mergeAnchorDisplayText(other.getAnchorDisplayText()); + } + if (other.getUserEnterTipType() != 0L) { + setUserEnterTipType(other.getUserEnterTipType()); + } + if (other.getAnchorEnterTipType() != 0L) { + setAnchorEnterTipType(other.getAnchorEnterTipType()); + } + internalGetMutableBuriedPointMap().mergeFrom( + other.internalGetBuriedPointMap()); + bitField0_ |= 0x00040000; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getCommonFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getUserFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + memberCount_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + input.readMessage( + getOperatorFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: { + isSetToAdmin_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + isTopUser_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + rankScore_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + topUserNo_ = input.readInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + enterType_ = input.readInt64(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: { + action_ = input.readInt64(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 90: { + actionDescription_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 96: { + userId_ = input.readInt64(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 114: { + popStr_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 114 + case 130: { + input.readMessage( + getBackgroundImageFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 130 + case 138: { + input.readMessage( + getBackgroundImageV2FieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00004000; + break; + } // case 138 + case 146: { + input.readMessage( + getAnchorDisplayTextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00008000; + break; + } // case 146 + case 160: { + userEnterTipType_ = input.readInt64(); + bitField0_ |= 0x00010000; + break; + } // case 160 + case 168: { + anchorEnterTipType_ = input.readInt64(); + bitField0_ |= 0x00020000; + break; + } // case 168 + case 178: { + com.google.protobuf.MapEntry + buriedPointMap__ = input.readMessage( + BuriedPointMapDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableBuriedPointMap().getMutableMap().put( + buriedPointMap__.getKey(), buriedPointMap__.getValue()); + bitField0_ |= 0x00040000; + break; + } // case 178 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common common_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder> commonBuilder_; + /** + * .Common common = 1; + * @return Whether the common field is set. + */ + public boolean hasCommon() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .Common common = 1; + * @return The common. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getCommon() { + if (commonBuilder_ == null) { + return common_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } else { + return commonBuilder_.getMessage(); + } + } + /** + * .Common common = 1; + */ + public Builder setCommon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common value) { + if (commonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + common_ = value; + } else { + commonBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public Builder setCommon( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder builderForValue) { + if (commonBuilder_ == null) { + common_ = builderForValue.build(); + } else { + commonBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public Builder mergeCommon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common value) { + if (commonBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + common_ != null && + common_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance()) { + getCommonBuilder().mergeFrom(value); + } else { + common_ = value; + } + } else { + commonBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public Builder clearCommon() { + bitField0_ = (bitField0_ & ~0x00000001); + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); + commonBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Common common = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder getCommonBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCommonFieldBuilder().getBuilder(); + } + /** + * .Common common = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder() { + if (commonBuilder_ != null) { + return commonBuilder_.getMessageOrBuilder(); + } else { + return common_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance() : common_; + } + } + /** + * .Common common = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder> + getCommonFieldBuilder() { + if (commonBuilder_ == null) { + commonBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder>( + getCommon(), + getParentForChildren(), + isClean()); + common_ = null; + } + return commonBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> userBuilder_; + /** + * .User user = 2; + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .User user = 2; + * @return The user. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * .User user = 2; + */ + public Builder setUser(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .User user = 2; + */ + public Builder setUser( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .User user = 2; + */ + public Builder mergeUser(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + user_ != null && + user_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .User user = 2; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000002); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User user = 2; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder getUserBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * .User user = 2; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + } + /** + * .User user = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + + private long memberCount_ ; + /** + * uint64 memberCount = 3; + * @return The memberCount. + */ + @java.lang.Override + public long getMemberCount() { + return memberCount_; + } + /** + * uint64 memberCount = 3; + * @param value The memberCount to set. + * @return This builder for chaining. + */ + public Builder setMemberCount(long value) { + + memberCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 memberCount = 3; + * @return This builder for chaining. + */ + public Builder clearMemberCount() { + bitField0_ = (bitField0_ & ~0x00000004); + memberCount_ = 0L; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User operator_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> operatorBuilder_; + /** + * .User operator = 4; + * @return Whether the operator field is set. + */ + public boolean hasOperator() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * .User operator = 4; + * @return The operator. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getOperator() { + if (operatorBuilder_ == null) { + return operator_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : operator_; + } else { + return operatorBuilder_.getMessage(); + } + } + /** + * .User operator = 4; + */ + public Builder setOperator(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (operatorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + operator_ = value; + } else { + operatorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .User operator = 4; + */ + public Builder setOperator( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder builderForValue) { + if (operatorBuilder_ == null) { + operator_ = builderForValue.build(); + } else { + operatorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .User operator = 4; + */ + public Builder mergeOperator(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (operatorBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + operator_ != null && + operator_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance()) { + getOperatorBuilder().mergeFrom(value); + } else { + operator_ = value; + } + } else { + operatorBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .User operator = 4; + */ + public Builder clearOperator() { + bitField0_ = (bitField0_ & ~0x00000008); + operator_ = null; + if (operatorBuilder_ != null) { + operatorBuilder_.dispose(); + operatorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User operator = 4; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder getOperatorBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getOperatorFieldBuilder().getBuilder(); + } + /** + * .User operator = 4; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getOperatorOrBuilder() { + if (operatorBuilder_ != null) { + return operatorBuilder_.getMessageOrBuilder(); + } else { + return operator_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : operator_; + } + } + /** + * .User operator = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> + getOperatorFieldBuilder() { + if (operatorBuilder_ == null) { + operatorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder>( + getOperator(), + getParentForChildren(), + isClean()); + operator_ = null; + } + return operatorBuilder_; + } + + private boolean isSetToAdmin_ ; + /** + * bool isSetToAdmin = 5; + * @return The isSetToAdmin. + */ + @java.lang.Override + public boolean getIsSetToAdmin() { + return isSetToAdmin_; + } + /** + * bool isSetToAdmin = 5; + * @param value The isSetToAdmin to set. + * @return This builder for chaining. + */ + public Builder setIsSetToAdmin(boolean value) { + + isSetToAdmin_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * bool isSetToAdmin = 5; + * @return This builder for chaining. + */ + public Builder clearIsSetToAdmin() { + bitField0_ = (bitField0_ & ~0x00000010); + isSetToAdmin_ = false; + onChanged(); + return this; + } + + private boolean isTopUser_ ; + /** + * bool isTopUser = 6; + * @return The isTopUser. + */ + @java.lang.Override + public boolean getIsTopUser() { + return isTopUser_; + } + /** + * bool isTopUser = 6; + * @param value The isTopUser to set. + * @return This builder for chaining. + */ + public Builder setIsTopUser(boolean value) { + + isTopUser_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * bool isTopUser = 6; + * @return This builder for chaining. + */ + public Builder clearIsTopUser() { + bitField0_ = (bitField0_ & ~0x00000020); + isTopUser_ = false; + onChanged(); + return this; + } + + private long rankScore_ ; + /** + * int64 rankScore = 7; + * @return The rankScore. + */ + @java.lang.Override + public long getRankScore() { + return rankScore_; + } + /** + * int64 rankScore = 7; + * @param value The rankScore to set. + * @return This builder for chaining. + */ + public Builder setRankScore(long value) { + + rankScore_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * int64 rankScore = 7; + * @return This builder for chaining. + */ + public Builder clearRankScore() { + bitField0_ = (bitField0_ & ~0x00000040); + rankScore_ = 0L; + onChanged(); + return this; + } + + private long topUserNo_ ; + /** + * int64 topUserNo = 8; + * @return The topUserNo. + */ + @java.lang.Override + public long getTopUserNo() { + return topUserNo_; + } + /** + * int64 topUserNo = 8; + * @param value The topUserNo to set. + * @return This builder for chaining. + */ + public Builder setTopUserNo(long value) { + + topUserNo_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * int64 topUserNo = 8; + * @return This builder for chaining. + */ + public Builder clearTopUserNo() { + bitField0_ = (bitField0_ & ~0x00000080); + topUserNo_ = 0L; + onChanged(); + return this; + } + + private long enterType_ ; + /** + * int64 enterType = 9; + * @return The enterType. + */ + @java.lang.Override + public long getEnterType() { + return enterType_; + } + /** + * int64 enterType = 9; + * @param value The enterType to set. + * @return This builder for chaining. + */ + public Builder setEnterType(long value) { + + enterType_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * int64 enterType = 9; + * @return This builder for chaining. + */ + public Builder clearEnterType() { + bitField0_ = (bitField0_ & ~0x00000100); + enterType_ = 0L; + onChanged(); + return this; + } + + private long action_ ; + /** + * int64 action = 10; + * @return The action. + */ + @java.lang.Override + public long getAction() { + return action_; + } + /** + * int64 action = 10; + * @param value The action to set. + * @return This builder for chaining. + */ + public Builder setAction(long value) { + + action_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * int64 action = 10; + * @return This builder for chaining. + */ + public Builder clearAction() { + bitField0_ = (bitField0_ & ~0x00000200); + action_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object actionDescription_ = ""; + /** + * string actionDescription = 11; + * @return The actionDescription. + */ + public java.lang.String getActionDescription() { + java.lang.Object ref = actionDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + actionDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string actionDescription = 11; + * @return The bytes for actionDescription. + */ + public com.google.protobuf.ByteString + getActionDescriptionBytes() { + java.lang.Object ref = actionDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + actionDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string actionDescription = 11; + * @param value The actionDescription to set. + * @return This builder for chaining. + */ + public Builder setActionDescription( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + actionDescription_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * string actionDescription = 11; + * @return This builder for chaining. + */ + public Builder clearActionDescription() { + actionDescription_ = getDefaultInstance().getActionDescription(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * string actionDescription = 11; + * @param value The bytes for actionDescription to set. + * @return This builder for chaining. + */ + public Builder setActionDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + actionDescription_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private long userId_ ; + /** + * int64 userId = 12; + * @return The userId. + */ + @java.lang.Override + public long getUserId() { + return userId_; + } + /** + * int64 userId = 12; + * @param value The userId to set. + * @return This builder for chaining. + */ + public Builder setUserId(long value) { + + userId_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * int64 userId = 12; + * @return This builder for chaining. + */ + public Builder clearUserId() { + bitField0_ = (bitField0_ & ~0x00000800); + userId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object popStr_ = ""; + /** + *
+     * EffectConfig effectConfig = 13;
+     * 
+ * + * string popStr = 14; + * @return The popStr. + */ + public java.lang.String getPopStr() { + java.lang.Object ref = popStr_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + popStr_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * EffectConfig effectConfig = 13;
+     * 
+ * + * string popStr = 14; + * @return The bytes for popStr. + */ + public com.google.protobuf.ByteString + getPopStrBytes() { + java.lang.Object ref = popStr_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + popStr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * EffectConfig effectConfig = 13;
+     * 
+ * + * string popStr = 14; + * @param value The popStr to set. + * @return This builder for chaining. + */ + public Builder setPopStr( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + popStr_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
+     * EffectConfig effectConfig = 13;
+     * 
+ * + * string popStr = 14; + * @return This builder for chaining. + */ + public Builder clearPopStr() { + popStr_ = getDefaultInstance().getPopStr(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + /** + *
+     * EffectConfig effectConfig = 13;
+     * 
+ * + * string popStr = 14; + * @param value The bytes for popStr to set. + * @return This builder for chaining. + */ + public Builder setPopStrBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + popStr_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image backgroundImage_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> backgroundImageBuilder_; + /** + *
+     * EffectConfig enterEffectConfig = 15;
+     * 
+ * + * .Image backgroundImage = 16; + * @return Whether the backgroundImage field is set. + */ + public boolean hasBackgroundImage() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + *
+     * EffectConfig enterEffectConfig = 15;
+     * 
+ * + * .Image backgroundImage = 16; + * @return The backgroundImage. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundImage() { + if (backgroundImageBuilder_ == null) { + return backgroundImage_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImage_; + } else { + return backgroundImageBuilder_.getMessage(); + } + } + /** + *
+     * EffectConfig enterEffectConfig = 15;
+     * 
+ * + * .Image backgroundImage = 16; + */ + public Builder setBackgroundImage(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (backgroundImageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backgroundImage_ = value; + } else { + backgroundImageBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
+     * EffectConfig enterEffectConfig = 15;
+     * 
+ * + * .Image backgroundImage = 16; + */ + public Builder setBackgroundImage( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (backgroundImageBuilder_ == null) { + backgroundImage_ = builderForValue.build(); + } else { + backgroundImageBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
+     * EffectConfig enterEffectConfig = 15;
+     * 
+ * + * .Image backgroundImage = 16; + */ + public Builder mergeBackgroundImage(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (backgroundImageBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) && + backgroundImage_ != null && + backgroundImage_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getBackgroundImageBuilder().mergeFrom(value); + } else { + backgroundImage_ = value; + } + } else { + backgroundImageBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
+     * EffectConfig enterEffectConfig = 15;
+     * 
+ * + * .Image backgroundImage = 16; + */ + public Builder clearBackgroundImage() { + bitField0_ = (bitField0_ & ~0x00002000); + backgroundImage_ = null; + if (backgroundImageBuilder_ != null) { + backgroundImageBuilder_.dispose(); + backgroundImageBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * EffectConfig enterEffectConfig = 15;
+     * 
+ * + * .Image backgroundImage = 16; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getBackgroundImageBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getBackgroundImageFieldBuilder().getBuilder(); + } + /** + *
+     * EffectConfig enterEffectConfig = 15;
+     * 
+ * + * .Image backgroundImage = 16; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundImageOrBuilder() { + if (backgroundImageBuilder_ != null) { + return backgroundImageBuilder_.getMessageOrBuilder(); + } else { + return backgroundImage_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImage_; + } + } + /** + *
+     * EffectConfig enterEffectConfig = 15;
+     * 
+ * + * .Image backgroundImage = 16; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getBackgroundImageFieldBuilder() { + if (backgroundImageBuilder_ == null) { + backgroundImageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getBackgroundImage(), + getParentForChildren(), + isClean()); + backgroundImage_ = null; + } + return backgroundImageBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image backgroundImageV2_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> backgroundImageV2Builder_; + /** + * .Image backgroundImageV2 = 17; + * @return Whether the backgroundImageV2 field is set. + */ + public boolean hasBackgroundImageV2() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + * .Image backgroundImageV2 = 17; + * @return The backgroundImageV2. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundImageV2() { + if (backgroundImageV2Builder_ == null) { + return backgroundImageV2_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImageV2_; + } else { + return backgroundImageV2Builder_.getMessage(); + } + } + /** + * .Image backgroundImageV2 = 17; + */ + public Builder setBackgroundImageV2(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (backgroundImageV2Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backgroundImageV2_ = value; + } else { + backgroundImageV2Builder_.setMessage(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * .Image backgroundImageV2 = 17; + */ + public Builder setBackgroundImageV2( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (backgroundImageV2Builder_ == null) { + backgroundImageV2_ = builderForValue.build(); + } else { + backgroundImageV2Builder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * .Image backgroundImageV2 = 17; + */ + public Builder mergeBackgroundImageV2(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (backgroundImageV2Builder_ == null) { + if (((bitField0_ & 0x00004000) != 0) && + backgroundImageV2_ != null && + backgroundImageV2_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getBackgroundImageV2Builder().mergeFrom(value); + } else { + backgroundImageV2_ = value; + } + } else { + backgroundImageV2Builder_.mergeFrom(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * .Image backgroundImageV2 = 17; + */ + public Builder clearBackgroundImageV2() { + bitField0_ = (bitField0_ & ~0x00004000); + backgroundImageV2_ = null; + if (backgroundImageV2Builder_ != null) { + backgroundImageV2Builder_.dispose(); + backgroundImageV2Builder_ = null; + } + onChanged(); + return this; + } + /** + * .Image backgroundImageV2 = 17; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getBackgroundImageV2Builder() { + bitField0_ |= 0x00004000; + onChanged(); + return getBackgroundImageV2FieldBuilder().getBuilder(); + } + /** + * .Image backgroundImageV2 = 17; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundImageV2OrBuilder() { + if (backgroundImageV2Builder_ != null) { + return backgroundImageV2Builder_.getMessageOrBuilder(); + } else { + return backgroundImageV2_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundImageV2_; + } + } + /** + * .Image backgroundImageV2 = 17; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getBackgroundImageV2FieldBuilder() { + if (backgroundImageV2Builder_ == null) { + backgroundImageV2Builder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getBackgroundImageV2(), + getParentForChildren(), + isClean()); + backgroundImageV2_ = null; + } + return backgroundImageV2Builder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text anchorDisplayText_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder> anchorDisplayTextBuilder_; + /** + * .Text anchorDisplayText = 18; + * @return Whether the anchorDisplayText field is set. + */ + public boolean hasAnchorDisplayText() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + * .Text anchorDisplayText = 18; + * @return The anchorDisplayText. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text getAnchorDisplayText() { + if (anchorDisplayTextBuilder_ == null) { + return anchorDisplayText_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance() : anchorDisplayText_; + } else { + return anchorDisplayTextBuilder_.getMessage(); + } + } + /** + * .Text anchorDisplayText = 18; + */ + public Builder setAnchorDisplayText(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text value) { + if (anchorDisplayTextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + anchorDisplayText_ = value; + } else { + anchorDisplayTextBuilder_.setMessage(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * .Text anchorDisplayText = 18; + */ + public Builder setAnchorDisplayText( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder builderForValue) { + if (anchorDisplayTextBuilder_ == null) { + anchorDisplayText_ = builderForValue.build(); + } else { + anchorDisplayTextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * .Text anchorDisplayText = 18; + */ + public Builder mergeAnchorDisplayText(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text value) { + if (anchorDisplayTextBuilder_ == null) { + if (((bitField0_ & 0x00008000) != 0) && + anchorDisplayText_ != null && + anchorDisplayText_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance()) { + getAnchorDisplayTextBuilder().mergeFrom(value); + } else { + anchorDisplayText_ = value; + } + } else { + anchorDisplayTextBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * .Text anchorDisplayText = 18; + */ + public Builder clearAnchorDisplayText() { + bitField0_ = (bitField0_ & ~0x00008000); + anchorDisplayText_ = null; + if (anchorDisplayTextBuilder_ != null) { + anchorDisplayTextBuilder_.dispose(); + anchorDisplayTextBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Text anchorDisplayText = 18; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder getAnchorDisplayTextBuilder() { + bitField0_ |= 0x00008000; + onChanged(); + return getAnchorDisplayTextFieldBuilder().getBuilder(); + } + /** + * .Text anchorDisplayText = 18; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder getAnchorDisplayTextOrBuilder() { + if (anchorDisplayTextBuilder_ != null) { + return anchorDisplayTextBuilder_.getMessageOrBuilder(); + } else { + return anchorDisplayText_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance() : anchorDisplayText_; + } + } + /** + * .Text anchorDisplayText = 18; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder> + getAnchorDisplayTextFieldBuilder() { + if (anchorDisplayTextBuilder_ == null) { + anchorDisplayTextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder>( + getAnchorDisplayText(), + getParentForChildren(), + isClean()); + anchorDisplayText_ = null; + } + return anchorDisplayTextBuilder_; + } + + private long userEnterTipType_ ; + /** + *
+     * PublicAreaCommon publicAreaCommon = 19;
+     * 
+ * + * int64 userEnterTipType = 20; + * @return The userEnterTipType. + */ + @java.lang.Override + public long getUserEnterTipType() { + return userEnterTipType_; + } + /** + *
+     * PublicAreaCommon publicAreaCommon = 19;
+     * 
+ * + * int64 userEnterTipType = 20; + * @param value The userEnterTipType to set. + * @return This builder for chaining. + */ + public Builder setUserEnterTipType(long value) { + + userEnterTipType_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + *
+     * PublicAreaCommon publicAreaCommon = 19;
+     * 
+ * + * int64 userEnterTipType = 20; + * @return This builder for chaining. + */ + public Builder clearUserEnterTipType() { + bitField0_ = (bitField0_ & ~0x00010000); + userEnterTipType_ = 0L; + onChanged(); + return this; + } + + private long anchorEnterTipType_ ; + /** + * int64 anchorEnterTipType = 21; + * @return The anchorEnterTipType. + */ + @java.lang.Override + public long getAnchorEnterTipType() { + return anchorEnterTipType_; + } + /** + * int64 anchorEnterTipType = 21; + * @param value The anchorEnterTipType to set. + * @return This builder for chaining. + */ + public Builder setAnchorEnterTipType(long value) { + + anchorEnterTipType_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * int64 anchorEnterTipType = 21; + * @return This builder for chaining. + */ + public Builder clearAnchorEnterTipType() { + bitField0_ = (bitField0_ & ~0x00020000); + anchorEnterTipType_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> buriedPointMap_; + private com.google.protobuf.MapField + internalGetBuriedPointMap() { + if (buriedPointMap_ == null) { + return com.google.protobuf.MapField.emptyMapField( + BuriedPointMapDefaultEntryHolder.defaultEntry); + } + return buriedPointMap_; + } + private com.google.protobuf.MapField + internalGetMutableBuriedPointMap() { + if (buriedPointMap_ == null) { + buriedPointMap_ = com.google.protobuf.MapField.newMapField( + BuriedPointMapDefaultEntryHolder.defaultEntry); + } + if (!buriedPointMap_.isMutable()) { + buriedPointMap_ = buriedPointMap_.copy(); + } + bitField0_ |= 0x00040000; + onChanged(); + return buriedPointMap_; + } + public int getBuriedPointMapCount() { + return internalGetBuriedPointMap().getMap().size(); + } + /** + * map<string, string> buriedPointMap = 22; + */ + @java.lang.Override + public boolean containsBuriedPointMap( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetBuriedPointMap().getMap().containsKey(key); + } + /** + * Use {@link #getBuriedPointMapMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getBuriedPointMap() { + return getBuriedPointMapMap(); + } + /** + * map<string, string> buriedPointMap = 22; + */ + @java.lang.Override + public java.util.Map getBuriedPointMapMap() { + return internalGetBuriedPointMap().getMap(); + } + /** + * map<string, string> buriedPointMap = 22; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getBuriedPointMapOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetBuriedPointMap().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> buriedPointMap = 22; + */ + @java.lang.Override + public java.lang.String getBuriedPointMapOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetBuriedPointMap().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearBuriedPointMap() { + bitField0_ = (bitField0_ & ~0x00040000); + internalGetMutableBuriedPointMap().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> buriedPointMap = 22; + */ + public Builder removeBuriedPointMap( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableBuriedPointMap().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableBuriedPointMap() { + bitField0_ |= 0x00040000; + return internalGetMutableBuriedPointMap().getMutableMap(); + } + /** + * map<string, string> buriedPointMap = 22; + */ + public Builder putBuriedPointMap( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableBuriedPointMap().getMutableMap() + .put(key, value); + bitField0_ |= 0x00040000; + return this; + } + /** + * map<string, string> buriedPointMap = 22; + */ + public Builder putAllBuriedPointMap( + java.util.Map values) { + internalGetMutableBuriedPointMap().getMutableMap() + .putAll(values); + bitField0_ |= 0x00040000; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg) + } + + // @@protoc_insertion_point(class_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public douyin_webcast_member_message_msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_member_message_msgOrBuilder.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_member_message_msgOrBuilder.java new file mode 100644 index 0000000..52d111b --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_webcast_member_message_msgOrBuilder.java @@ -0,0 +1,265 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_webcast_member_message_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +public interface douyin_webcast_member_message_msgOrBuilder extends + // @@protoc_insertion_point(interface_extends:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_webcast_member_message_msg) + com.google.protobuf.MessageOrBuilder { + + /** + * .Common common = 1; + * @return Whether the common field is set. + */ + boolean hasCommon(); + /** + * .Common common = 1; + * @return The common. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getCommon(); + /** + * .Common common = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder getCommonOrBuilder(); + + /** + * .User user = 2; + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * .User user = 2; + * @return The user. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser(); + /** + * .User user = 2; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder(); + + /** + * uint64 memberCount = 3; + * @return The memberCount. + */ + long getMemberCount(); + + /** + * .User operator = 4; + * @return Whether the operator field is set. + */ + boolean hasOperator(); + /** + * .User operator = 4; + * @return The operator. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getOperator(); + /** + * .User operator = 4; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getOperatorOrBuilder(); + + /** + * bool isSetToAdmin = 5; + * @return The isSetToAdmin. + */ + boolean getIsSetToAdmin(); + + /** + * bool isTopUser = 6; + * @return The isTopUser. + */ + boolean getIsTopUser(); + + /** + * int64 rankScore = 7; + * @return The rankScore. + */ + long getRankScore(); + + /** + * int64 topUserNo = 8; + * @return The topUserNo. + */ + long getTopUserNo(); + + /** + * int64 enterType = 9; + * @return The enterType. + */ + long getEnterType(); + + /** + * int64 action = 10; + * @return The action. + */ + long getAction(); + + /** + * string actionDescription = 11; + * @return The actionDescription. + */ + java.lang.String getActionDescription(); + /** + * string actionDescription = 11; + * @return The bytes for actionDescription. + */ + com.google.protobuf.ByteString + getActionDescriptionBytes(); + + /** + * int64 userId = 12; + * @return The userId. + */ + long getUserId(); + + /** + *
+   * EffectConfig effectConfig = 13;
+   * 
+ * + * string popStr = 14; + * @return The popStr. + */ + java.lang.String getPopStr(); + /** + *
+   * EffectConfig effectConfig = 13;
+   * 
+ * + * string popStr = 14; + * @return The bytes for popStr. + */ + com.google.protobuf.ByteString + getPopStrBytes(); + + /** + *
+   * EffectConfig enterEffectConfig = 15;
+   * 
+ * + * .Image backgroundImage = 16; + * @return Whether the backgroundImage field is set. + */ + boolean hasBackgroundImage(); + /** + *
+   * EffectConfig enterEffectConfig = 15;
+   * 
+ * + * .Image backgroundImage = 16; + * @return The backgroundImage. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundImage(); + /** + *
+   * EffectConfig enterEffectConfig = 15;
+   * 
+ * + * .Image backgroundImage = 16; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundImageOrBuilder(); + + /** + * .Image backgroundImageV2 = 17; + * @return Whether the backgroundImageV2 field is set. + */ + boolean hasBackgroundImageV2(); + /** + * .Image backgroundImageV2 = 17; + * @return The backgroundImageV2. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundImageV2(); + /** + * .Image backgroundImageV2 = 17; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundImageV2OrBuilder(); + + /** + * .Text anchorDisplayText = 18; + * @return Whether the anchorDisplayText field is set. + */ + boolean hasAnchorDisplayText(); + /** + * .Text anchorDisplayText = 18; + * @return The anchorDisplayText. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text getAnchorDisplayText(); + /** + * .Text anchorDisplayText = 18; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder getAnchorDisplayTextOrBuilder(); + + /** + *
+   * PublicAreaCommon publicAreaCommon = 19;
+   * 
+ * + * int64 userEnterTipType = 20; + * @return The userEnterTipType. + */ + long getUserEnterTipType(); + + /** + * int64 anchorEnterTipType = 21; + * @return The anchorEnterTipType. + */ + long getAnchorEnterTipType(); + + /** + * map<string, string> buriedPointMap = 22; + */ + int getBuriedPointMapCount(); + /** + * map<string, string> buriedPointMap = 22; + */ + boolean containsBuriedPointMap( + java.lang.String key); + /** + * Use {@link #getBuriedPointMapMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getBuriedPointMap(); + /** + * map<string, string> buriedPointMap = 22; + */ + java.util.Map + getBuriedPointMapMap(); + /** + * map<string, string> buriedPointMap = 22; + */ + /* nullable */ +java.lang.String getBuriedPointMapOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + * map<string, string> buriedPointMap = 22; + */ + java.lang.String getBuriedPointMapOrThrow( + java.lang.String key); +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame.java new file mode 100644 index 0000000..8caffe8 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame.java @@ -0,0 +1,1315 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_websocket_frame.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +/** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame} + */ +public final class douyin_websocket_frame extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame) + douyin_websocket_frameOrBuilder { +private static final long serialVersionUID = 0L; + // Use douyin_websocket_frame.newBuilder() to construct. + private douyin_websocket_frame(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private douyin_websocket_frame() { + payloadEncoding_ = ""; + payloadType_ = ""; + payload_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new douyin_websocket_frame(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_websocket_frameProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetHeadersList(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_websocket_frameProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame.Builder.class); + } + + public static final int SEQ_ID_FIELD_NUMBER = 1; + private long seqId_ = 0L; + /** + * uint64 seq_id = 1; + * @return The seqId. + */ + @java.lang.Override + public long getSeqId() { + return seqId_; + } + + public static final int LOG_ID_FIELD_NUMBER = 2; + private long logId_ = 0L; + /** + * uint64 log_id = 2; + * @return The logId. + */ + @java.lang.Override + public long getLogId() { + return logId_; + } + + public static final int SERVICE_FIELD_NUMBER = 3; + private long service_ = 0L; + /** + * uint64 service = 3; + * @return The service. + */ + @java.lang.Override + public long getService() { + return service_; + } + + public static final int METHOD_FIELD_NUMBER = 4; + private long method_ = 0L; + /** + * uint64 method = 4; + * @return The method. + */ + @java.lang.Override + public long getMethod() { + return method_; + } + + public static final int HEADERS_LIST_FIELD_NUMBER = 5; + private static final class HeadersListDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_websocket_frameProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_HeadersListEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> headersList_; + private com.google.protobuf.MapField + internalGetHeadersList() { + if (headersList_ == null) { + return com.google.protobuf.MapField.emptyMapField( + HeadersListDefaultEntryHolder.defaultEntry); + } + return headersList_; + } + public int getHeadersListCount() { + return internalGetHeadersList().getMap().size(); + } + /** + * map<string, string> headers_list = 5; + */ + @java.lang.Override + public boolean containsHeadersList( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetHeadersList().getMap().containsKey(key); + } + /** + * Use {@link #getHeadersListMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getHeadersList() { + return getHeadersListMap(); + } + /** + * map<string, string> headers_list = 5; + */ + @java.lang.Override + public java.util.Map getHeadersListMap() { + return internalGetHeadersList().getMap(); + } + /** + * map<string, string> headers_list = 5; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getHeadersListOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetHeadersList().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> headers_list = 5; + */ + @java.lang.Override + public java.lang.String getHeadersListOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetHeadersList().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int PAYLOAD_ENCODING_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object payloadEncoding_ = ""; + /** + * string payload_encoding = 6; + * @return The payloadEncoding. + */ + @java.lang.Override + public java.lang.String getPayloadEncoding() { + java.lang.Object ref = payloadEncoding_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + payloadEncoding_ = s; + return s; + } + } + /** + * string payload_encoding = 6; + * @return The bytes for payloadEncoding. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPayloadEncodingBytes() { + java.lang.Object ref = payloadEncoding_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + payloadEncoding_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAYLOAD_TYPE_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object payloadType_ = ""; + /** + * string payload_type = 7; + * @return The payloadType. + */ + @java.lang.Override + public java.lang.String getPayloadType() { + java.lang.Object ref = payloadType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + payloadType_ = s; + return s; + } + } + /** + * string payload_type = 7; + * @return The bytes for payloadType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPayloadTypeBytes() { + java.lang.Object ref = payloadType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + payloadType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAYLOAD_FIELD_NUMBER = 8; + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes payload = 8; + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (seqId_ != 0L) { + output.writeUInt64(1, seqId_); + } + if (logId_ != 0L) { + output.writeUInt64(2, logId_); + } + if (service_ != 0L) { + output.writeUInt64(3, service_); + } + if (method_ != 0L) { + output.writeUInt64(4, method_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetHeadersList(), + HeadersListDefaultEntryHolder.defaultEntry, + 5); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(payloadEncoding_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, payloadEncoding_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(payloadType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, payloadType_); + } + if (!payload_.isEmpty()) { + output.writeBytes(8, payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (seqId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, seqId_); + } + if (logId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, logId_); + } + if (service_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, service_); + } + if (method_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, method_); + } + for (java.util.Map.Entry entry + : internalGetHeadersList().getMap().entrySet()) { + com.google.protobuf.MapEntry + headersList__ = HeadersListDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, headersList__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(payloadEncoding_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, payloadEncoding_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(payloadType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, payloadType_); + } + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(8, payload_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame) obj; + + if (getSeqId() + != other.getSeqId()) return false; + if (getLogId() + != other.getLogId()) return false; + if (getService() + != other.getService()) return false; + if (getMethod() + != other.getMethod()) return false; + if (!internalGetHeadersList().equals( + other.internalGetHeadersList())) return false; + if (!getPayloadEncoding() + .equals(other.getPayloadEncoding())) return false; + if (!getPayloadType() + .equals(other.getPayloadType())) return false; + if (!getPayload() + .equals(other.getPayload())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SEQ_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSeqId()); + hash = (37 * hash) + LOG_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLogId()); + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getService()); + hash = (37 * hash) + METHOD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMethod()); + if (!internalGetHeadersList().getMap().isEmpty()) { + hash = (37 * hash) + HEADERS_LIST_FIELD_NUMBER; + hash = (53 * hash) + internalGetHeadersList().hashCode(); + } + hash = (37 * hash) + PAYLOAD_ENCODING_FIELD_NUMBER; + hash = (53 * hash) + getPayloadEncoding().hashCode(); + hash = (37 * hash) + PAYLOAD_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getPayloadType().hashCode(); + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame) + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frameOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_websocket_frameProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetHeadersList(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 5: + return internalGetMutableHeadersList(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_websocket_frameProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + seqId_ = 0L; + logId_ = 0L; + service_ = 0L; + method_ = 0L; + internalGetMutableHeadersList().clear(); + payloadEncoding_ = ""; + payloadType_ = ""; + payload_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_websocket_frameProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.seqId_ = seqId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.logId_ = logId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.service_ = service_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.method_ = method_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.headersList_ = internalGetHeadersList(); + result.headersList_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.payloadEncoding_ = payloadEncoding_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.payloadType_ = payloadType_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.payload_ = payload_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame.getDefaultInstance()) return this; + if (other.getSeqId() != 0L) { + setSeqId(other.getSeqId()); + } + if (other.getLogId() != 0L) { + setLogId(other.getLogId()); + } + if (other.getService() != 0L) { + setService(other.getService()); + } + if (other.getMethod() != 0L) { + setMethod(other.getMethod()); + } + internalGetMutableHeadersList().mergeFrom( + other.internalGetHeadersList()); + bitField0_ |= 0x00000010; + if (!other.getPayloadEncoding().isEmpty()) { + payloadEncoding_ = other.payloadEncoding_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getPayloadType().isEmpty()) { + payloadType_ = other.payloadType_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.getPayload() != com.google.protobuf.ByteString.EMPTY) { + setPayload(other.getPayload()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + seqId_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + logId_ = input.readUInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + service_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + method_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + com.google.protobuf.MapEntry + headersList__ = input.readMessage( + HeadersListDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableHeadersList().getMutableMap().put( + headersList__.getKey(), headersList__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + payloadEncoding_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + payloadType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: { + payload_ = input.readBytes(); + bitField0_ |= 0x00000080; + break; + } // case 66 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long seqId_ ; + /** + * uint64 seq_id = 1; + * @return The seqId. + */ + @java.lang.Override + public long getSeqId() { + return seqId_; + } + /** + * uint64 seq_id = 1; + * @param value The seqId to set. + * @return This builder for chaining. + */ + public Builder setSeqId(long value) { + + seqId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 seq_id = 1; + * @return This builder for chaining. + */ + public Builder clearSeqId() { + bitField0_ = (bitField0_ & ~0x00000001); + seqId_ = 0L; + onChanged(); + return this; + } + + private long logId_ ; + /** + * uint64 log_id = 2; + * @return The logId. + */ + @java.lang.Override + public long getLogId() { + return logId_; + } + /** + * uint64 log_id = 2; + * @param value The logId to set. + * @return This builder for chaining. + */ + public Builder setLogId(long value) { + + logId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint64 log_id = 2; + * @return This builder for chaining. + */ + public Builder clearLogId() { + bitField0_ = (bitField0_ & ~0x00000002); + logId_ = 0L; + onChanged(); + return this; + } + + private long service_ ; + /** + * uint64 service = 3; + * @return The service. + */ + @java.lang.Override + public long getService() { + return service_; + } + /** + * uint64 service = 3; + * @param value The service to set. + * @return This builder for chaining. + */ + public Builder setService(long value) { + + service_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 service = 3; + * @return This builder for chaining. + */ + public Builder clearService() { + bitField0_ = (bitField0_ & ~0x00000004); + service_ = 0L; + onChanged(); + return this; + } + + private long method_ ; + /** + * uint64 method = 4; + * @return The method. + */ + @java.lang.Override + public long getMethod() { + return method_; + } + /** + * uint64 method = 4; + * @param value The method to set. + * @return This builder for chaining. + */ + public Builder setMethod(long value) { + + method_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint64 method = 4; + * @return This builder for chaining. + */ + public Builder clearMethod() { + bitField0_ = (bitField0_ & ~0x00000008); + method_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> headersList_; + private com.google.protobuf.MapField + internalGetHeadersList() { + if (headersList_ == null) { + return com.google.protobuf.MapField.emptyMapField( + HeadersListDefaultEntryHolder.defaultEntry); + } + return headersList_; + } + private com.google.protobuf.MapField + internalGetMutableHeadersList() { + if (headersList_ == null) { + headersList_ = com.google.protobuf.MapField.newMapField( + HeadersListDefaultEntryHolder.defaultEntry); + } + if (!headersList_.isMutable()) { + headersList_ = headersList_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return headersList_; + } + public int getHeadersListCount() { + return internalGetHeadersList().getMap().size(); + } + /** + * map<string, string> headers_list = 5; + */ + @java.lang.Override + public boolean containsHeadersList( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetHeadersList().getMap().containsKey(key); + } + /** + * Use {@link #getHeadersListMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getHeadersList() { + return getHeadersListMap(); + } + /** + * map<string, string> headers_list = 5; + */ + @java.lang.Override + public java.util.Map getHeadersListMap() { + return internalGetHeadersList().getMap(); + } + /** + * map<string, string> headers_list = 5; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getHeadersListOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetHeadersList().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> headers_list = 5; + */ + @java.lang.Override + public java.lang.String getHeadersListOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetHeadersList().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearHeadersList() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableHeadersList().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> headers_list = 5; + */ + public Builder removeHeadersList( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableHeadersList().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableHeadersList() { + bitField0_ |= 0x00000010; + return internalGetMutableHeadersList().getMutableMap(); + } + /** + * map<string, string> headers_list = 5; + */ + public Builder putHeadersList( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableHeadersList().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + * map<string, string> headers_list = 5; + */ + public Builder putAllHeadersList( + java.util.Map values) { + internalGetMutableHeadersList().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private java.lang.Object payloadEncoding_ = ""; + /** + * string payload_encoding = 6; + * @return The payloadEncoding. + */ + public java.lang.String getPayloadEncoding() { + java.lang.Object ref = payloadEncoding_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + payloadEncoding_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string payload_encoding = 6; + * @return The bytes for payloadEncoding. + */ + public com.google.protobuf.ByteString + getPayloadEncodingBytes() { + java.lang.Object ref = payloadEncoding_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + payloadEncoding_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string payload_encoding = 6; + * @param value The payloadEncoding to set. + * @return This builder for chaining. + */ + public Builder setPayloadEncoding( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + payloadEncoding_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * string payload_encoding = 6; + * @return This builder for chaining. + */ + public Builder clearPayloadEncoding() { + payloadEncoding_ = getDefaultInstance().getPayloadEncoding(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * string payload_encoding = 6; + * @param value The bytes for payloadEncoding to set. + * @return This builder for chaining. + */ + public Builder setPayloadEncodingBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + payloadEncoding_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object payloadType_ = ""; + /** + * string payload_type = 7; + * @return The payloadType. + */ + public java.lang.String getPayloadType() { + java.lang.Object ref = payloadType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + payloadType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string payload_type = 7; + * @return The bytes for payloadType. + */ + public com.google.protobuf.ByteString + getPayloadTypeBytes() { + java.lang.Object ref = payloadType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + payloadType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string payload_type = 7; + * @param value The payloadType to set. + * @return This builder for chaining. + */ + public Builder setPayloadType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + payloadType_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * string payload_type = 7; + * @return This builder for chaining. + */ + public Builder clearPayloadType() { + payloadType_ = getDefaultInstance().getPayloadType(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * string payload_type = 7; + * @param value The bytes for payloadType to set. + * @return This builder for chaining. + */ + public Builder setPayloadTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + payloadType_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes payload = 8; + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + /** + * bytes payload = 8; + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + payload_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * bytes payload = 8; + * @return This builder for chaining. + */ + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000080); + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame) + } + + // @@protoc_insertion_point(class_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public douyin_websocket_frame parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frameOrBuilder.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frameOrBuilder.java new file mode 100644 index 0000000..9bf36f7 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frameOrBuilder.java @@ -0,0 +1,121 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_websocket_frame.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +public interface douyin_websocket_frameOrBuilder extends + // @@protoc_insertion_point(interface_extends:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 seq_id = 1; + * @return The seqId. + */ + long getSeqId(); + + /** + * uint64 log_id = 2; + * @return The logId. + */ + long getLogId(); + + /** + * uint64 service = 3; + * @return The service. + */ + long getService(); + + /** + * uint64 method = 4; + * @return The method. + */ + long getMethod(); + + /** + * map<string, string> headers_list = 5; + */ + int getHeadersListCount(); + /** + * map<string, string> headers_list = 5; + */ + boolean containsHeadersList( + java.lang.String key); + /** + * Use {@link #getHeadersListMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getHeadersList(); + /** + * map<string, string> headers_list = 5; + */ + java.util.Map + getHeadersListMap(); + /** + * map<string, string> headers_list = 5; + */ + /* nullable */ +java.lang.String getHeadersListOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + * map<string, string> headers_list = 5; + */ + java.lang.String getHeadersListOrThrow( + java.lang.String key); + + /** + * string payload_encoding = 6; + * @return The payloadEncoding. + */ + java.lang.String getPayloadEncoding(); + /** + * string payload_encoding = 6; + * @return The bytes for payloadEncoding. + */ + com.google.protobuf.ByteString + getPayloadEncodingBytes(); + + /** + * string payload_type = 7; + * @return The payloadType. + */ + java.lang.String getPayloadType(); + /** + * string payload_type = 7; + * @return The bytes for payloadType. + */ + com.google.protobuf.ByteString + getPayloadTypeBytes(); + + /** + * bytes payload = 8; + * @return The payload. + */ + com.google.protobuf.ByteString getPayload(); +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame_msg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame_msg.java new file mode 100644 index 0000000..5037b9f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame_msg.java @@ -0,0 +1,2007 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_websocket_frame_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +/** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg} + */ +public final class douyin_websocket_frame_msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg) + douyin_websocket_frame_msgOrBuilder { +private static final long serialVersionUID = 0L; + // Use douyin_websocket_frame_msg.newBuilder() to construct. + private douyin_websocket_frame_msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private douyin_websocket_frame_msg() { + messagesList_ = java.util.Collections.emptyList(); + cursor_ = ""; + internalExt_ = ""; + pushServer_ = ""; + liveCursor_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new douyin_websocket_frame_msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 7: + return internalGetRouteParams(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg.Builder.class); + } + + public static final int MESSAGES_LIST_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List messagesList_; + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + @java.lang.Override + public java.util.List getMessagesListList() { + return messagesList_; + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + @java.lang.Override + public java.util.List + getMessagesListOrBuilderList() { + return messagesList_; + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + @java.lang.Override + public int getMessagesListCount() { + return messagesList_.size(); + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg getMessagesList(int index) { + return messagesList_.get(index); + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msgOrBuilder getMessagesListOrBuilder( + int index) { + return messagesList_.get(index); + } + + public static final int CURSOR_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object cursor_ = ""; + /** + * string cursor = 2; + * @return The cursor. + */ + @java.lang.Override + public java.lang.String getCursor() { + java.lang.Object ref = cursor_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cursor_ = s; + return s; + } + } + /** + * string cursor = 2; + * @return The bytes for cursor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCursorBytes() { + java.lang.Object ref = cursor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cursor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FETCH_INTERVAL_FIELD_NUMBER = 3; + private long fetchInterval_ = 0L; + /** + * uint64 fetch_interval = 3; + * @return The fetchInterval. + */ + @java.lang.Override + public long getFetchInterval() { + return fetchInterval_; + } + + public static final int NOW_FIELD_NUMBER = 4; + private long now_ = 0L; + /** + * uint64 now = 4; + * @return The now. + */ + @java.lang.Override + public long getNow() { + return now_; + } + + public static final int INTERNAL_EXT_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object internalExt_ = ""; + /** + * string internal_ext = 5; + * @return The internalExt. + */ + @java.lang.Override + public java.lang.String getInternalExt() { + java.lang.Object ref = internalExt_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + internalExt_ = s; + return s; + } + } + /** + * string internal_ext = 5; + * @return The bytes for internalExt. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getInternalExtBytes() { + java.lang.Object ref = internalExt_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + internalExt_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FETCH_TYPE_FIELD_NUMBER = 6; + private int fetchType_ = 0; + /** + * uint32 fetch_type = 6; + * @return The fetchType. + */ + @java.lang.Override + public int getFetchType() { + return fetchType_; + } + + public static final int ROUTE_PARAMS_FIELD_NUMBER = 7; + private static final class RouteParamsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_RouteParamsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> routeParams_; + private com.google.protobuf.MapField + internalGetRouteParams() { + if (routeParams_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RouteParamsDefaultEntryHolder.defaultEntry); + } + return routeParams_; + } + public int getRouteParamsCount() { + return internalGetRouteParams().getMap().size(); + } + /** + * map<string, string> route_params = 7; + */ + @java.lang.Override + public boolean containsRouteParams( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetRouteParams().getMap().containsKey(key); + } + /** + * Use {@link #getRouteParamsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getRouteParams() { + return getRouteParamsMap(); + } + /** + * map<string, string> route_params = 7; + */ + @java.lang.Override + public java.util.Map getRouteParamsMap() { + return internalGetRouteParams().getMap(); + } + /** + * map<string, string> route_params = 7; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getRouteParamsOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetRouteParams().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> route_params = 7; + */ + @java.lang.Override + public java.lang.String getRouteParamsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetRouteParams().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int HEARTBEAT_DURATION_FIELD_NUMBER = 8; + private long heartbeatDuration_ = 0L; + /** + * uint64 heartbeat_duration = 8; + * @return The heartbeatDuration. + */ + @java.lang.Override + public long getHeartbeatDuration() { + return heartbeatDuration_; + } + + public static final int NEED_ACK_FIELD_NUMBER = 9; + private boolean needAck_ = false; + /** + * bool need_ack = 9; + * @return The needAck. + */ + @java.lang.Override + public boolean getNeedAck() { + return needAck_; + } + + public static final int PUSH_SERVER_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private volatile java.lang.Object pushServer_ = ""; + /** + * string push_server = 10; + * @return The pushServer. + */ + @java.lang.Override + public java.lang.String getPushServer() { + java.lang.Object ref = pushServer_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pushServer_ = s; + return s; + } + } + /** + * string push_server = 10; + * @return The bytes for pushServer. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPushServerBytes() { + java.lang.Object ref = pushServer_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pushServer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LIVE_CURSOR_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private volatile java.lang.Object liveCursor_ = ""; + /** + * string live_cursor = 11; + * @return The liveCursor. + */ + @java.lang.Override + public java.lang.String getLiveCursor() { + java.lang.Object ref = liveCursor_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + liveCursor_ = s; + return s; + } + } + /** + * string live_cursor = 11; + * @return The bytes for liveCursor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLiveCursorBytes() { + java.lang.Object ref = liveCursor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + liveCursor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HISTORY_NO_MORE_FIELD_NUMBER = 12; + private boolean historyNoMore_ = false; + /** + * bool history_no_more = 12; + * @return The historyNoMore. + */ + @java.lang.Override + public boolean getHistoryNoMore() { + return historyNoMore_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < messagesList_.size(); i++) { + output.writeMessage(1, messagesList_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cursor_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, cursor_); + } + if (fetchInterval_ != 0L) { + output.writeUInt64(3, fetchInterval_); + } + if (now_ != 0L) { + output.writeUInt64(4, now_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(internalExt_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, internalExt_); + } + if (fetchType_ != 0) { + output.writeUInt32(6, fetchType_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetRouteParams(), + RouteParamsDefaultEntryHolder.defaultEntry, + 7); + if (heartbeatDuration_ != 0L) { + output.writeUInt64(8, heartbeatDuration_); + } + if (needAck_ != false) { + output.writeBool(9, needAck_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pushServer_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, pushServer_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(liveCursor_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, liveCursor_); + } + if (historyNoMore_ != false) { + output.writeBool(12, historyNoMore_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < messagesList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, messagesList_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cursor_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, cursor_); + } + if (fetchInterval_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, fetchInterval_); + } + if (now_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, now_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(internalExt_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, internalExt_); + } + if (fetchType_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(6, fetchType_); + } + for (java.util.Map.Entry entry + : internalGetRouteParams().getMap().entrySet()) { + com.google.protobuf.MapEntry + routeParams__ = RouteParamsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, routeParams__); + } + if (heartbeatDuration_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(8, heartbeatDuration_); + } + if (needAck_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(9, needAck_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pushServer_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, pushServer_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(liveCursor_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, liveCursor_); + } + if (historyNoMore_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(12, historyNoMore_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg) obj; + + if (!getMessagesListList() + .equals(other.getMessagesListList())) return false; + if (!getCursor() + .equals(other.getCursor())) return false; + if (getFetchInterval() + != other.getFetchInterval()) return false; + if (getNow() + != other.getNow()) return false; + if (!getInternalExt() + .equals(other.getInternalExt())) return false; + if (getFetchType() + != other.getFetchType()) return false; + if (!internalGetRouteParams().equals( + other.internalGetRouteParams())) return false; + if (getHeartbeatDuration() + != other.getHeartbeatDuration()) return false; + if (getNeedAck() + != other.getNeedAck()) return false; + if (!getPushServer() + .equals(other.getPushServer())) return false; + if (!getLiveCursor() + .equals(other.getLiveCursor())) return false; + if (getHistoryNoMore() + != other.getHistoryNoMore()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getMessagesListCount() > 0) { + hash = (37 * hash) + MESSAGES_LIST_FIELD_NUMBER; + hash = (53 * hash) + getMessagesListList().hashCode(); + } + hash = (37 * hash) + CURSOR_FIELD_NUMBER; + hash = (53 * hash) + getCursor().hashCode(); + hash = (37 * hash) + FETCH_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFetchInterval()); + hash = (37 * hash) + NOW_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNow()); + hash = (37 * hash) + INTERNAL_EXT_FIELD_NUMBER; + hash = (53 * hash) + getInternalExt().hashCode(); + hash = (37 * hash) + FETCH_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getFetchType(); + if (!internalGetRouteParams().getMap().isEmpty()) { + hash = (37 * hash) + ROUTE_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + internalGetRouteParams().hashCode(); + } + hash = (37 * hash) + HEARTBEAT_DURATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getHeartbeatDuration()); + hash = (37 * hash) + NEED_ACK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getNeedAck()); + hash = (37 * hash) + PUSH_SERVER_FIELD_NUMBER; + hash = (53 * hash) + getPushServer().hashCode(); + hash = (37 * hash) + LIVE_CURSOR_FIELD_NUMBER; + hash = (53 * hash) + getLiveCursor().hashCode(); + hash = (37 * hash) + HISTORY_NO_MORE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getHistoryNoMore()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg) + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 7: + return internalGetRouteParams(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 7: + return internalGetMutableRouteParams(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (messagesListBuilder_ == null) { + messagesList_ = java.util.Collections.emptyList(); + } else { + messagesList_ = null; + messagesListBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + cursor_ = ""; + fetchInterval_ = 0L; + now_ = 0L; + internalExt_ = ""; + fetchType_ = 0; + internalGetMutableRouteParams().clear(); + heartbeatDuration_ = 0L; + needAck_ = false; + pushServer_ = ""; + liveCursor_ = ""; + historyNoMore_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msgProto.internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg result) { + if (messagesListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + messagesList_ = java.util.Collections.unmodifiableList(messagesList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.messagesList_ = messagesList_; + } else { + result.messagesList_ = messagesListBuilder_.build(); + } + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.cursor_ = cursor_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.fetchInterval_ = fetchInterval_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.now_ = now_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.internalExt_ = internalExt_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.fetchType_ = fetchType_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.routeParams_ = internalGetRouteParams(); + result.routeParams_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.heartbeatDuration_ = heartbeatDuration_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.needAck_ = needAck_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.pushServer_ = pushServer_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.liveCursor_ = liveCursor_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.historyNoMore_ = historyNoMore_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg.getDefaultInstance()) return this; + if (messagesListBuilder_ == null) { + if (!other.messagesList_.isEmpty()) { + if (messagesList_.isEmpty()) { + messagesList_ = other.messagesList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMessagesListIsMutable(); + messagesList_.addAll(other.messagesList_); + } + onChanged(); + } + } else { + if (!other.messagesList_.isEmpty()) { + if (messagesListBuilder_.isEmpty()) { + messagesListBuilder_.dispose(); + messagesListBuilder_ = null; + messagesList_ = other.messagesList_; + bitField0_ = (bitField0_ & ~0x00000001); + messagesListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getMessagesListFieldBuilder() : null; + } else { + messagesListBuilder_.addAllMessages(other.messagesList_); + } + } + } + if (!other.getCursor().isEmpty()) { + cursor_ = other.cursor_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getFetchInterval() != 0L) { + setFetchInterval(other.getFetchInterval()); + } + if (other.getNow() != 0L) { + setNow(other.getNow()); + } + if (!other.getInternalExt().isEmpty()) { + internalExt_ = other.internalExt_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getFetchType() != 0) { + setFetchType(other.getFetchType()); + } + internalGetMutableRouteParams().mergeFrom( + other.internalGetRouteParams()); + bitField0_ |= 0x00000040; + if (other.getHeartbeatDuration() != 0L) { + setHeartbeatDuration(other.getHeartbeatDuration()); + } + if (other.getNeedAck() != false) { + setNeedAck(other.getNeedAck()); + } + if (!other.getPushServer().isEmpty()) { + pushServer_ = other.pushServer_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (!other.getLiveCursor().isEmpty()) { + liveCursor_ = other.liveCursor_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (other.getHistoryNoMore() != false) { + setHistoryNoMore(other.getHistoryNoMore()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg m = + input.readMessage( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.parser(), + extensionRegistry); + if (messagesListBuilder_ == null) { + ensureMessagesListIsMutable(); + messagesList_.add(m); + } else { + messagesListBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + cursor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + fetchInterval_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + now_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + internalExt_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: { + fetchType_ = input.readUInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: { + com.google.protobuf.MapEntry + routeParams__ = input.readMessage( + RouteParamsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableRouteParams().getMutableMap().put( + routeParams__.getKey(), routeParams__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: { + heartbeatDuration_ = input.readUInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + needAck_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 82: { + pushServer_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: { + liveCursor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 96: { + historyNoMore_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 96 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List messagesList_ = + java.util.Collections.emptyList(); + private void ensureMessagesListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + messagesList_ = new java.util.ArrayList(messagesList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msgOrBuilder> messagesListBuilder_; + + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public java.util.List getMessagesListList() { + if (messagesListBuilder_ == null) { + return java.util.Collections.unmodifiableList(messagesList_); + } else { + return messagesListBuilder_.getMessageList(); + } + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public int getMessagesListCount() { + if (messagesListBuilder_ == null) { + return messagesList_.size(); + } else { + return messagesListBuilder_.getCount(); + } + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg getMessagesList(int index) { + if (messagesListBuilder_ == null) { + return messagesList_.get(index); + } else { + return messagesListBuilder_.getMessage(index); + } + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public Builder setMessagesList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg value) { + if (messagesListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesListIsMutable(); + messagesList_.set(index, value); + onChanged(); + } else { + messagesListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public Builder setMessagesList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.Builder builderForValue) { + if (messagesListBuilder_ == null) { + ensureMessagesListIsMutable(); + messagesList_.set(index, builderForValue.build()); + onChanged(); + } else { + messagesListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public Builder addMessagesList(tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg value) { + if (messagesListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesListIsMutable(); + messagesList_.add(value); + onChanged(); + } else { + messagesListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public Builder addMessagesList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg value) { + if (messagesListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesListIsMutable(); + messagesList_.add(index, value); + onChanged(); + } else { + messagesListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public Builder addMessagesList( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.Builder builderForValue) { + if (messagesListBuilder_ == null) { + ensureMessagesListIsMutable(); + messagesList_.add(builderForValue.build()); + onChanged(); + } else { + messagesListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public Builder addMessagesList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.Builder builderForValue) { + if (messagesListBuilder_ == null) { + ensureMessagesListIsMutable(); + messagesList_.add(index, builderForValue.build()); + onChanged(); + } else { + messagesListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public Builder addAllMessagesList( + java.lang.Iterable values) { + if (messagesListBuilder_ == null) { + ensureMessagesListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, messagesList_); + onChanged(); + } else { + messagesListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public Builder clearMessagesList() { + if (messagesListBuilder_ == null) { + messagesList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + messagesListBuilder_.clear(); + } + return this; + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public Builder removeMessagesList(int index) { + if (messagesListBuilder_ == null) { + ensureMessagesListIsMutable(); + messagesList_.remove(index); + onChanged(); + } else { + messagesListBuilder_.remove(index); + } + return this; + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.Builder getMessagesListBuilder( + int index) { + return getMessagesListFieldBuilder().getBuilder(index); + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msgOrBuilder getMessagesListOrBuilder( + int index) { + if (messagesListBuilder_ == null) { + return messagesList_.get(index); } else { + return messagesListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public java.util.List + getMessagesListOrBuilderList() { + if (messagesListBuilder_ != null) { + return messagesListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(messagesList_); + } + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.Builder addMessagesListBuilder() { + return getMessagesListFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.getDefaultInstance()); + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.Builder addMessagesListBuilder( + int index) { + return getMessagesListFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.getDefaultInstance()); + } + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + public java.util.List + getMessagesListBuilderList() { + return getMessagesListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msgOrBuilder> + getMessagesListFieldBuilder() { + if (messagesListBuilder_ == null) { + messagesListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msgOrBuilder>( + messagesList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + messagesList_ = null; + } + return messagesListBuilder_; + } + + private java.lang.Object cursor_ = ""; + /** + * string cursor = 2; + * @return The cursor. + */ + public java.lang.String getCursor() { + java.lang.Object ref = cursor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cursor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string cursor = 2; + * @return The bytes for cursor. + */ + public com.google.protobuf.ByteString + getCursorBytes() { + java.lang.Object ref = cursor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cursor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string cursor = 2; + * @param value The cursor to set. + * @return This builder for chaining. + */ + public Builder setCursor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + cursor_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string cursor = 2; + * @return This builder for chaining. + */ + public Builder clearCursor() { + cursor_ = getDefaultInstance().getCursor(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string cursor = 2; + * @param value The bytes for cursor to set. + * @return This builder for chaining. + */ + public Builder setCursorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + cursor_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long fetchInterval_ ; + /** + * uint64 fetch_interval = 3; + * @return The fetchInterval. + */ + @java.lang.Override + public long getFetchInterval() { + return fetchInterval_; + } + /** + * uint64 fetch_interval = 3; + * @param value The fetchInterval to set. + * @return This builder for chaining. + */ + public Builder setFetchInterval(long value) { + + fetchInterval_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 fetch_interval = 3; + * @return This builder for chaining. + */ + public Builder clearFetchInterval() { + bitField0_ = (bitField0_ & ~0x00000004); + fetchInterval_ = 0L; + onChanged(); + return this; + } + + private long now_ ; + /** + * uint64 now = 4; + * @return The now. + */ + @java.lang.Override + public long getNow() { + return now_; + } + /** + * uint64 now = 4; + * @param value The now to set. + * @return This builder for chaining. + */ + public Builder setNow(long value) { + + now_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint64 now = 4; + * @return This builder for chaining. + */ + public Builder clearNow() { + bitField0_ = (bitField0_ & ~0x00000008); + now_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object internalExt_ = ""; + /** + * string internal_ext = 5; + * @return The internalExt. + */ + public java.lang.String getInternalExt() { + java.lang.Object ref = internalExt_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + internalExt_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string internal_ext = 5; + * @return The bytes for internalExt. + */ + public com.google.protobuf.ByteString + getInternalExtBytes() { + java.lang.Object ref = internalExt_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + internalExt_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string internal_ext = 5; + * @param value The internalExt to set. + * @return This builder for chaining. + */ + public Builder setInternalExt( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + internalExt_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * string internal_ext = 5; + * @return This builder for chaining. + */ + public Builder clearInternalExt() { + internalExt_ = getDefaultInstance().getInternalExt(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * string internal_ext = 5; + * @param value The bytes for internalExt to set. + * @return This builder for chaining. + */ + public Builder setInternalExtBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + internalExt_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private int fetchType_ ; + /** + * uint32 fetch_type = 6; + * @return The fetchType. + */ + @java.lang.Override + public int getFetchType() { + return fetchType_; + } + /** + * uint32 fetch_type = 6; + * @param value The fetchType to set. + * @return This builder for chaining. + */ + public Builder setFetchType(int value) { + + fetchType_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * uint32 fetch_type = 6; + * @return This builder for chaining. + */ + public Builder clearFetchType() { + bitField0_ = (bitField0_ & ~0x00000020); + fetchType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> routeParams_; + private com.google.protobuf.MapField + internalGetRouteParams() { + if (routeParams_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RouteParamsDefaultEntryHolder.defaultEntry); + } + return routeParams_; + } + private com.google.protobuf.MapField + internalGetMutableRouteParams() { + if (routeParams_ == null) { + routeParams_ = com.google.protobuf.MapField.newMapField( + RouteParamsDefaultEntryHolder.defaultEntry); + } + if (!routeParams_.isMutable()) { + routeParams_ = routeParams_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return routeParams_; + } + public int getRouteParamsCount() { + return internalGetRouteParams().getMap().size(); + } + /** + * map<string, string> route_params = 7; + */ + @java.lang.Override + public boolean containsRouteParams( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetRouteParams().getMap().containsKey(key); + } + /** + * Use {@link #getRouteParamsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getRouteParams() { + return getRouteParamsMap(); + } + /** + * map<string, string> route_params = 7; + */ + @java.lang.Override + public java.util.Map getRouteParamsMap() { + return internalGetRouteParams().getMap(); + } + /** + * map<string, string> route_params = 7; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getRouteParamsOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetRouteParams().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> route_params = 7; + */ + @java.lang.Override + public java.lang.String getRouteParamsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetRouteParams().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearRouteParams() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableRouteParams().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> route_params = 7; + */ + public Builder removeRouteParams( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableRouteParams().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableRouteParams() { + bitField0_ |= 0x00000040; + return internalGetMutableRouteParams().getMutableMap(); + } + /** + * map<string, string> route_params = 7; + */ + public Builder putRouteParams( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableRouteParams().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + * map<string, string> route_params = 7; + */ + public Builder putAllRouteParams( + java.util.Map values) { + internalGetMutableRouteParams().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000040; + return this; + } + + private long heartbeatDuration_ ; + /** + * uint64 heartbeat_duration = 8; + * @return The heartbeatDuration. + */ + @java.lang.Override + public long getHeartbeatDuration() { + return heartbeatDuration_; + } + /** + * uint64 heartbeat_duration = 8; + * @param value The heartbeatDuration to set. + * @return This builder for chaining. + */ + public Builder setHeartbeatDuration(long value) { + + heartbeatDuration_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * uint64 heartbeat_duration = 8; + * @return This builder for chaining. + */ + public Builder clearHeartbeatDuration() { + bitField0_ = (bitField0_ & ~0x00000080); + heartbeatDuration_ = 0L; + onChanged(); + return this; + } + + private boolean needAck_ ; + /** + * bool need_ack = 9; + * @return The needAck. + */ + @java.lang.Override + public boolean getNeedAck() { + return needAck_; + } + /** + * bool need_ack = 9; + * @param value The needAck to set. + * @return This builder for chaining. + */ + public Builder setNeedAck(boolean value) { + + needAck_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * bool need_ack = 9; + * @return This builder for chaining. + */ + public Builder clearNeedAck() { + bitField0_ = (bitField0_ & ~0x00000100); + needAck_ = false; + onChanged(); + return this; + } + + private java.lang.Object pushServer_ = ""; + /** + * string push_server = 10; + * @return The pushServer. + */ + public java.lang.String getPushServer() { + java.lang.Object ref = pushServer_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pushServer_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string push_server = 10; + * @return The bytes for pushServer. + */ + public com.google.protobuf.ByteString + getPushServerBytes() { + java.lang.Object ref = pushServer_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pushServer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string push_server = 10; + * @param value The pushServer to set. + * @return This builder for chaining. + */ + public Builder setPushServer( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + pushServer_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * string push_server = 10; + * @return This builder for chaining. + */ + public Builder clearPushServer() { + pushServer_ = getDefaultInstance().getPushServer(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * string push_server = 10; + * @param value The bytes for pushServer to set. + * @return This builder for chaining. + */ + public Builder setPushServerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + pushServer_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object liveCursor_ = ""; + /** + * string live_cursor = 11; + * @return The liveCursor. + */ + public java.lang.String getLiveCursor() { + java.lang.Object ref = liveCursor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + liveCursor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string live_cursor = 11; + * @return The bytes for liveCursor. + */ + public com.google.protobuf.ByteString + getLiveCursorBytes() { + java.lang.Object ref = liveCursor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + liveCursor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string live_cursor = 11; + * @param value The liveCursor to set. + * @return This builder for chaining. + */ + public Builder setLiveCursor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + liveCursor_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * string live_cursor = 11; + * @return This builder for chaining. + */ + public Builder clearLiveCursor() { + liveCursor_ = getDefaultInstance().getLiveCursor(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * string live_cursor = 11; + * @param value The bytes for liveCursor to set. + * @return This builder for chaining. + */ + public Builder setLiveCursorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + liveCursor_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private boolean historyNoMore_ ; + /** + * bool history_no_more = 12; + * @return The historyNoMore. + */ + @java.lang.Override + public boolean getHistoryNoMore() { + return historyNoMore_; + } + /** + * bool history_no_more = 12; + * @param value The historyNoMore to set. + * @return This builder for chaining. + */ + public Builder setHistoryNoMore(boolean value) { + + historyNoMore_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * bool history_no_more = 12; + * @return This builder for chaining. + */ + public Builder clearHistoryNoMore() { + bitField0_ = (bitField0_ & ~0x00000800); + historyNoMore_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg) + } + + // @@protoc_insertion_point(class_scope:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public douyin_websocket_frame_msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame_msgOrBuilder.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame_msgOrBuilder.java new file mode 100644 index 0000000..e90332f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame_msgOrBuilder.java @@ -0,0 +1,175 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_websocket_frame_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +public interface douyin_websocket_frame_msgOrBuilder extends + // @@protoc_insertion_point(interface_extends:tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_websocket_frame_msg) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + java.util.List + getMessagesListList(); + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg getMessagesList(int index); + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + int getMessagesListCount(); + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + java.util.List + getMessagesListOrBuilderList(); + /** + * repeated .tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msg messages_list = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.douyin_cmd_msgOrBuilder getMessagesListOrBuilder( + int index); + + /** + * string cursor = 2; + * @return The cursor. + */ + java.lang.String getCursor(); + /** + * string cursor = 2; + * @return The bytes for cursor. + */ + com.google.protobuf.ByteString + getCursorBytes(); + + /** + * uint64 fetch_interval = 3; + * @return The fetchInterval. + */ + long getFetchInterval(); + + /** + * uint64 now = 4; + * @return The now. + */ + long getNow(); + + /** + * string internal_ext = 5; + * @return The internalExt. + */ + java.lang.String getInternalExt(); + /** + * string internal_ext = 5; + * @return The bytes for internalExt. + */ + com.google.protobuf.ByteString + getInternalExtBytes(); + + /** + * uint32 fetch_type = 6; + * @return The fetchType. + */ + int getFetchType(); + + /** + * map<string, string> route_params = 7; + */ + int getRouteParamsCount(); + /** + * map<string, string> route_params = 7; + */ + boolean containsRouteParams( + java.lang.String key); + /** + * Use {@link #getRouteParamsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getRouteParams(); + /** + * map<string, string> route_params = 7; + */ + java.util.Map + getRouteParamsMap(); + /** + * map<string, string> route_params = 7; + */ + /* nullable */ +java.lang.String getRouteParamsOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + * map<string, string> route_params = 7; + */ + java.lang.String getRouteParamsOrThrow( + java.lang.String key); + + /** + * uint64 heartbeat_duration = 8; + * @return The heartbeatDuration. + */ + long getHeartbeatDuration(); + + /** + * bool need_ack = 9; + * @return The needAck. + */ + boolean getNeedAck(); + + /** + * string push_server = 10; + * @return The pushServer. + */ + java.lang.String getPushServer(); + /** + * string push_server = 10; + * @return The bytes for pushServer. + */ + com.google.protobuf.ByteString + getPushServerBytes(); + + /** + * string live_cursor = 11; + * @return The liveCursor. + */ + java.lang.String getLiveCursor(); + /** + * string live_cursor = 11; + * @return The bytes for liveCursor. + */ + com.google.protobuf.ByteString + getLiveCursorBytes(); + + /** + * bool history_no_more = 12; + * @return The historyNoMore. + */ + boolean getHistoryNoMore(); +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame_msgProto.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame_msgProto.java new file mode 100644 index 0000000..607d3ed --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/douyin_websocket_frame_msgProto.java @@ -0,0 +1,100 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: douyin_websocket_frame_msg.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +public final class douyin_websocket_frame_msgProto { + private douyin_websocket_frame_msgProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_RouteParamsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_RouteParamsEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n douyin_websocket_frame_msg.proto\0222tech" + + ".ordinaryroad.live.chat.client.douyin.pr" + + "otobuf\032\024douyin_cmd_msg.proto\"\362\003\n\032douyin_" + + "websocket_frame_msg\022Y\n\rmessages_list\030\001 \003" + + "(\0132B.tech.ordinaryroad.live.chat.client." + + "douyin.protobuf.douyin_cmd_msg\022\016\n\006cursor" + + "\030\002 \001(\t\022\026\n\016fetch_interval\030\003 \001(\004\022\013\n\003now\030\004 " + + "\001(\004\022\024\n\014internal_ext\030\005 \001(\t\022\022\n\nfetch_type\030" + + "\006 \001(\r\022u\n\014route_params\030\007 \003(\0132_.tech.ordin" + + "aryroad.live.chat.client.douyin.protobuf" + + ".douyin_websocket_frame_msg.RouteParamsE" + + "ntry\022\032\n\022heartbeat_duration\030\010 \001(\004\022\020\n\010need" + + "_ack\030\t \001(\010\022\023\n\013push_server\030\n \001(\t\022\023\n\013live_" + + "cursor\030\013 \001(\t\022\027\n\017history_no_more\030\014 \001(\010\0322\n" + + "\020RouteParamsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" + + "\002 \001(\t:\0028\001B]\n2tech.ordinaryroad.live.chat" + + ".client.douyin.protobufB\037douyin_websocke" + + "t_frame_msgProtoP\001\242\002\003GPBb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_cmd_msgProto.getDescriptor(), + }); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_descriptor, + new java.lang.String[] { "MessagesList", "Cursor", "FetchInterval", "Now", "InternalExt", "FetchType", "RouteParams", "HeartbeatDuration", "NeedAck", "PushServer", "LiveCursor", "HistoryNoMore", }); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_RouteParamsEntry_descriptor = + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_descriptor.getNestedTypes().get(0); + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_RouteParamsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tech_ordinaryroad_live_chat_client_douyin_protobuf_douyin_websocket_frame_msg_RouteParamsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.Douyin_cmd_msgProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/CommonOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/CommonOuterClass.java new file mode 100644 index 0000000..17c17c4 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/CommonOuterClass.java @@ -0,0 +1,2558 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Common.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class CommonOuterClass { + private CommonOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface CommonOrBuilder extends + // @@protoc_insertion_point(interface_extends:Common) + com.google.protobuf.MessageOrBuilder { + + /** + * string method = 1; + * @return The method. + */ + java.lang.String getMethod(); + /** + * string method = 1; + * @return The bytes for method. + */ + com.google.protobuf.ByteString + getMethodBytes(); + + /** + * uint64 msgId = 2; + * @return The msgId. + */ + long getMsgId(); + + /** + * uint64 roomId = 3; + * @return The roomId. + */ + long getRoomId(); + + /** + * uint64 createTime = 4; + * @return The createTime. + */ + long getCreateTime(); + + /** + * uint32 monitor = 5; + * @return The monitor. + */ + int getMonitor(); + + /** + * bool isShowMsg = 6; + * @return The isShowMsg. + */ + boolean getIsShowMsg(); + + /** + * string describe = 7; + * @return The describe. + */ + java.lang.String getDescribe(); + /** + * string describe = 7; + * @return The bytes for describe. + */ + com.google.protobuf.ByteString + getDescribeBytes(); + + /** + *
+     * DisplayText displayText = 8;
+     * 
+ * + * uint64 foldType = 9; + * @return The foldType. + */ + long getFoldType(); + + /** + * uint64 anchorFoldType = 10; + * @return The anchorFoldType. + */ + long getAnchorFoldType(); + + /** + * uint64 priorityScore = 11; + * @return The priorityScore. + */ + long getPriorityScore(); + + /** + * string logId = 12; + * @return The logId. + */ + java.lang.String getLogId(); + /** + * string logId = 12; + * @return The bytes for logId. + */ + com.google.protobuf.ByteString + getLogIdBytes(); + + /** + * string msgProcessFilterK = 13; + * @return The msgProcessFilterK. + */ + java.lang.String getMsgProcessFilterK(); + /** + * string msgProcessFilterK = 13; + * @return The bytes for msgProcessFilterK. + */ + com.google.protobuf.ByteString + getMsgProcessFilterKBytes(); + + /** + * string msgProcessFilterV = 14; + * @return The msgProcessFilterV. + */ + java.lang.String getMsgProcessFilterV(); + /** + * string msgProcessFilterV = 14; + * @return The bytes for msgProcessFilterV. + */ + com.google.protobuf.ByteString + getMsgProcessFilterVBytes(); + + /** + * .User user = 15; + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * .User user = 15; + * @return The user. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser(); + /** + * .User user = 15; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder(); + + /** + *
+     * Room room = 16;
+     * 
+ * + * uint64 anchorFoldTypeV2 = 17; + * @return The anchorFoldTypeV2. + */ + long getAnchorFoldTypeV2(); + + /** + * uint64 processAtSeiTimeMs = 18; + * @return The processAtSeiTimeMs. + */ + long getProcessAtSeiTimeMs(); + + /** + * uint64 randomDispatchMs = 19; + * @return The randomDispatchMs. + */ + long getRandomDispatchMs(); + + /** + * bool isDispatch = 20; + * @return The isDispatch. + */ + boolean getIsDispatch(); + + /** + * uint32 channelId = 21; + * @return The channelId. + */ + int getChannelId(); + + /** + * uint64 diffSei2absSecond = 22; + * @return The diffSei2absSecond. + */ + long getDiffSei2AbsSecond(); + + /** + * uint64 anchorFoldDuration = 23; + * @return The anchorFoldDuration. + */ + long getAnchorFoldDuration(); + } + /** + * Protobuf type {@code Common} + */ + public static final class Common extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Common) + CommonOrBuilder { + private static final long serialVersionUID = 0L; + // Use Common.newBuilder() to construct. + private Common(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Common() { + method_ = ""; + describe_ = ""; + logId_ = ""; + msgProcessFilterK_ = ""; + msgProcessFilterV_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Common(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.internal_static_Common_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.internal_static_Common_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder.class); + } + + public static final int METHOD_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object method_ = ""; + /** + * string method = 1; + * @return The method. + */ + @java.lang.Override + public java.lang.String getMethod() { + java.lang.Object ref = method_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + method_ = s; + return s; + } + } + /** + * string method = 1; + * @return The bytes for method. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MSGID_FIELD_NUMBER = 2; + private long msgId_ = 0L; + /** + * uint64 msgId = 2; + * @return The msgId. + */ + @java.lang.Override + public long getMsgId() { + return msgId_; + } + + public static final int ROOMID_FIELD_NUMBER = 3; + private long roomId_ = 0L; + /** + * uint64 roomId = 3; + * @return The roomId. + */ + @java.lang.Override + public long getRoomId() { + return roomId_; + } + + public static final int CREATETIME_FIELD_NUMBER = 4; + private long createTime_ = 0L; + /** + * uint64 createTime = 4; + * @return The createTime. + */ + @java.lang.Override + public long getCreateTime() { + return createTime_; + } + + public static final int MONITOR_FIELD_NUMBER = 5; + private int monitor_ = 0; + /** + * uint32 monitor = 5; + * @return The monitor. + */ + @java.lang.Override + public int getMonitor() { + return monitor_; + } + + public static final int ISSHOWMSG_FIELD_NUMBER = 6; + private boolean isShowMsg_ = false; + /** + * bool isShowMsg = 6; + * @return The isShowMsg. + */ + @java.lang.Override + public boolean getIsShowMsg() { + return isShowMsg_; + } + + public static final int DESCRIBE_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object describe_ = ""; + /** + * string describe = 7; + * @return The describe. + */ + @java.lang.Override + public java.lang.String getDescribe() { + java.lang.Object ref = describe_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + describe_ = s; + return s; + } + } + /** + * string describe = 7; + * @return The bytes for describe. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescribeBytes() { + java.lang.Object ref = describe_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + describe_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FOLDTYPE_FIELD_NUMBER = 9; + private long foldType_ = 0L; + /** + *
+     * DisplayText displayText = 8;
+     * 
+ * + * uint64 foldType = 9; + * @return The foldType. + */ + @java.lang.Override + public long getFoldType() { + return foldType_; + } + + public static final int ANCHORFOLDTYPE_FIELD_NUMBER = 10; + private long anchorFoldType_ = 0L; + /** + * uint64 anchorFoldType = 10; + * @return The anchorFoldType. + */ + @java.lang.Override + public long getAnchorFoldType() { + return anchorFoldType_; + } + + public static final int PRIORITYSCORE_FIELD_NUMBER = 11; + private long priorityScore_ = 0L; + /** + * uint64 priorityScore = 11; + * @return The priorityScore. + */ + @java.lang.Override + public long getPriorityScore() { + return priorityScore_; + } + + public static final int LOGID_FIELD_NUMBER = 12; + @SuppressWarnings("serial") + private volatile java.lang.Object logId_ = ""; + /** + * string logId = 12; + * @return The logId. + */ + @java.lang.Override + public java.lang.String getLogId() { + java.lang.Object ref = logId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logId_ = s; + return s; + } + } + /** + * string logId = 12; + * @return The bytes for logId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLogIdBytes() { + java.lang.Object ref = logId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + logId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MSGPROCESSFILTERK_FIELD_NUMBER = 13; + @SuppressWarnings("serial") + private volatile java.lang.Object msgProcessFilterK_ = ""; + /** + * string msgProcessFilterK = 13; + * @return The msgProcessFilterK. + */ + @java.lang.Override + public java.lang.String getMsgProcessFilterK() { + java.lang.Object ref = msgProcessFilterK_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + msgProcessFilterK_ = s; + return s; + } + } + /** + * string msgProcessFilterK = 13; + * @return The bytes for msgProcessFilterK. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMsgProcessFilterKBytes() { + java.lang.Object ref = msgProcessFilterK_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msgProcessFilterK_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MSGPROCESSFILTERV_FIELD_NUMBER = 14; + @SuppressWarnings("serial") + private volatile java.lang.Object msgProcessFilterV_ = ""; + /** + * string msgProcessFilterV = 14; + * @return The msgProcessFilterV. + */ + @java.lang.Override + public java.lang.String getMsgProcessFilterV() { + java.lang.Object ref = msgProcessFilterV_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + msgProcessFilterV_ = s; + return s; + } + } + /** + * string msgProcessFilterV = 14; + * @return The bytes for msgProcessFilterV. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMsgProcessFilterVBytes() { + java.lang.Object ref = msgProcessFilterV_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msgProcessFilterV_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_FIELD_NUMBER = 15; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User user_; + /** + * .User user = 15; + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * .User user = 15; + * @return The user. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser() { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + /** + * .User user = 15; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder() { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + + public static final int ANCHORFOLDTYPEV2_FIELD_NUMBER = 17; + private long anchorFoldTypeV2_ = 0L; + /** + *
+     * Room room = 16;
+     * 
+ * + * uint64 anchorFoldTypeV2 = 17; + * @return The anchorFoldTypeV2. + */ + @java.lang.Override + public long getAnchorFoldTypeV2() { + return anchorFoldTypeV2_; + } + + public static final int PROCESSATSEITIMEMS_FIELD_NUMBER = 18; + private long processAtSeiTimeMs_ = 0L; + /** + * uint64 processAtSeiTimeMs = 18; + * @return The processAtSeiTimeMs. + */ + @java.lang.Override + public long getProcessAtSeiTimeMs() { + return processAtSeiTimeMs_; + } + + public static final int RANDOMDISPATCHMS_FIELD_NUMBER = 19; + private long randomDispatchMs_ = 0L; + /** + * uint64 randomDispatchMs = 19; + * @return The randomDispatchMs. + */ + @java.lang.Override + public long getRandomDispatchMs() { + return randomDispatchMs_; + } + + public static final int ISDISPATCH_FIELD_NUMBER = 20; + private boolean isDispatch_ = false; + /** + * bool isDispatch = 20; + * @return The isDispatch. + */ + @java.lang.Override + public boolean getIsDispatch() { + return isDispatch_; + } + + public static final int CHANNELID_FIELD_NUMBER = 21; + private int channelId_ = 0; + /** + * uint32 channelId = 21; + * @return The channelId. + */ + @java.lang.Override + public int getChannelId() { + return channelId_; + } + + public static final int DIFFSEI2ABSSECOND_FIELD_NUMBER = 22; + private long diffSei2AbsSecond_ = 0L; + /** + * uint64 diffSei2absSecond = 22; + * @return The diffSei2absSecond. + */ + @java.lang.Override + public long getDiffSei2AbsSecond() { + return diffSei2AbsSecond_; + } + + public static final int ANCHORFOLDDURATION_FIELD_NUMBER = 23; + private long anchorFoldDuration_ = 0L; + /** + * uint64 anchorFoldDuration = 23; + * @return The anchorFoldDuration. + */ + @java.lang.Override + public long getAnchorFoldDuration() { + return anchorFoldDuration_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(method_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, method_); + } + if (msgId_ != 0L) { + output.writeUInt64(2, msgId_); + } + if (roomId_ != 0L) { + output.writeUInt64(3, roomId_); + } + if (createTime_ != 0L) { + output.writeUInt64(4, createTime_); + } + if (monitor_ != 0) { + output.writeUInt32(5, monitor_); + } + if (isShowMsg_ != false) { + output.writeBool(6, isShowMsg_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(describe_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, describe_); + } + if (foldType_ != 0L) { + output.writeUInt64(9, foldType_); + } + if (anchorFoldType_ != 0L) { + output.writeUInt64(10, anchorFoldType_); + } + if (priorityScore_ != 0L) { + output.writeUInt64(11, priorityScore_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, logId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msgProcessFilterK_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, msgProcessFilterK_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msgProcessFilterV_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, msgProcessFilterV_); + } + if (user_ != null) { + output.writeMessage(15, getUser()); + } + if (anchorFoldTypeV2_ != 0L) { + output.writeUInt64(17, anchorFoldTypeV2_); + } + if (processAtSeiTimeMs_ != 0L) { + output.writeUInt64(18, processAtSeiTimeMs_); + } + if (randomDispatchMs_ != 0L) { + output.writeUInt64(19, randomDispatchMs_); + } + if (isDispatch_ != false) { + output.writeBool(20, isDispatch_); + } + if (channelId_ != 0) { + output.writeUInt32(21, channelId_); + } + if (diffSei2AbsSecond_ != 0L) { + output.writeUInt64(22, diffSei2AbsSecond_); + } + if (anchorFoldDuration_ != 0L) { + output.writeUInt64(23, anchorFoldDuration_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(method_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, method_); + } + if (msgId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, msgId_); + } + if (roomId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, roomId_); + } + if (createTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, createTime_); + } + if (monitor_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, monitor_); + } + if (isShowMsg_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(6, isShowMsg_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(describe_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, describe_); + } + if (foldType_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(9, foldType_); + } + if (anchorFoldType_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(10, anchorFoldType_); + } + if (priorityScore_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(11, priorityScore_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, logId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msgProcessFilterK_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, msgProcessFilterK_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msgProcessFilterV_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, msgProcessFilterV_); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, getUser()); + } + if (anchorFoldTypeV2_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(17, anchorFoldTypeV2_); + } + if (processAtSeiTimeMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(18, processAtSeiTimeMs_); + } + if (randomDispatchMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(19, randomDispatchMs_); + } + if (isDispatch_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(20, isDispatch_); + } + if (channelId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(21, channelId_); + } + if (diffSei2AbsSecond_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(22, diffSei2AbsSecond_); + } + if (anchorFoldDuration_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(23, anchorFoldDuration_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common) obj; + + if (!getMethod() + .equals(other.getMethod())) return false; + if (getMsgId() + != other.getMsgId()) return false; + if (getRoomId() + != other.getRoomId()) return false; + if (getCreateTime() + != other.getCreateTime()) return false; + if (getMonitor() + != other.getMonitor()) return false; + if (getIsShowMsg() + != other.getIsShowMsg()) return false; + if (!getDescribe() + .equals(other.getDescribe())) return false; + if (getFoldType() + != other.getFoldType()) return false; + if (getAnchorFoldType() + != other.getAnchorFoldType()) return false; + if (getPriorityScore() + != other.getPriorityScore()) return false; + if (!getLogId() + .equals(other.getLogId())) return false; + if (!getMsgProcessFilterK() + .equals(other.getMsgProcessFilterK())) return false; + if (!getMsgProcessFilterV() + .equals(other.getMsgProcessFilterV())) return false; + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser() + .equals(other.getUser())) return false; + } + if (getAnchorFoldTypeV2() + != other.getAnchorFoldTypeV2()) return false; + if (getProcessAtSeiTimeMs() + != other.getProcessAtSeiTimeMs()) return false; + if (getRandomDispatchMs() + != other.getRandomDispatchMs()) return false; + if (getIsDispatch() + != other.getIsDispatch()) return false; + if (getChannelId() + != other.getChannelId()) return false; + if (getDiffSei2AbsSecond() + != other.getDiffSei2AbsSecond()) return false; + if (getAnchorFoldDuration() + != other.getAnchorFoldDuration()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + METHOD_FIELD_NUMBER; + hash = (53 * hash) + getMethod().hashCode(); + hash = (37 * hash) + MSGID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMsgId()); + hash = (37 * hash) + ROOMID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRoomId()); + hash = (37 * hash) + CREATETIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCreateTime()); + hash = (37 * hash) + MONITOR_FIELD_NUMBER; + hash = (53 * hash) + getMonitor(); + hash = (37 * hash) + ISSHOWMSG_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsShowMsg()); + hash = (37 * hash) + DESCRIBE_FIELD_NUMBER; + hash = (53 * hash) + getDescribe().hashCode(); + hash = (37 * hash) + FOLDTYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFoldType()); + hash = (37 * hash) + ANCHORFOLDTYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAnchorFoldType()); + hash = (37 * hash) + PRIORITYSCORE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPriorityScore()); + hash = (37 * hash) + LOGID_FIELD_NUMBER; + hash = (53 * hash) + getLogId().hashCode(); + hash = (37 * hash) + MSGPROCESSFILTERK_FIELD_NUMBER; + hash = (53 * hash) + getMsgProcessFilterK().hashCode(); + hash = (37 * hash) + MSGPROCESSFILTERV_FIELD_NUMBER; + hash = (53 * hash) + getMsgProcessFilterV().hashCode(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + ANCHORFOLDTYPEV2_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAnchorFoldTypeV2()); + hash = (37 * hash) + PROCESSATSEITIMEMS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getProcessAtSeiTimeMs()); + hash = (37 * hash) + RANDOMDISPATCHMS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRandomDispatchMs()); + hash = (37 * hash) + ISDISPATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsDispatch()); + hash = (37 * hash) + CHANNELID_FIELD_NUMBER; + hash = (53 * hash) + getChannelId(); + hash = (37 * hash) + DIFFSEI2ABSSECOND_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDiffSei2AbsSecond()); + hash = (37 * hash) + ANCHORFOLDDURATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAnchorFoldDuration()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Common} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Common) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.CommonOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.internal_static_Common_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.internal_static_Common_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + method_ = ""; + msgId_ = 0L; + roomId_ = 0L; + createTime_ = 0L; + monitor_ = 0; + isShowMsg_ = false; + describe_ = ""; + foldType_ = 0L; + anchorFoldType_ = 0L; + priorityScore_ = 0L; + logId_ = ""; + msgProcessFilterK_ = ""; + msgProcessFilterV_ = ""; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + anchorFoldTypeV2_ = 0L; + processAtSeiTimeMs_ = 0L; + randomDispatchMs_ = 0L; + isDispatch_ = false; + channelId_ = 0; + diffSei2AbsSecond_ = 0L; + anchorFoldDuration_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.internal_static_Common_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.method_ = method_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.msgId_ = msgId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.roomId_ = roomId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTime_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.monitor_ = monitor_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.isShowMsg_ = isShowMsg_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.describe_ = describe_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.foldType_ = foldType_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.anchorFoldType_ = anchorFoldType_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.priorityScore_ = priorityScore_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.logId_ = logId_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.msgProcessFilterK_ = msgProcessFilterK_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.msgProcessFilterV_ = msgProcessFilterV_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.user_ = userBuilder_ == null + ? user_ + : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.anchorFoldTypeV2_ = anchorFoldTypeV2_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.processAtSeiTimeMs_ = processAtSeiTimeMs_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.randomDispatchMs_ = randomDispatchMs_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.isDispatch_ = isDispatch_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.channelId_ = channelId_; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.diffSei2AbsSecond_ = diffSei2AbsSecond_; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.anchorFoldDuration_ = anchorFoldDuration_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common.getDefaultInstance()) return this; + if (!other.getMethod().isEmpty()) { + method_ = other.method_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getMsgId() != 0L) { + setMsgId(other.getMsgId()); + } + if (other.getRoomId() != 0L) { + setRoomId(other.getRoomId()); + } + if (other.getCreateTime() != 0L) { + setCreateTime(other.getCreateTime()); + } + if (other.getMonitor() != 0) { + setMonitor(other.getMonitor()); + } + if (other.getIsShowMsg() != false) { + setIsShowMsg(other.getIsShowMsg()); + } + if (!other.getDescribe().isEmpty()) { + describe_ = other.describe_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.getFoldType() != 0L) { + setFoldType(other.getFoldType()); + } + if (other.getAnchorFoldType() != 0L) { + setAnchorFoldType(other.getAnchorFoldType()); + } + if (other.getPriorityScore() != 0L) { + setPriorityScore(other.getPriorityScore()); + } + if (!other.getLogId().isEmpty()) { + logId_ = other.logId_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (!other.getMsgProcessFilterK().isEmpty()) { + msgProcessFilterK_ = other.msgProcessFilterK_; + bitField0_ |= 0x00000800; + onChanged(); + } + if (!other.getMsgProcessFilterV().isEmpty()) { + msgProcessFilterV_ = other.msgProcessFilterV_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (other.getAnchorFoldTypeV2() != 0L) { + setAnchorFoldTypeV2(other.getAnchorFoldTypeV2()); + } + if (other.getProcessAtSeiTimeMs() != 0L) { + setProcessAtSeiTimeMs(other.getProcessAtSeiTimeMs()); + } + if (other.getRandomDispatchMs() != 0L) { + setRandomDispatchMs(other.getRandomDispatchMs()); + } + if (other.getIsDispatch() != false) { + setIsDispatch(other.getIsDispatch()); + } + if (other.getChannelId() != 0) { + setChannelId(other.getChannelId()); + } + if (other.getDiffSei2AbsSecond() != 0L) { + setDiffSei2AbsSecond(other.getDiffSei2AbsSecond()); + } + if (other.getAnchorFoldDuration() != 0L) { + setAnchorFoldDuration(other.getAnchorFoldDuration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + method_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + msgId_ = input.readUInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + roomId_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + createTime_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + monitor_ = input.readUInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + isShowMsg_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: { + describe_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 72: { + foldType_ = input.readUInt64(); + bitField0_ |= 0x00000080; + break; + } // case 72 + case 80: { + anchorFoldType_ = input.readUInt64(); + bitField0_ |= 0x00000100; + break; + } // case 80 + case 88: { + priorityScore_ = input.readUInt64(); + bitField0_ |= 0x00000200; + break; + } // case 88 + case 98: { + logId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 98 + case 106: { + msgProcessFilterK_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 106 + case 114: { + msgProcessFilterV_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 114 + case 122: { + input.readMessage( + getUserFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 122 + case 136: { + anchorFoldTypeV2_ = input.readUInt64(); + bitField0_ |= 0x00004000; + break; + } // case 136 + case 144: { + processAtSeiTimeMs_ = input.readUInt64(); + bitField0_ |= 0x00008000; + break; + } // case 144 + case 152: { + randomDispatchMs_ = input.readUInt64(); + bitField0_ |= 0x00010000; + break; + } // case 152 + case 160: { + isDispatch_ = input.readBool(); + bitField0_ |= 0x00020000; + break; + } // case 160 + case 168: { + channelId_ = input.readUInt32(); + bitField0_ |= 0x00040000; + break; + } // case 168 + case 176: { + diffSei2AbsSecond_ = input.readUInt64(); + bitField0_ |= 0x00080000; + break; + } // case 176 + case 184: { + anchorFoldDuration_ = input.readUInt64(); + bitField0_ |= 0x00100000; + break; + } // case 184 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object method_ = ""; + /** + * string method = 1; + * @return The method. + */ + public java.lang.String getMethod() { + java.lang.Object ref = method_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + method_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string method = 1; + * @return The bytes for method. + */ + public com.google.protobuf.ByteString + getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string method = 1; + * @param value The method to set. + * @return This builder for chaining. + */ + public Builder setMethod( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + method_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string method = 1; + * @return This builder for chaining. + */ + public Builder clearMethod() { + method_ = getDefaultInstance().getMethod(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string method = 1; + * @param value The bytes for method to set. + * @return This builder for chaining. + */ + public Builder setMethodBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + method_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long msgId_ ; + /** + * uint64 msgId = 2; + * @return The msgId. + */ + @java.lang.Override + public long getMsgId() { + return msgId_; + } + /** + * uint64 msgId = 2; + * @param value The msgId to set. + * @return This builder for chaining. + */ + public Builder setMsgId(long value) { + + msgId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint64 msgId = 2; + * @return This builder for chaining. + */ + public Builder clearMsgId() { + bitField0_ = (bitField0_ & ~0x00000002); + msgId_ = 0L; + onChanged(); + return this; + } + + private long roomId_ ; + /** + * uint64 roomId = 3; + * @return The roomId. + */ + @java.lang.Override + public long getRoomId() { + return roomId_; + } + /** + * uint64 roomId = 3; + * @param value The roomId to set. + * @return This builder for chaining. + */ + public Builder setRoomId(long value) { + + roomId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 roomId = 3; + * @return This builder for chaining. + */ + public Builder clearRoomId() { + bitField0_ = (bitField0_ & ~0x00000004); + roomId_ = 0L; + onChanged(); + return this; + } + + private long createTime_ ; + /** + * uint64 createTime = 4; + * @return The createTime. + */ + @java.lang.Override + public long getCreateTime() { + return createTime_; + } + /** + * uint64 createTime = 4; + * @param value The createTime to set. + * @return This builder for chaining. + */ + public Builder setCreateTime(long value) { + + createTime_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint64 createTime = 4; + * @return This builder for chaining. + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = 0L; + onChanged(); + return this; + } + + private int monitor_ ; + /** + * uint32 monitor = 5; + * @return The monitor. + */ + @java.lang.Override + public int getMonitor() { + return monitor_; + } + /** + * uint32 monitor = 5; + * @param value The monitor to set. + * @return This builder for chaining. + */ + public Builder setMonitor(int value) { + + monitor_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * uint32 monitor = 5; + * @return This builder for chaining. + */ + public Builder clearMonitor() { + bitField0_ = (bitField0_ & ~0x00000010); + monitor_ = 0; + onChanged(); + return this; + } + + private boolean isShowMsg_ ; + /** + * bool isShowMsg = 6; + * @return The isShowMsg. + */ + @java.lang.Override + public boolean getIsShowMsg() { + return isShowMsg_; + } + /** + * bool isShowMsg = 6; + * @param value The isShowMsg to set. + * @return This builder for chaining. + */ + public Builder setIsShowMsg(boolean value) { + + isShowMsg_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * bool isShowMsg = 6; + * @return This builder for chaining. + */ + public Builder clearIsShowMsg() { + bitField0_ = (bitField0_ & ~0x00000020); + isShowMsg_ = false; + onChanged(); + return this; + } + + private java.lang.Object describe_ = ""; + /** + * string describe = 7; + * @return The describe. + */ + public java.lang.String getDescribe() { + java.lang.Object ref = describe_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + describe_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string describe = 7; + * @return The bytes for describe. + */ + public com.google.protobuf.ByteString + getDescribeBytes() { + java.lang.Object ref = describe_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + describe_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string describe = 7; + * @param value The describe to set. + * @return This builder for chaining. + */ + public Builder setDescribe( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + describe_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * string describe = 7; + * @return This builder for chaining. + */ + public Builder clearDescribe() { + describe_ = getDefaultInstance().getDescribe(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * string describe = 7; + * @param value The bytes for describe to set. + * @return This builder for chaining. + */ + public Builder setDescribeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + describe_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private long foldType_ ; + /** + *
+       * DisplayText displayText = 8;
+       * 
+ * + * uint64 foldType = 9; + * @return The foldType. + */ + @java.lang.Override + public long getFoldType() { + return foldType_; + } + /** + *
+       * DisplayText displayText = 8;
+       * 
+ * + * uint64 foldType = 9; + * @param value The foldType to set. + * @return This builder for chaining. + */ + public Builder setFoldType(long value) { + + foldType_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+       * DisplayText displayText = 8;
+       * 
+ * + * uint64 foldType = 9; + * @return This builder for chaining. + */ + public Builder clearFoldType() { + bitField0_ = (bitField0_ & ~0x00000080); + foldType_ = 0L; + onChanged(); + return this; + } + + private long anchorFoldType_ ; + /** + * uint64 anchorFoldType = 10; + * @return The anchorFoldType. + */ + @java.lang.Override + public long getAnchorFoldType() { + return anchorFoldType_; + } + /** + * uint64 anchorFoldType = 10; + * @param value The anchorFoldType to set. + * @return This builder for chaining. + */ + public Builder setAnchorFoldType(long value) { + + anchorFoldType_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * uint64 anchorFoldType = 10; + * @return This builder for chaining. + */ + public Builder clearAnchorFoldType() { + bitField0_ = (bitField0_ & ~0x00000100); + anchorFoldType_ = 0L; + onChanged(); + return this; + } + + private long priorityScore_ ; + /** + * uint64 priorityScore = 11; + * @return The priorityScore. + */ + @java.lang.Override + public long getPriorityScore() { + return priorityScore_; + } + /** + * uint64 priorityScore = 11; + * @param value The priorityScore to set. + * @return This builder for chaining. + */ + public Builder setPriorityScore(long value) { + + priorityScore_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * uint64 priorityScore = 11; + * @return This builder for chaining. + */ + public Builder clearPriorityScore() { + bitField0_ = (bitField0_ & ~0x00000200); + priorityScore_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object logId_ = ""; + /** + * string logId = 12; + * @return The logId. + */ + public java.lang.String getLogId() { + java.lang.Object ref = logId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string logId = 12; + * @return The bytes for logId. + */ + public com.google.protobuf.ByteString + getLogIdBytes() { + java.lang.Object ref = logId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + logId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string logId = 12; + * @param value The logId to set. + * @return This builder for chaining. + */ + public Builder setLogId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + logId_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * string logId = 12; + * @return This builder for chaining. + */ + public Builder clearLogId() { + logId_ = getDefaultInstance().getLogId(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * string logId = 12; + * @param value The bytes for logId to set. + * @return This builder for chaining. + */ + public Builder setLogIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + logId_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object msgProcessFilterK_ = ""; + /** + * string msgProcessFilterK = 13; + * @return The msgProcessFilterK. + */ + public java.lang.String getMsgProcessFilterK() { + java.lang.Object ref = msgProcessFilterK_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + msgProcessFilterK_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string msgProcessFilterK = 13; + * @return The bytes for msgProcessFilterK. + */ + public com.google.protobuf.ByteString + getMsgProcessFilterKBytes() { + java.lang.Object ref = msgProcessFilterK_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msgProcessFilterK_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string msgProcessFilterK = 13; + * @param value The msgProcessFilterK to set. + * @return This builder for chaining. + */ + public Builder setMsgProcessFilterK( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + msgProcessFilterK_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * string msgProcessFilterK = 13; + * @return This builder for chaining. + */ + public Builder clearMsgProcessFilterK() { + msgProcessFilterK_ = getDefaultInstance().getMsgProcessFilterK(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * string msgProcessFilterK = 13; + * @param value The bytes for msgProcessFilterK to set. + * @return This builder for chaining. + */ + public Builder setMsgProcessFilterKBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + msgProcessFilterK_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private java.lang.Object msgProcessFilterV_ = ""; + /** + * string msgProcessFilterV = 14; + * @return The msgProcessFilterV. + */ + public java.lang.String getMsgProcessFilterV() { + java.lang.Object ref = msgProcessFilterV_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + msgProcessFilterV_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string msgProcessFilterV = 14; + * @return The bytes for msgProcessFilterV. + */ + public com.google.protobuf.ByteString + getMsgProcessFilterVBytes() { + java.lang.Object ref = msgProcessFilterV_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msgProcessFilterV_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string msgProcessFilterV = 14; + * @param value The msgProcessFilterV to set. + * @return This builder for chaining. + */ + public Builder setMsgProcessFilterV( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + msgProcessFilterV_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * string msgProcessFilterV = 14; + * @return This builder for chaining. + */ + public Builder clearMsgProcessFilterV() { + msgProcessFilterV_ = getDefaultInstance().getMsgProcessFilterV(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + /** + * string msgProcessFilterV = 14; + * @param value The bytes for msgProcessFilterV to set. + * @return This builder for chaining. + */ + public Builder setMsgProcessFilterVBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + msgProcessFilterV_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> userBuilder_; + /** + * .User user = 15; + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * .User user = 15; + * @return The user. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * .User user = 15; + */ + public Builder setUser(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * .User user = 15; + */ + public Builder setUser( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * .User user = 15; + */ + public Builder mergeUser(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) && + user_ != null && + user_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * .User user = 15; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00002000); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User user = 15; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder getUserBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * .User user = 15; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + } + /** + * .User user = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + + private long anchorFoldTypeV2_ ; + /** + *
+       * Room room = 16;
+       * 
+ * + * uint64 anchorFoldTypeV2 = 17; + * @return The anchorFoldTypeV2. + */ + @java.lang.Override + public long getAnchorFoldTypeV2() { + return anchorFoldTypeV2_; + } + /** + *
+       * Room room = 16;
+       * 
+ * + * uint64 anchorFoldTypeV2 = 17; + * @param value The anchorFoldTypeV2 to set. + * @return This builder for chaining. + */ + public Builder setAnchorFoldTypeV2(long value) { + + anchorFoldTypeV2_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
+       * Room room = 16;
+       * 
+ * + * uint64 anchorFoldTypeV2 = 17; + * @return This builder for chaining. + */ + public Builder clearAnchorFoldTypeV2() { + bitField0_ = (bitField0_ & ~0x00004000); + anchorFoldTypeV2_ = 0L; + onChanged(); + return this; + } + + private long processAtSeiTimeMs_ ; + /** + * uint64 processAtSeiTimeMs = 18; + * @return The processAtSeiTimeMs. + */ + @java.lang.Override + public long getProcessAtSeiTimeMs() { + return processAtSeiTimeMs_; + } + /** + * uint64 processAtSeiTimeMs = 18; + * @param value The processAtSeiTimeMs to set. + * @return This builder for chaining. + */ + public Builder setProcessAtSeiTimeMs(long value) { + + processAtSeiTimeMs_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * uint64 processAtSeiTimeMs = 18; + * @return This builder for chaining. + */ + public Builder clearProcessAtSeiTimeMs() { + bitField0_ = (bitField0_ & ~0x00008000); + processAtSeiTimeMs_ = 0L; + onChanged(); + return this; + } + + private long randomDispatchMs_ ; + /** + * uint64 randomDispatchMs = 19; + * @return The randomDispatchMs. + */ + @java.lang.Override + public long getRandomDispatchMs() { + return randomDispatchMs_; + } + /** + * uint64 randomDispatchMs = 19; + * @param value The randomDispatchMs to set. + * @return This builder for chaining. + */ + public Builder setRandomDispatchMs(long value) { + + randomDispatchMs_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * uint64 randomDispatchMs = 19; + * @return This builder for chaining. + */ + public Builder clearRandomDispatchMs() { + bitField0_ = (bitField0_ & ~0x00010000); + randomDispatchMs_ = 0L; + onChanged(); + return this; + } + + private boolean isDispatch_ ; + /** + * bool isDispatch = 20; + * @return The isDispatch. + */ + @java.lang.Override + public boolean getIsDispatch() { + return isDispatch_; + } + /** + * bool isDispatch = 20; + * @param value The isDispatch to set. + * @return This builder for chaining. + */ + public Builder setIsDispatch(boolean value) { + + isDispatch_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * bool isDispatch = 20; + * @return This builder for chaining. + */ + public Builder clearIsDispatch() { + bitField0_ = (bitField0_ & ~0x00020000); + isDispatch_ = false; + onChanged(); + return this; + } + + private int channelId_ ; + /** + * uint32 channelId = 21; + * @return The channelId. + */ + @java.lang.Override + public int getChannelId() { + return channelId_; + } + /** + * uint32 channelId = 21; + * @param value The channelId to set. + * @return This builder for chaining. + */ + public Builder setChannelId(int value) { + + channelId_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * uint32 channelId = 21; + * @return This builder for chaining. + */ + public Builder clearChannelId() { + bitField0_ = (bitField0_ & ~0x00040000); + channelId_ = 0; + onChanged(); + return this; + } + + private long diffSei2AbsSecond_ ; + /** + * uint64 diffSei2absSecond = 22; + * @return The diffSei2absSecond. + */ + @java.lang.Override + public long getDiffSei2AbsSecond() { + return diffSei2AbsSecond_; + } + /** + * uint64 diffSei2absSecond = 22; + * @param value The diffSei2absSecond to set. + * @return This builder for chaining. + */ + public Builder setDiffSei2AbsSecond(long value) { + + diffSei2AbsSecond_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * uint64 diffSei2absSecond = 22; + * @return This builder for chaining. + */ + public Builder clearDiffSei2AbsSecond() { + bitField0_ = (bitField0_ & ~0x00080000); + diffSei2AbsSecond_ = 0L; + onChanged(); + return this; + } + + private long anchorFoldDuration_ ; + /** + * uint64 anchorFoldDuration = 23; + * @return The anchorFoldDuration. + */ + @java.lang.Override + public long getAnchorFoldDuration() { + return anchorFoldDuration_; + } + /** + * uint64 anchorFoldDuration = 23; + * @param value The anchorFoldDuration to set. + * @return This builder for chaining. + */ + public Builder setAnchorFoldDuration(long value) { + + anchorFoldDuration_ = value; + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * uint64 anchorFoldDuration = 23; + * @return This builder for chaining. + */ + public Builder clearAnchorFoldDuration() { + bitField0_ = (bitField0_ & ~0x00100000); + anchorFoldDuration_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Common) + } + + // @@protoc_insertion_point(class_scope:Common) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Common parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.CommonOuterClass.Common getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Common_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Common_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\014Common.proto\032\nUser.proto\"\312\003\n\006Common\022\016\n" + + "\006method\030\001 \001(\t\022\r\n\005msgId\030\002 \001(\004\022\016\n\006roomId\030\003" + + " \001(\004\022\022\n\ncreateTime\030\004 \001(\004\022\017\n\007monitor\030\005 \001(" + + "\r\022\021\n\tisShowMsg\030\006 \001(\010\022\020\n\010describe\030\007 \001(\t\022\020" + + "\n\010foldType\030\t \001(\004\022\026\n\016anchorFoldType\030\n \001(\004" + + "\022\025\n\rpriorityScore\030\013 \001(\004\022\r\n\005logId\030\014 \001(\t\022\031" + + "\n\021msgProcessFilterK\030\r \001(\t\022\031\n\021msgProcessF" + + "ilterV\030\016 \001(\t\022\023\n\004user\030\017 \001(\0132\005.User\022\030\n\020anc" + + "horFoldTypeV2\030\021 \001(\004\022\032\n\022processAtSeiTimeM" + + "s\030\022 \001(\004\022\030\n\020randomDispatchMs\030\023 \001(\004\022\022\n\nisD" + + "ispatch\030\024 \001(\010\022\021\n\tchannelId\030\025 \001(\r\022\031\n\021diff" + + "Sei2absSecond\030\026 \001(\004\022\032\n\022anchorFoldDuratio" + + "n\030\027 \001(\004B8\n6tech.ordinaryroad.live.chat.c" + + "lient.douyin.protobuf.dtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.getDescriptor(), + }); + internal_static_Common_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Common_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Common_descriptor, + new java.lang.String[] { "Method", "MsgId", "RoomId", "CreateTime", "Monitor", "IsShowMsg", "Describe", "FoldType", "AnchorFoldType", "PriorityScore", "LogId", "MsgProcessFilterK", "MsgProcessFilterV", "User", "AnchorFoldTypeV2", "ProcessAtSeiTimeMs", "RandomDispatchMs", "IsDispatch", "ChannelId", "DiffSei2AbsSecond", "AnchorFoldDuration", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/DoubleLikeDetailOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/DoubleLikeDetailOuterClass.java new file mode 100644 index 0000000..20a7381 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/DoubleLikeDetailOuterClass.java @@ -0,0 +1,767 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: DoubleLikeDetail.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class DoubleLikeDetailOuterClass { + private DoubleLikeDetailOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface DoubleLikeDetailOrBuilder extends + // @@protoc_insertion_point(interface_extends:DoubleLikeDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * bool doubleFlag = 1; + * @return The doubleFlag. + */ + boolean getDoubleFlag(); + + /** + * uint32 seqId = 2; + * @return The seqId. + */ + int getSeqId(); + + /** + * uint32 renewalsNum = 3; + * @return The renewalsNum. + */ + int getRenewalsNum(); + + /** + * uint32 triggersNum = 4; + * @return The triggersNum. + */ + int getTriggersNum(); + } + /** + * Protobuf type {@code DoubleLikeDetail} + */ + public static final class DoubleLikeDetail extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:DoubleLikeDetail) + DoubleLikeDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use DoubleLikeDetail.newBuilder() to construct. + private DoubleLikeDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DoubleLikeDetail() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DoubleLikeDetail(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.internal_static_DoubleLikeDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.internal_static_DoubleLikeDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.Builder.class); + } + + public static final int DOUBLEFLAG_FIELD_NUMBER = 1; + private boolean doubleFlag_ = false; + /** + * bool doubleFlag = 1; + * @return The doubleFlag. + */ + @java.lang.Override + public boolean getDoubleFlag() { + return doubleFlag_; + } + + public static final int SEQID_FIELD_NUMBER = 2; + private int seqId_ = 0; + /** + * uint32 seqId = 2; + * @return The seqId. + */ + @java.lang.Override + public int getSeqId() { + return seqId_; + } + + public static final int RENEWALSNUM_FIELD_NUMBER = 3; + private int renewalsNum_ = 0; + /** + * uint32 renewalsNum = 3; + * @return The renewalsNum. + */ + @java.lang.Override + public int getRenewalsNum() { + return renewalsNum_; + } + + public static final int TRIGGERSNUM_FIELD_NUMBER = 4; + private int triggersNum_ = 0; + /** + * uint32 triggersNum = 4; + * @return The triggersNum. + */ + @java.lang.Override + public int getTriggersNum() { + return triggersNum_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (doubleFlag_ != false) { + output.writeBool(1, doubleFlag_); + } + if (seqId_ != 0) { + output.writeUInt32(2, seqId_); + } + if (renewalsNum_ != 0) { + output.writeUInt32(3, renewalsNum_); + } + if (triggersNum_ != 0) { + output.writeUInt32(4, triggersNum_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (doubleFlag_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, doubleFlag_); + } + if (seqId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, seqId_); + } + if (renewalsNum_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, renewalsNum_); + } + if (triggersNum_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, triggersNum_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail) obj; + + if (getDoubleFlag() + != other.getDoubleFlag()) return false; + if (getSeqId() + != other.getSeqId()) return false; + if (getRenewalsNum() + != other.getRenewalsNum()) return false; + if (getTriggersNum() + != other.getTriggersNum()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DOUBLEFLAG_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDoubleFlag()); + hash = (37 * hash) + SEQID_FIELD_NUMBER; + hash = (53 * hash) + getSeqId(); + hash = (37 * hash) + RENEWALSNUM_FIELD_NUMBER; + hash = (53 * hash) + getRenewalsNum(); + hash = (37 * hash) + TRIGGERSNUM_FIELD_NUMBER; + hash = (53 * hash) + getTriggersNum(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code DoubleLikeDetail} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:DoubleLikeDetail) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.internal_static_DoubleLikeDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.internal_static_DoubleLikeDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + doubleFlag_ = false; + seqId_ = 0; + renewalsNum_ = 0; + triggersNum_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.internal_static_DoubleLikeDetail_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.doubleFlag_ = doubleFlag_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.seqId_ = seqId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.renewalsNum_ = renewalsNum_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.triggersNum_ = triggersNum_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail.getDefaultInstance()) return this; + if (other.getDoubleFlag() != false) { + setDoubleFlag(other.getDoubleFlag()); + } + if (other.getSeqId() != 0) { + setSeqId(other.getSeqId()); + } + if (other.getRenewalsNum() != 0) { + setRenewalsNum(other.getRenewalsNum()); + } + if (other.getTriggersNum() != 0) { + setTriggersNum(other.getTriggersNum()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + doubleFlag_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + seqId_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + renewalsNum_ = input.readUInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + triggersNum_ = input.readUInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean doubleFlag_ ; + /** + * bool doubleFlag = 1; + * @return The doubleFlag. + */ + @java.lang.Override + public boolean getDoubleFlag() { + return doubleFlag_; + } + /** + * bool doubleFlag = 1; + * @param value The doubleFlag to set. + * @return This builder for chaining. + */ + public Builder setDoubleFlag(boolean value) { + + doubleFlag_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bool doubleFlag = 1; + * @return This builder for chaining. + */ + public Builder clearDoubleFlag() { + bitField0_ = (bitField0_ & ~0x00000001); + doubleFlag_ = false; + onChanged(); + return this; + } + + private int seqId_ ; + /** + * uint32 seqId = 2; + * @return The seqId. + */ + @java.lang.Override + public int getSeqId() { + return seqId_; + } + /** + * uint32 seqId = 2; + * @param value The seqId to set. + * @return This builder for chaining. + */ + public Builder setSeqId(int value) { + + seqId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint32 seqId = 2; + * @return This builder for chaining. + */ + public Builder clearSeqId() { + bitField0_ = (bitField0_ & ~0x00000002); + seqId_ = 0; + onChanged(); + return this; + } + + private int renewalsNum_ ; + /** + * uint32 renewalsNum = 3; + * @return The renewalsNum. + */ + @java.lang.Override + public int getRenewalsNum() { + return renewalsNum_; + } + /** + * uint32 renewalsNum = 3; + * @param value The renewalsNum to set. + * @return This builder for chaining. + */ + public Builder setRenewalsNum(int value) { + + renewalsNum_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint32 renewalsNum = 3; + * @return This builder for chaining. + */ + public Builder clearRenewalsNum() { + bitField0_ = (bitField0_ & ~0x00000004); + renewalsNum_ = 0; + onChanged(); + return this; + } + + private int triggersNum_ ; + /** + * uint32 triggersNum = 4; + * @return The triggersNum. + */ + @java.lang.Override + public int getTriggersNum() { + return triggersNum_; + } + /** + * uint32 triggersNum = 4; + * @param value The triggersNum to set. + * @return This builder for chaining. + */ + public Builder setTriggersNum(int value) { + + triggersNum_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint32 triggersNum = 4; + * @return This builder for chaining. + */ + public Builder clearTriggersNum() { + bitField0_ = (bitField0_ & ~0x00000008); + triggersNum_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:DoubleLikeDetail) + } + + // @@protoc_insertion_point(class_scope:DoubleLikeDetail) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DoubleLikeDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.DoubleLikeDetailOuterClass.DoubleLikeDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_DoubleLikeDetail_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_DoubleLikeDetail_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026DoubleLikeDetail.proto\"_\n\020DoubleLikeDe" + + "tail\022\022\n\ndoubleFlag\030\001 \001(\010\022\r\n\005seqId\030\002 \001(\r\022" + + "\023\n\013renewalsNum\030\003 \001(\r\022\023\n\013triggersNum\030\004 \001(" + + "\rB8\n6tech.ordinaryroad.live.chat.client." + + "douyin.protobuf.dtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_DoubleLikeDetail_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_DoubleLikeDetail_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_DoubleLikeDetail_descriptor, + new java.lang.String[] { "DoubleFlag", "SeqId", "RenewalsNum", "TriggersNum", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/GiftIMPriorityOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/GiftIMPriorityOuterClass.java new file mode 100644 index 0000000..79765e3 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/GiftIMPriorityOuterClass.java @@ -0,0 +1,816 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: GiftIMPriority.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class GiftIMPriorityOuterClass { + private GiftIMPriorityOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface GiftIMPriorityOrBuilder extends + // @@protoc_insertion_point(interface_extends:GiftIMPriority) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated uint64 queue_sizes_list = 1; + * @return A list containing the queueSizesList. + */ + java.util.List getQueueSizesListList(); + /** + * repeated uint64 queue_sizes_list = 1; + * @return The count of queueSizesList. + */ + int getQueueSizesListCount(); + /** + * repeated uint64 queue_sizes_list = 1; + * @param index The index of the element to return. + * @return The queueSizesList at the given index. + */ + long getQueueSizesList(int index); + + /** + * uint64 self_queue_priority = 2; + * @return The selfQueuePriority. + */ + long getSelfQueuePriority(); + + /** + * uint64 priority = 3; + * @return The priority. + */ + long getPriority(); + } + /** + * Protobuf type {@code GiftIMPriority} + */ + public static final class GiftIMPriority extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:GiftIMPriority) + GiftIMPriorityOrBuilder { + private static final long serialVersionUID = 0L; + // Use GiftIMPriority.newBuilder() to construct. + private GiftIMPriority(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GiftIMPriority() { + queueSizesList_ = emptyLongList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GiftIMPriority(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.internal_static_GiftIMPriority_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.internal_static_GiftIMPriority_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.Builder.class); + } + + public static final int QUEUE_SIZES_LIST_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList queueSizesList_; + /** + * repeated uint64 queue_sizes_list = 1; + * @return A list containing the queueSizesList. + */ + @java.lang.Override + public java.util.List + getQueueSizesListList() { + return queueSizesList_; + } + /** + * repeated uint64 queue_sizes_list = 1; + * @return The count of queueSizesList. + */ + public int getQueueSizesListCount() { + return queueSizesList_.size(); + } + /** + * repeated uint64 queue_sizes_list = 1; + * @param index The index of the element to return. + * @return The queueSizesList at the given index. + */ + public long getQueueSizesList(int index) { + return queueSizesList_.getLong(index); + } + private int queueSizesListMemoizedSerializedSize = -1; + + public static final int SELF_QUEUE_PRIORITY_FIELD_NUMBER = 2; + private long selfQueuePriority_ = 0L; + /** + * uint64 self_queue_priority = 2; + * @return The selfQueuePriority. + */ + @java.lang.Override + public long getSelfQueuePriority() { + return selfQueuePriority_; + } + + public static final int PRIORITY_FIELD_NUMBER = 3; + private long priority_ = 0L; + /** + * uint64 priority = 3; + * @return The priority. + */ + @java.lang.Override + public long getPriority() { + return priority_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (getQueueSizesListList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(queueSizesListMemoizedSerializedSize); + } + for (int i = 0; i < queueSizesList_.size(); i++) { + output.writeUInt64NoTag(queueSizesList_.getLong(i)); + } + if (selfQueuePriority_ != 0L) { + output.writeUInt64(2, selfQueuePriority_); + } + if (priority_ != 0L) { + output.writeUInt64(3, priority_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < queueSizesList_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeUInt64SizeNoTag(queueSizesList_.getLong(i)); + } + size += dataSize; + if (!getQueueSizesListList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + queueSizesListMemoizedSerializedSize = dataSize; + } + if (selfQueuePriority_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, selfQueuePriority_); + } + if (priority_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, priority_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority) obj; + + if (!getQueueSizesListList() + .equals(other.getQueueSizesListList())) return false; + if (getSelfQueuePriority() + != other.getSelfQueuePriority()) return false; + if (getPriority() + != other.getPriority()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getQueueSizesListCount() > 0) { + hash = (37 * hash) + QUEUE_SIZES_LIST_FIELD_NUMBER; + hash = (53 * hash) + getQueueSizesListList().hashCode(); + } + hash = (37 * hash) + SELF_QUEUE_PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSelfQueuePriority()); + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPriority()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code GiftIMPriority} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:GiftIMPriority) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriorityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.internal_static_GiftIMPriority_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.internal_static_GiftIMPriority_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + queueSizesList_ = emptyLongList(); + selfQueuePriority_ = 0L; + priority_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.internal_static_GiftIMPriority_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority result) { + if (((bitField0_ & 0x00000001) != 0)) { + queueSizesList_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.queueSizesList_ = queueSizesList_; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.selfQueuePriority_ = selfQueuePriority_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.priority_ = priority_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority.getDefaultInstance()) return this; + if (!other.queueSizesList_.isEmpty()) { + if (queueSizesList_.isEmpty()) { + queueSizesList_ = other.queueSizesList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQueueSizesListIsMutable(); + queueSizesList_.addAll(other.queueSizesList_); + } + onChanged(); + } + if (other.getSelfQueuePriority() != 0L) { + setSelfQueuePriority(other.getSelfQueuePriority()); + } + if (other.getPriority() != 0L) { + setPriority(other.getPriority()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + long v = input.readUInt64(); + ensureQueueSizesListIsMutable(); + queueSizesList_.addLong(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureQueueSizesListIsMutable(); + while (input.getBytesUntilLimit() > 0) { + queueSizesList_.addLong(input.readUInt64()); + } + input.popLimit(limit); + break; + } // case 10 + case 16: { + selfQueuePriority_ = input.readUInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + priority_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.LongList queueSizesList_ = emptyLongList(); + private void ensureQueueSizesListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + queueSizesList_ = mutableCopy(queueSizesList_); + bitField0_ |= 0x00000001; + } + } + /** + * repeated uint64 queue_sizes_list = 1; + * @return A list containing the queueSizesList. + */ + public java.util.List + getQueueSizesListList() { + return ((bitField0_ & 0x00000001) != 0) ? + java.util.Collections.unmodifiableList(queueSizesList_) : queueSizesList_; + } + /** + * repeated uint64 queue_sizes_list = 1; + * @return The count of queueSizesList. + */ + public int getQueueSizesListCount() { + return queueSizesList_.size(); + } + /** + * repeated uint64 queue_sizes_list = 1; + * @param index The index of the element to return. + * @return The queueSizesList at the given index. + */ + public long getQueueSizesList(int index) { + return queueSizesList_.getLong(index); + } + /** + * repeated uint64 queue_sizes_list = 1; + * @param index The index to set the value at. + * @param value The queueSizesList to set. + * @return This builder for chaining. + */ + public Builder setQueueSizesList( + int index, long value) { + + ensureQueueSizesListIsMutable(); + queueSizesList_.setLong(index, value); + onChanged(); + return this; + } + /** + * repeated uint64 queue_sizes_list = 1; + * @param value The queueSizesList to add. + * @return This builder for chaining. + */ + public Builder addQueueSizesList(long value) { + + ensureQueueSizesListIsMutable(); + queueSizesList_.addLong(value); + onChanged(); + return this; + } + /** + * repeated uint64 queue_sizes_list = 1; + * @param values The queueSizesList to add. + * @return This builder for chaining. + */ + public Builder addAllQueueSizesList( + java.lang.Iterable values) { + ensureQueueSizesListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, queueSizesList_); + onChanged(); + return this; + } + /** + * repeated uint64 queue_sizes_list = 1; + * @return This builder for chaining. + */ + public Builder clearQueueSizesList() { + queueSizesList_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + private long selfQueuePriority_ ; + /** + * uint64 self_queue_priority = 2; + * @return The selfQueuePriority. + */ + @java.lang.Override + public long getSelfQueuePriority() { + return selfQueuePriority_; + } + /** + * uint64 self_queue_priority = 2; + * @param value The selfQueuePriority to set. + * @return This builder for chaining. + */ + public Builder setSelfQueuePriority(long value) { + + selfQueuePriority_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint64 self_queue_priority = 2; + * @return This builder for chaining. + */ + public Builder clearSelfQueuePriority() { + bitField0_ = (bitField0_ & ~0x00000002); + selfQueuePriority_ = 0L; + onChanged(); + return this; + } + + private long priority_ ; + /** + * uint64 priority = 3; + * @return The priority. + */ + @java.lang.Override + public long getPriority() { + return priority_; + } + /** + * uint64 priority = 3; + * @param value The priority to set. + * @return This builder for chaining. + */ + public Builder setPriority(long value) { + + priority_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 priority = 3; + * @return This builder for chaining. + */ + public Builder clearPriority() { + bitField0_ = (bitField0_ & ~0x00000004); + priority_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:GiftIMPriority) + } + + // @@protoc_insertion_point(class_scope:GiftIMPriority) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GiftIMPriority parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftIMPriorityOuterClass.GiftIMPriority getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_GiftIMPriority_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_GiftIMPriority_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024GiftIMPriority.proto\"Y\n\016GiftIMPriority" + + "\022\030\n\020queue_sizes_list\030\001 \003(\004\022\033\n\023self_queue" + + "_priority\030\002 \001(\004\022\020\n\010priority\030\003 \001(\004B8\n6tec" + + "h.ordinaryroad.live.chat.client.douyin.p" + + "rotobuf.dtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_GiftIMPriority_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_GiftIMPriority_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_GiftIMPriority_descriptor, + new java.lang.String[] { "QueueSizesList", "SelfQueuePriority", "Priority", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/GiftStructOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/GiftStructOuterClass.java new file mode 100644 index 0000000..e4e15b3 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/GiftStructOuterClass.java @@ -0,0 +1,6440 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: GiftStruct.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class GiftStructOuterClass { + private GiftStructOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface GiftStructOrBuilder extends + // @@protoc_insertion_point(interface_extends:GiftStruct) + com.google.protobuf.MessageOrBuilder { + + /** + * .Image image = 1; + * @return Whether the image field is set. + */ + boolean hasImage(); + /** + * .Image image = 1; + * @return The image. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getImage(); + /** + * .Image image = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImageOrBuilder(); + + /** + * string describe = 2; + * @return The describe. + */ + java.lang.String getDescribe(); + /** + * string describe = 2; + * @return The bytes for describe. + */ + com.google.protobuf.ByteString + getDescribeBytes(); + + /** + * bool notify = 3; + * @return The notify. + */ + boolean getNotify(); + + /** + * uint64 duration = 4; + * @return The duration. + */ + long getDuration(); + + /** + * uint64 id = 5; + * @return The id. + */ + long getId(); + + /** + *
+     * GiftStructFansClubInfo fansclubInfo = 6;
+     * 
+ * + * bool for_linkmic = 7; + * @return The forLinkmic. + */ + boolean getForLinkmic(); + + /** + * bool doodle = 8; + * @return The doodle. + */ + boolean getDoodle(); + + /** + * bool for_fansclub = 9; + * @return The forFansclub. + */ + boolean getForFansclub(); + + /** + * bool combo = 10; + * @return The combo. + */ + boolean getCombo(); + + /** + * uint32 type = 11; + * @return The type. + */ + int getType(); + + /** + * uint32 diamond_count = 12; + * @return The diamondCount. + */ + int getDiamondCount(); + + /** + * bool is_displayed_on_panel = 13; + * @return The isDisplayedOnPanel. + */ + boolean getIsDisplayedOnPanel(); + + /** + * uint64 primary_effect_id = 14; + * @return The primaryEffectId. + */ + long getPrimaryEffectId(); + + /** + * .Image gift_label_icon = 15; + * @return Whether the giftLabelIcon field is set. + */ + boolean hasGiftLabelIcon(); + /** + * .Image gift_label_icon = 15; + * @return The giftLabelIcon. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getGiftLabelIcon(); + /** + * .Image gift_label_icon = 15; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getGiftLabelIconOrBuilder(); + + /** + * string name = 16; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 16; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * string region = 17; + * @return The region. + */ + java.lang.String getRegion(); + /** + * string region = 17; + * @return The bytes for region. + */ + com.google.protobuf.ByteString + getRegionBytes(); + + /** + * string manual = 18; + * @return The manual. + */ + java.lang.String getManual(); + /** + * string manual = 18; + * @return The bytes for manual. + */ + com.google.protobuf.ByteString + getManualBytes(); + + /** + * bool for_custom = 19; + * @return The forCustom. + */ + boolean getForCustom(); + + /** + * map<string, int64> specialEffectsMap = 20; + */ + int getSpecialEffectsMapCount(); + /** + * map<string, int64> specialEffectsMap = 20; + */ + boolean containsSpecialEffectsMap( + java.lang.String key); + /** + * Use {@link #getSpecialEffectsMapMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getSpecialEffectsMap(); + /** + * map<string, int64> specialEffectsMap = 20; + */ + java.util.Map + getSpecialEffectsMapMap(); + /** + * map<string, int64> specialEffectsMap = 20; + */ + long getSpecialEffectsMapOrDefault( + java.lang.String key, + long defaultValue); + /** + * map<string, int64> specialEffectsMap = 20; + */ + long getSpecialEffectsMapOrThrow( + java.lang.String key); + + /** + * .Image icon = 21; + * @return Whether the icon field is set. + */ + boolean hasIcon(); + /** + * .Image icon = 21; + * @return The icon. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIcon(); + /** + * .Image icon = 21; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getIconOrBuilder(); + + /** + * uint32 action_type = 22; + * @return The actionType. + */ + int getActionType(); + + /** + * int32 watermelonSeeds = 23; + * @return The watermelonSeeds. + */ + int getWatermelonSeeds(); + + /** + * string goldEffect = 24; + * @return The goldEffect. + */ + java.lang.String getGoldEffect(); + /** + * string goldEffect = 24; + * @return The bytes for goldEffect. + */ + com.google.protobuf.ByteString + getGoldEffectBytes(); + + /** + *
+     * repeated LuckyMoneyGiftMeta subs = 25;
+     * 
+ * + * int64 goldenBeans = 26; + * @return The goldenBeans. + */ + long getGoldenBeans(); + + /** + * int64 honorLevel = 27; + * @return The honorLevel. + */ + long getHonorLevel(); + + /** + * int32 itemType = 28; + * @return The itemType. + */ + int getItemType(); + + /** + * string schemeUrl = 29; + * @return The schemeUrl. + */ + java.lang.String getSchemeUrl(); + /** + * string schemeUrl = 29; + * @return The bytes for schemeUrl. + */ + com.google.protobuf.ByteString + getSchemeUrlBytes(); + + /** + *
+     * GiftPanelOperation giftOperation = 30;
+     * 
+ * + * string eventName = 31; + * @return The eventName. + */ + java.lang.String getEventName(); + /** + *
+     * GiftPanelOperation giftOperation = 30;
+     * 
+ * + * string eventName = 31; + * @return The bytes for eventName. + */ + com.google.protobuf.ByteString + getEventNameBytes(); + + /** + * int64 nobleLevel = 32; + * @return The nobleLevel. + */ + long getNobleLevel(); + + /** + * string guideUrl = 33; + * @return The guideUrl. + */ + java.lang.String getGuideUrl(); + /** + * string guideUrl = 33; + * @return The bytes for guideUrl. + */ + com.google.protobuf.ByteString + getGuideUrlBytes(); + + /** + * bool punishMedicine = 34; + * @return The punishMedicine. + */ + boolean getPunishMedicine(); + + /** + * bool forPortal = 35; + * @return The forPortal. + */ + boolean getForPortal(); + + /** + * string businessText = 36; + * @return The businessText. + */ + java.lang.String getBusinessText(); + /** + * string businessText = 36; + * @return The bytes for businessText. + */ + com.google.protobuf.ByteString + getBusinessTextBytes(); + + /** + * bool cnyGift = 37; + * @return The cnyGift. + */ + boolean getCnyGift(); + + /** + * int64 appId = 38; + * @return The appId. + */ + long getAppId(); + + /** + * int64 vipLevel = 39; + * @return The vipLevel. + */ + long getVipLevel(); + + /** + * bool isGray = 40; + * @return The isGray. + */ + boolean getIsGray(); + + /** + * string graySchemeUrl = 41; + * @return The graySchemeUrl. + */ + java.lang.String getGraySchemeUrl(); + /** + * string graySchemeUrl = 41; + * @return The bytes for graySchemeUrl. + */ + com.google.protobuf.ByteString + getGraySchemeUrlBytes(); + + /** + * int64 giftScene = 42; + * @return The giftScene. + */ + long getGiftScene(); + + /** + *
+     * GiftBanner giftBanner = 43;
+     * 
+ * + * repeated string triggerWords = 44; + * @return A list containing the triggerWords. + */ + java.util.List + getTriggerWordsList(); + /** + *
+     * GiftBanner giftBanner = 43;
+     * 
+ * + * repeated string triggerWords = 44; + * @return The count of triggerWords. + */ + int getTriggerWordsCount(); + /** + *
+     * GiftBanner giftBanner = 43;
+     * 
+ * + * repeated string triggerWords = 44; + * @param index The index of the element to return. + * @return The triggerWords at the given index. + */ + java.lang.String getTriggerWords(int index); + /** + *
+     * GiftBanner giftBanner = 43;
+     * 
+ * + * repeated string triggerWords = 44; + * @param index The index of the value to return. + * @return The bytes of the triggerWords at the given index. + */ + com.google.protobuf.ByteString + getTriggerWordsBytes(int index); + + /** + *
+     * repeated GiftBuffInfo giftBuffInfos = 45;
+     * 
+ * + * bool forFirstRecharge = 46; + * @return The forFirstRecharge. + */ + boolean getForFirstRecharge(); + + /** + * .Image dynamicImgForSelected = 47; + * @return Whether the dynamicImgForSelected field is set. + */ + boolean hasDynamicImgForSelected(); + /** + * .Image dynamicImgForSelected = 47; + * @return The dynamicImgForSelected. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getDynamicImgForSelected(); + /** + * .Image dynamicImgForSelected = 47; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getDynamicImgForSelectedOrBuilder(); + + /** + * int32 afterSendAction = 48; + * @return The afterSendAction. + */ + int getAfterSendAction(); + + /** + * int64 giftOfflineTime = 49; + * @return The giftOfflineTime. + */ + long getGiftOfflineTime(); + + /** + * string topBarText = 50; + * @return The topBarText. + */ + java.lang.String getTopBarText(); + /** + * string topBarText = 50; + * @return The bytes for topBarText. + */ + com.google.protobuf.ByteString + getTopBarTextBytes(); + + /** + * .Image topRightAvatar = 51; + * @return Whether the topRightAvatar field is set. + */ + boolean hasTopRightAvatar(); + /** + * .Image topRightAvatar = 51; + * @return The topRightAvatar. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getTopRightAvatar(); + /** + * .Image topRightAvatar = 51; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getTopRightAvatarOrBuilder(); + + /** + * string bannerSchemeUrl = 52; + * @return The bannerSchemeUrl. + */ + java.lang.String getBannerSchemeUrl(); + /** + * string bannerSchemeUrl = 52; + * @return The bytes for bannerSchemeUrl. + */ + com.google.protobuf.ByteString + getBannerSchemeUrlBytes(); + + /** + * bool isLocked = 53; + * @return The isLocked. + */ + boolean getIsLocked(); + + /** + * int64 reqExtraType = 54; + * @return The reqExtraType. + */ + long getReqExtraType(); + + /** + * repeated int64 assetIds = 55; + * @return A list containing the assetIds. + */ + java.util.List getAssetIdsList(); + /** + * repeated int64 assetIds = 55; + * @return The count of assetIds. + */ + int getAssetIdsCount(); + /** + * repeated int64 assetIds = 55; + * @param index The index of the element to return. + * @return The assetIds at the given index. + */ + long getAssetIds(int index); + + /** + *
+     * GiftPreviewInfo giftPreviewInfo = 56;
+     * GiftTip giftTip = 57;
+     * 
+ * + * int32 needSweepLightCount = 58; + * @return The needSweepLightCount. + */ + int getNeedSweepLightCount(); + } + /** + * Protobuf type {@code GiftStruct} + */ + public static final class GiftStruct extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:GiftStruct) + GiftStructOrBuilder { + private static final long serialVersionUID = 0L; + // Use GiftStruct.newBuilder() to construct. + private GiftStruct(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GiftStruct() { + describe_ = ""; + name_ = ""; + region_ = ""; + manual_ = ""; + goldEffect_ = ""; + schemeUrl_ = ""; + eventName_ = ""; + guideUrl_ = ""; + businessText_ = ""; + graySchemeUrl_ = ""; + triggerWords_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + topBarText_ = ""; + bannerSchemeUrl_ = ""; + assetIds_ = emptyLongList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GiftStruct(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.internal_static_GiftStruct_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 20: + return internalGetSpecialEffectsMap(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.internal_static_GiftStruct_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.Builder.class); + } + + public static final int IMAGE_FIELD_NUMBER = 1; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image image_; + /** + * .Image image = 1; + * @return Whether the image field is set. + */ + @java.lang.Override + public boolean hasImage() { + return image_ != null; + } + /** + * .Image image = 1; + * @return The image. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getImage() { + return image_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : image_; + } + /** + * .Image image = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImageOrBuilder() { + return image_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : image_; + } + + public static final int DESCRIBE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object describe_ = ""; + /** + * string describe = 2; + * @return The describe. + */ + @java.lang.Override + public java.lang.String getDescribe() { + java.lang.Object ref = describe_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + describe_ = s; + return s; + } + } + /** + * string describe = 2; + * @return The bytes for describe. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescribeBytes() { + java.lang.Object ref = describe_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + describe_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOTIFY_FIELD_NUMBER = 3; + private boolean notify_ = false; + /** + * bool notify = 3; + * @return The notify. + */ + @java.lang.Override + public boolean getNotify() { + return notify_; + } + + public static final int DURATION_FIELD_NUMBER = 4; + private long duration_ = 0L; + /** + * uint64 duration = 4; + * @return The duration. + */ + @java.lang.Override + public long getDuration() { + return duration_; + } + + public static final int ID_FIELD_NUMBER = 5; + private long id_ = 0L; + /** + * uint64 id = 5; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int FOR_LINKMIC_FIELD_NUMBER = 7; + private boolean forLinkmic_ = false; + /** + *
+     * GiftStructFansClubInfo fansclubInfo = 6;
+     * 
+ * + * bool for_linkmic = 7; + * @return The forLinkmic. + */ + @java.lang.Override + public boolean getForLinkmic() { + return forLinkmic_; + } + + public static final int DOODLE_FIELD_NUMBER = 8; + private boolean doodle_ = false; + /** + * bool doodle = 8; + * @return The doodle. + */ + @java.lang.Override + public boolean getDoodle() { + return doodle_; + } + + public static final int FOR_FANSCLUB_FIELD_NUMBER = 9; + private boolean forFansclub_ = false; + /** + * bool for_fansclub = 9; + * @return The forFansclub. + */ + @java.lang.Override + public boolean getForFansclub() { + return forFansclub_; + } + + public static final int COMBO_FIELD_NUMBER = 10; + private boolean combo_ = false; + /** + * bool combo = 10; + * @return The combo. + */ + @java.lang.Override + public boolean getCombo() { + return combo_; + } + + public static final int TYPE_FIELD_NUMBER = 11; + private int type_ = 0; + /** + * uint32 type = 11; + * @return The type. + */ + @java.lang.Override + public int getType() { + return type_; + } + + public static final int DIAMOND_COUNT_FIELD_NUMBER = 12; + private int diamondCount_ = 0; + /** + * uint32 diamond_count = 12; + * @return The diamondCount. + */ + @java.lang.Override + public int getDiamondCount() { + return diamondCount_; + } + + public static final int IS_DISPLAYED_ON_PANEL_FIELD_NUMBER = 13; + private boolean isDisplayedOnPanel_ = false; + /** + * bool is_displayed_on_panel = 13; + * @return The isDisplayedOnPanel. + */ + @java.lang.Override + public boolean getIsDisplayedOnPanel() { + return isDisplayedOnPanel_; + } + + public static final int PRIMARY_EFFECT_ID_FIELD_NUMBER = 14; + private long primaryEffectId_ = 0L; + /** + * uint64 primary_effect_id = 14; + * @return The primaryEffectId. + */ + @java.lang.Override + public long getPrimaryEffectId() { + return primaryEffectId_; + } + + public static final int GIFT_LABEL_ICON_FIELD_NUMBER = 15; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image giftLabelIcon_; + /** + * .Image gift_label_icon = 15; + * @return Whether the giftLabelIcon field is set. + */ + @java.lang.Override + public boolean hasGiftLabelIcon() { + return giftLabelIcon_ != null; + } + /** + * .Image gift_label_icon = 15; + * @return The giftLabelIcon. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getGiftLabelIcon() { + return giftLabelIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : giftLabelIcon_; + } + /** + * .Image gift_label_icon = 15; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getGiftLabelIconOrBuilder() { + return giftLabelIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : giftLabelIcon_; + } + + public static final int NAME_FIELD_NUMBER = 16; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 16; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * string name = 16; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REGION_FIELD_NUMBER = 17; + @SuppressWarnings("serial") + private volatile java.lang.Object region_ = ""; + /** + * string region = 17; + * @return The region. + */ + @java.lang.Override + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } + } + /** + * string region = 17; + * @return The bytes for region. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MANUAL_FIELD_NUMBER = 18; + @SuppressWarnings("serial") + private volatile java.lang.Object manual_ = ""; + /** + * string manual = 18; + * @return The manual. + */ + @java.lang.Override + public java.lang.String getManual() { + java.lang.Object ref = manual_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + manual_ = s; + return s; + } + } + /** + * string manual = 18; + * @return The bytes for manual. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getManualBytes() { + java.lang.Object ref = manual_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + manual_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FOR_CUSTOM_FIELD_NUMBER = 19; + private boolean forCustom_ = false; + /** + * bool for_custom = 19; + * @return The forCustom. + */ + @java.lang.Override + public boolean getForCustom() { + return forCustom_; + } + + public static final int SPECIALEFFECTSMAP_FIELD_NUMBER = 20; + private static final class SpecialEffectsMapDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.Long> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.internal_static_GiftStruct_SpecialEffectsMapEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.INT64, + 0L); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.Long> specialEffectsMap_; + private com.google.protobuf.MapField + internalGetSpecialEffectsMap() { + if (specialEffectsMap_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SpecialEffectsMapDefaultEntryHolder.defaultEntry); + } + return specialEffectsMap_; + } + public int getSpecialEffectsMapCount() { + return internalGetSpecialEffectsMap().getMap().size(); + } + /** + * map<string, int64> specialEffectsMap = 20; + */ + @java.lang.Override + public boolean containsSpecialEffectsMap( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetSpecialEffectsMap().getMap().containsKey(key); + } + /** + * Use {@link #getSpecialEffectsMapMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSpecialEffectsMap() { + return getSpecialEffectsMapMap(); + } + /** + * map<string, int64> specialEffectsMap = 20; + */ + @java.lang.Override + public java.util.Map getSpecialEffectsMapMap() { + return internalGetSpecialEffectsMap().getMap(); + } + /** + * map<string, int64> specialEffectsMap = 20; + */ + @java.lang.Override + public long getSpecialEffectsMapOrDefault( + java.lang.String key, + long defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSpecialEffectsMap().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, int64> specialEffectsMap = 20; + */ + @java.lang.Override + public long getSpecialEffectsMapOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSpecialEffectsMap().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ICON_FIELD_NUMBER = 21; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image icon_; + /** + * .Image icon = 21; + * @return Whether the icon field is set. + */ + @java.lang.Override + public boolean hasIcon() { + return icon_ != null; + } + /** + * .Image icon = 21; + * @return The icon. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIcon() { + return icon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : icon_; + } + /** + * .Image icon = 21; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getIconOrBuilder() { + return icon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : icon_; + } + + public static final int ACTION_TYPE_FIELD_NUMBER = 22; + private int actionType_ = 0; + /** + * uint32 action_type = 22; + * @return The actionType. + */ + @java.lang.Override + public int getActionType() { + return actionType_; + } + + public static final int WATERMELONSEEDS_FIELD_NUMBER = 23; + private int watermelonSeeds_ = 0; + /** + * int32 watermelonSeeds = 23; + * @return The watermelonSeeds. + */ + @java.lang.Override + public int getWatermelonSeeds() { + return watermelonSeeds_; + } + + public static final int GOLDEFFECT_FIELD_NUMBER = 24; + @SuppressWarnings("serial") + private volatile java.lang.Object goldEffect_ = ""; + /** + * string goldEffect = 24; + * @return The goldEffect. + */ + @java.lang.Override + public java.lang.String getGoldEffect() { + java.lang.Object ref = goldEffect_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + goldEffect_ = s; + return s; + } + } + /** + * string goldEffect = 24; + * @return The bytes for goldEffect. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGoldEffectBytes() { + java.lang.Object ref = goldEffect_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + goldEffect_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GOLDENBEANS_FIELD_NUMBER = 26; + private long goldenBeans_ = 0L; + /** + *
+     * repeated LuckyMoneyGiftMeta subs = 25;
+     * 
+ * + * int64 goldenBeans = 26; + * @return The goldenBeans. + */ + @java.lang.Override + public long getGoldenBeans() { + return goldenBeans_; + } + + public static final int HONORLEVEL_FIELD_NUMBER = 27; + private long honorLevel_ = 0L; + /** + * int64 honorLevel = 27; + * @return The honorLevel. + */ + @java.lang.Override + public long getHonorLevel() { + return honorLevel_; + } + + public static final int ITEMTYPE_FIELD_NUMBER = 28; + private int itemType_ = 0; + /** + * int32 itemType = 28; + * @return The itemType. + */ + @java.lang.Override + public int getItemType() { + return itemType_; + } + + public static final int SCHEMEURL_FIELD_NUMBER = 29; + @SuppressWarnings("serial") + private volatile java.lang.Object schemeUrl_ = ""; + /** + * string schemeUrl = 29; + * @return The schemeUrl. + */ + @java.lang.Override + public java.lang.String getSchemeUrl() { + java.lang.Object ref = schemeUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schemeUrl_ = s; + return s; + } + } + /** + * string schemeUrl = 29; + * @return The bytes for schemeUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSchemeUrlBytes() { + java.lang.Object ref = schemeUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + schemeUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENTNAME_FIELD_NUMBER = 31; + @SuppressWarnings("serial") + private volatile java.lang.Object eventName_ = ""; + /** + *
+     * GiftPanelOperation giftOperation = 30;
+     * 
+ * + * string eventName = 31; + * @return The eventName. + */ + @java.lang.Override + public java.lang.String getEventName() { + java.lang.Object ref = eventName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eventName_ = s; + return s; + } + } + /** + *
+     * GiftPanelOperation giftOperation = 30;
+     * 
+ * + * string eventName = 31; + * @return The bytes for eventName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getEventNameBytes() { + java.lang.Object ref = eventName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + eventName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOBLELEVEL_FIELD_NUMBER = 32; + private long nobleLevel_ = 0L; + /** + * int64 nobleLevel = 32; + * @return The nobleLevel. + */ + @java.lang.Override + public long getNobleLevel() { + return nobleLevel_; + } + + public static final int GUIDEURL_FIELD_NUMBER = 33; + @SuppressWarnings("serial") + private volatile java.lang.Object guideUrl_ = ""; + /** + * string guideUrl = 33; + * @return The guideUrl. + */ + @java.lang.Override + public java.lang.String getGuideUrl() { + java.lang.Object ref = guideUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + guideUrl_ = s; + return s; + } + } + /** + * string guideUrl = 33; + * @return The bytes for guideUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGuideUrlBytes() { + java.lang.Object ref = guideUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + guideUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PUNISHMEDICINE_FIELD_NUMBER = 34; + private boolean punishMedicine_ = false; + /** + * bool punishMedicine = 34; + * @return The punishMedicine. + */ + @java.lang.Override + public boolean getPunishMedicine() { + return punishMedicine_; + } + + public static final int FORPORTAL_FIELD_NUMBER = 35; + private boolean forPortal_ = false; + /** + * bool forPortal = 35; + * @return The forPortal. + */ + @java.lang.Override + public boolean getForPortal() { + return forPortal_; + } + + public static final int BUSINESSTEXT_FIELD_NUMBER = 36; + @SuppressWarnings("serial") + private volatile java.lang.Object businessText_ = ""; + /** + * string businessText = 36; + * @return The businessText. + */ + @java.lang.Override + public java.lang.String getBusinessText() { + java.lang.Object ref = businessText_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + businessText_ = s; + return s; + } + } + /** + * string businessText = 36; + * @return The bytes for businessText. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBusinessTextBytes() { + java.lang.Object ref = businessText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + businessText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CNYGIFT_FIELD_NUMBER = 37; + private boolean cnyGift_ = false; + /** + * bool cnyGift = 37; + * @return The cnyGift. + */ + @java.lang.Override + public boolean getCnyGift() { + return cnyGift_; + } + + public static final int APPID_FIELD_NUMBER = 38; + private long appId_ = 0L; + /** + * int64 appId = 38; + * @return The appId. + */ + @java.lang.Override + public long getAppId() { + return appId_; + } + + public static final int VIPLEVEL_FIELD_NUMBER = 39; + private long vipLevel_ = 0L; + /** + * int64 vipLevel = 39; + * @return The vipLevel. + */ + @java.lang.Override + public long getVipLevel() { + return vipLevel_; + } + + public static final int ISGRAY_FIELD_NUMBER = 40; + private boolean isGray_ = false; + /** + * bool isGray = 40; + * @return The isGray. + */ + @java.lang.Override + public boolean getIsGray() { + return isGray_; + } + + public static final int GRAYSCHEMEURL_FIELD_NUMBER = 41; + @SuppressWarnings("serial") + private volatile java.lang.Object graySchemeUrl_ = ""; + /** + * string graySchemeUrl = 41; + * @return The graySchemeUrl. + */ + @java.lang.Override + public java.lang.String getGraySchemeUrl() { + java.lang.Object ref = graySchemeUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + graySchemeUrl_ = s; + return s; + } + } + /** + * string graySchemeUrl = 41; + * @return The bytes for graySchemeUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGraySchemeUrlBytes() { + java.lang.Object ref = graySchemeUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graySchemeUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GIFTSCENE_FIELD_NUMBER = 42; + private long giftScene_ = 0L; + /** + * int64 giftScene = 42; + * @return The giftScene. + */ + @java.lang.Override + public long getGiftScene() { + return giftScene_; + } + + public static final int TRIGGERWORDS_FIELD_NUMBER = 44; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList triggerWords_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
+     * GiftBanner giftBanner = 43;
+     * 
+ * + * repeated string triggerWords = 44; + * @return A list containing the triggerWords. + */ + public com.google.protobuf.ProtocolStringList + getTriggerWordsList() { + return triggerWords_; + } + /** + *
+     * GiftBanner giftBanner = 43;
+     * 
+ * + * repeated string triggerWords = 44; + * @return The count of triggerWords. + */ + public int getTriggerWordsCount() { + return triggerWords_.size(); + } + /** + *
+     * GiftBanner giftBanner = 43;
+     * 
+ * + * repeated string triggerWords = 44; + * @param index The index of the element to return. + * @return The triggerWords at the given index. + */ + public java.lang.String getTriggerWords(int index) { + return triggerWords_.get(index); + } + /** + *
+     * GiftBanner giftBanner = 43;
+     * 
+ * + * repeated string triggerWords = 44; + * @param index The index of the value to return. + * @return The bytes of the triggerWords at the given index. + */ + public com.google.protobuf.ByteString + getTriggerWordsBytes(int index) { + return triggerWords_.getByteString(index); + } + + public static final int FORFIRSTRECHARGE_FIELD_NUMBER = 46; + private boolean forFirstRecharge_ = false; + /** + *
+     * repeated GiftBuffInfo giftBuffInfos = 45;
+     * 
+ * + * bool forFirstRecharge = 46; + * @return The forFirstRecharge. + */ + @java.lang.Override + public boolean getForFirstRecharge() { + return forFirstRecharge_; + } + + public static final int DYNAMICIMGFORSELECTED_FIELD_NUMBER = 47; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image dynamicImgForSelected_; + /** + * .Image dynamicImgForSelected = 47; + * @return Whether the dynamicImgForSelected field is set. + */ + @java.lang.Override + public boolean hasDynamicImgForSelected() { + return dynamicImgForSelected_ != null; + } + /** + * .Image dynamicImgForSelected = 47; + * @return The dynamicImgForSelected. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getDynamicImgForSelected() { + return dynamicImgForSelected_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : dynamicImgForSelected_; + } + /** + * .Image dynamicImgForSelected = 47; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getDynamicImgForSelectedOrBuilder() { + return dynamicImgForSelected_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : dynamicImgForSelected_; + } + + public static final int AFTERSENDACTION_FIELD_NUMBER = 48; + private int afterSendAction_ = 0; + /** + * int32 afterSendAction = 48; + * @return The afterSendAction. + */ + @java.lang.Override + public int getAfterSendAction() { + return afterSendAction_; + } + + public static final int GIFTOFFLINETIME_FIELD_NUMBER = 49; + private long giftOfflineTime_ = 0L; + /** + * int64 giftOfflineTime = 49; + * @return The giftOfflineTime. + */ + @java.lang.Override + public long getGiftOfflineTime() { + return giftOfflineTime_; + } + + public static final int TOPBARTEXT_FIELD_NUMBER = 50; + @SuppressWarnings("serial") + private volatile java.lang.Object topBarText_ = ""; + /** + * string topBarText = 50; + * @return The topBarText. + */ + @java.lang.Override + public java.lang.String getTopBarText() { + java.lang.Object ref = topBarText_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topBarText_ = s; + return s; + } + } + /** + * string topBarText = 50; + * @return The bytes for topBarText. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTopBarTextBytes() { + java.lang.Object ref = topBarText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topBarText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOPRIGHTAVATAR_FIELD_NUMBER = 51; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image topRightAvatar_; + /** + * .Image topRightAvatar = 51; + * @return Whether the topRightAvatar field is set. + */ + @java.lang.Override + public boolean hasTopRightAvatar() { + return topRightAvatar_ != null; + } + /** + * .Image topRightAvatar = 51; + * @return The topRightAvatar. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getTopRightAvatar() { + return topRightAvatar_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : topRightAvatar_; + } + /** + * .Image topRightAvatar = 51; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getTopRightAvatarOrBuilder() { + return topRightAvatar_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : topRightAvatar_; + } + + public static final int BANNERSCHEMEURL_FIELD_NUMBER = 52; + @SuppressWarnings("serial") + private volatile java.lang.Object bannerSchemeUrl_ = ""; + /** + * string bannerSchemeUrl = 52; + * @return The bannerSchemeUrl. + */ + @java.lang.Override + public java.lang.String getBannerSchemeUrl() { + java.lang.Object ref = bannerSchemeUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bannerSchemeUrl_ = s; + return s; + } + } + /** + * string bannerSchemeUrl = 52; + * @return The bytes for bannerSchemeUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBannerSchemeUrlBytes() { + java.lang.Object ref = bannerSchemeUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + bannerSchemeUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ISLOCKED_FIELD_NUMBER = 53; + private boolean isLocked_ = false; + /** + * bool isLocked = 53; + * @return The isLocked. + */ + @java.lang.Override + public boolean getIsLocked() { + return isLocked_; + } + + public static final int REQEXTRATYPE_FIELD_NUMBER = 54; + private long reqExtraType_ = 0L; + /** + * int64 reqExtraType = 54; + * @return The reqExtraType. + */ + @java.lang.Override + public long getReqExtraType() { + return reqExtraType_; + } + + public static final int ASSETIDS_FIELD_NUMBER = 55; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList assetIds_; + /** + * repeated int64 assetIds = 55; + * @return A list containing the assetIds. + */ + @java.lang.Override + public java.util.List + getAssetIdsList() { + return assetIds_; + } + /** + * repeated int64 assetIds = 55; + * @return The count of assetIds. + */ + public int getAssetIdsCount() { + return assetIds_.size(); + } + /** + * repeated int64 assetIds = 55; + * @param index The index of the element to return. + * @return The assetIds at the given index. + */ + public long getAssetIds(int index) { + return assetIds_.getLong(index); + } + private int assetIdsMemoizedSerializedSize = -1; + + public static final int NEEDSWEEPLIGHTCOUNT_FIELD_NUMBER = 58; + private int needSweepLightCount_ = 0; + /** + *
+     * GiftPreviewInfo giftPreviewInfo = 56;
+     * GiftTip giftTip = 57;
+     * 
+ * + * int32 needSweepLightCount = 58; + * @return The needSweepLightCount. + */ + @java.lang.Override + public int getNeedSweepLightCount() { + return needSweepLightCount_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (image_ != null) { + output.writeMessage(1, getImage()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(describe_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, describe_); + } + if (notify_ != false) { + output.writeBool(3, notify_); + } + if (duration_ != 0L) { + output.writeUInt64(4, duration_); + } + if (id_ != 0L) { + output.writeUInt64(5, id_); + } + if (forLinkmic_ != false) { + output.writeBool(7, forLinkmic_); + } + if (doodle_ != false) { + output.writeBool(8, doodle_); + } + if (forFansclub_ != false) { + output.writeBool(9, forFansclub_); + } + if (combo_ != false) { + output.writeBool(10, combo_); + } + if (type_ != 0) { + output.writeUInt32(11, type_); + } + if (diamondCount_ != 0) { + output.writeUInt32(12, diamondCount_); + } + if (isDisplayedOnPanel_ != false) { + output.writeBool(13, isDisplayedOnPanel_); + } + if (primaryEffectId_ != 0L) { + output.writeUInt64(14, primaryEffectId_); + } + if (giftLabelIcon_ != null) { + output.writeMessage(15, getGiftLabelIcon()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(region_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, region_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(manual_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 18, manual_); + } + if (forCustom_ != false) { + output.writeBool(19, forCustom_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetSpecialEffectsMap(), + SpecialEffectsMapDefaultEntryHolder.defaultEntry, + 20); + if (icon_ != null) { + output.writeMessage(21, getIcon()); + } + if (actionType_ != 0) { + output.writeUInt32(22, actionType_); + } + if (watermelonSeeds_ != 0) { + output.writeInt32(23, watermelonSeeds_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(goldEffect_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 24, goldEffect_); + } + if (goldenBeans_ != 0L) { + output.writeInt64(26, goldenBeans_); + } + if (honorLevel_ != 0L) { + output.writeInt64(27, honorLevel_); + } + if (itemType_ != 0) { + output.writeInt32(28, itemType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemeUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 29, schemeUrl_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 31, eventName_); + } + if (nobleLevel_ != 0L) { + output.writeInt64(32, nobleLevel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(guideUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 33, guideUrl_); + } + if (punishMedicine_ != false) { + output.writeBool(34, punishMedicine_); + } + if (forPortal_ != false) { + output.writeBool(35, forPortal_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(businessText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 36, businessText_); + } + if (cnyGift_ != false) { + output.writeBool(37, cnyGift_); + } + if (appId_ != 0L) { + output.writeInt64(38, appId_); + } + if (vipLevel_ != 0L) { + output.writeInt64(39, vipLevel_); + } + if (isGray_ != false) { + output.writeBool(40, isGray_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(graySchemeUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 41, graySchemeUrl_); + } + if (giftScene_ != 0L) { + output.writeInt64(42, giftScene_); + } + for (int i = 0; i < triggerWords_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 44, triggerWords_.getRaw(i)); + } + if (forFirstRecharge_ != false) { + output.writeBool(46, forFirstRecharge_); + } + if (dynamicImgForSelected_ != null) { + output.writeMessage(47, getDynamicImgForSelected()); + } + if (afterSendAction_ != 0) { + output.writeInt32(48, afterSendAction_); + } + if (giftOfflineTime_ != 0L) { + output.writeInt64(49, giftOfflineTime_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topBarText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 50, topBarText_); + } + if (topRightAvatar_ != null) { + output.writeMessage(51, getTopRightAvatar()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bannerSchemeUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 52, bannerSchemeUrl_); + } + if (isLocked_ != false) { + output.writeBool(53, isLocked_); + } + if (reqExtraType_ != 0L) { + output.writeInt64(54, reqExtraType_); + } + if (getAssetIdsList().size() > 0) { + output.writeUInt32NoTag(442); + output.writeUInt32NoTag(assetIdsMemoizedSerializedSize); + } + for (int i = 0; i < assetIds_.size(); i++) { + output.writeInt64NoTag(assetIds_.getLong(i)); + } + if (needSweepLightCount_ != 0) { + output.writeInt32(58, needSweepLightCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (image_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getImage()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(describe_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, describe_); + } + if (notify_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, notify_); + } + if (duration_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, duration_); + } + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(5, id_); + } + if (forLinkmic_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, forLinkmic_); + } + if (doodle_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(8, doodle_); + } + if (forFansclub_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(9, forFansclub_); + } + if (combo_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(10, combo_); + } + if (type_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(11, type_); + } + if (diamondCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(12, diamondCount_); + } + if (isDisplayedOnPanel_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(13, isDisplayedOnPanel_); + } + if (primaryEffectId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(14, primaryEffectId_); + } + if (giftLabelIcon_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, getGiftLabelIcon()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(region_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, region_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(manual_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, manual_); + } + if (forCustom_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(19, forCustom_); + } + for (java.util.Map.Entry entry + : internalGetSpecialEffectsMap().getMap().entrySet()) { + com.google.protobuf.MapEntry + specialEffectsMap__ = SpecialEffectsMapDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(20, specialEffectsMap__); + } + if (icon_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(21, getIcon()); + } + if (actionType_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(22, actionType_); + } + if (watermelonSeeds_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(23, watermelonSeeds_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(goldEffect_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(24, goldEffect_); + } + if (goldenBeans_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(26, goldenBeans_); + } + if (honorLevel_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(27, honorLevel_); + } + if (itemType_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(28, itemType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemeUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(29, schemeUrl_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(31, eventName_); + } + if (nobleLevel_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(32, nobleLevel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(guideUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(33, guideUrl_); + } + if (punishMedicine_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(34, punishMedicine_); + } + if (forPortal_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(35, forPortal_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(businessText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(36, businessText_); + } + if (cnyGift_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(37, cnyGift_); + } + if (appId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(38, appId_); + } + if (vipLevel_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(39, vipLevel_); + } + if (isGray_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(40, isGray_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(graySchemeUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(41, graySchemeUrl_); + } + if (giftScene_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(42, giftScene_); + } + { + int dataSize = 0; + for (int i = 0; i < triggerWords_.size(); i++) { + dataSize += computeStringSizeNoTag(triggerWords_.getRaw(i)); + } + size += dataSize; + size += 2 * getTriggerWordsList().size(); + } + if (forFirstRecharge_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(46, forFirstRecharge_); + } + if (dynamicImgForSelected_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(47, getDynamicImgForSelected()); + } + if (afterSendAction_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(48, afterSendAction_); + } + if (giftOfflineTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(49, giftOfflineTime_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topBarText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(50, topBarText_); + } + if (topRightAvatar_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(51, getTopRightAvatar()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bannerSchemeUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(52, bannerSchemeUrl_); + } + if (isLocked_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(53, isLocked_); + } + if (reqExtraType_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(54, reqExtraType_); + } + { + int dataSize = 0; + for (int i = 0; i < assetIds_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(assetIds_.getLong(i)); + } + size += dataSize; + if (!getAssetIdsList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + assetIdsMemoizedSerializedSize = dataSize; + } + if (needSweepLightCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(58, needSweepLightCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct) obj; + + if (hasImage() != other.hasImage()) return false; + if (hasImage()) { + if (!getImage() + .equals(other.getImage())) return false; + } + if (!getDescribe() + .equals(other.getDescribe())) return false; + if (getNotify() + != other.getNotify()) return false; + if (getDuration() + != other.getDuration()) return false; + if (getId() + != other.getId()) return false; + if (getForLinkmic() + != other.getForLinkmic()) return false; + if (getDoodle() + != other.getDoodle()) return false; + if (getForFansclub() + != other.getForFansclub()) return false; + if (getCombo() + != other.getCombo()) return false; + if (getType() + != other.getType()) return false; + if (getDiamondCount() + != other.getDiamondCount()) return false; + if (getIsDisplayedOnPanel() + != other.getIsDisplayedOnPanel()) return false; + if (getPrimaryEffectId() + != other.getPrimaryEffectId()) return false; + if (hasGiftLabelIcon() != other.hasGiftLabelIcon()) return false; + if (hasGiftLabelIcon()) { + if (!getGiftLabelIcon() + .equals(other.getGiftLabelIcon())) return false; + } + if (!getName() + .equals(other.getName())) return false; + if (!getRegion() + .equals(other.getRegion())) return false; + if (!getManual() + .equals(other.getManual())) return false; + if (getForCustom() + != other.getForCustom()) return false; + if (!internalGetSpecialEffectsMap().equals( + other.internalGetSpecialEffectsMap())) return false; + if (hasIcon() != other.hasIcon()) return false; + if (hasIcon()) { + if (!getIcon() + .equals(other.getIcon())) return false; + } + if (getActionType() + != other.getActionType()) return false; + if (getWatermelonSeeds() + != other.getWatermelonSeeds()) return false; + if (!getGoldEffect() + .equals(other.getGoldEffect())) return false; + if (getGoldenBeans() + != other.getGoldenBeans()) return false; + if (getHonorLevel() + != other.getHonorLevel()) return false; + if (getItemType() + != other.getItemType()) return false; + if (!getSchemeUrl() + .equals(other.getSchemeUrl())) return false; + if (!getEventName() + .equals(other.getEventName())) return false; + if (getNobleLevel() + != other.getNobleLevel()) return false; + if (!getGuideUrl() + .equals(other.getGuideUrl())) return false; + if (getPunishMedicine() + != other.getPunishMedicine()) return false; + if (getForPortal() + != other.getForPortal()) return false; + if (!getBusinessText() + .equals(other.getBusinessText())) return false; + if (getCnyGift() + != other.getCnyGift()) return false; + if (getAppId() + != other.getAppId()) return false; + if (getVipLevel() + != other.getVipLevel()) return false; + if (getIsGray() + != other.getIsGray()) return false; + if (!getGraySchemeUrl() + .equals(other.getGraySchemeUrl())) return false; + if (getGiftScene() + != other.getGiftScene()) return false; + if (!getTriggerWordsList() + .equals(other.getTriggerWordsList())) return false; + if (getForFirstRecharge() + != other.getForFirstRecharge()) return false; + if (hasDynamicImgForSelected() != other.hasDynamicImgForSelected()) return false; + if (hasDynamicImgForSelected()) { + if (!getDynamicImgForSelected() + .equals(other.getDynamicImgForSelected())) return false; + } + if (getAfterSendAction() + != other.getAfterSendAction()) return false; + if (getGiftOfflineTime() + != other.getGiftOfflineTime()) return false; + if (!getTopBarText() + .equals(other.getTopBarText())) return false; + if (hasTopRightAvatar() != other.hasTopRightAvatar()) return false; + if (hasTopRightAvatar()) { + if (!getTopRightAvatar() + .equals(other.getTopRightAvatar())) return false; + } + if (!getBannerSchemeUrl() + .equals(other.getBannerSchemeUrl())) return false; + if (getIsLocked() + != other.getIsLocked()) return false; + if (getReqExtraType() + != other.getReqExtraType()) return false; + if (!getAssetIdsList() + .equals(other.getAssetIdsList())) return false; + if (getNeedSweepLightCount() + != other.getNeedSweepLightCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasImage()) { + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + } + hash = (37 * hash) + DESCRIBE_FIELD_NUMBER; + hash = (53 * hash) + getDescribe().hashCode(); + hash = (37 * hash) + NOTIFY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getNotify()); + hash = (37 * hash) + DURATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDuration()); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + FOR_LINKMIC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getForLinkmic()); + hash = (37 * hash) + DOODLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDoodle()); + hash = (37 * hash) + FOR_FANSCLUB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getForFansclub()); + hash = (37 * hash) + COMBO_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCombo()); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType(); + hash = (37 * hash) + DIAMOND_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getDiamondCount(); + hash = (37 * hash) + IS_DISPLAYED_ON_PANEL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsDisplayedOnPanel()); + hash = (37 * hash) + PRIMARY_EFFECT_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPrimaryEffectId()); + if (hasGiftLabelIcon()) { + hash = (37 * hash) + GIFT_LABEL_ICON_FIELD_NUMBER; + hash = (53 * hash) + getGiftLabelIcon().hashCode(); + } + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegion().hashCode(); + hash = (37 * hash) + MANUAL_FIELD_NUMBER; + hash = (53 * hash) + getManual().hashCode(); + hash = (37 * hash) + FOR_CUSTOM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getForCustom()); + if (!internalGetSpecialEffectsMap().getMap().isEmpty()) { + hash = (37 * hash) + SPECIALEFFECTSMAP_FIELD_NUMBER; + hash = (53 * hash) + internalGetSpecialEffectsMap().hashCode(); + } + if (hasIcon()) { + hash = (37 * hash) + ICON_FIELD_NUMBER; + hash = (53 * hash) + getIcon().hashCode(); + } + hash = (37 * hash) + ACTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getActionType(); + hash = (37 * hash) + WATERMELONSEEDS_FIELD_NUMBER; + hash = (53 * hash) + getWatermelonSeeds(); + hash = (37 * hash) + GOLDEFFECT_FIELD_NUMBER; + hash = (53 * hash) + getGoldEffect().hashCode(); + hash = (37 * hash) + GOLDENBEANS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getGoldenBeans()); + hash = (37 * hash) + HONORLEVEL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getHonorLevel()); + hash = (37 * hash) + ITEMTYPE_FIELD_NUMBER; + hash = (53 * hash) + getItemType(); + hash = (37 * hash) + SCHEMEURL_FIELD_NUMBER; + hash = (53 * hash) + getSchemeUrl().hashCode(); + hash = (37 * hash) + EVENTNAME_FIELD_NUMBER; + hash = (53 * hash) + getEventName().hashCode(); + hash = (37 * hash) + NOBLELEVEL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNobleLevel()); + hash = (37 * hash) + GUIDEURL_FIELD_NUMBER; + hash = (53 * hash) + getGuideUrl().hashCode(); + hash = (37 * hash) + PUNISHMEDICINE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPunishMedicine()); + hash = (37 * hash) + FORPORTAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getForPortal()); + hash = (37 * hash) + BUSINESSTEXT_FIELD_NUMBER; + hash = (53 * hash) + getBusinessText().hashCode(); + hash = (37 * hash) + CNYGIFT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCnyGift()); + hash = (37 * hash) + APPID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAppId()); + hash = (37 * hash) + VIPLEVEL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVipLevel()); + hash = (37 * hash) + ISGRAY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsGray()); + hash = (37 * hash) + GRAYSCHEMEURL_FIELD_NUMBER; + hash = (53 * hash) + getGraySchemeUrl().hashCode(); + hash = (37 * hash) + GIFTSCENE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getGiftScene()); + if (getTriggerWordsCount() > 0) { + hash = (37 * hash) + TRIGGERWORDS_FIELD_NUMBER; + hash = (53 * hash) + getTriggerWordsList().hashCode(); + } + hash = (37 * hash) + FORFIRSTRECHARGE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getForFirstRecharge()); + if (hasDynamicImgForSelected()) { + hash = (37 * hash) + DYNAMICIMGFORSELECTED_FIELD_NUMBER; + hash = (53 * hash) + getDynamicImgForSelected().hashCode(); + } + hash = (37 * hash) + AFTERSENDACTION_FIELD_NUMBER; + hash = (53 * hash) + getAfterSendAction(); + hash = (37 * hash) + GIFTOFFLINETIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getGiftOfflineTime()); + hash = (37 * hash) + TOPBARTEXT_FIELD_NUMBER; + hash = (53 * hash) + getTopBarText().hashCode(); + if (hasTopRightAvatar()) { + hash = (37 * hash) + TOPRIGHTAVATAR_FIELD_NUMBER; + hash = (53 * hash) + getTopRightAvatar().hashCode(); + } + hash = (37 * hash) + BANNERSCHEMEURL_FIELD_NUMBER; + hash = (53 * hash) + getBannerSchemeUrl().hashCode(); + hash = (37 * hash) + ISLOCKED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsLocked()); + hash = (37 * hash) + REQEXTRATYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getReqExtraType()); + if (getAssetIdsCount() > 0) { + hash = (37 * hash) + ASSETIDS_FIELD_NUMBER; + hash = (53 * hash) + getAssetIdsList().hashCode(); + } + hash = (37 * hash) + NEEDSWEEPLIGHTCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getNeedSweepLightCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code GiftStruct} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:GiftStruct) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStructOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.internal_static_GiftStruct_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 20: + return internalGetSpecialEffectsMap(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 20: + return internalGetMutableSpecialEffectsMap(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.internal_static_GiftStruct_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bitField1_ = 0; + image_ = null; + if (imageBuilder_ != null) { + imageBuilder_.dispose(); + imageBuilder_ = null; + } + describe_ = ""; + notify_ = false; + duration_ = 0L; + id_ = 0L; + forLinkmic_ = false; + doodle_ = false; + forFansclub_ = false; + combo_ = false; + type_ = 0; + diamondCount_ = 0; + isDisplayedOnPanel_ = false; + primaryEffectId_ = 0L; + giftLabelIcon_ = null; + if (giftLabelIconBuilder_ != null) { + giftLabelIconBuilder_.dispose(); + giftLabelIconBuilder_ = null; + } + name_ = ""; + region_ = ""; + manual_ = ""; + forCustom_ = false; + internalGetMutableSpecialEffectsMap().clear(); + icon_ = null; + if (iconBuilder_ != null) { + iconBuilder_.dispose(); + iconBuilder_ = null; + } + actionType_ = 0; + watermelonSeeds_ = 0; + goldEffect_ = ""; + goldenBeans_ = 0L; + honorLevel_ = 0L; + itemType_ = 0; + schemeUrl_ = ""; + eventName_ = ""; + nobleLevel_ = 0L; + guideUrl_ = ""; + punishMedicine_ = false; + forPortal_ = false; + businessText_ = ""; + cnyGift_ = false; + appId_ = 0L; + vipLevel_ = 0L; + isGray_ = false; + graySchemeUrl_ = ""; + giftScene_ = 0L; + triggerWords_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + forFirstRecharge_ = false; + dynamicImgForSelected_ = null; + if (dynamicImgForSelectedBuilder_ != null) { + dynamicImgForSelectedBuilder_.dispose(); + dynamicImgForSelectedBuilder_ = null; + } + afterSendAction_ = 0; + giftOfflineTime_ = 0L; + topBarText_ = ""; + topRightAvatar_ = null; + if (topRightAvatarBuilder_ != null) { + topRightAvatarBuilder_.dispose(); + topRightAvatarBuilder_ = null; + } + bannerSchemeUrl_ = ""; + isLocked_ = false; + reqExtraType_ = 0L; + assetIds_ = emptyLongList(); + needSweepLightCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.internal_static_GiftStruct_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + if (bitField1_ != 0) { buildPartial1(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct result) { + if (((bitField1_ & 0x00020000) != 0)) { + assetIds_.makeImmutable(); + bitField1_ = (bitField1_ & ~0x00020000); + } + result.assetIds_ = assetIds_; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.image_ = imageBuilder_ == null + ? image_ + : imageBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.describe_ = describe_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.notify_ = notify_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.duration_ = duration_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.forLinkmic_ = forLinkmic_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.doodle_ = doodle_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.forFansclub_ = forFansclub_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.combo_ = combo_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.diamondCount_ = diamondCount_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.isDisplayedOnPanel_ = isDisplayedOnPanel_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.primaryEffectId_ = primaryEffectId_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.giftLabelIcon_ = giftLabelIconBuilder_ == null + ? giftLabelIcon_ + : giftLabelIconBuilder_.build(); + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.region_ = region_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.manual_ = manual_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.forCustom_ = forCustom_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.specialEffectsMap_ = internalGetSpecialEffectsMap(); + result.specialEffectsMap_.makeImmutable(); + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.icon_ = iconBuilder_ == null + ? icon_ + : iconBuilder_.build(); + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.actionType_ = actionType_; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.watermelonSeeds_ = watermelonSeeds_; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.goldEffect_ = goldEffect_; + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.goldenBeans_ = goldenBeans_; + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.honorLevel_ = honorLevel_; + } + if (((from_bitField0_ & 0x02000000) != 0)) { + result.itemType_ = itemType_; + } + if (((from_bitField0_ & 0x04000000) != 0)) { + result.schemeUrl_ = schemeUrl_; + } + if (((from_bitField0_ & 0x08000000) != 0)) { + result.eventName_ = eventName_; + } + if (((from_bitField0_ & 0x10000000) != 0)) { + result.nobleLevel_ = nobleLevel_; + } + if (((from_bitField0_ & 0x20000000) != 0)) { + result.guideUrl_ = guideUrl_; + } + if (((from_bitField0_ & 0x40000000) != 0)) { + result.punishMedicine_ = punishMedicine_; + } + if (((from_bitField0_ & 0x80000000) != 0)) { + result.forPortal_ = forPortal_; + } + } + + private void buildPartial1(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct result) { + int from_bitField1_ = bitField1_; + if (((from_bitField1_ & 0x00000001) != 0)) { + result.businessText_ = businessText_; + } + if (((from_bitField1_ & 0x00000002) != 0)) { + result.cnyGift_ = cnyGift_; + } + if (((from_bitField1_ & 0x00000004) != 0)) { + result.appId_ = appId_; + } + if (((from_bitField1_ & 0x00000008) != 0)) { + result.vipLevel_ = vipLevel_; + } + if (((from_bitField1_ & 0x00000010) != 0)) { + result.isGray_ = isGray_; + } + if (((from_bitField1_ & 0x00000020) != 0)) { + result.graySchemeUrl_ = graySchemeUrl_; + } + if (((from_bitField1_ & 0x00000040) != 0)) { + result.giftScene_ = giftScene_; + } + if (((from_bitField1_ & 0x00000080) != 0)) { + triggerWords_.makeImmutable(); + result.triggerWords_ = triggerWords_; + } + if (((from_bitField1_ & 0x00000100) != 0)) { + result.forFirstRecharge_ = forFirstRecharge_; + } + if (((from_bitField1_ & 0x00000200) != 0)) { + result.dynamicImgForSelected_ = dynamicImgForSelectedBuilder_ == null + ? dynamicImgForSelected_ + : dynamicImgForSelectedBuilder_.build(); + } + if (((from_bitField1_ & 0x00000400) != 0)) { + result.afterSendAction_ = afterSendAction_; + } + if (((from_bitField1_ & 0x00000800) != 0)) { + result.giftOfflineTime_ = giftOfflineTime_; + } + if (((from_bitField1_ & 0x00001000) != 0)) { + result.topBarText_ = topBarText_; + } + if (((from_bitField1_ & 0x00002000) != 0)) { + result.topRightAvatar_ = topRightAvatarBuilder_ == null + ? topRightAvatar_ + : topRightAvatarBuilder_.build(); + } + if (((from_bitField1_ & 0x00004000) != 0)) { + result.bannerSchemeUrl_ = bannerSchemeUrl_; + } + if (((from_bitField1_ & 0x00008000) != 0)) { + result.isLocked_ = isLocked_; + } + if (((from_bitField1_ & 0x00010000) != 0)) { + result.reqExtraType_ = reqExtraType_; + } + if (((from_bitField1_ & 0x00040000) != 0)) { + result.needSweepLightCount_ = needSweepLightCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct.getDefaultInstance()) return this; + if (other.hasImage()) { + mergeImage(other.getImage()); + } + if (!other.getDescribe().isEmpty()) { + describe_ = other.describe_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getNotify() != false) { + setNotify(other.getNotify()); + } + if (other.getDuration() != 0L) { + setDuration(other.getDuration()); + } + if (other.getId() != 0L) { + setId(other.getId()); + } + if (other.getForLinkmic() != false) { + setForLinkmic(other.getForLinkmic()); + } + if (other.getDoodle() != false) { + setDoodle(other.getDoodle()); + } + if (other.getForFansclub() != false) { + setForFansclub(other.getForFansclub()); + } + if (other.getCombo() != false) { + setCombo(other.getCombo()); + } + if (other.getType() != 0) { + setType(other.getType()); + } + if (other.getDiamondCount() != 0) { + setDiamondCount(other.getDiamondCount()); + } + if (other.getIsDisplayedOnPanel() != false) { + setIsDisplayedOnPanel(other.getIsDisplayedOnPanel()); + } + if (other.getPrimaryEffectId() != 0L) { + setPrimaryEffectId(other.getPrimaryEffectId()); + } + if (other.hasGiftLabelIcon()) { + mergeGiftLabelIcon(other.getGiftLabelIcon()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00004000; + onChanged(); + } + if (!other.getRegion().isEmpty()) { + region_ = other.region_; + bitField0_ |= 0x00008000; + onChanged(); + } + if (!other.getManual().isEmpty()) { + manual_ = other.manual_; + bitField0_ |= 0x00010000; + onChanged(); + } + if (other.getForCustom() != false) { + setForCustom(other.getForCustom()); + } + internalGetMutableSpecialEffectsMap().mergeFrom( + other.internalGetSpecialEffectsMap()); + bitField0_ |= 0x00040000; + if (other.hasIcon()) { + mergeIcon(other.getIcon()); + } + if (other.getActionType() != 0) { + setActionType(other.getActionType()); + } + if (other.getWatermelonSeeds() != 0) { + setWatermelonSeeds(other.getWatermelonSeeds()); + } + if (!other.getGoldEffect().isEmpty()) { + goldEffect_ = other.goldEffect_; + bitField0_ |= 0x00400000; + onChanged(); + } + if (other.getGoldenBeans() != 0L) { + setGoldenBeans(other.getGoldenBeans()); + } + if (other.getHonorLevel() != 0L) { + setHonorLevel(other.getHonorLevel()); + } + if (other.getItemType() != 0) { + setItemType(other.getItemType()); + } + if (!other.getSchemeUrl().isEmpty()) { + schemeUrl_ = other.schemeUrl_; + bitField0_ |= 0x04000000; + onChanged(); + } + if (!other.getEventName().isEmpty()) { + eventName_ = other.eventName_; + bitField0_ |= 0x08000000; + onChanged(); + } + if (other.getNobleLevel() != 0L) { + setNobleLevel(other.getNobleLevel()); + } + if (!other.getGuideUrl().isEmpty()) { + guideUrl_ = other.guideUrl_; + bitField0_ |= 0x20000000; + onChanged(); + } + if (other.getPunishMedicine() != false) { + setPunishMedicine(other.getPunishMedicine()); + } + if (other.getForPortal() != false) { + setForPortal(other.getForPortal()); + } + if (!other.getBusinessText().isEmpty()) { + businessText_ = other.businessText_; + bitField1_ |= 0x00000001; + onChanged(); + } + if (other.getCnyGift() != false) { + setCnyGift(other.getCnyGift()); + } + if (other.getAppId() != 0L) { + setAppId(other.getAppId()); + } + if (other.getVipLevel() != 0L) { + setVipLevel(other.getVipLevel()); + } + if (other.getIsGray() != false) { + setIsGray(other.getIsGray()); + } + if (!other.getGraySchemeUrl().isEmpty()) { + graySchemeUrl_ = other.graySchemeUrl_; + bitField1_ |= 0x00000020; + onChanged(); + } + if (other.getGiftScene() != 0L) { + setGiftScene(other.getGiftScene()); + } + if (!other.triggerWords_.isEmpty()) { + if (triggerWords_.isEmpty()) { + triggerWords_ = other.triggerWords_; + bitField1_ |= 0x00000080; + } else { + ensureTriggerWordsIsMutable(); + triggerWords_.addAll(other.triggerWords_); + } + onChanged(); + } + if (other.getForFirstRecharge() != false) { + setForFirstRecharge(other.getForFirstRecharge()); + } + if (other.hasDynamicImgForSelected()) { + mergeDynamicImgForSelected(other.getDynamicImgForSelected()); + } + if (other.getAfterSendAction() != 0) { + setAfterSendAction(other.getAfterSendAction()); + } + if (other.getGiftOfflineTime() != 0L) { + setGiftOfflineTime(other.getGiftOfflineTime()); + } + if (!other.getTopBarText().isEmpty()) { + topBarText_ = other.topBarText_; + bitField1_ |= 0x00001000; + onChanged(); + } + if (other.hasTopRightAvatar()) { + mergeTopRightAvatar(other.getTopRightAvatar()); + } + if (!other.getBannerSchemeUrl().isEmpty()) { + bannerSchemeUrl_ = other.bannerSchemeUrl_; + bitField1_ |= 0x00004000; + onChanged(); + } + if (other.getIsLocked() != false) { + setIsLocked(other.getIsLocked()); + } + if (other.getReqExtraType() != 0L) { + setReqExtraType(other.getReqExtraType()); + } + if (!other.assetIds_.isEmpty()) { + if (assetIds_.isEmpty()) { + assetIds_ = other.assetIds_; + bitField1_ = (bitField1_ & ~0x00020000); + } else { + ensureAssetIdsIsMutable(); + assetIds_.addAll(other.assetIds_); + } + onChanged(); + } + if (other.getNeedSweepLightCount() != 0) { + setNeedSweepLightCount(other.getNeedSweepLightCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getImageFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + describe_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + notify_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + duration_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + id_ = input.readUInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 56: { + forLinkmic_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 56 + case 64: { + doodle_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 64 + case 72: { + forFansclub_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 72 + case 80: { + combo_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 80 + case 88: { + type_ = input.readUInt32(); + bitField0_ |= 0x00000200; + break; + } // case 88 + case 96: { + diamondCount_ = input.readUInt32(); + bitField0_ |= 0x00000400; + break; + } // case 96 + case 104: { + isDisplayedOnPanel_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 104 + case 112: { + primaryEffectId_ = input.readUInt64(); + bitField0_ |= 0x00001000; + break; + } // case 112 + case 122: { + input.readMessage( + getGiftLabelIconFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 122 + case 130: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 130 + case 138: { + region_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 138 + case 146: { + manual_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00010000; + break; + } // case 146 + case 152: { + forCustom_ = input.readBool(); + bitField0_ |= 0x00020000; + break; + } // case 152 + case 162: { + com.google.protobuf.MapEntry + specialEffectsMap__ = input.readMessage( + SpecialEffectsMapDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableSpecialEffectsMap().getMutableMap().put( + specialEffectsMap__.getKey(), specialEffectsMap__.getValue()); + bitField0_ |= 0x00040000; + break; + } // case 162 + case 170: { + input.readMessage( + getIconFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 170 + case 176: { + actionType_ = input.readUInt32(); + bitField0_ |= 0x00100000; + break; + } // case 176 + case 184: { + watermelonSeeds_ = input.readInt32(); + bitField0_ |= 0x00200000; + break; + } // case 184 + case 194: { + goldEffect_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00400000; + break; + } // case 194 + case 208: { + goldenBeans_ = input.readInt64(); + bitField0_ |= 0x00800000; + break; + } // case 208 + case 216: { + honorLevel_ = input.readInt64(); + bitField0_ |= 0x01000000; + break; + } // case 216 + case 224: { + itemType_ = input.readInt32(); + bitField0_ |= 0x02000000; + break; + } // case 224 + case 234: { + schemeUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x04000000; + break; + } // case 234 + case 250: { + eventName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x08000000; + break; + } // case 250 + case 256: { + nobleLevel_ = input.readInt64(); + bitField0_ |= 0x10000000; + break; + } // case 256 + case 266: { + guideUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x20000000; + break; + } // case 266 + case 272: { + punishMedicine_ = input.readBool(); + bitField0_ |= 0x40000000; + break; + } // case 272 + case 280: { + forPortal_ = input.readBool(); + bitField0_ |= 0x80000000; + break; + } // case 280 + case 290: { + businessText_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000001; + break; + } // case 290 + case 296: { + cnyGift_ = input.readBool(); + bitField1_ |= 0x00000002; + break; + } // case 296 + case 304: { + appId_ = input.readInt64(); + bitField1_ |= 0x00000004; + break; + } // case 304 + case 312: { + vipLevel_ = input.readInt64(); + bitField1_ |= 0x00000008; + break; + } // case 312 + case 320: { + isGray_ = input.readBool(); + bitField1_ |= 0x00000010; + break; + } // case 320 + case 330: { + graySchemeUrl_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000020; + break; + } // case 330 + case 336: { + giftScene_ = input.readInt64(); + bitField1_ |= 0x00000040; + break; + } // case 336 + case 354: { + java.lang.String s = input.readStringRequireUtf8(); + ensureTriggerWordsIsMutable(); + triggerWords_.add(s); + break; + } // case 354 + case 368: { + forFirstRecharge_ = input.readBool(); + bitField1_ |= 0x00000100; + break; + } // case 368 + case 378: { + input.readMessage( + getDynamicImgForSelectedFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000200; + break; + } // case 378 + case 384: { + afterSendAction_ = input.readInt32(); + bitField1_ |= 0x00000400; + break; + } // case 384 + case 392: { + giftOfflineTime_ = input.readInt64(); + bitField1_ |= 0x00000800; + break; + } // case 392 + case 402: { + topBarText_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00001000; + break; + } // case 402 + case 410: { + input.readMessage( + getTopRightAvatarFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00002000; + break; + } // case 410 + case 418: { + bannerSchemeUrl_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00004000; + break; + } // case 418 + case 424: { + isLocked_ = input.readBool(); + bitField1_ |= 0x00008000; + break; + } // case 424 + case 432: { + reqExtraType_ = input.readInt64(); + bitField1_ |= 0x00010000; + break; + } // case 432 + case 440: { + long v = input.readInt64(); + ensureAssetIdsIsMutable(); + assetIds_.addLong(v); + break; + } // case 440 + case 442: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureAssetIdsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + assetIds_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 442 + case 464: { + needSweepLightCount_ = input.readInt32(); + bitField1_ |= 0x00040000; + break; + } // case 464 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + private int bitField1_; + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image image_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> imageBuilder_; + /** + * .Image image = 1; + * @return Whether the image field is set. + */ + public boolean hasImage() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .Image image = 1; + * @return The image. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getImage() { + if (imageBuilder_ == null) { + return image_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : image_; + } else { + return imageBuilder_.getMessage(); + } + } + /** + * .Image image = 1; + */ + public Builder setImage(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (imageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + image_ = value; + } else { + imageBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Image image = 1; + */ + public Builder setImage( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (imageBuilder_ == null) { + image_ = builderForValue.build(); + } else { + imageBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Image image = 1; + */ + public Builder mergeImage(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (imageBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + image_ != null && + image_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getImageBuilder().mergeFrom(value); + } else { + image_ = value; + } + } else { + imageBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Image image = 1; + */ + public Builder clearImage() { + bitField0_ = (bitField0_ & ~0x00000001); + image_ = null; + if (imageBuilder_ != null) { + imageBuilder_.dispose(); + imageBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image image = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getImageBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getImageFieldBuilder().getBuilder(); + } + /** + * .Image image = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImageOrBuilder() { + if (imageBuilder_ != null) { + return imageBuilder_.getMessageOrBuilder(); + } else { + return image_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : image_; + } + } + /** + * .Image image = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getImageFieldBuilder() { + if (imageBuilder_ == null) { + imageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getImage(), + getParentForChildren(), + isClean()); + image_ = null; + } + return imageBuilder_; + } + + private java.lang.Object describe_ = ""; + /** + * string describe = 2; + * @return The describe. + */ + public java.lang.String getDescribe() { + java.lang.Object ref = describe_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + describe_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string describe = 2; + * @return The bytes for describe. + */ + public com.google.protobuf.ByteString + getDescribeBytes() { + java.lang.Object ref = describe_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + describe_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string describe = 2; + * @param value The describe to set. + * @return This builder for chaining. + */ + public Builder setDescribe( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + describe_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string describe = 2; + * @return This builder for chaining. + */ + public Builder clearDescribe() { + describe_ = getDefaultInstance().getDescribe(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string describe = 2; + * @param value The bytes for describe to set. + * @return This builder for chaining. + */ + public Builder setDescribeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + describe_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean notify_ ; + /** + * bool notify = 3; + * @return The notify. + */ + @java.lang.Override + public boolean getNotify() { + return notify_; + } + /** + * bool notify = 3; + * @param value The notify to set. + * @return This builder for chaining. + */ + public Builder setNotify(boolean value) { + + notify_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * bool notify = 3; + * @return This builder for chaining. + */ + public Builder clearNotify() { + bitField0_ = (bitField0_ & ~0x00000004); + notify_ = false; + onChanged(); + return this; + } + + private long duration_ ; + /** + * uint64 duration = 4; + * @return The duration. + */ + @java.lang.Override + public long getDuration() { + return duration_; + } + /** + * uint64 duration = 4; + * @param value The duration to set. + * @return This builder for chaining. + */ + public Builder setDuration(long value) { + + duration_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint64 duration = 4; + * @return This builder for chaining. + */ + public Builder clearDuration() { + bitField0_ = (bitField0_ & ~0x00000008); + duration_ = 0L; + onChanged(); + return this; + } + + private long id_ ; + /** + * uint64 id = 5; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + * uint64 id = 5; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * uint64 id = 5; + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000010); + id_ = 0L; + onChanged(); + return this; + } + + private boolean forLinkmic_ ; + /** + *
+       * GiftStructFansClubInfo fansclubInfo = 6;
+       * 
+ * + * bool for_linkmic = 7; + * @return The forLinkmic. + */ + @java.lang.Override + public boolean getForLinkmic() { + return forLinkmic_; + } + /** + *
+       * GiftStructFansClubInfo fansclubInfo = 6;
+       * 
+ * + * bool for_linkmic = 7; + * @param value The forLinkmic to set. + * @return This builder for chaining. + */ + public Builder setForLinkmic(boolean value) { + + forLinkmic_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+       * GiftStructFansClubInfo fansclubInfo = 6;
+       * 
+ * + * bool for_linkmic = 7; + * @return This builder for chaining. + */ + public Builder clearForLinkmic() { + bitField0_ = (bitField0_ & ~0x00000020); + forLinkmic_ = false; + onChanged(); + return this; + } + + private boolean doodle_ ; + /** + * bool doodle = 8; + * @return The doodle. + */ + @java.lang.Override + public boolean getDoodle() { + return doodle_; + } + /** + * bool doodle = 8; + * @param value The doodle to set. + * @return This builder for chaining. + */ + public Builder setDoodle(boolean value) { + + doodle_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * bool doodle = 8; + * @return This builder for chaining. + */ + public Builder clearDoodle() { + bitField0_ = (bitField0_ & ~0x00000040); + doodle_ = false; + onChanged(); + return this; + } + + private boolean forFansclub_ ; + /** + * bool for_fansclub = 9; + * @return The forFansclub. + */ + @java.lang.Override + public boolean getForFansclub() { + return forFansclub_; + } + /** + * bool for_fansclub = 9; + * @param value The forFansclub to set. + * @return This builder for chaining. + */ + public Builder setForFansclub(boolean value) { + + forFansclub_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * bool for_fansclub = 9; + * @return This builder for chaining. + */ + public Builder clearForFansclub() { + bitField0_ = (bitField0_ & ~0x00000080); + forFansclub_ = false; + onChanged(); + return this; + } + + private boolean combo_ ; + /** + * bool combo = 10; + * @return The combo. + */ + @java.lang.Override + public boolean getCombo() { + return combo_; + } + /** + * bool combo = 10; + * @param value The combo to set. + * @return This builder for chaining. + */ + public Builder setCombo(boolean value) { + + combo_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * bool combo = 10; + * @return This builder for chaining. + */ + public Builder clearCombo() { + bitField0_ = (bitField0_ & ~0x00000100); + combo_ = false; + onChanged(); + return this; + } + + private int type_ ; + /** + * uint32 type = 11; + * @return The type. + */ + @java.lang.Override + public int getType() { + return type_; + } + /** + * uint32 type = 11; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(int value) { + + type_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * uint32 type = 11; + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000200); + type_ = 0; + onChanged(); + return this; + } + + private int diamondCount_ ; + /** + * uint32 diamond_count = 12; + * @return The diamondCount. + */ + @java.lang.Override + public int getDiamondCount() { + return diamondCount_; + } + /** + * uint32 diamond_count = 12; + * @param value The diamondCount to set. + * @return This builder for chaining. + */ + public Builder setDiamondCount(int value) { + + diamondCount_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * uint32 diamond_count = 12; + * @return This builder for chaining. + */ + public Builder clearDiamondCount() { + bitField0_ = (bitField0_ & ~0x00000400); + diamondCount_ = 0; + onChanged(); + return this; + } + + private boolean isDisplayedOnPanel_ ; + /** + * bool is_displayed_on_panel = 13; + * @return The isDisplayedOnPanel. + */ + @java.lang.Override + public boolean getIsDisplayedOnPanel() { + return isDisplayedOnPanel_; + } + /** + * bool is_displayed_on_panel = 13; + * @param value The isDisplayedOnPanel to set. + * @return This builder for chaining. + */ + public Builder setIsDisplayedOnPanel(boolean value) { + + isDisplayedOnPanel_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * bool is_displayed_on_panel = 13; + * @return This builder for chaining. + */ + public Builder clearIsDisplayedOnPanel() { + bitField0_ = (bitField0_ & ~0x00000800); + isDisplayedOnPanel_ = false; + onChanged(); + return this; + } + + private long primaryEffectId_ ; + /** + * uint64 primary_effect_id = 14; + * @return The primaryEffectId. + */ + @java.lang.Override + public long getPrimaryEffectId() { + return primaryEffectId_; + } + /** + * uint64 primary_effect_id = 14; + * @param value The primaryEffectId to set. + * @return This builder for chaining. + */ + public Builder setPrimaryEffectId(long value) { + + primaryEffectId_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * uint64 primary_effect_id = 14; + * @return This builder for chaining. + */ + public Builder clearPrimaryEffectId() { + bitField0_ = (bitField0_ & ~0x00001000); + primaryEffectId_ = 0L; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image giftLabelIcon_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> giftLabelIconBuilder_; + /** + * .Image gift_label_icon = 15; + * @return Whether the giftLabelIcon field is set. + */ + public boolean hasGiftLabelIcon() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * .Image gift_label_icon = 15; + * @return The giftLabelIcon. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getGiftLabelIcon() { + if (giftLabelIconBuilder_ == null) { + return giftLabelIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : giftLabelIcon_; + } else { + return giftLabelIconBuilder_.getMessage(); + } + } + /** + * .Image gift_label_icon = 15; + */ + public Builder setGiftLabelIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (giftLabelIconBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + giftLabelIcon_ = value; + } else { + giftLabelIconBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * .Image gift_label_icon = 15; + */ + public Builder setGiftLabelIcon( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (giftLabelIconBuilder_ == null) { + giftLabelIcon_ = builderForValue.build(); + } else { + giftLabelIconBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * .Image gift_label_icon = 15; + */ + public Builder mergeGiftLabelIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (giftLabelIconBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) && + giftLabelIcon_ != null && + giftLabelIcon_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getGiftLabelIconBuilder().mergeFrom(value); + } else { + giftLabelIcon_ = value; + } + } else { + giftLabelIconBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * .Image gift_label_icon = 15; + */ + public Builder clearGiftLabelIcon() { + bitField0_ = (bitField0_ & ~0x00002000); + giftLabelIcon_ = null; + if (giftLabelIconBuilder_ != null) { + giftLabelIconBuilder_.dispose(); + giftLabelIconBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image gift_label_icon = 15; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getGiftLabelIconBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getGiftLabelIconFieldBuilder().getBuilder(); + } + /** + * .Image gift_label_icon = 15; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getGiftLabelIconOrBuilder() { + if (giftLabelIconBuilder_ != null) { + return giftLabelIconBuilder_.getMessageOrBuilder(); + } else { + return giftLabelIcon_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : giftLabelIcon_; + } + } + /** + * .Image gift_label_icon = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getGiftLabelIconFieldBuilder() { + if (giftLabelIconBuilder_ == null) { + giftLabelIconBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getGiftLabelIcon(), + getParentForChildren(), + isClean()); + giftLabelIcon_ = null; + } + return giftLabelIconBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * string name = 16; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string name = 16; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string name = 16; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * string name = 16; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + /** + * string name = 16; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + private java.lang.Object region_ = ""; + /** + * string region = 17; + * @return The region. + */ + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string region = 17; + * @return The bytes for region. + */ + public com.google.protobuf.ByteString + getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string region = 17; + * @param value The region to set. + * @return This builder for chaining. + */ + public Builder setRegion( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + region_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * string region = 17; + * @return This builder for chaining. + */ + public Builder clearRegion() { + region_ = getDefaultInstance().getRegion(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + /** + * string region = 17; + * @param value The bytes for region to set. + * @return This builder for chaining. + */ + public Builder setRegionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + region_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private java.lang.Object manual_ = ""; + /** + * string manual = 18; + * @return The manual. + */ + public java.lang.String getManual() { + java.lang.Object ref = manual_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + manual_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string manual = 18; + * @return The bytes for manual. + */ + public com.google.protobuf.ByteString + getManualBytes() { + java.lang.Object ref = manual_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + manual_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string manual = 18; + * @param value The manual to set. + * @return This builder for chaining. + */ + public Builder setManual( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + manual_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * string manual = 18; + * @return This builder for chaining. + */ + public Builder clearManual() { + manual_ = getDefaultInstance().getManual(); + bitField0_ = (bitField0_ & ~0x00010000); + onChanged(); + return this; + } + /** + * string manual = 18; + * @param value The bytes for manual to set. + * @return This builder for chaining. + */ + public Builder setManualBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + manual_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + private boolean forCustom_ ; + /** + * bool for_custom = 19; + * @return The forCustom. + */ + @java.lang.Override + public boolean getForCustom() { + return forCustom_; + } + /** + * bool for_custom = 19; + * @param value The forCustom to set. + * @return This builder for chaining. + */ + public Builder setForCustom(boolean value) { + + forCustom_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * bool for_custom = 19; + * @return This builder for chaining. + */ + public Builder clearForCustom() { + bitField0_ = (bitField0_ & ~0x00020000); + forCustom_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.Long> specialEffectsMap_; + private com.google.protobuf.MapField + internalGetSpecialEffectsMap() { + if (specialEffectsMap_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SpecialEffectsMapDefaultEntryHolder.defaultEntry); + } + return specialEffectsMap_; + } + private com.google.protobuf.MapField + internalGetMutableSpecialEffectsMap() { + if (specialEffectsMap_ == null) { + specialEffectsMap_ = com.google.protobuf.MapField.newMapField( + SpecialEffectsMapDefaultEntryHolder.defaultEntry); + } + if (!specialEffectsMap_.isMutable()) { + specialEffectsMap_ = specialEffectsMap_.copy(); + } + bitField0_ |= 0x00040000; + onChanged(); + return specialEffectsMap_; + } + public int getSpecialEffectsMapCount() { + return internalGetSpecialEffectsMap().getMap().size(); + } + /** + * map<string, int64> specialEffectsMap = 20; + */ + @java.lang.Override + public boolean containsSpecialEffectsMap( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetSpecialEffectsMap().getMap().containsKey(key); + } + /** + * Use {@link #getSpecialEffectsMapMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSpecialEffectsMap() { + return getSpecialEffectsMapMap(); + } + /** + * map<string, int64> specialEffectsMap = 20; + */ + @java.lang.Override + public java.util.Map getSpecialEffectsMapMap() { + return internalGetSpecialEffectsMap().getMap(); + } + /** + * map<string, int64> specialEffectsMap = 20; + */ + @java.lang.Override + public long getSpecialEffectsMapOrDefault( + java.lang.String key, + long defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSpecialEffectsMap().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, int64> specialEffectsMap = 20; + */ + @java.lang.Override + public long getSpecialEffectsMapOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSpecialEffectsMap().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearSpecialEffectsMap() { + bitField0_ = (bitField0_ & ~0x00040000); + internalGetMutableSpecialEffectsMap().getMutableMap() + .clear(); + return this; + } + /** + * map<string, int64> specialEffectsMap = 20; + */ + public Builder removeSpecialEffectsMap( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableSpecialEffectsMap().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableSpecialEffectsMap() { + bitField0_ |= 0x00040000; + return internalGetMutableSpecialEffectsMap().getMutableMap(); + } + /** + * map<string, int64> specialEffectsMap = 20; + */ + public Builder putSpecialEffectsMap( + java.lang.String key, + long value) { + if (key == null) { throw new NullPointerException("map key"); } + + internalGetMutableSpecialEffectsMap().getMutableMap() + .put(key, value); + bitField0_ |= 0x00040000; + return this; + } + /** + * map<string, int64> specialEffectsMap = 20; + */ + public Builder putAllSpecialEffectsMap( + java.util.Map values) { + internalGetMutableSpecialEffectsMap().getMutableMap() + .putAll(values); + bitField0_ |= 0x00040000; + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image icon_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> iconBuilder_; + /** + * .Image icon = 21; + * @return Whether the icon field is set. + */ + public boolean hasIcon() { + return ((bitField0_ & 0x00080000) != 0); + } + /** + * .Image icon = 21; + * @return The icon. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIcon() { + if (iconBuilder_ == null) { + return icon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : icon_; + } else { + return iconBuilder_.getMessage(); + } + } + /** + * .Image icon = 21; + */ + public Builder setIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (iconBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + icon_ = value; + } else { + iconBuilder_.setMessage(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * .Image icon = 21; + */ + public Builder setIcon( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (iconBuilder_ == null) { + icon_ = builderForValue.build(); + } else { + iconBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * .Image icon = 21; + */ + public Builder mergeIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (iconBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0) && + icon_ != null && + icon_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getIconBuilder().mergeFrom(value); + } else { + icon_ = value; + } + } else { + iconBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * .Image icon = 21; + */ + public Builder clearIcon() { + bitField0_ = (bitField0_ & ~0x00080000); + icon_ = null; + if (iconBuilder_ != null) { + iconBuilder_.dispose(); + iconBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image icon = 21; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getIconBuilder() { + bitField0_ |= 0x00080000; + onChanged(); + return getIconFieldBuilder().getBuilder(); + } + /** + * .Image icon = 21; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getIconOrBuilder() { + if (iconBuilder_ != null) { + return iconBuilder_.getMessageOrBuilder(); + } else { + return icon_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : icon_; + } + } + /** + * .Image icon = 21; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getIconFieldBuilder() { + if (iconBuilder_ == null) { + iconBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getIcon(), + getParentForChildren(), + isClean()); + icon_ = null; + } + return iconBuilder_; + } + + private int actionType_ ; + /** + * uint32 action_type = 22; + * @return The actionType. + */ + @java.lang.Override + public int getActionType() { + return actionType_; + } + /** + * uint32 action_type = 22; + * @param value The actionType to set. + * @return This builder for chaining. + */ + public Builder setActionType(int value) { + + actionType_ = value; + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * uint32 action_type = 22; + * @return This builder for chaining. + */ + public Builder clearActionType() { + bitField0_ = (bitField0_ & ~0x00100000); + actionType_ = 0; + onChanged(); + return this; + } + + private int watermelonSeeds_ ; + /** + * int32 watermelonSeeds = 23; + * @return The watermelonSeeds. + */ + @java.lang.Override + public int getWatermelonSeeds() { + return watermelonSeeds_; + } + /** + * int32 watermelonSeeds = 23; + * @param value The watermelonSeeds to set. + * @return This builder for chaining. + */ + public Builder setWatermelonSeeds(int value) { + + watermelonSeeds_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * int32 watermelonSeeds = 23; + * @return This builder for chaining. + */ + public Builder clearWatermelonSeeds() { + bitField0_ = (bitField0_ & ~0x00200000); + watermelonSeeds_ = 0; + onChanged(); + return this; + } + + private java.lang.Object goldEffect_ = ""; + /** + * string goldEffect = 24; + * @return The goldEffect. + */ + public java.lang.String getGoldEffect() { + java.lang.Object ref = goldEffect_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + goldEffect_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string goldEffect = 24; + * @return The bytes for goldEffect. + */ + public com.google.protobuf.ByteString + getGoldEffectBytes() { + java.lang.Object ref = goldEffect_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + goldEffect_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string goldEffect = 24; + * @param value The goldEffect to set. + * @return This builder for chaining. + */ + public Builder setGoldEffect( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + goldEffect_ = value; + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * string goldEffect = 24; + * @return This builder for chaining. + */ + public Builder clearGoldEffect() { + goldEffect_ = getDefaultInstance().getGoldEffect(); + bitField0_ = (bitField0_ & ~0x00400000); + onChanged(); + return this; + } + /** + * string goldEffect = 24; + * @param value The bytes for goldEffect to set. + * @return This builder for chaining. + */ + public Builder setGoldEffectBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + goldEffect_ = value; + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + + private long goldenBeans_ ; + /** + *
+       * repeated LuckyMoneyGiftMeta subs = 25;
+       * 
+ * + * int64 goldenBeans = 26; + * @return The goldenBeans. + */ + @java.lang.Override + public long getGoldenBeans() { + return goldenBeans_; + } + /** + *
+       * repeated LuckyMoneyGiftMeta subs = 25;
+       * 
+ * + * int64 goldenBeans = 26; + * @param value The goldenBeans to set. + * @return This builder for chaining. + */ + public Builder setGoldenBeans(long value) { + + goldenBeans_ = value; + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + *
+       * repeated LuckyMoneyGiftMeta subs = 25;
+       * 
+ * + * int64 goldenBeans = 26; + * @return This builder for chaining. + */ + public Builder clearGoldenBeans() { + bitField0_ = (bitField0_ & ~0x00800000); + goldenBeans_ = 0L; + onChanged(); + return this; + } + + private long honorLevel_ ; + /** + * int64 honorLevel = 27; + * @return The honorLevel. + */ + @java.lang.Override + public long getHonorLevel() { + return honorLevel_; + } + /** + * int64 honorLevel = 27; + * @param value The honorLevel to set. + * @return This builder for chaining. + */ + public Builder setHonorLevel(long value) { + + honorLevel_ = value; + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * int64 honorLevel = 27; + * @return This builder for chaining. + */ + public Builder clearHonorLevel() { + bitField0_ = (bitField0_ & ~0x01000000); + honorLevel_ = 0L; + onChanged(); + return this; + } + + private int itemType_ ; + /** + * int32 itemType = 28; + * @return The itemType. + */ + @java.lang.Override + public int getItemType() { + return itemType_; + } + /** + * int32 itemType = 28; + * @param value The itemType to set. + * @return This builder for chaining. + */ + public Builder setItemType(int value) { + + itemType_ = value; + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + /** + * int32 itemType = 28; + * @return This builder for chaining. + */ + public Builder clearItemType() { + bitField0_ = (bitField0_ & ~0x02000000); + itemType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object schemeUrl_ = ""; + /** + * string schemeUrl = 29; + * @return The schemeUrl. + */ + public java.lang.String getSchemeUrl() { + java.lang.Object ref = schemeUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schemeUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string schemeUrl = 29; + * @return The bytes for schemeUrl. + */ + public com.google.protobuf.ByteString + getSchemeUrlBytes() { + java.lang.Object ref = schemeUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + schemeUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string schemeUrl = 29; + * @param value The schemeUrl to set. + * @return This builder for chaining. + */ + public Builder setSchemeUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + schemeUrl_ = value; + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + /** + * string schemeUrl = 29; + * @return This builder for chaining. + */ + public Builder clearSchemeUrl() { + schemeUrl_ = getDefaultInstance().getSchemeUrl(); + bitField0_ = (bitField0_ & ~0x04000000); + onChanged(); + return this; + } + /** + * string schemeUrl = 29; + * @param value The bytes for schemeUrl to set. + * @return This builder for chaining. + */ + public Builder setSchemeUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + schemeUrl_ = value; + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + + private java.lang.Object eventName_ = ""; + /** + *
+       * GiftPanelOperation giftOperation = 30;
+       * 
+ * + * string eventName = 31; + * @return The eventName. + */ + public java.lang.String getEventName() { + java.lang.Object ref = eventName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eventName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * GiftPanelOperation giftOperation = 30;
+       * 
+ * + * string eventName = 31; + * @return The bytes for eventName. + */ + public com.google.protobuf.ByteString + getEventNameBytes() { + java.lang.Object ref = eventName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + eventName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * GiftPanelOperation giftOperation = 30;
+       * 
+ * + * string eventName = 31; + * @param value The eventName to set. + * @return This builder for chaining. + */ + public Builder setEventName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + eventName_ = value; + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + /** + *
+       * GiftPanelOperation giftOperation = 30;
+       * 
+ * + * string eventName = 31; + * @return This builder for chaining. + */ + public Builder clearEventName() { + eventName_ = getDefaultInstance().getEventName(); + bitField0_ = (bitField0_ & ~0x08000000); + onChanged(); + return this; + } + /** + *
+       * GiftPanelOperation giftOperation = 30;
+       * 
+ * + * string eventName = 31; + * @param value The bytes for eventName to set. + * @return This builder for chaining. + */ + public Builder setEventNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + eventName_ = value; + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + + private long nobleLevel_ ; + /** + * int64 nobleLevel = 32; + * @return The nobleLevel. + */ + @java.lang.Override + public long getNobleLevel() { + return nobleLevel_; + } + /** + * int64 nobleLevel = 32; + * @param value The nobleLevel to set. + * @return This builder for chaining. + */ + public Builder setNobleLevel(long value) { + + nobleLevel_ = value; + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + /** + * int64 nobleLevel = 32; + * @return This builder for chaining. + */ + public Builder clearNobleLevel() { + bitField0_ = (bitField0_ & ~0x10000000); + nobleLevel_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object guideUrl_ = ""; + /** + * string guideUrl = 33; + * @return The guideUrl. + */ + public java.lang.String getGuideUrl() { + java.lang.Object ref = guideUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + guideUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string guideUrl = 33; + * @return The bytes for guideUrl. + */ + public com.google.protobuf.ByteString + getGuideUrlBytes() { + java.lang.Object ref = guideUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + guideUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string guideUrl = 33; + * @param value The guideUrl to set. + * @return This builder for chaining. + */ + public Builder setGuideUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + guideUrl_ = value; + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + /** + * string guideUrl = 33; + * @return This builder for chaining. + */ + public Builder clearGuideUrl() { + guideUrl_ = getDefaultInstance().getGuideUrl(); + bitField0_ = (bitField0_ & ~0x20000000); + onChanged(); + return this; + } + /** + * string guideUrl = 33; + * @param value The bytes for guideUrl to set. + * @return This builder for chaining. + */ + public Builder setGuideUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + guideUrl_ = value; + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + + private boolean punishMedicine_ ; + /** + * bool punishMedicine = 34; + * @return The punishMedicine. + */ + @java.lang.Override + public boolean getPunishMedicine() { + return punishMedicine_; + } + /** + * bool punishMedicine = 34; + * @param value The punishMedicine to set. + * @return This builder for chaining. + */ + public Builder setPunishMedicine(boolean value) { + + punishMedicine_ = value; + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + /** + * bool punishMedicine = 34; + * @return This builder for chaining. + */ + public Builder clearPunishMedicine() { + bitField0_ = (bitField0_ & ~0x40000000); + punishMedicine_ = false; + onChanged(); + return this; + } + + private boolean forPortal_ ; + /** + * bool forPortal = 35; + * @return The forPortal. + */ + @java.lang.Override + public boolean getForPortal() { + return forPortal_; + } + /** + * bool forPortal = 35; + * @param value The forPortal to set. + * @return This builder for chaining. + */ + public Builder setForPortal(boolean value) { + + forPortal_ = value; + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + /** + * bool forPortal = 35; + * @return This builder for chaining. + */ + public Builder clearForPortal() { + bitField0_ = (bitField0_ & ~0x80000000); + forPortal_ = false; + onChanged(); + return this; + } + + private java.lang.Object businessText_ = ""; + /** + * string businessText = 36; + * @return The businessText. + */ + public java.lang.String getBusinessText() { + java.lang.Object ref = businessText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + businessText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string businessText = 36; + * @return The bytes for businessText. + */ + public com.google.protobuf.ByteString + getBusinessTextBytes() { + java.lang.Object ref = businessText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + businessText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string businessText = 36; + * @param value The businessText to set. + * @return This builder for chaining. + */ + public Builder setBusinessText( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + businessText_ = value; + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string businessText = 36; + * @return This builder for chaining. + */ + public Builder clearBusinessText() { + businessText_ = getDefaultInstance().getBusinessText(); + bitField1_ = (bitField1_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string businessText = 36; + * @param value The bytes for businessText to set. + * @return This builder for chaining. + */ + public Builder setBusinessTextBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + businessText_ = value; + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean cnyGift_ ; + /** + * bool cnyGift = 37; + * @return The cnyGift. + */ + @java.lang.Override + public boolean getCnyGift() { + return cnyGift_; + } + /** + * bool cnyGift = 37; + * @param value The cnyGift to set. + * @return This builder for chaining. + */ + public Builder setCnyGift(boolean value) { + + cnyGift_ = value; + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + /** + * bool cnyGift = 37; + * @return This builder for chaining. + */ + public Builder clearCnyGift() { + bitField1_ = (bitField1_ & ~0x00000002); + cnyGift_ = false; + onChanged(); + return this; + } + + private long appId_ ; + /** + * int64 appId = 38; + * @return The appId. + */ + @java.lang.Override + public long getAppId() { + return appId_; + } + /** + * int64 appId = 38; + * @param value The appId to set. + * @return This builder for chaining. + */ + public Builder setAppId(long value) { + + appId_ = value; + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 appId = 38; + * @return This builder for chaining. + */ + public Builder clearAppId() { + bitField1_ = (bitField1_ & ~0x00000004); + appId_ = 0L; + onChanged(); + return this; + } + + private long vipLevel_ ; + /** + * int64 vipLevel = 39; + * @return The vipLevel. + */ + @java.lang.Override + public long getVipLevel() { + return vipLevel_; + } + /** + * int64 vipLevel = 39; + * @param value The vipLevel to set. + * @return This builder for chaining. + */ + public Builder setVipLevel(long value) { + + vipLevel_ = value; + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int64 vipLevel = 39; + * @return This builder for chaining. + */ + public Builder clearVipLevel() { + bitField1_ = (bitField1_ & ~0x00000008); + vipLevel_ = 0L; + onChanged(); + return this; + } + + private boolean isGray_ ; + /** + * bool isGray = 40; + * @return The isGray. + */ + @java.lang.Override + public boolean getIsGray() { + return isGray_; + } + /** + * bool isGray = 40; + * @param value The isGray to set. + * @return This builder for chaining. + */ + public Builder setIsGray(boolean value) { + + isGray_ = value; + bitField1_ |= 0x00000010; + onChanged(); + return this; + } + /** + * bool isGray = 40; + * @return This builder for chaining. + */ + public Builder clearIsGray() { + bitField1_ = (bitField1_ & ~0x00000010); + isGray_ = false; + onChanged(); + return this; + } + + private java.lang.Object graySchemeUrl_ = ""; + /** + * string graySchemeUrl = 41; + * @return The graySchemeUrl. + */ + public java.lang.String getGraySchemeUrl() { + java.lang.Object ref = graySchemeUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + graySchemeUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string graySchemeUrl = 41; + * @return The bytes for graySchemeUrl. + */ + public com.google.protobuf.ByteString + getGraySchemeUrlBytes() { + java.lang.Object ref = graySchemeUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graySchemeUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string graySchemeUrl = 41; + * @param value The graySchemeUrl to set. + * @return This builder for chaining. + */ + public Builder setGraySchemeUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + graySchemeUrl_ = value; + bitField1_ |= 0x00000020; + onChanged(); + return this; + } + /** + * string graySchemeUrl = 41; + * @return This builder for chaining. + */ + public Builder clearGraySchemeUrl() { + graySchemeUrl_ = getDefaultInstance().getGraySchemeUrl(); + bitField1_ = (bitField1_ & ~0x00000020); + onChanged(); + return this; + } + /** + * string graySchemeUrl = 41; + * @param value The bytes for graySchemeUrl to set. + * @return This builder for chaining. + */ + public Builder setGraySchemeUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + graySchemeUrl_ = value; + bitField1_ |= 0x00000020; + onChanged(); + return this; + } + + private long giftScene_ ; + /** + * int64 giftScene = 42; + * @return The giftScene. + */ + @java.lang.Override + public long getGiftScene() { + return giftScene_; + } + /** + * int64 giftScene = 42; + * @param value The giftScene to set. + * @return This builder for chaining. + */ + public Builder setGiftScene(long value) { + + giftScene_ = value; + bitField1_ |= 0x00000040; + onChanged(); + return this; + } + /** + * int64 giftScene = 42; + * @return This builder for chaining. + */ + public Builder clearGiftScene() { + bitField1_ = (bitField1_ & ~0x00000040); + giftScene_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList triggerWords_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureTriggerWordsIsMutable() { + if (!triggerWords_.isModifiable()) { + triggerWords_ = new com.google.protobuf.LazyStringArrayList(triggerWords_); + } + bitField1_ |= 0x00000080; + } + /** + *
+       * GiftBanner giftBanner = 43;
+       * 
+ * + * repeated string triggerWords = 44; + * @return A list containing the triggerWords. + */ + public com.google.protobuf.ProtocolStringList + getTriggerWordsList() { + triggerWords_.makeImmutable(); + return triggerWords_; + } + /** + *
+       * GiftBanner giftBanner = 43;
+       * 
+ * + * repeated string triggerWords = 44; + * @return The count of triggerWords. + */ + public int getTriggerWordsCount() { + return triggerWords_.size(); + } + /** + *
+       * GiftBanner giftBanner = 43;
+       * 
+ * + * repeated string triggerWords = 44; + * @param index The index of the element to return. + * @return The triggerWords at the given index. + */ + public java.lang.String getTriggerWords(int index) { + return triggerWords_.get(index); + } + /** + *
+       * GiftBanner giftBanner = 43;
+       * 
+ * + * repeated string triggerWords = 44; + * @param index The index of the value to return. + * @return The bytes of the triggerWords at the given index. + */ + public com.google.protobuf.ByteString + getTriggerWordsBytes(int index) { + return triggerWords_.getByteString(index); + } + /** + *
+       * GiftBanner giftBanner = 43;
+       * 
+ * + * repeated string triggerWords = 44; + * @param index The index to set the value at. + * @param value The triggerWords to set. + * @return This builder for chaining. + */ + public Builder setTriggerWords( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureTriggerWordsIsMutable(); + triggerWords_.set(index, value); + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+       * GiftBanner giftBanner = 43;
+       * 
+ * + * repeated string triggerWords = 44; + * @param value The triggerWords to add. + * @return This builder for chaining. + */ + public Builder addTriggerWords( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureTriggerWordsIsMutable(); + triggerWords_.add(value); + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+       * GiftBanner giftBanner = 43;
+       * 
+ * + * repeated string triggerWords = 44; + * @param values The triggerWords to add. + * @return This builder for chaining. + */ + public Builder addAllTriggerWords( + java.lang.Iterable values) { + ensureTriggerWordsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, triggerWords_); + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+       * GiftBanner giftBanner = 43;
+       * 
+ * + * repeated string triggerWords = 44; + * @return This builder for chaining. + */ + public Builder clearTriggerWords() { + triggerWords_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField1_ = (bitField1_ & ~0x00000080);; + onChanged(); + return this; + } + /** + *
+       * GiftBanner giftBanner = 43;
+       * 
+ * + * repeated string triggerWords = 44; + * @param value The bytes of the triggerWords to add. + * @return This builder for chaining. + */ + public Builder addTriggerWordsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureTriggerWordsIsMutable(); + triggerWords_.add(value); + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + + private boolean forFirstRecharge_ ; + /** + *
+       * repeated GiftBuffInfo giftBuffInfos = 45;
+       * 
+ * + * bool forFirstRecharge = 46; + * @return The forFirstRecharge. + */ + @java.lang.Override + public boolean getForFirstRecharge() { + return forFirstRecharge_; + } + /** + *
+       * repeated GiftBuffInfo giftBuffInfos = 45;
+       * 
+ * + * bool forFirstRecharge = 46; + * @param value The forFirstRecharge to set. + * @return This builder for chaining. + */ + public Builder setForFirstRecharge(boolean value) { + + forFirstRecharge_ = value; + bitField1_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
+       * repeated GiftBuffInfo giftBuffInfos = 45;
+       * 
+ * + * bool forFirstRecharge = 46; + * @return This builder for chaining. + */ + public Builder clearForFirstRecharge() { + bitField1_ = (bitField1_ & ~0x00000100); + forFirstRecharge_ = false; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image dynamicImgForSelected_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> dynamicImgForSelectedBuilder_; + /** + * .Image dynamicImgForSelected = 47; + * @return Whether the dynamicImgForSelected field is set. + */ + public boolean hasDynamicImgForSelected() { + return ((bitField1_ & 0x00000200) != 0); + } + /** + * .Image dynamicImgForSelected = 47; + * @return The dynamicImgForSelected. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getDynamicImgForSelected() { + if (dynamicImgForSelectedBuilder_ == null) { + return dynamicImgForSelected_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : dynamicImgForSelected_; + } else { + return dynamicImgForSelectedBuilder_.getMessage(); + } + } + /** + * .Image dynamicImgForSelected = 47; + */ + public Builder setDynamicImgForSelected(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (dynamicImgForSelectedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dynamicImgForSelected_ = value; + } else { + dynamicImgForSelectedBuilder_.setMessage(value); + } + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .Image dynamicImgForSelected = 47; + */ + public Builder setDynamicImgForSelected( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (dynamicImgForSelectedBuilder_ == null) { + dynamicImgForSelected_ = builderForValue.build(); + } else { + dynamicImgForSelectedBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .Image dynamicImgForSelected = 47; + */ + public Builder mergeDynamicImgForSelected(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (dynamicImgForSelectedBuilder_ == null) { + if (((bitField1_ & 0x00000200) != 0) && + dynamicImgForSelected_ != null && + dynamicImgForSelected_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getDynamicImgForSelectedBuilder().mergeFrom(value); + } else { + dynamicImgForSelected_ = value; + } + } else { + dynamicImgForSelectedBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .Image dynamicImgForSelected = 47; + */ + public Builder clearDynamicImgForSelected() { + bitField1_ = (bitField1_ & ~0x00000200); + dynamicImgForSelected_ = null; + if (dynamicImgForSelectedBuilder_ != null) { + dynamicImgForSelectedBuilder_.dispose(); + dynamicImgForSelectedBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image dynamicImgForSelected = 47; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getDynamicImgForSelectedBuilder() { + bitField1_ |= 0x00000200; + onChanged(); + return getDynamicImgForSelectedFieldBuilder().getBuilder(); + } + /** + * .Image dynamicImgForSelected = 47; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getDynamicImgForSelectedOrBuilder() { + if (dynamicImgForSelectedBuilder_ != null) { + return dynamicImgForSelectedBuilder_.getMessageOrBuilder(); + } else { + return dynamicImgForSelected_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : dynamicImgForSelected_; + } + } + /** + * .Image dynamicImgForSelected = 47; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getDynamicImgForSelectedFieldBuilder() { + if (dynamicImgForSelectedBuilder_ == null) { + dynamicImgForSelectedBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getDynamicImgForSelected(), + getParentForChildren(), + isClean()); + dynamicImgForSelected_ = null; + } + return dynamicImgForSelectedBuilder_; + } + + private int afterSendAction_ ; + /** + * int32 afterSendAction = 48; + * @return The afterSendAction. + */ + @java.lang.Override + public int getAfterSendAction() { + return afterSendAction_; + } + /** + * int32 afterSendAction = 48; + * @param value The afterSendAction to set. + * @return This builder for chaining. + */ + public Builder setAfterSendAction(int value) { + + afterSendAction_ = value; + bitField1_ |= 0x00000400; + onChanged(); + return this; + } + /** + * int32 afterSendAction = 48; + * @return This builder for chaining. + */ + public Builder clearAfterSendAction() { + bitField1_ = (bitField1_ & ~0x00000400); + afterSendAction_ = 0; + onChanged(); + return this; + } + + private long giftOfflineTime_ ; + /** + * int64 giftOfflineTime = 49; + * @return The giftOfflineTime. + */ + @java.lang.Override + public long getGiftOfflineTime() { + return giftOfflineTime_; + } + /** + * int64 giftOfflineTime = 49; + * @param value The giftOfflineTime to set. + * @return This builder for chaining. + */ + public Builder setGiftOfflineTime(long value) { + + giftOfflineTime_ = value; + bitField1_ |= 0x00000800; + onChanged(); + return this; + } + /** + * int64 giftOfflineTime = 49; + * @return This builder for chaining. + */ + public Builder clearGiftOfflineTime() { + bitField1_ = (bitField1_ & ~0x00000800); + giftOfflineTime_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object topBarText_ = ""; + /** + * string topBarText = 50; + * @return The topBarText. + */ + public java.lang.String getTopBarText() { + java.lang.Object ref = topBarText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topBarText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string topBarText = 50; + * @return The bytes for topBarText. + */ + public com.google.protobuf.ByteString + getTopBarTextBytes() { + java.lang.Object ref = topBarText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topBarText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string topBarText = 50; + * @param value The topBarText to set. + * @return This builder for chaining. + */ + public Builder setTopBarText( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + topBarText_ = value; + bitField1_ |= 0x00001000; + onChanged(); + return this; + } + /** + * string topBarText = 50; + * @return This builder for chaining. + */ + public Builder clearTopBarText() { + topBarText_ = getDefaultInstance().getTopBarText(); + bitField1_ = (bitField1_ & ~0x00001000); + onChanged(); + return this; + } + /** + * string topBarText = 50; + * @param value The bytes for topBarText to set. + * @return This builder for chaining. + */ + public Builder setTopBarTextBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + topBarText_ = value; + bitField1_ |= 0x00001000; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image topRightAvatar_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> topRightAvatarBuilder_; + /** + * .Image topRightAvatar = 51; + * @return Whether the topRightAvatar field is set. + */ + public boolean hasTopRightAvatar() { + return ((bitField1_ & 0x00002000) != 0); + } + /** + * .Image topRightAvatar = 51; + * @return The topRightAvatar. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getTopRightAvatar() { + if (topRightAvatarBuilder_ == null) { + return topRightAvatar_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : topRightAvatar_; + } else { + return topRightAvatarBuilder_.getMessage(); + } + } + /** + * .Image topRightAvatar = 51; + */ + public Builder setTopRightAvatar(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (topRightAvatarBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + topRightAvatar_ = value; + } else { + topRightAvatarBuilder_.setMessage(value); + } + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + /** + * .Image topRightAvatar = 51; + */ + public Builder setTopRightAvatar( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (topRightAvatarBuilder_ == null) { + topRightAvatar_ = builderForValue.build(); + } else { + topRightAvatarBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + /** + * .Image topRightAvatar = 51; + */ + public Builder mergeTopRightAvatar(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (topRightAvatarBuilder_ == null) { + if (((bitField1_ & 0x00002000) != 0) && + topRightAvatar_ != null && + topRightAvatar_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getTopRightAvatarBuilder().mergeFrom(value); + } else { + topRightAvatar_ = value; + } + } else { + topRightAvatarBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + /** + * .Image topRightAvatar = 51; + */ + public Builder clearTopRightAvatar() { + bitField1_ = (bitField1_ & ~0x00002000); + topRightAvatar_ = null; + if (topRightAvatarBuilder_ != null) { + topRightAvatarBuilder_.dispose(); + topRightAvatarBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image topRightAvatar = 51; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getTopRightAvatarBuilder() { + bitField1_ |= 0x00002000; + onChanged(); + return getTopRightAvatarFieldBuilder().getBuilder(); + } + /** + * .Image topRightAvatar = 51; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getTopRightAvatarOrBuilder() { + if (topRightAvatarBuilder_ != null) { + return topRightAvatarBuilder_.getMessageOrBuilder(); + } else { + return topRightAvatar_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : topRightAvatar_; + } + } + /** + * .Image topRightAvatar = 51; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getTopRightAvatarFieldBuilder() { + if (topRightAvatarBuilder_ == null) { + topRightAvatarBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getTopRightAvatar(), + getParentForChildren(), + isClean()); + topRightAvatar_ = null; + } + return topRightAvatarBuilder_; + } + + private java.lang.Object bannerSchemeUrl_ = ""; + /** + * string bannerSchemeUrl = 52; + * @return The bannerSchemeUrl. + */ + public java.lang.String getBannerSchemeUrl() { + java.lang.Object ref = bannerSchemeUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bannerSchemeUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string bannerSchemeUrl = 52; + * @return The bytes for bannerSchemeUrl. + */ + public com.google.protobuf.ByteString + getBannerSchemeUrlBytes() { + java.lang.Object ref = bannerSchemeUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + bannerSchemeUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string bannerSchemeUrl = 52; + * @param value The bannerSchemeUrl to set. + * @return This builder for chaining. + */ + public Builder setBannerSchemeUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + bannerSchemeUrl_ = value; + bitField1_ |= 0x00004000; + onChanged(); + return this; + } + /** + * string bannerSchemeUrl = 52; + * @return This builder for chaining. + */ + public Builder clearBannerSchemeUrl() { + bannerSchemeUrl_ = getDefaultInstance().getBannerSchemeUrl(); + bitField1_ = (bitField1_ & ~0x00004000); + onChanged(); + return this; + } + /** + * string bannerSchemeUrl = 52; + * @param value The bytes for bannerSchemeUrl to set. + * @return This builder for chaining. + */ + public Builder setBannerSchemeUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + bannerSchemeUrl_ = value; + bitField1_ |= 0x00004000; + onChanged(); + return this; + } + + private boolean isLocked_ ; + /** + * bool isLocked = 53; + * @return The isLocked. + */ + @java.lang.Override + public boolean getIsLocked() { + return isLocked_; + } + /** + * bool isLocked = 53; + * @param value The isLocked to set. + * @return This builder for chaining. + */ + public Builder setIsLocked(boolean value) { + + isLocked_ = value; + bitField1_ |= 0x00008000; + onChanged(); + return this; + } + /** + * bool isLocked = 53; + * @return This builder for chaining. + */ + public Builder clearIsLocked() { + bitField1_ = (bitField1_ & ~0x00008000); + isLocked_ = false; + onChanged(); + return this; + } + + private long reqExtraType_ ; + /** + * int64 reqExtraType = 54; + * @return The reqExtraType. + */ + @java.lang.Override + public long getReqExtraType() { + return reqExtraType_; + } + /** + * int64 reqExtraType = 54; + * @param value The reqExtraType to set. + * @return This builder for chaining. + */ + public Builder setReqExtraType(long value) { + + reqExtraType_ = value; + bitField1_ |= 0x00010000; + onChanged(); + return this; + } + /** + * int64 reqExtraType = 54; + * @return This builder for chaining. + */ + public Builder clearReqExtraType() { + bitField1_ = (bitField1_ & ~0x00010000); + reqExtraType_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList assetIds_ = emptyLongList(); + private void ensureAssetIdsIsMutable() { + if (!((bitField1_ & 0x00020000) != 0)) { + assetIds_ = mutableCopy(assetIds_); + bitField1_ |= 0x00020000; + } + } + /** + * repeated int64 assetIds = 55; + * @return A list containing the assetIds. + */ + public java.util.List + getAssetIdsList() { + return ((bitField1_ & 0x00020000) != 0) ? + java.util.Collections.unmodifiableList(assetIds_) : assetIds_; + } + /** + * repeated int64 assetIds = 55; + * @return The count of assetIds. + */ + public int getAssetIdsCount() { + return assetIds_.size(); + } + /** + * repeated int64 assetIds = 55; + * @param index The index of the element to return. + * @return The assetIds at the given index. + */ + public long getAssetIds(int index) { + return assetIds_.getLong(index); + } + /** + * repeated int64 assetIds = 55; + * @param index The index to set the value at. + * @param value The assetIds to set. + * @return This builder for chaining. + */ + public Builder setAssetIds( + int index, long value) { + + ensureAssetIdsIsMutable(); + assetIds_.setLong(index, value); + onChanged(); + return this; + } + /** + * repeated int64 assetIds = 55; + * @param value The assetIds to add. + * @return This builder for chaining. + */ + public Builder addAssetIds(long value) { + + ensureAssetIdsIsMutable(); + assetIds_.addLong(value); + onChanged(); + return this; + } + /** + * repeated int64 assetIds = 55; + * @param values The assetIds to add. + * @return This builder for chaining. + */ + public Builder addAllAssetIds( + java.lang.Iterable values) { + ensureAssetIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, assetIds_); + onChanged(); + return this; + } + /** + * repeated int64 assetIds = 55; + * @return This builder for chaining. + */ + public Builder clearAssetIds() { + assetIds_ = emptyLongList(); + bitField1_ = (bitField1_ & ~0x00020000); + onChanged(); + return this; + } + + private int needSweepLightCount_ ; + /** + *
+       * GiftPreviewInfo giftPreviewInfo = 56;
+       * GiftTip giftTip = 57;
+       * 
+ * + * int32 needSweepLightCount = 58; + * @return The needSweepLightCount. + */ + @java.lang.Override + public int getNeedSweepLightCount() { + return needSweepLightCount_; + } + /** + *
+       * GiftPreviewInfo giftPreviewInfo = 56;
+       * GiftTip giftTip = 57;
+       * 
+ * + * int32 needSweepLightCount = 58; + * @param value The needSweepLightCount to set. + * @return This builder for chaining. + */ + public Builder setNeedSweepLightCount(int value) { + + needSweepLightCount_ = value; + bitField1_ |= 0x00040000; + onChanged(); + return this; + } + /** + *
+       * GiftPreviewInfo giftPreviewInfo = 56;
+       * GiftTip giftTip = 57;
+       * 
+ * + * int32 needSweepLightCount = 58; + * @return This builder for chaining. + */ + public Builder clearNeedSweepLightCount() { + bitField1_ = (bitField1_ & ~0x00040000); + needSweepLightCount_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:GiftStruct) + } + + // @@protoc_insertion_point(class_scope:GiftStruct) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GiftStruct parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.GiftStructOuterClass.GiftStruct getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_GiftStruct_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_GiftStruct_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_GiftStruct_SpecialEffectsMapEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_GiftStruct_SpecialEffectsMapEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\020GiftStruct.proto\032\013Image.proto\"\241\t\n\nGift" + + "Struct\022\025\n\005image\030\001 \001(\0132\006.Image\022\020\n\010describ" + + "e\030\002 \001(\t\022\016\n\006notify\030\003 \001(\010\022\020\n\010duration\030\004 \001(" + + "\004\022\n\n\002id\030\005 \001(\004\022\023\n\013for_linkmic\030\007 \001(\010\022\016\n\006do" + + "odle\030\010 \001(\010\022\024\n\014for_fansclub\030\t \001(\010\022\r\n\005comb" + + "o\030\n \001(\010\022\014\n\004type\030\013 \001(\r\022\025\n\rdiamond_count\030\014" + + " \001(\r\022\035\n\025is_displayed_on_panel\030\r \001(\010\022\031\n\021p" + + "rimary_effect_id\030\016 \001(\004\022\037\n\017gift_label_ico" + + "n\030\017 \001(\0132\006.Image\022\014\n\004name\030\020 \001(\t\022\016\n\006region\030" + + "\021 \001(\t\022\016\n\006manual\030\022 \001(\t\022\022\n\nfor_custom\030\023 \001(" + + "\010\022=\n\021specialEffectsMap\030\024 \003(\0132\".GiftStruc" + + "t.SpecialEffectsMapEntry\022\024\n\004icon\030\025 \001(\0132\006" + + ".Image\022\023\n\013action_type\030\026 \001(\r\022\027\n\017watermelo" + + "nSeeds\030\027 \001(\005\022\022\n\ngoldEffect\030\030 \001(\t\022\023\n\013gold" + + "enBeans\030\032 \001(\003\022\022\n\nhonorLevel\030\033 \001(\003\022\020\n\010ite" + + "mType\030\034 \001(\005\022\021\n\tschemeUrl\030\035 \001(\t\022\021\n\teventN" + + "ame\030\037 \001(\t\022\022\n\nnobleLevel\030 \001(\003\022\020\n\010guideUr" + + "l\030! \001(\t\022\026\n\016punishMedicine\030\" \001(\010\022\021\n\tforPo" + + "rtal\030# \001(\010\022\024\n\014businessText\030$ \001(\t\022\017\n\007cnyG" + + "ift\030% \001(\010\022\r\n\005appId\030& \001(\003\022\020\n\010vipLevel\030\' \001" + + "(\003\022\016\n\006isGray\030( \001(\010\022\025\n\rgraySchemeUrl\030) \001(" + + "\t\022\021\n\tgiftScene\030* \001(\003\022\024\n\014triggerWords\030, \003" + + "(\t\022\030\n\020forFirstRecharge\030. \001(\010\022%\n\025dynamicI" + + "mgForSelected\030/ \001(\0132\006.Image\022\027\n\017afterSend" + + "Action\0300 \001(\005\022\027\n\017giftOfflineTime\0301 \001(\003\022\022\n" + + "\ntopBarText\0302 \001(\t\022\036\n\016topRightAvatar\0303 \001(" + + "\0132\006.Image\022\027\n\017bannerSchemeUrl\0304 \001(\t\022\020\n\010is" + + "Locked\0305 \001(\010\022\024\n\014reqExtraType\0306 \001(\003\022\020\n\010as" + + "setIds\0307 \003(\003\022\033\n\023needSweepLightCount\030: \001(" + + "\005\0328\n\026SpecialEffectsMapEntry\022\013\n\003key\030\001 \001(\t" + + "\022\r\n\005value\030\002 \001(\003:\0028\001B8\n6tech.ordinaryroad" + + ".live.chat.client.douyin.protobuf.dtob\006p" + + "roto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.getDescriptor(), + }); + internal_static_GiftStruct_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_GiftStruct_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_GiftStruct_descriptor, + new java.lang.String[] { "Image", "Describe", "Notify", "Duration", "Id", "ForLinkmic", "Doodle", "ForFansclub", "Combo", "Type", "DiamondCount", "IsDisplayedOnPanel", "PrimaryEffectId", "GiftLabelIcon", "Name", "Region", "Manual", "ForCustom", "SpecialEffectsMap", "Icon", "ActionType", "WatermelonSeeds", "GoldEffect", "GoldenBeans", "HonorLevel", "ItemType", "SchemeUrl", "EventName", "NobleLevel", "GuideUrl", "PunishMedicine", "ForPortal", "BusinessText", "CnyGift", "AppId", "VipLevel", "IsGray", "GraySchemeUrl", "GiftScene", "TriggerWords", "ForFirstRecharge", "DynamicImgForSelected", "AfterSendAction", "GiftOfflineTime", "TopBarText", "TopRightAvatar", "BannerSchemeUrl", "IsLocked", "ReqExtraType", "AssetIds", "NeedSweepLightCount", }); + internal_static_GiftStruct_SpecialEffectsMapEntry_descriptor = + internal_static_GiftStruct_descriptor.getNestedTypes().get(0); + internal_static_GiftStruct_SpecialEffectsMapEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_GiftStruct_SpecialEffectsMapEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/ImageOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/ImageOuterClass.java new file mode 100644 index 0000000..4a30d6e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/ImageOuterClass.java @@ -0,0 +1,3722 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Image.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class ImageOuterClass { + private ImageOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ImageOrBuilder extends + // @@protoc_insertion_point(interface_extends:Image) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string urlListList = 1; + * @return A list containing the urlListList. + */ + java.util.List + getUrlListListList(); + /** + * repeated string urlListList = 1; + * @return The count of urlListList. + */ + int getUrlListListCount(); + /** + * repeated string urlListList = 1; + * @param index The index of the element to return. + * @return The urlListList at the given index. + */ + java.lang.String getUrlListList(int index); + /** + * repeated string urlListList = 1; + * @param index The index of the value to return. + * @return The bytes of the urlListList at the given index. + */ + com.google.protobuf.ByteString + getUrlListListBytes(int index); + + /** + * string uri = 2; + * @return The uri. + */ + java.lang.String getUri(); + /** + * string uri = 2; + * @return The bytes for uri. + */ + com.google.protobuf.ByteString + getUriBytes(); + + /** + * int64 height = 3; + * @return The height. + */ + long getHeight(); + + /** + * int64 width = 4; + * @return The width. + */ + long getWidth(); + + /** + * string avgColor = 5; + * @return The avgColor. + */ + java.lang.String getAvgColor(); + /** + * string avgColor = 5; + * @return The bytes for avgColor. + */ + com.google.protobuf.ByteString + getAvgColorBytes(); + + /** + * int32 imageType = 6; + * @return The imageType. + */ + int getImageType(); + + /** + * string openWebUrl = 7; + * @return The openWebUrl. + */ + java.lang.String getOpenWebUrl(); + /** + * string openWebUrl = 7; + * @return The bytes for openWebUrl. + */ + com.google.protobuf.ByteString + getOpenWebUrlBytes(); + + /** + * .Image.Content content = 8; + * @return Whether the content field is set. + */ + boolean hasContent(); + /** + * .Image.Content content = 8; + * @return The content. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content getContent(); + /** + * .Image.Content content = 8; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.ContentOrBuilder getContentOrBuilder(); + + /** + * bool isAnimated = 9; + * @return The isAnimated. + */ + boolean getIsAnimated(); + + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + java.util.List + getFlexSettingListListList(); + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting getFlexSettingListList(int index); + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + int getFlexSettingListListCount(); + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + java.util.List + getFlexSettingListListOrBuilderList(); + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSettingOrBuilder getFlexSettingListListOrBuilder( + int index); + + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + java.util.List + getTextSettingListListList(); + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting getTextSettingListList(int index); + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + int getTextSettingListListCount(); + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + java.util.List + getTextSettingListListOrBuilderList(); + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSettingOrBuilder getTextSettingListListOrBuilder( + int index); + } + /** + * Protobuf type {@code Image} + */ + public static final class Image extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Image) + ImageOrBuilder { + private static final long serialVersionUID = 0L; + // Use Image.newBuilder() to construct. + private Image(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Image() { + urlListList_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + uri_ = ""; + avgColor_ = ""; + openWebUrl_ = ""; + flexSettingListList_ = java.util.Collections.emptyList(); + textSettingListList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Image(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder.class); + } + + public interface ContentOrBuilder extends + // @@protoc_insertion_point(interface_extends:Image.Content) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * string fontColor = 2; + * @return The fontColor. + */ + java.lang.String getFontColor(); + /** + * string fontColor = 2; + * @return The bytes for fontColor. + */ + com.google.protobuf.ByteString + getFontColorBytes(); + + /** + * int64 level = 3; + * @return The level. + */ + long getLevel(); + + /** + * string alternativeText = 4; + * @return The alternativeText. + */ + java.lang.String getAlternativeText(); + /** + * string alternativeText = 4; + * @return The bytes for alternativeText. + */ + com.google.protobuf.ByteString + getAlternativeTextBytes(); + } + /** + * Protobuf type {@code Image.Content} + */ + public static final class Content extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Image.Content) + ContentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Content.newBuilder() to construct. + private Content(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Content() { + name_ = ""; + fontColor_ = ""; + alternativeText_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Content(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_Content_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_Content_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FONTCOLOR_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object fontColor_ = ""; + /** + * string fontColor = 2; + * @return The fontColor. + */ + @java.lang.Override + public java.lang.String getFontColor() { + java.lang.Object ref = fontColor_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fontColor_ = s; + return s; + } + } + /** + * string fontColor = 2; + * @return The bytes for fontColor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFontColorBytes() { + java.lang.Object ref = fontColor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fontColor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LEVEL_FIELD_NUMBER = 3; + private long level_ = 0L; + /** + * int64 level = 3; + * @return The level. + */ + @java.lang.Override + public long getLevel() { + return level_; + } + + public static final int ALTERNATIVETEXT_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object alternativeText_ = ""; + /** + * string alternativeText = 4; + * @return The alternativeText. + */ + @java.lang.Override + public java.lang.String getAlternativeText() { + java.lang.Object ref = alternativeText_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + alternativeText_ = s; + return s; + } + } + /** + * string alternativeText = 4; + * @return The bytes for alternativeText. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAlternativeTextBytes() { + java.lang.Object ref = alternativeText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + alternativeText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fontColor_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fontColor_); + } + if (level_ != 0L) { + output.writeInt64(3, level_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(alternativeText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, alternativeText_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fontColor_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, fontColor_); + } + if (level_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, level_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(alternativeText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, alternativeText_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getFontColor() + .equals(other.getFontColor())) return false; + if (getLevel() + != other.getLevel()) return false; + if (!getAlternativeText() + .equals(other.getAlternativeText())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + FONTCOLOR_FIELD_NUMBER; + hash = (53 * hash) + getFontColor().hashCode(); + hash = (37 * hash) + LEVEL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLevel()); + hash = (37 * hash) + ALTERNATIVETEXT_FIELD_NUMBER; + hash = (53 * hash) + getAlternativeText().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Image.Content} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Image.Content) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.ContentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_Content_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_Content_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + fontColor_ = ""; + level_ = 0L; + alternativeText_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_Content_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fontColor_ = fontColor_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.level_ = level_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.alternativeText_ = alternativeText_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFontColor().isEmpty()) { + fontColor_ = other.fontColor_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getLevel() != 0L) { + setLevel(other.getLevel()); + } + if (!other.getAlternativeText().isEmpty()) { + alternativeText_ = other.alternativeText_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + fontColor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + level_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + alternativeText_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object fontColor_ = ""; + /** + * string fontColor = 2; + * @return The fontColor. + */ + public java.lang.String getFontColor() { + java.lang.Object ref = fontColor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fontColor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string fontColor = 2; + * @return The bytes for fontColor. + */ + public com.google.protobuf.ByteString + getFontColorBytes() { + java.lang.Object ref = fontColor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fontColor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string fontColor = 2; + * @param value The fontColor to set. + * @return This builder for chaining. + */ + public Builder setFontColor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + fontColor_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string fontColor = 2; + * @return This builder for chaining. + */ + public Builder clearFontColor() { + fontColor_ = getDefaultInstance().getFontColor(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string fontColor = 2; + * @param value The bytes for fontColor to set. + * @return This builder for chaining. + */ + public Builder setFontColorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + fontColor_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long level_ ; + /** + * int64 level = 3; + * @return The level. + */ + @java.lang.Override + public long getLevel() { + return level_; + } + /** + * int64 level = 3; + * @param value The level to set. + * @return This builder for chaining. + */ + public Builder setLevel(long value) { + + level_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 level = 3; + * @return This builder for chaining. + */ + public Builder clearLevel() { + bitField0_ = (bitField0_ & ~0x00000004); + level_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object alternativeText_ = ""; + /** + * string alternativeText = 4; + * @return The alternativeText. + */ + public java.lang.String getAlternativeText() { + java.lang.Object ref = alternativeText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + alternativeText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string alternativeText = 4; + * @return The bytes for alternativeText. + */ + public com.google.protobuf.ByteString + getAlternativeTextBytes() { + java.lang.Object ref = alternativeText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + alternativeText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string alternativeText = 4; + * @param value The alternativeText to set. + * @return This builder for chaining. + */ + public Builder setAlternativeText( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + alternativeText_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * string alternativeText = 4; + * @return This builder for chaining. + */ + public Builder clearAlternativeText() { + alternativeText_ = getDefaultInstance().getAlternativeText(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * string alternativeText = 4; + * @param value The bytes for alternativeText to set. + * @return This builder for chaining. + */ + public Builder setAlternativeTextBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + alternativeText_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Image.Content) + } + + // @@protoc_insertion_point(class_scope:Image.Content) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Content parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface NinePatchSettingOrBuilder extends + // @@protoc_insertion_point(interface_extends:Image.NinePatchSetting) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code Image.NinePatchSetting} + */ + public static final class NinePatchSetting extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Image.NinePatchSetting) + NinePatchSettingOrBuilder { + private static final long serialVersionUID = 0L; + // Use NinePatchSetting.newBuilder() to construct. + private NinePatchSetting(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private NinePatchSetting() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new NinePatchSetting(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_NinePatchSetting_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_NinePatchSetting_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Image.NinePatchSetting} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Image.NinePatchSetting) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSettingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_NinePatchSetting_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_NinePatchSetting_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_NinePatchSetting_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Image.NinePatchSetting) + } + + // @@protoc_insertion_point(class_scope:Image.NinePatchSetting) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NinePatchSetting parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int URLLISTLIST_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList urlListList_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * repeated string urlListList = 1; + * @return A list containing the urlListList. + */ + public com.google.protobuf.ProtocolStringList + getUrlListListList() { + return urlListList_; + } + /** + * repeated string urlListList = 1; + * @return The count of urlListList. + */ + public int getUrlListListCount() { + return urlListList_.size(); + } + /** + * repeated string urlListList = 1; + * @param index The index of the element to return. + * @return The urlListList at the given index. + */ + public java.lang.String getUrlListList(int index) { + return urlListList_.get(index); + } + /** + * repeated string urlListList = 1; + * @param index The index of the value to return. + * @return The bytes of the urlListList at the given index. + */ + public com.google.protobuf.ByteString + getUrlListListBytes(int index) { + return urlListList_.getByteString(index); + } + + public static final int URI_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object uri_ = ""; + /** + * string uri = 2; + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + * string uri = 2; + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HEIGHT_FIELD_NUMBER = 3; + private long height_ = 0L; + /** + * int64 height = 3; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return height_; + } + + public static final int WIDTH_FIELD_NUMBER = 4; + private long width_ = 0L; + /** + * int64 width = 4; + * @return The width. + */ + @java.lang.Override + public long getWidth() { + return width_; + } + + public static final int AVGCOLOR_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object avgColor_ = ""; + /** + * string avgColor = 5; + * @return The avgColor. + */ + @java.lang.Override + public java.lang.String getAvgColor() { + java.lang.Object ref = avgColor_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + avgColor_ = s; + return s; + } + } + /** + * string avgColor = 5; + * @return The bytes for avgColor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAvgColorBytes() { + java.lang.Object ref = avgColor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + avgColor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IMAGETYPE_FIELD_NUMBER = 6; + private int imageType_ = 0; + /** + * int32 imageType = 6; + * @return The imageType. + */ + @java.lang.Override + public int getImageType() { + return imageType_; + } + + public static final int OPENWEBURL_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object openWebUrl_ = ""; + /** + * string openWebUrl = 7; + * @return The openWebUrl. + */ + @java.lang.Override + public java.lang.String getOpenWebUrl() { + java.lang.Object ref = openWebUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + openWebUrl_ = s; + return s; + } + } + /** + * string openWebUrl = 7; + * @return The bytes for openWebUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOpenWebUrlBytes() { + java.lang.Object ref = openWebUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + openWebUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 8; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content content_; + /** + * .Image.Content content = 8; + * @return Whether the content field is set. + */ + @java.lang.Override + public boolean hasContent() { + return content_ != null; + } + /** + * .Image.Content content = 8; + * @return The content. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content getContent() { + return content_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.getDefaultInstance() : content_; + } + /** + * .Image.Content content = 8; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.ContentOrBuilder getContentOrBuilder() { + return content_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.getDefaultInstance() : content_; + } + + public static final int ISANIMATED_FIELD_NUMBER = 9; + private boolean isAnimated_ = false; + /** + * bool isAnimated = 9; + * @return The isAnimated. + */ + @java.lang.Override + public boolean getIsAnimated() { + return isAnimated_; + } + + public static final int FLEXSETTINGLISTLIST_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private java.util.List flexSettingListList_; + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + @java.lang.Override + public java.util.List getFlexSettingListListList() { + return flexSettingListList_; + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + @java.lang.Override + public java.util.List + getFlexSettingListListOrBuilderList() { + return flexSettingListList_; + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + @java.lang.Override + public int getFlexSettingListListCount() { + return flexSettingListList_.size(); + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting getFlexSettingListList(int index) { + return flexSettingListList_.get(index); + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSettingOrBuilder getFlexSettingListListOrBuilder( + int index) { + return flexSettingListList_.get(index); + } + + public static final int TEXTSETTINGLISTLIST_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private java.util.List textSettingListList_; + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + @java.lang.Override + public java.util.List getTextSettingListListList() { + return textSettingListList_; + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + @java.lang.Override + public java.util.List + getTextSettingListListOrBuilderList() { + return textSettingListList_; + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + @java.lang.Override + public int getTextSettingListListCount() { + return textSettingListList_.size(); + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting getTextSettingListList(int index) { + return textSettingListList_.get(index); + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSettingOrBuilder getTextSettingListListOrBuilder( + int index) { + return textSettingListList_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < urlListList_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, urlListList_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uri_); + } + if (height_ != 0L) { + output.writeInt64(3, height_); + } + if (width_ != 0L) { + output.writeInt64(4, width_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(avgColor_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, avgColor_); + } + if (imageType_ != 0) { + output.writeInt32(6, imageType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(openWebUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, openWebUrl_); + } + if (content_ != null) { + output.writeMessage(8, getContent()); + } + if (isAnimated_ != false) { + output.writeBool(9, isAnimated_); + } + for (int i = 0; i < flexSettingListList_.size(); i++) { + output.writeMessage(10, flexSettingListList_.get(i)); + } + for (int i = 0; i < textSettingListList_.size(); i++) { + output.writeMessage(11, textSettingListList_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < urlListList_.size(); i++) { + dataSize += computeStringSizeNoTag(urlListList_.getRaw(i)); + } + size += dataSize; + size += 1 * getUrlListListList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uri_); + } + if (height_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, height_); + } + if (width_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, width_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(avgColor_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, avgColor_); + } + if (imageType_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, imageType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(openWebUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, openWebUrl_); + } + if (content_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getContent()); + } + if (isAnimated_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(9, isAnimated_); + } + for (int i = 0; i < flexSettingListList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, flexSettingListList_.get(i)); + } + for (int i = 0; i < textSettingListList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, textSettingListList_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image) obj; + + if (!getUrlListListList() + .equals(other.getUrlListListList())) return false; + if (!getUri() + .equals(other.getUri())) return false; + if (getHeight() + != other.getHeight()) return false; + if (getWidth() + != other.getWidth()) return false; + if (!getAvgColor() + .equals(other.getAvgColor())) return false; + if (getImageType() + != other.getImageType()) return false; + if (!getOpenWebUrl() + .equals(other.getOpenWebUrl())) return false; + if (hasContent() != other.hasContent()) return false; + if (hasContent()) { + if (!getContent() + .equals(other.getContent())) return false; + } + if (getIsAnimated() + != other.getIsAnimated()) return false; + if (!getFlexSettingListListList() + .equals(other.getFlexSettingListListList())) return false; + if (!getTextSettingListListList() + .equals(other.getTextSettingListListList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getUrlListListCount() > 0) { + hash = (37 * hash) + URLLISTLIST_FIELD_NUMBER; + hash = (53 * hash) + getUrlListListList().hashCode(); + } + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + HEIGHT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getHeight()); + hash = (37 * hash) + WIDTH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getWidth()); + hash = (37 * hash) + AVGCOLOR_FIELD_NUMBER; + hash = (53 * hash) + getAvgColor().hashCode(); + hash = (37 * hash) + IMAGETYPE_FIELD_NUMBER; + hash = (53 * hash) + getImageType(); + hash = (37 * hash) + OPENWEBURL_FIELD_NUMBER; + hash = (53 * hash) + getOpenWebUrl().hashCode(); + if (hasContent()) { + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + } + hash = (37 * hash) + ISANIMATED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsAnimated()); + if (getFlexSettingListListCount() > 0) { + hash = (37 * hash) + FLEXSETTINGLISTLIST_FIELD_NUMBER; + hash = (53 * hash) + getFlexSettingListListList().hashCode(); + } + if (getTextSettingListListCount() > 0) { + hash = (37 * hash) + TEXTSETTINGLISTLIST_FIELD_NUMBER; + hash = (53 * hash) + getTextSettingListListList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Image} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Image) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + urlListList_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + uri_ = ""; + height_ = 0L; + width_ = 0L; + avgColor_ = ""; + imageType_ = 0; + openWebUrl_ = ""; + content_ = null; + if (contentBuilder_ != null) { + contentBuilder_.dispose(); + contentBuilder_ = null; + } + isAnimated_ = false; + if (flexSettingListListBuilder_ == null) { + flexSettingListList_ = java.util.Collections.emptyList(); + } else { + flexSettingListList_ = null; + flexSettingListListBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + if (textSettingListListBuilder_ == null) { + textSettingListList_ = java.util.Collections.emptyList(); + } else { + textSettingListList_ = null; + textSettingListListBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.internal_static_Image_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image result) { + if (flexSettingListListBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0)) { + flexSettingListList_ = java.util.Collections.unmodifiableList(flexSettingListList_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.flexSettingListList_ = flexSettingListList_; + } else { + result.flexSettingListList_ = flexSettingListListBuilder_.build(); + } + if (textSettingListListBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + textSettingListList_ = java.util.Collections.unmodifiableList(textSettingListList_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.textSettingListList_ = textSettingListList_; + } else { + result.textSettingListList_ = textSettingListListBuilder_.build(); + } + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + urlListList_.makeImmutable(); + result.urlListList_ = urlListList_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.uri_ = uri_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.height_ = height_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.width_ = width_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.avgColor_ = avgColor_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.imageType_ = imageType_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.openWebUrl_ = openWebUrl_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.content_ = contentBuilder_ == null + ? content_ + : contentBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.isAnimated_ = isAnimated_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) return this; + if (!other.urlListList_.isEmpty()) { + if (urlListList_.isEmpty()) { + urlListList_ = other.urlListList_; + bitField0_ |= 0x00000001; + } else { + ensureUrlListListIsMutable(); + urlListList_.addAll(other.urlListList_); + } + onChanged(); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getHeight() != 0L) { + setHeight(other.getHeight()); + } + if (other.getWidth() != 0L) { + setWidth(other.getWidth()); + } + if (!other.getAvgColor().isEmpty()) { + avgColor_ = other.avgColor_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getImageType() != 0) { + setImageType(other.getImageType()); + } + if (!other.getOpenWebUrl().isEmpty()) { + openWebUrl_ = other.openWebUrl_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasContent()) { + mergeContent(other.getContent()); + } + if (other.getIsAnimated() != false) { + setIsAnimated(other.getIsAnimated()); + } + if (flexSettingListListBuilder_ == null) { + if (!other.flexSettingListList_.isEmpty()) { + if (flexSettingListList_.isEmpty()) { + flexSettingListList_ = other.flexSettingListList_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureFlexSettingListListIsMutable(); + flexSettingListList_.addAll(other.flexSettingListList_); + } + onChanged(); + } + } else { + if (!other.flexSettingListList_.isEmpty()) { + if (flexSettingListListBuilder_.isEmpty()) { + flexSettingListListBuilder_.dispose(); + flexSettingListListBuilder_ = null; + flexSettingListList_ = other.flexSettingListList_; + bitField0_ = (bitField0_ & ~0x00000200); + flexSettingListListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFlexSettingListListFieldBuilder() : null; + } else { + flexSettingListListBuilder_.addAllMessages(other.flexSettingListList_); + } + } + } + if (textSettingListListBuilder_ == null) { + if (!other.textSettingListList_.isEmpty()) { + if (textSettingListList_.isEmpty()) { + textSettingListList_ = other.textSettingListList_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureTextSettingListListIsMutable(); + textSettingListList_.addAll(other.textSettingListList_); + } + onChanged(); + } + } else { + if (!other.textSettingListList_.isEmpty()) { + if (textSettingListListBuilder_.isEmpty()) { + textSettingListListBuilder_.dispose(); + textSettingListListBuilder_ = null; + textSettingListList_ = other.textSettingListList_; + bitField0_ = (bitField0_ & ~0x00000400); + textSettingListListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTextSettingListListFieldBuilder() : null; + } else { + textSettingListListBuilder_.addAllMessages(other.textSettingListList_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + ensureUrlListListIsMutable(); + urlListList_.add(s); + break; + } // case 10 + case 18: { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + height_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + width_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + avgColor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: { + imageType_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: { + openWebUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: { + input.readMessage( + getContentFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: { + isAnimated_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 82: { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting m = + input.readMessage( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.parser(), + extensionRegistry); + if (flexSettingListListBuilder_ == null) { + ensureFlexSettingListListIsMutable(); + flexSettingListList_.add(m); + } else { + flexSettingListListBuilder_.addMessage(m); + } + break; + } // case 82 + case 90: { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting m = + input.readMessage( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.parser(), + extensionRegistry); + if (textSettingListListBuilder_ == null) { + ensureTextSettingListListIsMutable(); + textSettingListList_.add(m); + } else { + textSettingListListBuilder_.addMessage(m); + } + break; + } // case 90 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList urlListList_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureUrlListListIsMutable() { + if (!urlListList_.isModifiable()) { + urlListList_ = new com.google.protobuf.LazyStringArrayList(urlListList_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated string urlListList = 1; + * @return A list containing the urlListList. + */ + public com.google.protobuf.ProtocolStringList + getUrlListListList() { + urlListList_.makeImmutable(); + return urlListList_; + } + /** + * repeated string urlListList = 1; + * @return The count of urlListList. + */ + public int getUrlListListCount() { + return urlListList_.size(); + } + /** + * repeated string urlListList = 1; + * @param index The index of the element to return. + * @return The urlListList at the given index. + */ + public java.lang.String getUrlListList(int index) { + return urlListList_.get(index); + } + /** + * repeated string urlListList = 1; + * @param index The index of the value to return. + * @return The bytes of the urlListList at the given index. + */ + public com.google.protobuf.ByteString + getUrlListListBytes(int index) { + return urlListList_.getByteString(index); + } + /** + * repeated string urlListList = 1; + * @param index The index to set the value at. + * @param value The urlListList to set. + * @return This builder for chaining. + */ + public Builder setUrlListList( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureUrlListListIsMutable(); + urlListList_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string urlListList = 1; + * @param value The urlListList to add. + * @return This builder for chaining. + */ + public Builder addUrlListList( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureUrlListListIsMutable(); + urlListList_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string urlListList = 1; + * @param values The urlListList to add. + * @return This builder for chaining. + */ + public Builder addAllUrlListList( + java.lang.Iterable values) { + ensureUrlListListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, urlListList_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string urlListList = 1; + * @return This builder for chaining. + */ + public Builder clearUrlListList() { + urlListList_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + * repeated string urlListList = 1; + * @param value The bytes of the urlListList to add. + * @return This builder for chaining. + */ + public Builder addUrlListListBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureUrlListListIsMutable(); + urlListList_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object uri_ = ""; + /** + * string uri = 2; + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string uri = 2; + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string uri = 2; + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + uri_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string uri = 2; + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string uri = 2; + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + uri_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long height_ ; + /** + * int64 height = 3; + * @return The height. + */ + @java.lang.Override + public long getHeight() { + return height_; + } + /** + * int64 height = 3; + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(long value) { + + height_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 height = 3; + * @return This builder for chaining. + */ + public Builder clearHeight() { + bitField0_ = (bitField0_ & ~0x00000004); + height_ = 0L; + onChanged(); + return this; + } + + private long width_ ; + /** + * int64 width = 4; + * @return The width. + */ + @java.lang.Override + public long getWidth() { + return width_; + } + /** + * int64 width = 4; + * @param value The width to set. + * @return This builder for chaining. + */ + public Builder setWidth(long value) { + + width_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int64 width = 4; + * @return This builder for chaining. + */ + public Builder clearWidth() { + bitField0_ = (bitField0_ & ~0x00000008); + width_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object avgColor_ = ""; + /** + * string avgColor = 5; + * @return The avgColor. + */ + public java.lang.String getAvgColor() { + java.lang.Object ref = avgColor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + avgColor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string avgColor = 5; + * @return The bytes for avgColor. + */ + public com.google.protobuf.ByteString + getAvgColorBytes() { + java.lang.Object ref = avgColor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + avgColor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string avgColor = 5; + * @param value The avgColor to set. + * @return This builder for chaining. + */ + public Builder setAvgColor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + avgColor_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * string avgColor = 5; + * @return This builder for chaining. + */ + public Builder clearAvgColor() { + avgColor_ = getDefaultInstance().getAvgColor(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * string avgColor = 5; + * @param value The bytes for avgColor to set. + * @return This builder for chaining. + */ + public Builder setAvgColorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + avgColor_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private int imageType_ ; + /** + * int32 imageType = 6; + * @return The imageType. + */ + @java.lang.Override + public int getImageType() { + return imageType_; + } + /** + * int32 imageType = 6; + * @param value The imageType to set. + * @return This builder for chaining. + */ + public Builder setImageType(int value) { + + imageType_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * int32 imageType = 6; + * @return This builder for chaining. + */ + public Builder clearImageType() { + bitField0_ = (bitField0_ & ~0x00000020); + imageType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object openWebUrl_ = ""; + /** + * string openWebUrl = 7; + * @return The openWebUrl. + */ + public java.lang.String getOpenWebUrl() { + java.lang.Object ref = openWebUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + openWebUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string openWebUrl = 7; + * @return The bytes for openWebUrl. + */ + public com.google.protobuf.ByteString + getOpenWebUrlBytes() { + java.lang.Object ref = openWebUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + openWebUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string openWebUrl = 7; + * @param value The openWebUrl to set. + * @return This builder for chaining. + */ + public Builder setOpenWebUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + openWebUrl_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * string openWebUrl = 7; + * @return This builder for chaining. + */ + public Builder clearOpenWebUrl() { + openWebUrl_ = getDefaultInstance().getOpenWebUrl(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * string openWebUrl = 7; + * @param value The bytes for openWebUrl to set. + * @return This builder for chaining. + */ + public Builder setOpenWebUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + openWebUrl_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content content_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.ContentOrBuilder> contentBuilder_; + /** + * .Image.Content content = 8; + * @return Whether the content field is set. + */ + public boolean hasContent() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * .Image.Content content = 8; + * @return The content. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content getContent() { + if (contentBuilder_ == null) { + return content_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.getDefaultInstance() : content_; + } else { + return contentBuilder_.getMessage(); + } + } + /** + * .Image.Content content = 8; + */ + public Builder setContent(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content value) { + if (contentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + } else { + contentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * .Image.Content content = 8; + */ + public Builder setContent( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.Builder builderForValue) { + if (contentBuilder_ == null) { + content_ = builderForValue.build(); + } else { + contentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * .Image.Content content = 8; + */ + public Builder mergeContent(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content value) { + if (contentBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) && + content_ != null && + content_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.getDefaultInstance()) { + getContentBuilder().mergeFrom(value); + } else { + content_ = value; + } + } else { + contentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * .Image.Content content = 8; + */ + public Builder clearContent() { + bitField0_ = (bitField0_ & ~0x00000080); + content_ = null; + if (contentBuilder_ != null) { + contentBuilder_.dispose(); + contentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image.Content content = 8; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.Builder getContentBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getContentFieldBuilder().getBuilder(); + } + /** + * .Image.Content content = 8; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.ContentOrBuilder getContentOrBuilder() { + if (contentBuilder_ != null) { + return contentBuilder_.getMessageOrBuilder(); + } else { + return content_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.getDefaultInstance() : content_; + } + } + /** + * .Image.Content content = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.ContentOrBuilder> + getContentFieldBuilder() { + if (contentBuilder_ == null) { + contentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Content.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.ContentOrBuilder>( + getContent(), + getParentForChildren(), + isClean()); + content_ = null; + } + return contentBuilder_; + } + + private boolean isAnimated_ ; + /** + * bool isAnimated = 9; + * @return The isAnimated. + */ + @java.lang.Override + public boolean getIsAnimated() { + return isAnimated_; + } + /** + * bool isAnimated = 9; + * @param value The isAnimated to set. + * @return This builder for chaining. + */ + public Builder setIsAnimated(boolean value) { + + isAnimated_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * bool isAnimated = 9; + * @return This builder for chaining. + */ + public Builder clearIsAnimated() { + bitField0_ = (bitField0_ & ~0x00000100); + isAnimated_ = false; + onChanged(); + return this; + } + + private java.util.List flexSettingListList_ = + java.util.Collections.emptyList(); + private void ensureFlexSettingListListIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + flexSettingListList_ = new java.util.ArrayList(flexSettingListList_); + bitField0_ |= 0x00000200; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSettingOrBuilder> flexSettingListListBuilder_; + + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public java.util.List getFlexSettingListListList() { + if (flexSettingListListBuilder_ == null) { + return java.util.Collections.unmodifiableList(flexSettingListList_); + } else { + return flexSettingListListBuilder_.getMessageList(); + } + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public int getFlexSettingListListCount() { + if (flexSettingListListBuilder_ == null) { + return flexSettingListList_.size(); + } else { + return flexSettingListListBuilder_.getCount(); + } + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting getFlexSettingListList(int index) { + if (flexSettingListListBuilder_ == null) { + return flexSettingListList_.get(index); + } else { + return flexSettingListListBuilder_.getMessage(index); + } + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public Builder setFlexSettingListList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting value) { + if (flexSettingListListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlexSettingListListIsMutable(); + flexSettingListList_.set(index, value); + onChanged(); + } else { + flexSettingListListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public Builder setFlexSettingListList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder builderForValue) { + if (flexSettingListListBuilder_ == null) { + ensureFlexSettingListListIsMutable(); + flexSettingListList_.set(index, builderForValue.build()); + onChanged(); + } else { + flexSettingListListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public Builder addFlexSettingListList(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting value) { + if (flexSettingListListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlexSettingListListIsMutable(); + flexSettingListList_.add(value); + onChanged(); + } else { + flexSettingListListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public Builder addFlexSettingListList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting value) { + if (flexSettingListListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlexSettingListListIsMutable(); + flexSettingListList_.add(index, value); + onChanged(); + } else { + flexSettingListListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public Builder addFlexSettingListList( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder builderForValue) { + if (flexSettingListListBuilder_ == null) { + ensureFlexSettingListListIsMutable(); + flexSettingListList_.add(builderForValue.build()); + onChanged(); + } else { + flexSettingListListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public Builder addFlexSettingListList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder builderForValue) { + if (flexSettingListListBuilder_ == null) { + ensureFlexSettingListListIsMutable(); + flexSettingListList_.add(index, builderForValue.build()); + onChanged(); + } else { + flexSettingListListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public Builder addAllFlexSettingListList( + java.lang.Iterable values) { + if (flexSettingListListBuilder_ == null) { + ensureFlexSettingListListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, flexSettingListList_); + onChanged(); + } else { + flexSettingListListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public Builder clearFlexSettingListList() { + if (flexSettingListListBuilder_ == null) { + flexSettingListList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + } else { + flexSettingListListBuilder_.clear(); + } + return this; + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public Builder removeFlexSettingListList(int index) { + if (flexSettingListListBuilder_ == null) { + ensureFlexSettingListListIsMutable(); + flexSettingListList_.remove(index); + onChanged(); + } else { + flexSettingListListBuilder_.remove(index); + } + return this; + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder getFlexSettingListListBuilder( + int index) { + return getFlexSettingListListFieldBuilder().getBuilder(index); + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSettingOrBuilder getFlexSettingListListOrBuilder( + int index) { + if (flexSettingListListBuilder_ == null) { + return flexSettingListList_.get(index); } else { + return flexSettingListListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public java.util.List + getFlexSettingListListOrBuilderList() { + if (flexSettingListListBuilder_ != null) { + return flexSettingListListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(flexSettingListList_); + } + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder addFlexSettingListListBuilder() { + return getFlexSettingListListFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.getDefaultInstance()); + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder addFlexSettingListListBuilder( + int index) { + return getFlexSettingListListFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.getDefaultInstance()); + } + /** + * repeated .Image.NinePatchSetting flexSettingListList = 10; + */ + public java.util.List + getFlexSettingListListBuilderList() { + return getFlexSettingListListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSettingOrBuilder> + getFlexSettingListListFieldBuilder() { + if (flexSettingListListBuilder_ == null) { + flexSettingListListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSettingOrBuilder>( + flexSettingListList_, + ((bitField0_ & 0x00000200) != 0), + getParentForChildren(), + isClean()); + flexSettingListList_ = null; + } + return flexSettingListListBuilder_; + } + + private java.util.List textSettingListList_ = + java.util.Collections.emptyList(); + private void ensureTextSettingListListIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + textSettingListList_ = new java.util.ArrayList(textSettingListList_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSettingOrBuilder> textSettingListListBuilder_; + + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public java.util.List getTextSettingListListList() { + if (textSettingListListBuilder_ == null) { + return java.util.Collections.unmodifiableList(textSettingListList_); + } else { + return textSettingListListBuilder_.getMessageList(); + } + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public int getTextSettingListListCount() { + if (textSettingListListBuilder_ == null) { + return textSettingListList_.size(); + } else { + return textSettingListListBuilder_.getCount(); + } + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting getTextSettingListList(int index) { + if (textSettingListListBuilder_ == null) { + return textSettingListList_.get(index); + } else { + return textSettingListListBuilder_.getMessage(index); + } + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public Builder setTextSettingListList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting value) { + if (textSettingListListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextSettingListListIsMutable(); + textSettingListList_.set(index, value); + onChanged(); + } else { + textSettingListListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public Builder setTextSettingListList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder builderForValue) { + if (textSettingListListBuilder_ == null) { + ensureTextSettingListListIsMutable(); + textSettingListList_.set(index, builderForValue.build()); + onChanged(); + } else { + textSettingListListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public Builder addTextSettingListList(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting value) { + if (textSettingListListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextSettingListListIsMutable(); + textSettingListList_.add(value); + onChanged(); + } else { + textSettingListListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public Builder addTextSettingListList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting value) { + if (textSettingListListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextSettingListListIsMutable(); + textSettingListList_.add(index, value); + onChanged(); + } else { + textSettingListListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public Builder addTextSettingListList( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder builderForValue) { + if (textSettingListListBuilder_ == null) { + ensureTextSettingListListIsMutable(); + textSettingListList_.add(builderForValue.build()); + onChanged(); + } else { + textSettingListListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public Builder addTextSettingListList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder builderForValue) { + if (textSettingListListBuilder_ == null) { + ensureTextSettingListListIsMutable(); + textSettingListList_.add(index, builderForValue.build()); + onChanged(); + } else { + textSettingListListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public Builder addAllTextSettingListList( + java.lang.Iterable values) { + if (textSettingListListBuilder_ == null) { + ensureTextSettingListListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, textSettingListList_); + onChanged(); + } else { + textSettingListListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public Builder clearTextSettingListList() { + if (textSettingListListBuilder_ == null) { + textSettingListList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + textSettingListListBuilder_.clear(); + } + return this; + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public Builder removeTextSettingListList(int index) { + if (textSettingListListBuilder_ == null) { + ensureTextSettingListListIsMutable(); + textSettingListList_.remove(index); + onChanged(); + } else { + textSettingListListBuilder_.remove(index); + } + return this; + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder getTextSettingListListBuilder( + int index) { + return getTextSettingListListFieldBuilder().getBuilder(index); + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSettingOrBuilder getTextSettingListListOrBuilder( + int index) { + if (textSettingListListBuilder_ == null) { + return textSettingListList_.get(index); } else { + return textSettingListListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public java.util.List + getTextSettingListListOrBuilderList() { + if (textSettingListListBuilder_ != null) { + return textSettingListListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(textSettingListList_); + } + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder addTextSettingListListBuilder() { + return getTextSettingListListFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.getDefaultInstance()); + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder addTextSettingListListBuilder( + int index) { + return getTextSettingListListFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.getDefaultInstance()); + } + /** + * repeated .Image.NinePatchSetting textSettingListList = 11; + */ + public java.util.List + getTextSettingListListBuilderList() { + return getTextSettingListListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSettingOrBuilder> + getTextSettingListListFieldBuilder() { + if (textSettingListListBuilder_ == null) { + textSettingListListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSetting.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.NinePatchSettingOrBuilder>( + textSettingListList_, + ((bitField0_ & 0x00000400) != 0), + getParentForChildren(), + isClean()); + textSettingListList_ = null; + } + return textSettingListListBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Image) + } + + // @@protoc_insertion_point(class_scope:Image) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Image parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Image_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Image_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Image_Content_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Image_Content_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Image_NinePatchSetting_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Image_NinePatchSetting_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\013Image.proto\"\212\003\n\005Image\022\023\n\013urlListList\030\001" + + " \003(\t\022\013\n\003uri\030\002 \001(\t\022\016\n\006height\030\003 \001(\003\022\r\n\005wid" + + "th\030\004 \001(\003\022\020\n\010avgColor\030\005 \001(\t\022\021\n\timageType\030" + + "\006 \001(\005\022\022\n\nopenWebUrl\030\007 \001(\t\022\037\n\007content\030\010 \001" + + "(\0132\016.Image.Content\022\022\n\nisAnimated\030\t \001(\010\0224" + + "\n\023flexSettingListList\030\n \003(\0132\027.Image.Nine" + + "PatchSetting\0224\n\023textSettingListList\030\013 \003(" + + "\0132\027.Image.NinePatchSetting\032R\n\007Content\022\014\n" + + "\004name\030\001 \001(\t\022\021\n\tfontColor\030\002 \001(\t\022\r\n\005level\030" + + "\003 \001(\003\022\027\n\017alternativeText\030\004 \001(\t\032\022\n\020NinePa" + + "tchSettingB8\n6tech.ordinaryroad.live.cha" + + "t.client.douyin.protobuf.dtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_Image_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Image_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Image_descriptor, + new java.lang.String[] { "UrlListList", "Uri", "Height", "Width", "AvgColor", "ImageType", "OpenWebUrl", "Content", "IsAnimated", "FlexSettingListList", "TextSettingListList", }); + internal_static_Image_Content_descriptor = + internal_static_Image_descriptor.getNestedTypes().get(0); + internal_static_Image_Content_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Image_Content_descriptor, + new java.lang.String[] { "Name", "FontColor", "Level", "AlternativeText", }); + internal_static_Image_NinePatchSetting_descriptor = + internal_static_Image_descriptor.getNestedTypes().get(1); + internal_static_Image_NinePatchSetting_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Image_NinePatchSetting_descriptor, + new java.lang.String[] { }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/PatternRefOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/PatternRefOuterClass.java new file mode 100644 index 0000000..378b1fc --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/PatternRefOuterClass.java @@ -0,0 +1,773 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: PatternRef.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class PatternRefOuterClass { + private PatternRefOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface PatternRefOrBuilder extends + // @@protoc_insertion_point(interface_extends:PatternRef) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + * @return The key. + */ + java.lang.String getKey(); + /** + * string key = 1; + * @return The bytes for key. + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * string default_pattern = 2; + * @return The defaultPattern. + */ + java.lang.String getDefaultPattern(); + /** + * string default_pattern = 2; + * @return The bytes for defaultPattern. + */ + com.google.protobuf.ByteString + getDefaultPatternBytes(); + } + /** + * Protobuf type {@code PatternRef} + */ + public static final class PatternRef extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:PatternRef) + PatternRefOrBuilder { + private static final long serialVersionUID = 0L; + // Use PatternRef.newBuilder() to construct. + private PatternRef(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PatternRef() { + key_ = ""; + defaultPattern_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PatternRef(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.internal_static_PatternRef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.internal_static_PatternRef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + /** + * string key = 1; + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEFAULT_PATTERN_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object defaultPattern_ = ""; + /** + * string default_pattern = 2; + * @return The defaultPattern. + */ + @java.lang.Override + public java.lang.String getDefaultPattern() { + java.lang.Object ref = defaultPattern_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + defaultPattern_ = s; + return s; + } + } + /** + * string default_pattern = 2; + * @return The bytes for defaultPattern. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDefaultPatternBytes() { + java.lang.Object ref = defaultPattern_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + defaultPattern_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultPattern_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, defaultPattern_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultPattern_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, defaultPattern_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef) obj; + + if (!getKey() + .equals(other.getKey())) return false; + if (!getDefaultPattern() + .equals(other.getDefaultPattern())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + DEFAULT_PATTERN_FIELD_NUMBER; + hash = (53 * hash) + getDefaultPattern().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code PatternRef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:PatternRef) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.internal_static_PatternRef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.internal_static_PatternRef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = ""; + defaultPattern_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.internal_static_PatternRef_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.defaultPattern_ = defaultPattern_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDefaultPattern().isEmpty()) { + defaultPattern_ = other.defaultPattern_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + key_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + defaultPattern_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + * @return The bytes for key. + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string key = 1; + * @return This builder for chaining. + */ + public Builder clearKey() { + key_ = getDefaultInstance().getKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string key = 1; + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object defaultPattern_ = ""; + /** + * string default_pattern = 2; + * @return The defaultPattern. + */ + public java.lang.String getDefaultPattern() { + java.lang.Object ref = defaultPattern_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + defaultPattern_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string default_pattern = 2; + * @return The bytes for defaultPattern. + */ + public com.google.protobuf.ByteString + getDefaultPatternBytes() { + java.lang.Object ref = defaultPattern_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + defaultPattern_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string default_pattern = 2; + * @param value The defaultPattern to set. + * @return This builder for chaining. + */ + public Builder setDefaultPattern( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + defaultPattern_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string default_pattern = 2; + * @return This builder for chaining. + */ + public Builder clearDefaultPattern() { + defaultPattern_ = getDefaultInstance().getDefaultPattern(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string default_pattern = 2; + * @param value The bytes for defaultPattern to set. + * @return This builder for chaining. + */ + public Builder setDefaultPatternBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + defaultPattern_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:PatternRef) + } + + // @@protoc_insertion_point(class_scope:PatternRef) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PatternRef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_PatternRef_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_PatternRef_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\020PatternRef.proto\"2\n\nPatternRef\022\013\n\003key\030" + + "\001 \001(\t\022\027\n\017default_pattern\030\002 \001(\tB8\n6tech.o" + + "rdinaryroad.live.chat.client.douyin.prot" + + "obuf.dtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_PatternRef_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_PatternRef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_PatternRef_descriptor, + new java.lang.String[] { "Key", "DefaultPattern", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/PublicAreaCommonOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/PublicAreaCommonOuterClass.java new file mode 100644 index 0000000..6585a11 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/PublicAreaCommonOuterClass.java @@ -0,0 +1,823 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: PublicAreaCommon.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class PublicAreaCommonOuterClass { + private PublicAreaCommonOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface PublicAreaCommonOrBuilder extends + // @@protoc_insertion_point(interface_extends:PublicAreaCommon) + com.google.protobuf.MessageOrBuilder { + + /** + * .Image user_label = 1; + * @return Whether the userLabel field is set. + */ + boolean hasUserLabel(); + /** + * .Image user_label = 1; + * @return The userLabel. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getUserLabel(); + /** + * .Image user_label = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getUserLabelOrBuilder(); + + /** + * uint64 user_consume_in_room = 2; + * @return The userConsumeInRoom. + */ + long getUserConsumeInRoom(); + + /** + * uint64 user_send_gift_cnt_in_room = 3; + * @return The userSendGiftCntInRoom. + */ + long getUserSendGiftCntInRoom(); + } + /** + * Protobuf type {@code PublicAreaCommon} + */ + public static final class PublicAreaCommon extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:PublicAreaCommon) + PublicAreaCommonOrBuilder { + private static final long serialVersionUID = 0L; + // Use PublicAreaCommon.newBuilder() to construct. + private PublicAreaCommon(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PublicAreaCommon() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PublicAreaCommon(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.internal_static_PublicAreaCommon_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.internal_static_PublicAreaCommon_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.Builder.class); + } + + public static final int USER_LABEL_FIELD_NUMBER = 1; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image userLabel_; + /** + * .Image user_label = 1; + * @return Whether the userLabel field is set. + */ + @java.lang.Override + public boolean hasUserLabel() { + return userLabel_ != null; + } + /** + * .Image user_label = 1; + * @return The userLabel. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getUserLabel() { + return userLabel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : userLabel_; + } + /** + * .Image user_label = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getUserLabelOrBuilder() { + return userLabel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : userLabel_; + } + + public static final int USER_CONSUME_IN_ROOM_FIELD_NUMBER = 2; + private long userConsumeInRoom_ = 0L; + /** + * uint64 user_consume_in_room = 2; + * @return The userConsumeInRoom. + */ + @java.lang.Override + public long getUserConsumeInRoom() { + return userConsumeInRoom_; + } + + public static final int USER_SEND_GIFT_CNT_IN_ROOM_FIELD_NUMBER = 3; + private long userSendGiftCntInRoom_ = 0L; + /** + * uint64 user_send_gift_cnt_in_room = 3; + * @return The userSendGiftCntInRoom. + */ + @java.lang.Override + public long getUserSendGiftCntInRoom() { + return userSendGiftCntInRoom_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (userLabel_ != null) { + output.writeMessage(1, getUserLabel()); + } + if (userConsumeInRoom_ != 0L) { + output.writeUInt64(2, userConsumeInRoom_); + } + if (userSendGiftCntInRoom_ != 0L) { + output.writeUInt64(3, userSendGiftCntInRoom_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (userLabel_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getUserLabel()); + } + if (userConsumeInRoom_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, userConsumeInRoom_); + } + if (userSendGiftCntInRoom_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, userSendGiftCntInRoom_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon) obj; + + if (hasUserLabel() != other.hasUserLabel()) return false; + if (hasUserLabel()) { + if (!getUserLabel() + .equals(other.getUserLabel())) return false; + } + if (getUserConsumeInRoom() + != other.getUserConsumeInRoom()) return false; + if (getUserSendGiftCntInRoom() + != other.getUserSendGiftCntInRoom()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUserLabel()) { + hash = (37 * hash) + USER_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getUserLabel().hashCode(); + } + hash = (37 * hash) + USER_CONSUME_IN_ROOM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getUserConsumeInRoom()); + hash = (37 * hash) + USER_SEND_GIFT_CNT_IN_ROOM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getUserSendGiftCntInRoom()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code PublicAreaCommon} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:PublicAreaCommon) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommonOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.internal_static_PublicAreaCommon_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.internal_static_PublicAreaCommon_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + userLabel_ = null; + if (userLabelBuilder_ != null) { + userLabelBuilder_.dispose(); + userLabelBuilder_ = null; + } + userConsumeInRoom_ = 0L; + userSendGiftCntInRoom_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.internal_static_PublicAreaCommon_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.userLabel_ = userLabelBuilder_ == null + ? userLabel_ + : userLabelBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.userConsumeInRoom_ = userConsumeInRoom_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.userSendGiftCntInRoom_ = userSendGiftCntInRoom_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon.getDefaultInstance()) return this; + if (other.hasUserLabel()) { + mergeUserLabel(other.getUserLabel()); + } + if (other.getUserConsumeInRoom() != 0L) { + setUserConsumeInRoom(other.getUserConsumeInRoom()); + } + if (other.getUserSendGiftCntInRoom() != 0L) { + setUserSendGiftCntInRoom(other.getUserSendGiftCntInRoom()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getUserLabelFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + userConsumeInRoom_ = input.readUInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + userSendGiftCntInRoom_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image userLabel_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> userLabelBuilder_; + /** + * .Image user_label = 1; + * @return Whether the userLabel field is set. + */ + public boolean hasUserLabel() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .Image user_label = 1; + * @return The userLabel. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getUserLabel() { + if (userLabelBuilder_ == null) { + return userLabel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : userLabel_; + } else { + return userLabelBuilder_.getMessage(); + } + } + /** + * .Image user_label = 1; + */ + public Builder setUserLabel(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (userLabelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userLabel_ = value; + } else { + userLabelBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Image user_label = 1; + */ + public Builder setUserLabel( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (userLabelBuilder_ == null) { + userLabel_ = builderForValue.build(); + } else { + userLabelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Image user_label = 1; + */ + public Builder mergeUserLabel(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (userLabelBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + userLabel_ != null && + userLabel_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getUserLabelBuilder().mergeFrom(value); + } else { + userLabel_ = value; + } + } else { + userLabelBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Image user_label = 1; + */ + public Builder clearUserLabel() { + bitField0_ = (bitField0_ & ~0x00000001); + userLabel_ = null; + if (userLabelBuilder_ != null) { + userLabelBuilder_.dispose(); + userLabelBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image user_label = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getUserLabelBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUserLabelFieldBuilder().getBuilder(); + } + /** + * .Image user_label = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getUserLabelOrBuilder() { + if (userLabelBuilder_ != null) { + return userLabelBuilder_.getMessageOrBuilder(); + } else { + return userLabel_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : userLabel_; + } + } + /** + * .Image user_label = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getUserLabelFieldBuilder() { + if (userLabelBuilder_ == null) { + userLabelBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getUserLabel(), + getParentForChildren(), + isClean()); + userLabel_ = null; + } + return userLabelBuilder_; + } + + private long userConsumeInRoom_ ; + /** + * uint64 user_consume_in_room = 2; + * @return The userConsumeInRoom. + */ + @java.lang.Override + public long getUserConsumeInRoom() { + return userConsumeInRoom_; + } + /** + * uint64 user_consume_in_room = 2; + * @param value The userConsumeInRoom to set. + * @return This builder for chaining. + */ + public Builder setUserConsumeInRoom(long value) { + + userConsumeInRoom_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint64 user_consume_in_room = 2; + * @return This builder for chaining. + */ + public Builder clearUserConsumeInRoom() { + bitField0_ = (bitField0_ & ~0x00000002); + userConsumeInRoom_ = 0L; + onChanged(); + return this; + } + + private long userSendGiftCntInRoom_ ; + /** + * uint64 user_send_gift_cnt_in_room = 3; + * @return The userSendGiftCntInRoom. + */ + @java.lang.Override + public long getUserSendGiftCntInRoom() { + return userSendGiftCntInRoom_; + } + /** + * uint64 user_send_gift_cnt_in_room = 3; + * @param value The userSendGiftCntInRoom to set. + * @return This builder for chaining. + */ + public Builder setUserSendGiftCntInRoom(long value) { + + userSendGiftCntInRoom_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 user_send_gift_cnt_in_room = 3; + * @return This builder for chaining. + */ + public Builder clearUserSendGiftCntInRoom() { + bitField0_ = (bitField0_ & ~0x00000004); + userSendGiftCntInRoom_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:PublicAreaCommon) + } + + // @@protoc_insertion_point(class_scope:PublicAreaCommon) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PublicAreaCommon parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PublicAreaCommonOuterClass.PublicAreaCommon getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_PublicAreaCommon_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_PublicAreaCommon_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026PublicAreaCommon.proto\032\013Image.proto\"p\n" + + "\020PublicAreaCommon\022\032\n\nuser_label\030\001 \001(\0132\006." + + "Image\022\034\n\024user_consume_in_room\030\002 \001(\004\022\"\n\032u" + + "ser_send_gift_cnt_in_room\030\003 \001(\004B8\n6tech." + + "ordinaryroad.live.chat.client.douyin.pro" + + "tobuf.dtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.getDescriptor(), + }); + internal_static_PublicAreaCommon_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_PublicAreaCommon_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_PublicAreaCommon_descriptor, + new java.lang.String[] { "UserLabel", "UserConsumeInRoom", "UserSendGiftCntInRoom", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextEffectDetailOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextEffectDetailOuterClass.java new file mode 100644 index 0000000..9e29e90 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextEffectDetailOuterClass.java @@ -0,0 +1,1968 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: TextEffectDetail.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class TextEffectDetailOuterClass { + private TextEffectDetailOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TextEffectDetailOrBuilder extends + // @@protoc_insertion_point(interface_extends:TextEffectDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * .Text text = 1; + * @return Whether the text field is set. + */ + boolean hasText(); + /** + * .Text text = 1; + * @return The text. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text getText(); + /** + * .Text text = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder getTextOrBuilder(); + + /** + * uint32 text_font_size = 2; + * @return The textFontSize. + */ + int getTextFontSize(); + + /** + * .Image background = 3; + * @return Whether the background field is set. + */ + boolean hasBackground(); + /** + * .Image background = 3; + * @return The background. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackground(); + /** + * .Image background = 3; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundOrBuilder(); + + /** + * uint32 start = 4; + * @return The start. + */ + int getStart(); + + /** + * uint32 duration = 5; + * @return The duration. + */ + int getDuration(); + + /** + * uint32 x = 6; + * @return The x. + */ + int getX(); + + /** + * uint32 y = 7; + * @return The y. + */ + int getY(); + + /** + * uint32 width = 8; + * @return The width. + */ + int getWidth(); + + /** + * uint32 height = 9; + * @return The height. + */ + int getHeight(); + + /** + * uint32 shadow_dx = 10; + * @return The shadowDx. + */ + int getShadowDx(); + + /** + * uint32 shadow_dy = 11; + * @return The shadowDy. + */ + int getShadowDy(); + + /** + * uint32 shadow_radius = 12; + * @return The shadowRadius. + */ + int getShadowRadius(); + + /** + * string shadow_color = 13; + * @return The shadowColor. + */ + java.lang.String getShadowColor(); + /** + * string shadow_color = 13; + * @return The bytes for shadowColor. + */ + com.google.protobuf.ByteString + getShadowColorBytes(); + + /** + * string stroke_color = 14; + * @return The strokeColor. + */ + java.lang.String getStrokeColor(); + /** + * string stroke_color = 14; + * @return The bytes for strokeColor. + */ + com.google.protobuf.ByteString + getStrokeColorBytes(); + + /** + * uint32 stroke_width = 15; + * @return The strokeWidth. + */ + int getStrokeWidth(); + } + /** + * Protobuf type {@code TextEffectDetail} + */ + public static final class TextEffectDetail extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:TextEffectDetail) + TextEffectDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextEffectDetail.newBuilder() to construct. + private TextEffectDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextEffectDetail() { + shadowColor_ = ""; + strokeColor_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TextEffectDetail(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.internal_static_TextEffectDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.internal_static_TextEffectDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder.class); + } + + public static final int TEXT_FIELD_NUMBER = 1; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text text_; + /** + * .Text text = 1; + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return text_ != null; + } + /** + * .Text text = 1; + * @return The text. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text getText() { + return text_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance() : text_; + } + /** + * .Text text = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder getTextOrBuilder() { + return text_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance() : text_; + } + + public static final int TEXT_FONT_SIZE_FIELD_NUMBER = 2; + private int textFontSize_ = 0; + /** + * uint32 text_font_size = 2; + * @return The textFontSize. + */ + @java.lang.Override + public int getTextFontSize() { + return textFontSize_; + } + + public static final int BACKGROUND_FIELD_NUMBER = 3; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image background_; + /** + * .Image background = 3; + * @return Whether the background field is set. + */ + @java.lang.Override + public boolean hasBackground() { + return background_ != null; + } + /** + * .Image background = 3; + * @return The background. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackground() { + return background_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : background_; + } + /** + * .Image background = 3; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundOrBuilder() { + return background_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : background_; + } + + public static final int START_FIELD_NUMBER = 4; + private int start_ = 0; + /** + * uint32 start = 4; + * @return The start. + */ + @java.lang.Override + public int getStart() { + return start_; + } + + public static final int DURATION_FIELD_NUMBER = 5; + private int duration_ = 0; + /** + * uint32 duration = 5; + * @return The duration. + */ + @java.lang.Override + public int getDuration() { + return duration_; + } + + public static final int X_FIELD_NUMBER = 6; + private int x_ = 0; + /** + * uint32 x = 6; + * @return The x. + */ + @java.lang.Override + public int getX() { + return x_; + } + + public static final int Y_FIELD_NUMBER = 7; + private int y_ = 0; + /** + * uint32 y = 7; + * @return The y. + */ + @java.lang.Override + public int getY() { + return y_; + } + + public static final int WIDTH_FIELD_NUMBER = 8; + private int width_ = 0; + /** + * uint32 width = 8; + * @return The width. + */ + @java.lang.Override + public int getWidth() { + return width_; + } + + public static final int HEIGHT_FIELD_NUMBER = 9; + private int height_ = 0; + /** + * uint32 height = 9; + * @return The height. + */ + @java.lang.Override + public int getHeight() { + return height_; + } + + public static final int SHADOW_DX_FIELD_NUMBER = 10; + private int shadowDx_ = 0; + /** + * uint32 shadow_dx = 10; + * @return The shadowDx. + */ + @java.lang.Override + public int getShadowDx() { + return shadowDx_; + } + + public static final int SHADOW_DY_FIELD_NUMBER = 11; + private int shadowDy_ = 0; + /** + * uint32 shadow_dy = 11; + * @return The shadowDy. + */ + @java.lang.Override + public int getShadowDy() { + return shadowDy_; + } + + public static final int SHADOW_RADIUS_FIELD_NUMBER = 12; + private int shadowRadius_ = 0; + /** + * uint32 shadow_radius = 12; + * @return The shadowRadius. + */ + @java.lang.Override + public int getShadowRadius() { + return shadowRadius_; + } + + public static final int SHADOW_COLOR_FIELD_NUMBER = 13; + @SuppressWarnings("serial") + private volatile java.lang.Object shadowColor_ = ""; + /** + * string shadow_color = 13; + * @return The shadowColor. + */ + @java.lang.Override + public java.lang.String getShadowColor() { + java.lang.Object ref = shadowColor_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shadowColor_ = s; + return s; + } + } + /** + * string shadow_color = 13; + * @return The bytes for shadowColor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getShadowColorBytes() { + java.lang.Object ref = shadowColor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + shadowColor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STROKE_COLOR_FIELD_NUMBER = 14; + @SuppressWarnings("serial") + private volatile java.lang.Object strokeColor_ = ""; + /** + * string stroke_color = 14; + * @return The strokeColor. + */ + @java.lang.Override + public java.lang.String getStrokeColor() { + java.lang.Object ref = strokeColor_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + strokeColor_ = s; + return s; + } + } + /** + * string stroke_color = 14; + * @return The bytes for strokeColor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStrokeColorBytes() { + java.lang.Object ref = strokeColor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + strokeColor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STROKE_WIDTH_FIELD_NUMBER = 15; + private int strokeWidth_ = 0; + /** + * uint32 stroke_width = 15; + * @return The strokeWidth. + */ + @java.lang.Override + public int getStrokeWidth() { + return strokeWidth_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (text_ != null) { + output.writeMessage(1, getText()); + } + if (textFontSize_ != 0) { + output.writeUInt32(2, textFontSize_); + } + if (background_ != null) { + output.writeMessage(3, getBackground()); + } + if (start_ != 0) { + output.writeUInt32(4, start_); + } + if (duration_ != 0) { + output.writeUInt32(5, duration_); + } + if (x_ != 0) { + output.writeUInt32(6, x_); + } + if (y_ != 0) { + output.writeUInt32(7, y_); + } + if (width_ != 0) { + output.writeUInt32(8, width_); + } + if (height_ != 0) { + output.writeUInt32(9, height_); + } + if (shadowDx_ != 0) { + output.writeUInt32(10, shadowDx_); + } + if (shadowDy_ != 0) { + output.writeUInt32(11, shadowDy_); + } + if (shadowRadius_ != 0) { + output.writeUInt32(12, shadowRadius_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(shadowColor_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, shadowColor_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(strokeColor_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, strokeColor_); + } + if (strokeWidth_ != 0) { + output.writeUInt32(15, strokeWidth_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (text_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getText()); + } + if (textFontSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, textFontSize_); + } + if (background_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getBackground()); + } + if (start_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, start_); + } + if (duration_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, duration_); + } + if (x_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(6, x_); + } + if (y_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(7, y_); + } + if (width_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(8, width_); + } + if (height_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(9, height_); + } + if (shadowDx_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(10, shadowDx_); + } + if (shadowDy_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(11, shadowDy_); + } + if (shadowRadius_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(12, shadowRadius_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(shadowColor_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, shadowColor_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(strokeColor_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, strokeColor_); + } + if (strokeWidth_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(15, strokeWidth_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail) obj; + + if (hasText() != other.hasText()) return false; + if (hasText()) { + if (!getText() + .equals(other.getText())) return false; + } + if (getTextFontSize() + != other.getTextFontSize()) return false; + if (hasBackground() != other.hasBackground()) return false; + if (hasBackground()) { + if (!getBackground() + .equals(other.getBackground())) return false; + } + if (getStart() + != other.getStart()) return false; + if (getDuration() + != other.getDuration()) return false; + if (getX() + != other.getX()) return false; + if (getY() + != other.getY()) return false; + if (getWidth() + != other.getWidth()) return false; + if (getHeight() + != other.getHeight()) return false; + if (getShadowDx() + != other.getShadowDx()) return false; + if (getShadowDy() + != other.getShadowDy()) return false; + if (getShadowRadius() + != other.getShadowRadius()) return false; + if (!getShadowColor() + .equals(other.getShadowColor())) return false; + if (!getStrokeColor() + .equals(other.getStrokeColor())) return false; + if (getStrokeWidth() + != other.getStrokeWidth()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasText()) { + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + } + hash = (37 * hash) + TEXT_FONT_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTextFontSize(); + if (hasBackground()) { + hash = (37 * hash) + BACKGROUND_FIELD_NUMBER; + hash = (53 * hash) + getBackground().hashCode(); + } + hash = (37 * hash) + START_FIELD_NUMBER; + hash = (53 * hash) + getStart(); + hash = (37 * hash) + DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDuration(); + hash = (37 * hash) + X_FIELD_NUMBER; + hash = (53 * hash) + getX(); + hash = (37 * hash) + Y_FIELD_NUMBER; + hash = (53 * hash) + getY(); + hash = (37 * hash) + WIDTH_FIELD_NUMBER; + hash = (53 * hash) + getWidth(); + hash = (37 * hash) + HEIGHT_FIELD_NUMBER; + hash = (53 * hash) + getHeight(); + hash = (37 * hash) + SHADOW_DX_FIELD_NUMBER; + hash = (53 * hash) + getShadowDx(); + hash = (37 * hash) + SHADOW_DY_FIELD_NUMBER; + hash = (53 * hash) + getShadowDy(); + hash = (37 * hash) + SHADOW_RADIUS_FIELD_NUMBER; + hash = (53 * hash) + getShadowRadius(); + hash = (37 * hash) + SHADOW_COLOR_FIELD_NUMBER; + hash = (53 * hash) + getShadowColor().hashCode(); + hash = (37 * hash) + STROKE_COLOR_FIELD_NUMBER; + hash = (53 * hash) + getStrokeColor().hashCode(); + hash = (37 * hash) + STROKE_WIDTH_FIELD_NUMBER; + hash = (53 * hash) + getStrokeWidth(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code TextEffectDetail} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:TextEffectDetail) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.internal_static_TextEffectDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.internal_static_TextEffectDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + text_ = null; + if (textBuilder_ != null) { + textBuilder_.dispose(); + textBuilder_ = null; + } + textFontSize_ = 0; + background_ = null; + if (backgroundBuilder_ != null) { + backgroundBuilder_.dispose(); + backgroundBuilder_ = null; + } + start_ = 0; + duration_ = 0; + x_ = 0; + y_ = 0; + width_ = 0; + height_ = 0; + shadowDx_ = 0; + shadowDy_ = 0; + shadowRadius_ = 0; + shadowColor_ = ""; + strokeColor_ = ""; + strokeWidth_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.internal_static_TextEffectDetail_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.text_ = textBuilder_ == null + ? text_ + : textBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.textFontSize_ = textFontSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.background_ = backgroundBuilder_ == null + ? background_ + : backgroundBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.start_ = start_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.duration_ = duration_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.x_ = x_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.y_ = y_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.width_ = width_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.height_ = height_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.shadowDx_ = shadowDx_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.shadowDy_ = shadowDy_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.shadowRadius_ = shadowRadius_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.shadowColor_ = shadowColor_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.strokeColor_ = strokeColor_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.strokeWidth_ = strokeWidth_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance()) return this; + if (other.hasText()) { + mergeText(other.getText()); + } + if (other.getTextFontSize() != 0) { + setTextFontSize(other.getTextFontSize()); + } + if (other.hasBackground()) { + mergeBackground(other.getBackground()); + } + if (other.getStart() != 0) { + setStart(other.getStart()); + } + if (other.getDuration() != 0) { + setDuration(other.getDuration()); + } + if (other.getX() != 0) { + setX(other.getX()); + } + if (other.getY() != 0) { + setY(other.getY()); + } + if (other.getWidth() != 0) { + setWidth(other.getWidth()); + } + if (other.getHeight() != 0) { + setHeight(other.getHeight()); + } + if (other.getShadowDx() != 0) { + setShadowDx(other.getShadowDx()); + } + if (other.getShadowDy() != 0) { + setShadowDy(other.getShadowDy()); + } + if (other.getShadowRadius() != 0) { + setShadowRadius(other.getShadowRadius()); + } + if (!other.getShadowColor().isEmpty()) { + shadowColor_ = other.shadowColor_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (!other.getStrokeColor().isEmpty()) { + strokeColor_ = other.strokeColor_; + bitField0_ |= 0x00002000; + onChanged(); + } + if (other.getStrokeWidth() != 0) { + setStrokeWidth(other.getStrokeWidth()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getTextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + textFontSize_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + input.readMessage( + getBackgroundFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + start_ = input.readUInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + duration_ = input.readUInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + x_ = input.readUInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + y_ = input.readUInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + width_ = input.readUInt32(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + height_ = input.readUInt32(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: { + shadowDx_ = input.readUInt32(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: { + shadowDy_ = input.readUInt32(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 96: { + shadowRadius_ = input.readUInt32(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 106: { + shadowColor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 114: { + strokeColor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 120: { + strokeWidth_ = input.readUInt32(); + bitField0_ |= 0x00004000; + break; + } // case 120 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text text_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder> textBuilder_; + /** + * .Text text = 1; + * @return Whether the text field is set. + */ + public boolean hasText() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .Text text = 1; + * @return The text. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text getText() { + if (textBuilder_ == null) { + return text_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance() : text_; + } else { + return textBuilder_.getMessage(); + } + } + /** + * .Text text = 1; + */ + public Builder setText(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text value) { + if (textBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + text_ = value; + } else { + textBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Text text = 1; + */ + public Builder setText( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder builderForValue) { + if (textBuilder_ == null) { + text_ = builderForValue.build(); + } else { + textBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Text text = 1; + */ + public Builder mergeText(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text value) { + if (textBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + text_ != null && + text_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance()) { + getTextBuilder().mergeFrom(value); + } else { + text_ = value; + } + } else { + textBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Text text = 1; + */ + public Builder clearText() { + bitField0_ = (bitField0_ & ~0x00000001); + text_ = null; + if (textBuilder_ != null) { + textBuilder_.dispose(); + textBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Text text = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder getTextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getTextFieldBuilder().getBuilder(); + } + /** + * .Text text = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder getTextOrBuilder() { + if (textBuilder_ != null) { + return textBuilder_.getMessageOrBuilder(); + } else { + return text_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance() : text_; + } + } + /** + * .Text text = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder> + getTextFieldBuilder() { + if (textBuilder_ == null) { + textBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder>( + getText(), + getParentForChildren(), + isClean()); + text_ = null; + } + return textBuilder_; + } + + private int textFontSize_ ; + /** + * uint32 text_font_size = 2; + * @return The textFontSize. + */ + @java.lang.Override + public int getTextFontSize() { + return textFontSize_; + } + /** + * uint32 text_font_size = 2; + * @param value The textFontSize to set. + * @return This builder for chaining. + */ + public Builder setTextFontSize(int value) { + + textFontSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint32 text_font_size = 2; + * @return This builder for chaining. + */ + public Builder clearTextFontSize() { + bitField0_ = (bitField0_ & ~0x00000002); + textFontSize_ = 0; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image background_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> backgroundBuilder_; + /** + * .Image background = 3; + * @return Whether the background field is set. + */ + public boolean hasBackground() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * .Image background = 3; + * @return The background. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackground() { + if (backgroundBuilder_ == null) { + return background_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : background_; + } else { + return backgroundBuilder_.getMessage(); + } + } + /** + * .Image background = 3; + */ + public Builder setBackground(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (backgroundBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + background_ = value; + } else { + backgroundBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .Image background = 3; + */ + public Builder setBackground( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (backgroundBuilder_ == null) { + background_ = builderForValue.build(); + } else { + backgroundBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .Image background = 3; + */ + public Builder mergeBackground(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (backgroundBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + background_ != null && + background_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getBackgroundBuilder().mergeFrom(value); + } else { + background_ = value; + } + } else { + backgroundBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .Image background = 3; + */ + public Builder clearBackground() { + bitField0_ = (bitField0_ & ~0x00000004); + background_ = null; + if (backgroundBuilder_ != null) { + backgroundBuilder_.dispose(); + backgroundBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image background = 3; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getBackgroundBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getBackgroundFieldBuilder().getBuilder(); + } + /** + * .Image background = 3; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundOrBuilder() { + if (backgroundBuilder_ != null) { + return backgroundBuilder_.getMessageOrBuilder(); + } else { + return background_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : background_; + } + } + /** + * .Image background = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getBackgroundFieldBuilder() { + if (backgroundBuilder_ == null) { + backgroundBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getBackground(), + getParentForChildren(), + isClean()); + background_ = null; + } + return backgroundBuilder_; + } + + private int start_ ; + /** + * uint32 start = 4; + * @return The start. + */ + @java.lang.Override + public int getStart() { + return start_; + } + /** + * uint32 start = 4; + * @param value The start to set. + * @return This builder for chaining. + */ + public Builder setStart(int value) { + + start_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint32 start = 4; + * @return This builder for chaining. + */ + public Builder clearStart() { + bitField0_ = (bitField0_ & ~0x00000008); + start_ = 0; + onChanged(); + return this; + } + + private int duration_ ; + /** + * uint32 duration = 5; + * @return The duration. + */ + @java.lang.Override + public int getDuration() { + return duration_; + } + /** + * uint32 duration = 5; + * @param value The duration to set. + * @return This builder for chaining. + */ + public Builder setDuration(int value) { + + duration_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * uint32 duration = 5; + * @return This builder for chaining. + */ + public Builder clearDuration() { + bitField0_ = (bitField0_ & ~0x00000010); + duration_ = 0; + onChanged(); + return this; + } + + private int x_ ; + /** + * uint32 x = 6; + * @return The x. + */ + @java.lang.Override + public int getX() { + return x_; + } + /** + * uint32 x = 6; + * @param value The x to set. + * @return This builder for chaining. + */ + public Builder setX(int value) { + + x_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * uint32 x = 6; + * @return This builder for chaining. + */ + public Builder clearX() { + bitField0_ = (bitField0_ & ~0x00000020); + x_ = 0; + onChanged(); + return this; + } + + private int y_ ; + /** + * uint32 y = 7; + * @return The y. + */ + @java.lang.Override + public int getY() { + return y_; + } + /** + * uint32 y = 7; + * @param value The y to set. + * @return This builder for chaining. + */ + public Builder setY(int value) { + + y_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * uint32 y = 7; + * @return This builder for chaining. + */ + public Builder clearY() { + bitField0_ = (bitField0_ & ~0x00000040); + y_ = 0; + onChanged(); + return this; + } + + private int width_ ; + /** + * uint32 width = 8; + * @return The width. + */ + @java.lang.Override + public int getWidth() { + return width_; + } + /** + * uint32 width = 8; + * @param value The width to set. + * @return This builder for chaining. + */ + public Builder setWidth(int value) { + + width_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * uint32 width = 8; + * @return This builder for chaining. + */ + public Builder clearWidth() { + bitField0_ = (bitField0_ & ~0x00000080); + width_ = 0; + onChanged(); + return this; + } + + private int height_ ; + /** + * uint32 height = 9; + * @return The height. + */ + @java.lang.Override + public int getHeight() { + return height_; + } + /** + * uint32 height = 9; + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(int value) { + + height_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * uint32 height = 9; + * @return This builder for chaining. + */ + public Builder clearHeight() { + bitField0_ = (bitField0_ & ~0x00000100); + height_ = 0; + onChanged(); + return this; + } + + private int shadowDx_ ; + /** + * uint32 shadow_dx = 10; + * @return The shadowDx. + */ + @java.lang.Override + public int getShadowDx() { + return shadowDx_; + } + /** + * uint32 shadow_dx = 10; + * @param value The shadowDx to set. + * @return This builder for chaining. + */ + public Builder setShadowDx(int value) { + + shadowDx_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * uint32 shadow_dx = 10; + * @return This builder for chaining. + */ + public Builder clearShadowDx() { + bitField0_ = (bitField0_ & ~0x00000200); + shadowDx_ = 0; + onChanged(); + return this; + } + + private int shadowDy_ ; + /** + * uint32 shadow_dy = 11; + * @return The shadowDy. + */ + @java.lang.Override + public int getShadowDy() { + return shadowDy_; + } + /** + * uint32 shadow_dy = 11; + * @param value The shadowDy to set. + * @return This builder for chaining. + */ + public Builder setShadowDy(int value) { + + shadowDy_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * uint32 shadow_dy = 11; + * @return This builder for chaining. + */ + public Builder clearShadowDy() { + bitField0_ = (bitField0_ & ~0x00000400); + shadowDy_ = 0; + onChanged(); + return this; + } + + private int shadowRadius_ ; + /** + * uint32 shadow_radius = 12; + * @return The shadowRadius. + */ + @java.lang.Override + public int getShadowRadius() { + return shadowRadius_; + } + /** + * uint32 shadow_radius = 12; + * @param value The shadowRadius to set. + * @return This builder for chaining. + */ + public Builder setShadowRadius(int value) { + + shadowRadius_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * uint32 shadow_radius = 12; + * @return This builder for chaining. + */ + public Builder clearShadowRadius() { + bitField0_ = (bitField0_ & ~0x00000800); + shadowRadius_ = 0; + onChanged(); + return this; + } + + private java.lang.Object shadowColor_ = ""; + /** + * string shadow_color = 13; + * @return The shadowColor. + */ + public java.lang.String getShadowColor() { + java.lang.Object ref = shadowColor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shadowColor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string shadow_color = 13; + * @return The bytes for shadowColor. + */ + public com.google.protobuf.ByteString + getShadowColorBytes() { + java.lang.Object ref = shadowColor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + shadowColor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string shadow_color = 13; + * @param value The shadowColor to set. + * @return This builder for chaining. + */ + public Builder setShadowColor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + shadowColor_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * string shadow_color = 13; + * @return This builder for chaining. + */ + public Builder clearShadowColor() { + shadowColor_ = getDefaultInstance().getShadowColor(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + /** + * string shadow_color = 13; + * @param value The bytes for shadowColor to set. + * @return This builder for chaining. + */ + public Builder setShadowColorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + shadowColor_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private java.lang.Object strokeColor_ = ""; + /** + * string stroke_color = 14; + * @return The strokeColor. + */ + public java.lang.String getStrokeColor() { + java.lang.Object ref = strokeColor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + strokeColor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string stroke_color = 14; + * @return The bytes for strokeColor. + */ + public com.google.protobuf.ByteString + getStrokeColorBytes() { + java.lang.Object ref = strokeColor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + strokeColor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string stroke_color = 14; + * @param value The strokeColor to set. + * @return This builder for chaining. + */ + public Builder setStrokeColor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + strokeColor_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * string stroke_color = 14; + * @return This builder for chaining. + */ + public Builder clearStrokeColor() { + strokeColor_ = getDefaultInstance().getStrokeColor(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + /** + * string stroke_color = 14; + * @param value The bytes for strokeColor to set. + * @return This builder for chaining. + */ + public Builder setStrokeColorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + strokeColor_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + private int strokeWidth_ ; + /** + * uint32 stroke_width = 15; + * @return The strokeWidth. + */ + @java.lang.Override + public int getStrokeWidth() { + return strokeWidth_; + } + /** + * uint32 stroke_width = 15; + * @param value The strokeWidth to set. + * @return This builder for chaining. + */ + public Builder setStrokeWidth(int value) { + + strokeWidth_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * uint32 stroke_width = 15; + * @return This builder for chaining. + */ + public Builder clearStrokeWidth() { + bitField0_ = (bitField0_ & ~0x00004000); + strokeWidth_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:TextEffectDetail) + } + + // @@protoc_insertion_point(class_scope:TextEffectDetail) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextEffectDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_TextEffectDetail_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_TextEffectDetail_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026TextEffectDetail.proto\032\013Image.proto\032\nT" + + "ext.proto\"\260\002\n\020TextEffectDetail\022\023\n\004text\030\001" + + " \001(\0132\005.Text\022\026\n\016text_font_size\030\002 \001(\r\022\032\n\nb" + + "ackground\030\003 \001(\0132\006.Image\022\r\n\005start\030\004 \001(\r\022\020" + + "\n\010duration\030\005 \001(\r\022\t\n\001x\030\006 \001(\r\022\t\n\001y\030\007 \001(\r\022\r" + + "\n\005width\030\010 \001(\r\022\016\n\006height\030\t \001(\r\022\021\n\tshadow_" + + "dx\030\n \001(\r\022\021\n\tshadow_dy\030\013 \001(\r\022\025\n\rshadow_ra" + + "dius\030\014 \001(\r\022\024\n\014shadow_color\030\r \001(\t\022\024\n\014stro" + + "ke_color\030\016 \001(\t\022\024\n\014stroke_width\030\017 \001(\rB8\n6" + + "tech.ordinaryroad.live.chat.client.douyi" + + "n.protobuf.dtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.getDescriptor(), + }); + internal_static_TextEffectDetail_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_TextEffectDetail_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_TextEffectDetail_descriptor, + new java.lang.String[] { "Text", "TextFontSize", "Background", "Start", "Duration", "X", "Y", "Width", "Height", "ShadowDx", "ShadowDy", "ShadowRadius", "ShadowColor", "StrokeColor", "StrokeWidth", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextEffectOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextEffectOuterClass.java new file mode 100644 index 0000000..9fffc74 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextEffectOuterClass.java @@ -0,0 +1,872 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: TextEffect.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class TextEffectOuterClass { + private TextEffectOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TextEffectOrBuilder extends + // @@protoc_insertion_point(interface_extends:TextEffect) + com.google.protobuf.MessageOrBuilder { + + /** + * .TextEffectDetail portrait = 1; + * @return Whether the portrait field is set. + */ + boolean hasPortrait(); + /** + * .TextEffectDetail portrait = 1; + * @return The portrait. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getPortrait(); + /** + * .TextEffectDetail portrait = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder getPortraitOrBuilder(); + + /** + * .TextEffectDetail landscape = 2; + * @return Whether the landscape field is set. + */ + boolean hasLandscape(); + /** + * .TextEffectDetail landscape = 2; + * @return The landscape. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getLandscape(); + /** + * .TextEffectDetail landscape = 2; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder getLandscapeOrBuilder(); + } + /** + * Protobuf type {@code TextEffect} + */ + public static final class TextEffect extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:TextEffect) + TextEffectOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextEffect.newBuilder() to construct. + private TextEffect(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextEffect() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TextEffect(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.internal_static_TextEffect_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.internal_static_TextEffect_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.Builder.class); + } + + public static final int PORTRAIT_FIELD_NUMBER = 1; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail portrait_; + /** + * .TextEffectDetail portrait = 1; + * @return Whether the portrait field is set. + */ + @java.lang.Override + public boolean hasPortrait() { + return portrait_ != null; + } + /** + * .TextEffectDetail portrait = 1; + * @return The portrait. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getPortrait() { + return portrait_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : portrait_; + } + /** + * .TextEffectDetail portrait = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder getPortraitOrBuilder() { + return portrait_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : portrait_; + } + + public static final int LANDSCAPE_FIELD_NUMBER = 2; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail landscape_; + /** + * .TextEffectDetail landscape = 2; + * @return Whether the landscape field is set. + */ + @java.lang.Override + public boolean hasLandscape() { + return landscape_ != null; + } + /** + * .TextEffectDetail landscape = 2; + * @return The landscape. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getLandscape() { + return landscape_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : landscape_; + } + /** + * .TextEffectDetail landscape = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder getLandscapeOrBuilder() { + return landscape_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : landscape_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (portrait_ != null) { + output.writeMessage(1, getPortrait()); + } + if (landscape_ != null) { + output.writeMessage(2, getLandscape()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (portrait_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getPortrait()); + } + if (landscape_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getLandscape()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect) obj; + + if (hasPortrait() != other.hasPortrait()) return false; + if (hasPortrait()) { + if (!getPortrait() + .equals(other.getPortrait())) return false; + } + if (hasLandscape() != other.hasLandscape()) return false; + if (hasLandscape()) { + if (!getLandscape() + .equals(other.getLandscape())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPortrait()) { + hash = (37 * hash) + PORTRAIT_FIELD_NUMBER; + hash = (53 * hash) + getPortrait().hashCode(); + } + if (hasLandscape()) { + hash = (37 * hash) + LANDSCAPE_FIELD_NUMBER; + hash = (53 * hash) + getLandscape().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code TextEffect} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:TextEffect) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffectOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.internal_static_TextEffect_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.internal_static_TextEffect_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + portrait_ = null; + if (portraitBuilder_ != null) { + portraitBuilder_.dispose(); + portraitBuilder_ = null; + } + landscape_ = null; + if (landscapeBuilder_ != null) { + landscapeBuilder_.dispose(); + landscapeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.internal_static_TextEffect_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.portrait_ = portraitBuilder_ == null + ? portrait_ + : portraitBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.landscape_ = landscapeBuilder_ == null + ? landscape_ + : landscapeBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect.getDefaultInstance()) return this; + if (other.hasPortrait()) { + mergePortrait(other.getPortrait()); + } + if (other.hasLandscape()) { + mergeLandscape(other.getLandscape()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getPortraitFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getLandscapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail portrait_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder> portraitBuilder_; + /** + * .TextEffectDetail portrait = 1; + * @return Whether the portrait field is set. + */ + public boolean hasPortrait() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .TextEffectDetail portrait = 1; + * @return The portrait. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getPortrait() { + if (portraitBuilder_ == null) { + return portrait_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : portrait_; + } else { + return portraitBuilder_.getMessage(); + } + } + /** + * .TextEffectDetail portrait = 1; + */ + public Builder setPortrait(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail value) { + if (portraitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + portrait_ = value; + } else { + portraitBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .TextEffectDetail portrait = 1; + */ + public Builder setPortrait( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder builderForValue) { + if (portraitBuilder_ == null) { + portrait_ = builderForValue.build(); + } else { + portraitBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .TextEffectDetail portrait = 1; + */ + public Builder mergePortrait(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail value) { + if (portraitBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + portrait_ != null && + portrait_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance()) { + getPortraitBuilder().mergeFrom(value); + } else { + portrait_ = value; + } + } else { + portraitBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .TextEffectDetail portrait = 1; + */ + public Builder clearPortrait() { + bitField0_ = (bitField0_ & ~0x00000001); + portrait_ = null; + if (portraitBuilder_ != null) { + portraitBuilder_.dispose(); + portraitBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .TextEffectDetail portrait = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder getPortraitBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPortraitFieldBuilder().getBuilder(); + } + /** + * .TextEffectDetail portrait = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder getPortraitOrBuilder() { + if (portraitBuilder_ != null) { + return portraitBuilder_.getMessageOrBuilder(); + } else { + return portrait_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : portrait_; + } + } + /** + * .TextEffectDetail portrait = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder> + getPortraitFieldBuilder() { + if (portraitBuilder_ == null) { + portraitBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder>( + getPortrait(), + getParentForChildren(), + isClean()); + portrait_ = null; + } + return portraitBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail landscape_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder> landscapeBuilder_; + /** + * .TextEffectDetail landscape = 2; + * @return Whether the landscape field is set. + */ + public boolean hasLandscape() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .TextEffectDetail landscape = 2; + * @return The landscape. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail getLandscape() { + if (landscapeBuilder_ == null) { + return landscape_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : landscape_; + } else { + return landscapeBuilder_.getMessage(); + } + } + /** + * .TextEffectDetail landscape = 2; + */ + public Builder setLandscape(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail value) { + if (landscapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + landscape_ = value; + } else { + landscapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .TextEffectDetail landscape = 2; + */ + public Builder setLandscape( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder builderForValue) { + if (landscapeBuilder_ == null) { + landscape_ = builderForValue.build(); + } else { + landscapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .TextEffectDetail landscape = 2; + */ + public Builder mergeLandscape(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail value) { + if (landscapeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + landscape_ != null && + landscape_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance()) { + getLandscapeBuilder().mergeFrom(value); + } else { + landscape_ = value; + } + } else { + landscapeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .TextEffectDetail landscape = 2; + */ + public Builder clearLandscape() { + bitField0_ = (bitField0_ & ~0x00000002); + landscape_ = null; + if (landscapeBuilder_ != null) { + landscapeBuilder_.dispose(); + landscapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .TextEffectDetail landscape = 2; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder getLandscapeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getLandscapeFieldBuilder().getBuilder(); + } + /** + * .TextEffectDetail landscape = 2; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder getLandscapeOrBuilder() { + if (landscapeBuilder_ != null) { + return landscapeBuilder_.getMessageOrBuilder(); + } else { + return landscape_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.getDefaultInstance() : landscape_; + } + } + /** + * .TextEffectDetail landscape = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder> + getLandscapeFieldBuilder() { + if (landscapeBuilder_ == null) { + landscapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetail.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.TextEffectDetailOrBuilder>( + getLandscape(), + getParentForChildren(), + isClean()); + landscape_ = null; + } + return landscapeBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:TextEffect) + } + + // @@protoc_insertion_point(class_scope:TextEffect) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextEffect parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectOuterClass.TextEffect getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_TextEffect_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_TextEffect_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\020TextEffect.proto\032\026TextEffectDetail.pro" + + "to\"W\n\nTextEffect\022#\n\010portrait\030\001 \001(\0132\021.Tex" + + "tEffectDetail\022$\n\tlandscape\030\002 \001(\0132\021.TextE" + + "ffectDetailB8\n6tech.ordinaryroad.live.ch" + + "at.client.douyin.protobuf.dtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.getDescriptor(), + }); + internal_static_TextEffect_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_TextEffect_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_TextEffect_descriptor, + new java.lang.String[] { "Portrait", "Landscape", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextEffectDetailOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextFormatOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextFormatOuterClass.java new file mode 100644 index 0000000..d3fc345 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextFormatOuterClass.java @@ -0,0 +1,1136 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: TextFormat.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class TextFormatOuterClass { + private TextFormatOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TextFormatOrBuilder extends + // @@protoc_insertion_point(interface_extends:TextFormat) + com.google.protobuf.MessageOrBuilder { + + /** + * string color = 1; + * @return The color. + */ + java.lang.String getColor(); + /** + * string color = 1; + * @return The bytes for color. + */ + com.google.protobuf.ByteString + getColorBytes(); + + /** + * bool bold = 2; + * @return The bold. + */ + boolean getBold(); + + /** + * bool italic = 3; + * @return The italic. + */ + boolean getItalic(); + + /** + * uint32 weight = 4; + * @return The weight. + */ + int getWeight(); + + /** + * uint32 italic_angle = 5; + * @return The italicAngle. + */ + int getItalicAngle(); + + /** + * uint32 font_size = 6; + * @return The fontSize. + */ + int getFontSize(); + + /** + * bool use_heigh_light_color = 7; + * @return The useHeighLightColor. + */ + boolean getUseHeighLightColor(); + + /** + * bool use_remote_clor = 8; + * @return The useRemoteClor. + */ + boolean getUseRemoteClor(); + } + /** + * Protobuf type {@code TextFormat} + */ + public static final class TextFormat extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:TextFormat) + TextFormatOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextFormat.newBuilder() to construct. + private TextFormat(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextFormat() { + color_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TextFormat(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.internal_static_TextFormat_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.internal_static_TextFormat_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.Builder.class); + } + + public static final int COLOR_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object color_ = ""; + /** + * string color = 1; + * @return The color. + */ + @java.lang.Override + public java.lang.String getColor() { + java.lang.Object ref = color_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + color_ = s; + return s; + } + } + /** + * string color = 1; + * @return The bytes for color. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getColorBytes() { + java.lang.Object ref = color_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + color_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOLD_FIELD_NUMBER = 2; + private boolean bold_ = false; + /** + * bool bold = 2; + * @return The bold. + */ + @java.lang.Override + public boolean getBold() { + return bold_; + } + + public static final int ITALIC_FIELD_NUMBER = 3; + private boolean italic_ = false; + /** + * bool italic = 3; + * @return The italic. + */ + @java.lang.Override + public boolean getItalic() { + return italic_; + } + + public static final int WEIGHT_FIELD_NUMBER = 4; + private int weight_ = 0; + /** + * uint32 weight = 4; + * @return The weight. + */ + @java.lang.Override + public int getWeight() { + return weight_; + } + + public static final int ITALIC_ANGLE_FIELD_NUMBER = 5; + private int italicAngle_ = 0; + /** + * uint32 italic_angle = 5; + * @return The italicAngle. + */ + @java.lang.Override + public int getItalicAngle() { + return italicAngle_; + } + + public static final int FONT_SIZE_FIELD_NUMBER = 6; + private int fontSize_ = 0; + /** + * uint32 font_size = 6; + * @return The fontSize. + */ + @java.lang.Override + public int getFontSize() { + return fontSize_; + } + + public static final int USE_HEIGH_LIGHT_COLOR_FIELD_NUMBER = 7; + private boolean useHeighLightColor_ = false; + /** + * bool use_heigh_light_color = 7; + * @return The useHeighLightColor. + */ + @java.lang.Override + public boolean getUseHeighLightColor() { + return useHeighLightColor_; + } + + public static final int USE_REMOTE_CLOR_FIELD_NUMBER = 8; + private boolean useRemoteClor_ = false; + /** + * bool use_remote_clor = 8; + * @return The useRemoteClor. + */ + @java.lang.Override + public boolean getUseRemoteClor() { + return useRemoteClor_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(color_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, color_); + } + if (bold_ != false) { + output.writeBool(2, bold_); + } + if (italic_ != false) { + output.writeBool(3, italic_); + } + if (weight_ != 0) { + output.writeUInt32(4, weight_); + } + if (italicAngle_ != 0) { + output.writeUInt32(5, italicAngle_); + } + if (fontSize_ != 0) { + output.writeUInt32(6, fontSize_); + } + if (useHeighLightColor_ != false) { + output.writeBool(7, useHeighLightColor_); + } + if (useRemoteClor_ != false) { + output.writeBool(8, useRemoteClor_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(color_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, color_); + } + if (bold_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, bold_); + } + if (italic_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, italic_); + } + if (weight_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, weight_); + } + if (italicAngle_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, italicAngle_); + } + if (fontSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(6, fontSize_); + } + if (useHeighLightColor_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, useHeighLightColor_); + } + if (useRemoteClor_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(8, useRemoteClor_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat) obj; + + if (!getColor() + .equals(other.getColor())) return false; + if (getBold() + != other.getBold()) return false; + if (getItalic() + != other.getItalic()) return false; + if (getWeight() + != other.getWeight()) return false; + if (getItalicAngle() + != other.getItalicAngle()) return false; + if (getFontSize() + != other.getFontSize()) return false; + if (getUseHeighLightColor() + != other.getUseHeighLightColor()) return false; + if (getUseRemoteClor() + != other.getUseRemoteClor()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + COLOR_FIELD_NUMBER; + hash = (53 * hash) + getColor().hashCode(); + hash = (37 * hash) + BOLD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getBold()); + hash = (37 * hash) + ITALIC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getItalic()); + hash = (37 * hash) + WEIGHT_FIELD_NUMBER; + hash = (53 * hash) + getWeight(); + hash = (37 * hash) + ITALIC_ANGLE_FIELD_NUMBER; + hash = (53 * hash) + getItalicAngle(); + hash = (37 * hash) + FONT_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getFontSize(); + hash = (37 * hash) + USE_HEIGH_LIGHT_COLOR_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUseHeighLightColor()); + hash = (37 * hash) + USE_REMOTE_CLOR_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUseRemoteClor()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code TextFormat} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:TextFormat) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormatOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.internal_static_TextFormat_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.internal_static_TextFormat_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + color_ = ""; + bold_ = false; + italic_ = false; + weight_ = 0; + italicAngle_ = 0; + fontSize_ = 0; + useHeighLightColor_ = false; + useRemoteClor_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.internal_static_TextFormat_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.color_ = color_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.bold_ = bold_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.italic_ = italic_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.weight_ = weight_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.italicAngle_ = italicAngle_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.fontSize_ = fontSize_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.useHeighLightColor_ = useHeighLightColor_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.useRemoteClor_ = useRemoteClor_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.getDefaultInstance()) return this; + if (!other.getColor().isEmpty()) { + color_ = other.color_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getBold() != false) { + setBold(other.getBold()); + } + if (other.getItalic() != false) { + setItalic(other.getItalic()); + } + if (other.getWeight() != 0) { + setWeight(other.getWeight()); + } + if (other.getItalicAngle() != 0) { + setItalicAngle(other.getItalicAngle()); + } + if (other.getFontSize() != 0) { + setFontSize(other.getFontSize()); + } + if (other.getUseHeighLightColor() != false) { + setUseHeighLightColor(other.getUseHeighLightColor()); + } + if (other.getUseRemoteClor() != false) { + setUseRemoteClor(other.getUseRemoteClor()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + color_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + bold_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + italic_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + weight_ = input.readUInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + italicAngle_ = input.readUInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + fontSize_ = input.readUInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + useHeighLightColor_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + useRemoteClor_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 64 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object color_ = ""; + /** + * string color = 1; + * @return The color. + */ + public java.lang.String getColor() { + java.lang.Object ref = color_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + color_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string color = 1; + * @return The bytes for color. + */ + public com.google.protobuf.ByteString + getColorBytes() { + java.lang.Object ref = color_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + color_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string color = 1; + * @param value The color to set. + * @return This builder for chaining. + */ + public Builder setColor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + color_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string color = 1; + * @return This builder for chaining. + */ + public Builder clearColor() { + color_ = getDefaultInstance().getColor(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string color = 1; + * @param value The bytes for color to set. + * @return This builder for chaining. + */ + public Builder setColorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + color_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean bold_ ; + /** + * bool bold = 2; + * @return The bold. + */ + @java.lang.Override + public boolean getBold() { + return bold_; + } + /** + * bool bold = 2; + * @param value The bold to set. + * @return This builder for chaining. + */ + public Builder setBold(boolean value) { + + bold_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * bool bold = 2; + * @return This builder for chaining. + */ + public Builder clearBold() { + bitField0_ = (bitField0_ & ~0x00000002); + bold_ = false; + onChanged(); + return this; + } + + private boolean italic_ ; + /** + * bool italic = 3; + * @return The italic. + */ + @java.lang.Override + public boolean getItalic() { + return italic_; + } + /** + * bool italic = 3; + * @param value The italic to set. + * @return This builder for chaining. + */ + public Builder setItalic(boolean value) { + + italic_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * bool italic = 3; + * @return This builder for chaining. + */ + public Builder clearItalic() { + bitField0_ = (bitField0_ & ~0x00000004); + italic_ = false; + onChanged(); + return this; + } + + private int weight_ ; + /** + * uint32 weight = 4; + * @return The weight. + */ + @java.lang.Override + public int getWeight() { + return weight_; + } + /** + * uint32 weight = 4; + * @param value The weight to set. + * @return This builder for chaining. + */ + public Builder setWeight(int value) { + + weight_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint32 weight = 4; + * @return This builder for chaining. + */ + public Builder clearWeight() { + bitField0_ = (bitField0_ & ~0x00000008); + weight_ = 0; + onChanged(); + return this; + } + + private int italicAngle_ ; + /** + * uint32 italic_angle = 5; + * @return The italicAngle. + */ + @java.lang.Override + public int getItalicAngle() { + return italicAngle_; + } + /** + * uint32 italic_angle = 5; + * @param value The italicAngle to set. + * @return This builder for chaining. + */ + public Builder setItalicAngle(int value) { + + italicAngle_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * uint32 italic_angle = 5; + * @return This builder for chaining. + */ + public Builder clearItalicAngle() { + bitField0_ = (bitField0_ & ~0x00000010); + italicAngle_ = 0; + onChanged(); + return this; + } + + private int fontSize_ ; + /** + * uint32 font_size = 6; + * @return The fontSize. + */ + @java.lang.Override + public int getFontSize() { + return fontSize_; + } + /** + * uint32 font_size = 6; + * @param value The fontSize to set. + * @return This builder for chaining. + */ + public Builder setFontSize(int value) { + + fontSize_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * uint32 font_size = 6; + * @return This builder for chaining. + */ + public Builder clearFontSize() { + bitField0_ = (bitField0_ & ~0x00000020); + fontSize_ = 0; + onChanged(); + return this; + } + + private boolean useHeighLightColor_ ; + /** + * bool use_heigh_light_color = 7; + * @return The useHeighLightColor. + */ + @java.lang.Override + public boolean getUseHeighLightColor() { + return useHeighLightColor_; + } + /** + * bool use_heigh_light_color = 7; + * @param value The useHeighLightColor to set. + * @return This builder for chaining. + */ + public Builder setUseHeighLightColor(boolean value) { + + useHeighLightColor_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * bool use_heigh_light_color = 7; + * @return This builder for chaining. + */ + public Builder clearUseHeighLightColor() { + bitField0_ = (bitField0_ & ~0x00000040); + useHeighLightColor_ = false; + onChanged(); + return this; + } + + private boolean useRemoteClor_ ; + /** + * bool use_remote_clor = 8; + * @return The useRemoteClor. + */ + @java.lang.Override + public boolean getUseRemoteClor() { + return useRemoteClor_; + } + /** + * bool use_remote_clor = 8; + * @param value The useRemoteClor to set. + * @return This builder for chaining. + */ + public Builder setUseRemoteClor(boolean value) { + + useRemoteClor_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * bool use_remote_clor = 8; + * @return This builder for chaining. + */ + public Builder clearUseRemoteClor() { + bitField0_ = (bitField0_ & ~0x00000080); + useRemoteClor_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:TextFormat) + } + + // @@protoc_insertion_point(class_scope:TextFormat) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextFormat parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_TextFormat_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_TextFormat_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\020TextFormat.proto\"\252\001\n\nTextFormat\022\r\n\005col" + + "or\030\001 \001(\t\022\014\n\004bold\030\002 \001(\010\022\016\n\006italic\030\003 \001(\010\022\016" + + "\n\006weight\030\004 \001(\r\022\024\n\014italic_angle\030\005 \001(\r\022\021\n\t" + + "font_size\030\006 \001(\r\022\035\n\025use_heigh_light_color" + + "\030\007 \001(\010\022\027\n\017use_remote_clor\030\010 \001(\010B8\n6tech." + + "ordinaryroad.live.chat.client.douyin.pro" + + "tobuf.dtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_TextFormat_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_TextFormat_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_TextFormat_descriptor, + new java.lang.String[] { "Color", "Bold", "Italic", "Weight", "ItalicAngle", "FontSize", "UseHeighLightColor", "UseRemoteClor", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextOuterClass.java new file mode 100644 index 0000000..4ff0f8d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextOuterClass.java @@ -0,0 +1,1171 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Text.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class TextOuterClass { + private TextOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TextOrBuilder extends + // @@protoc_insertion_point(interface_extends:Text) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + * @return The key. + */ + java.lang.String getKey(); + /** + * string key = 1; + * @return The bytes for key. + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * string default_patter = 2; + * @return The defaultPatter. + */ + java.lang.String getDefaultPatter(); + /** + * string default_patter = 2; + * @return The bytes for defaultPatter. + */ + com.google.protobuf.ByteString + getDefaultPatterBytes(); + + /** + * .TextFormat default_format = 3; + * @return Whether the defaultFormat field is set. + */ + boolean hasDefaultFormat(); + /** + * .TextFormat default_format = 3; + * @return The defaultFormat. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat getDefaultFormat(); + /** + * .TextFormat default_format = 3; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormatOrBuilder getDefaultFormatOrBuilder(); + + /** + * .TextPiece pieces_list = 4; + * @return Whether the piecesList field is set. + */ + boolean hasPiecesList(); + /** + * .TextPiece pieces_list = 4; + * @return The piecesList. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece getPiecesList(); + /** + * .TextPiece pieces_list = 4; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPieceOrBuilder getPiecesListOrBuilder(); + } + /** + * Protobuf type {@code Text} + */ + public static final class Text extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Text) + TextOrBuilder { + private static final long serialVersionUID = 0L; + // Use Text.newBuilder() to construct. + private Text(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Text() { + key_ = ""; + defaultPatter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Text(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.internal_static_Text_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.internal_static_Text_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + /** + * string key = 1; + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEFAULT_PATTER_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object defaultPatter_ = ""; + /** + * string default_patter = 2; + * @return The defaultPatter. + */ + @java.lang.Override + public java.lang.String getDefaultPatter() { + java.lang.Object ref = defaultPatter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + defaultPatter_ = s; + return s; + } + } + /** + * string default_patter = 2; + * @return The bytes for defaultPatter. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDefaultPatterBytes() { + java.lang.Object ref = defaultPatter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + defaultPatter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEFAULT_FORMAT_FIELD_NUMBER = 3; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat defaultFormat_; + /** + * .TextFormat default_format = 3; + * @return Whether the defaultFormat field is set. + */ + @java.lang.Override + public boolean hasDefaultFormat() { + return defaultFormat_ != null; + } + /** + * .TextFormat default_format = 3; + * @return The defaultFormat. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat getDefaultFormat() { + return defaultFormat_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.getDefaultInstance() : defaultFormat_; + } + /** + * .TextFormat default_format = 3; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormatOrBuilder getDefaultFormatOrBuilder() { + return defaultFormat_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.getDefaultInstance() : defaultFormat_; + } + + public static final int PIECES_LIST_FIELD_NUMBER = 4; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece piecesList_; + /** + * .TextPiece pieces_list = 4; + * @return Whether the piecesList field is set. + */ + @java.lang.Override + public boolean hasPiecesList() { + return piecesList_ != null; + } + /** + * .TextPiece pieces_list = 4; + * @return The piecesList. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece getPiecesList() { + return piecesList_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.getDefaultInstance() : piecesList_; + } + /** + * .TextPiece pieces_list = 4; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPieceOrBuilder getPiecesListOrBuilder() { + return piecesList_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.getDefaultInstance() : piecesList_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultPatter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, defaultPatter_); + } + if (defaultFormat_ != null) { + output.writeMessage(3, getDefaultFormat()); + } + if (piecesList_ != null) { + output.writeMessage(4, getPiecesList()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultPatter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, defaultPatter_); + } + if (defaultFormat_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getDefaultFormat()); + } + if (piecesList_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getPiecesList()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text) obj; + + if (!getKey() + .equals(other.getKey())) return false; + if (!getDefaultPatter() + .equals(other.getDefaultPatter())) return false; + if (hasDefaultFormat() != other.hasDefaultFormat()) return false; + if (hasDefaultFormat()) { + if (!getDefaultFormat() + .equals(other.getDefaultFormat())) return false; + } + if (hasPiecesList() != other.hasPiecesList()) return false; + if (hasPiecesList()) { + if (!getPiecesList() + .equals(other.getPiecesList())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + DEFAULT_PATTER_FIELD_NUMBER; + hash = (53 * hash) + getDefaultPatter().hashCode(); + if (hasDefaultFormat()) { + hash = (37 * hash) + DEFAULT_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getDefaultFormat().hashCode(); + } + if (hasPiecesList()) { + hash = (37 * hash) + PIECES_LIST_FIELD_NUMBER; + hash = (53 * hash) + getPiecesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Text} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Text) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.TextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.internal_static_Text_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.internal_static_Text_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = ""; + defaultPatter_ = ""; + defaultFormat_ = null; + if (defaultFormatBuilder_ != null) { + defaultFormatBuilder_.dispose(); + defaultFormatBuilder_ = null; + } + piecesList_ = null; + if (piecesListBuilder_ != null) { + piecesListBuilder_.dispose(); + piecesListBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.internal_static_Text_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.defaultPatter_ = defaultPatter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.defaultFormat_ = defaultFormatBuilder_ == null + ? defaultFormat_ + : defaultFormatBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.piecesList_ = piecesListBuilder_ == null + ? piecesList_ + : piecesListBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDefaultPatter().isEmpty()) { + defaultPatter_ = other.defaultPatter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasDefaultFormat()) { + mergeDefaultFormat(other.getDefaultFormat()); + } + if (other.hasPiecesList()) { + mergePiecesList(other.getPiecesList()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + key_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + defaultPatter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + getDefaultFormatFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + input.readMessage( + getPiecesListFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + * @return The bytes for key. + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string key = 1; + * @return This builder for chaining. + */ + public Builder clearKey() { + key_ = getDefaultInstance().getKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string key = 1; + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object defaultPatter_ = ""; + /** + * string default_patter = 2; + * @return The defaultPatter. + */ + public java.lang.String getDefaultPatter() { + java.lang.Object ref = defaultPatter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + defaultPatter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string default_patter = 2; + * @return The bytes for defaultPatter. + */ + public com.google.protobuf.ByteString + getDefaultPatterBytes() { + java.lang.Object ref = defaultPatter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + defaultPatter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string default_patter = 2; + * @param value The defaultPatter to set. + * @return This builder for chaining. + */ + public Builder setDefaultPatter( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + defaultPatter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string default_patter = 2; + * @return This builder for chaining. + */ + public Builder clearDefaultPatter() { + defaultPatter_ = getDefaultInstance().getDefaultPatter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string default_patter = 2; + * @param value The bytes for defaultPatter to set. + * @return This builder for chaining. + */ + public Builder setDefaultPatterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + defaultPatter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat defaultFormat_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormatOrBuilder> defaultFormatBuilder_; + /** + * .TextFormat default_format = 3; + * @return Whether the defaultFormat field is set. + */ + public boolean hasDefaultFormat() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * .TextFormat default_format = 3; + * @return The defaultFormat. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat getDefaultFormat() { + if (defaultFormatBuilder_ == null) { + return defaultFormat_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.getDefaultInstance() : defaultFormat_; + } else { + return defaultFormatBuilder_.getMessage(); + } + } + /** + * .TextFormat default_format = 3; + */ + public Builder setDefaultFormat(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat value) { + if (defaultFormatBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + defaultFormat_ = value; + } else { + defaultFormatBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .TextFormat default_format = 3; + */ + public Builder setDefaultFormat( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.Builder builderForValue) { + if (defaultFormatBuilder_ == null) { + defaultFormat_ = builderForValue.build(); + } else { + defaultFormatBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .TextFormat default_format = 3; + */ + public Builder mergeDefaultFormat(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat value) { + if (defaultFormatBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + defaultFormat_ != null && + defaultFormat_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.getDefaultInstance()) { + getDefaultFormatBuilder().mergeFrom(value); + } else { + defaultFormat_ = value; + } + } else { + defaultFormatBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .TextFormat default_format = 3; + */ + public Builder clearDefaultFormat() { + bitField0_ = (bitField0_ & ~0x00000004); + defaultFormat_ = null; + if (defaultFormatBuilder_ != null) { + defaultFormatBuilder_.dispose(); + defaultFormatBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .TextFormat default_format = 3; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.Builder getDefaultFormatBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDefaultFormatFieldBuilder().getBuilder(); + } + /** + * .TextFormat default_format = 3; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormatOrBuilder getDefaultFormatOrBuilder() { + if (defaultFormatBuilder_ != null) { + return defaultFormatBuilder_.getMessageOrBuilder(); + } else { + return defaultFormat_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.getDefaultInstance() : defaultFormat_; + } + } + /** + * .TextFormat default_format = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormatOrBuilder> + getDefaultFormatFieldBuilder() { + if (defaultFormatBuilder_ == null) { + defaultFormatBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormatOrBuilder>( + getDefaultFormat(), + getParentForChildren(), + isClean()); + defaultFormat_ = null; + } + return defaultFormatBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece piecesList_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPieceOrBuilder> piecesListBuilder_; + /** + * .TextPiece pieces_list = 4; + * @return Whether the piecesList field is set. + */ + public boolean hasPiecesList() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * .TextPiece pieces_list = 4; + * @return The piecesList. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece getPiecesList() { + if (piecesListBuilder_ == null) { + return piecesList_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.getDefaultInstance() : piecesList_; + } else { + return piecesListBuilder_.getMessage(); + } + } + /** + * .TextPiece pieces_list = 4; + */ + public Builder setPiecesList(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece value) { + if (piecesListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + piecesList_ = value; + } else { + piecesListBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .TextPiece pieces_list = 4; + */ + public Builder setPiecesList( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.Builder builderForValue) { + if (piecesListBuilder_ == null) { + piecesList_ = builderForValue.build(); + } else { + piecesListBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .TextPiece pieces_list = 4; + */ + public Builder mergePiecesList(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece value) { + if (piecesListBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + piecesList_ != null && + piecesList_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.getDefaultInstance()) { + getPiecesListBuilder().mergeFrom(value); + } else { + piecesList_ = value; + } + } else { + piecesListBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .TextPiece pieces_list = 4; + */ + public Builder clearPiecesList() { + bitField0_ = (bitField0_ & ~0x00000008); + piecesList_ = null; + if (piecesListBuilder_ != null) { + piecesListBuilder_.dispose(); + piecesListBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .TextPiece pieces_list = 4; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.Builder getPiecesListBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getPiecesListFieldBuilder().getBuilder(); + } + /** + * .TextPiece pieces_list = 4; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPieceOrBuilder getPiecesListOrBuilder() { + if (piecesListBuilder_ != null) { + return piecesListBuilder_.getMessageOrBuilder(); + } else { + return piecesList_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.getDefaultInstance() : piecesList_; + } + } + /** + * .TextPiece pieces_list = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPieceOrBuilder> + getPiecesListFieldBuilder() { + if (piecesListBuilder_ == null) { + piecesListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPieceOrBuilder>( + getPiecesList(), + getParentForChildren(), + isClean()); + piecesList_ = null; + } + return piecesListBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Text) + } + + // @@protoc_insertion_point(class_scope:Text) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Text parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextOuterClass.Text getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Text_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Text_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\nText.proto\032\020TextFormat.proto\032\017TextPiec" + + "e.proto\"q\n\004Text\022\013\n\003key\030\001 \001(\t\022\026\n\016default_" + + "patter\030\002 \001(\t\022#\n\016default_format\030\003 \001(\0132\013.T" + + "extFormat\022\037\n\013pieces_list\030\004 \001(\0132\n.TextPie" + + "ceB8\n6tech.ordinaryroad.live.chat.client" + + ".douyin.protobuf.dtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.getDescriptor(), + }); + internal_static_Text_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Text_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Text_descriptor, + new java.lang.String[] { "Key", "DefaultPatter", "DefaultFormat", "PiecesList", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceGiftOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceGiftOuterClass.java new file mode 100644 index 0000000..7e8d34f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceGiftOuterClass.java @@ -0,0 +1,749 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: TextPieceGift.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class TextPieceGiftOuterClass { + private TextPieceGiftOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TextPieceGiftOrBuilder extends + // @@protoc_insertion_point(interface_extends:TextPieceGift) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 gift_id = 1; + * @return The giftId. + */ + long getGiftId(); + + /** + * .PatternRef name_ref = 2; + * @return Whether the nameRef field is set. + */ + boolean hasNameRef(); + /** + * .PatternRef name_ref = 2; + * @return The nameRef. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef getNameRef(); + /** + * .PatternRef name_ref = 2; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRefOrBuilder getNameRefOrBuilder(); + } + /** + * Protobuf type {@code TextPieceGift} + */ + public static final class TextPieceGift extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:TextPieceGift) + TextPieceGiftOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextPieceGift.newBuilder() to construct. + private TextPieceGift(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextPieceGift() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TextPieceGift(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.internal_static_TextPieceGift_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.internal_static_TextPieceGift_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.Builder.class); + } + + public static final int GIFT_ID_FIELD_NUMBER = 1; + private long giftId_ = 0L; + /** + * uint64 gift_id = 1; + * @return The giftId. + */ + @java.lang.Override + public long getGiftId() { + return giftId_; + } + + public static final int NAME_REF_FIELD_NUMBER = 2; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef nameRef_; + /** + * .PatternRef name_ref = 2; + * @return Whether the nameRef field is set. + */ + @java.lang.Override + public boolean hasNameRef() { + return nameRef_ != null; + } + /** + * .PatternRef name_ref = 2; + * @return The nameRef. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef getNameRef() { + return nameRef_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.getDefaultInstance() : nameRef_; + } + /** + * .PatternRef name_ref = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRefOrBuilder getNameRefOrBuilder() { + return nameRef_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.getDefaultInstance() : nameRef_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (giftId_ != 0L) { + output.writeUInt64(1, giftId_); + } + if (nameRef_ != null) { + output.writeMessage(2, getNameRef()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (giftId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, giftId_); + } + if (nameRef_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getNameRef()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift) obj; + + if (getGiftId() + != other.getGiftId()) return false; + if (hasNameRef() != other.hasNameRef()) return false; + if (hasNameRef()) { + if (!getNameRef() + .equals(other.getNameRef())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + GIFT_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getGiftId()); + if (hasNameRef()) { + hash = (37 * hash) + NAME_REF_FIELD_NUMBER; + hash = (53 * hash) + getNameRef().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code TextPieceGift} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:TextPieceGift) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGiftOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.internal_static_TextPieceGift_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.internal_static_TextPieceGift_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + giftId_ = 0L; + nameRef_ = null; + if (nameRefBuilder_ != null) { + nameRefBuilder_.dispose(); + nameRefBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.internal_static_TextPieceGift_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.giftId_ = giftId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nameRef_ = nameRefBuilder_ == null + ? nameRef_ + : nameRefBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.getDefaultInstance()) return this; + if (other.getGiftId() != 0L) { + setGiftId(other.getGiftId()); + } + if (other.hasNameRef()) { + mergeNameRef(other.getNameRef()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + giftId_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getNameRefFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long giftId_ ; + /** + * uint64 gift_id = 1; + * @return The giftId. + */ + @java.lang.Override + public long getGiftId() { + return giftId_; + } + /** + * uint64 gift_id = 1; + * @param value The giftId to set. + * @return This builder for chaining. + */ + public Builder setGiftId(long value) { + + giftId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 gift_id = 1; + * @return This builder for chaining. + */ + public Builder clearGiftId() { + bitField0_ = (bitField0_ & ~0x00000001); + giftId_ = 0L; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef nameRef_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRefOrBuilder> nameRefBuilder_; + /** + * .PatternRef name_ref = 2; + * @return Whether the nameRef field is set. + */ + public boolean hasNameRef() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .PatternRef name_ref = 2; + * @return The nameRef. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef getNameRef() { + if (nameRefBuilder_ == null) { + return nameRef_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.getDefaultInstance() : nameRef_; + } else { + return nameRefBuilder_.getMessage(); + } + } + /** + * .PatternRef name_ref = 2; + */ + public Builder setNameRef(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef value) { + if (nameRefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + nameRef_ = value; + } else { + nameRefBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .PatternRef name_ref = 2; + */ + public Builder setNameRef( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.Builder builderForValue) { + if (nameRefBuilder_ == null) { + nameRef_ = builderForValue.build(); + } else { + nameRefBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .PatternRef name_ref = 2; + */ + public Builder mergeNameRef(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef value) { + if (nameRefBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + nameRef_ != null && + nameRef_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.getDefaultInstance()) { + getNameRefBuilder().mergeFrom(value); + } else { + nameRef_ = value; + } + } else { + nameRefBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .PatternRef name_ref = 2; + */ + public Builder clearNameRef() { + bitField0_ = (bitField0_ & ~0x00000002); + nameRef_ = null; + if (nameRefBuilder_ != null) { + nameRefBuilder_.dispose(); + nameRefBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .PatternRef name_ref = 2; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.Builder getNameRefBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getNameRefFieldBuilder().getBuilder(); + } + /** + * .PatternRef name_ref = 2; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRefOrBuilder getNameRefOrBuilder() { + if (nameRefBuilder_ != null) { + return nameRefBuilder_.getMessageOrBuilder(); + } else { + return nameRef_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.getDefaultInstance() : nameRef_; + } + } + /** + * .PatternRef name_ref = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRefOrBuilder> + getNameRefFieldBuilder() { + if (nameRefBuilder_ == null) { + nameRefBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRef.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.PatternRefOrBuilder>( + getNameRef(), + getParentForChildren(), + isClean()); + nameRef_ = null; + } + return nameRefBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:TextPieceGift) + } + + // @@protoc_insertion_point(class_scope:TextPieceGift) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextPieceGift parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_TextPieceGift_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_TextPieceGift_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\023TextPieceGift.proto\032\020PatternRef.proto\"" + + "?\n\rTextPieceGift\022\017\n\007gift_id\030\001 \001(\004\022\035\n\010nam" + + "e_ref\030\002 \001(\0132\013.PatternRefB8\n6tech.ordinar" + + "yroad.live.chat.client.douyin.protobuf.d" + + "tob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.getDescriptor(), + }); + internal_static_TextPieceGift_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_TextPieceGift_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_TextPieceGift_descriptor, + new java.lang.String[] { "GiftId", "NameRef", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.PatternRefOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceHeartOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceHeartOuterClass.java new file mode 100644 index 0000000..7e4c99c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceHeartOuterClass.java @@ -0,0 +1,625 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: TextPieceHeart.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class TextPieceHeartOuterClass { + private TextPieceHeartOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TextPieceHeartOrBuilder extends + // @@protoc_insertion_point(interface_extends:TextPieceHeart) + com.google.protobuf.MessageOrBuilder { + + /** + * string color = 1; + * @return The color. + */ + java.lang.String getColor(); + /** + * string color = 1; + * @return The bytes for color. + */ + com.google.protobuf.ByteString + getColorBytes(); + } + /** + * Protobuf type {@code TextPieceHeart} + */ + public static final class TextPieceHeart extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:TextPieceHeart) + TextPieceHeartOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextPieceHeart.newBuilder() to construct. + private TextPieceHeart(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextPieceHeart() { + color_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TextPieceHeart(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.internal_static_TextPieceHeart_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.internal_static_TextPieceHeart_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.Builder.class); + } + + public static final int COLOR_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object color_ = ""; + /** + * string color = 1; + * @return The color. + */ + @java.lang.Override + public java.lang.String getColor() { + java.lang.Object ref = color_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + color_ = s; + return s; + } + } + /** + * string color = 1; + * @return The bytes for color. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getColorBytes() { + java.lang.Object ref = color_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + color_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(color_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, color_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(color_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, color_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart) obj; + + if (!getColor() + .equals(other.getColor())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + COLOR_FIELD_NUMBER; + hash = (53 * hash) + getColor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code TextPieceHeart} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:TextPieceHeart) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeartOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.internal_static_TextPieceHeart_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.internal_static_TextPieceHeart_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + color_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.internal_static_TextPieceHeart_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.color_ = color_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.getDefaultInstance()) return this; + if (!other.getColor().isEmpty()) { + color_ = other.color_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + color_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object color_ = ""; + /** + * string color = 1; + * @return The color. + */ + public java.lang.String getColor() { + java.lang.Object ref = color_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + color_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string color = 1; + * @return The bytes for color. + */ + public com.google.protobuf.ByteString + getColorBytes() { + java.lang.Object ref = color_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + color_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string color = 1; + * @param value The color to set. + * @return This builder for chaining. + */ + public Builder setColor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + color_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string color = 1; + * @return This builder for chaining. + */ + public Builder clearColor() { + color_ = getDefaultInstance().getColor(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string color = 1; + * @param value The bytes for color to set. + * @return This builder for chaining. + */ + public Builder setColorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + color_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:TextPieceHeart) + } + + // @@protoc_insertion_point(class_scope:TextPieceHeart) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextPieceHeart parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_TextPieceHeart_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_TextPieceHeart_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024TextPieceHeart.proto\"\037\n\016TextPieceHeart" + + "\022\r\n\005color\030\001 \001(\tB8\n6tech.ordinaryroad.liv" + + "e.chat.client.douyin.protobuf.dtob\006proto" + + "3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_TextPieceHeart_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_TextPieceHeart_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_TextPieceHeart_descriptor, + new java.lang.String[] { "Color", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceImageOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceImageOuterClass.java new file mode 100644 index 0000000..8d3adcb --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceImageOuterClass.java @@ -0,0 +1,750 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: TextPieceImage.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class TextPieceImageOuterClass { + private TextPieceImageOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TextPieceImageOrBuilder extends + // @@protoc_insertion_point(interface_extends:TextPieceImage) + com.google.protobuf.MessageOrBuilder { + + /** + * .Image image = 1; + * @return Whether the image field is set. + */ + boolean hasImage(); + /** + * .Image image = 1; + * @return The image. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getImage(); + /** + * .Image image = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImageOrBuilder(); + + /** + * float scaling_rate = 2; + * @return The scalingRate. + */ + float getScalingRate(); + } + /** + * Protobuf type {@code TextPieceImage} + */ + public static final class TextPieceImage extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:TextPieceImage) + TextPieceImageOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextPieceImage.newBuilder() to construct. + private TextPieceImage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextPieceImage() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TextPieceImage(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.internal_static_TextPieceImage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.internal_static_TextPieceImage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.Builder.class); + } + + public static final int IMAGE_FIELD_NUMBER = 1; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image image_; + /** + * .Image image = 1; + * @return Whether the image field is set. + */ + @java.lang.Override + public boolean hasImage() { + return image_ != null; + } + /** + * .Image image = 1; + * @return The image. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getImage() { + return image_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : image_; + } + /** + * .Image image = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImageOrBuilder() { + return image_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : image_; + } + + public static final int SCALING_RATE_FIELD_NUMBER = 2; + private float scalingRate_ = 0F; + /** + * float scaling_rate = 2; + * @return The scalingRate. + */ + @java.lang.Override + public float getScalingRate() { + return scalingRate_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (image_ != null) { + output.writeMessage(1, getImage()); + } + if (java.lang.Float.floatToRawIntBits(scalingRate_) != 0) { + output.writeFloat(2, scalingRate_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (image_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getImage()); + } + if (java.lang.Float.floatToRawIntBits(scalingRate_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, scalingRate_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage) obj; + + if (hasImage() != other.hasImage()) return false; + if (hasImage()) { + if (!getImage() + .equals(other.getImage())) return false; + } + if (java.lang.Float.floatToIntBits(getScalingRate()) + != java.lang.Float.floatToIntBits( + other.getScalingRate())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasImage()) { + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + } + hash = (37 * hash) + SCALING_RATE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getScalingRate()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code TextPieceImage} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:TextPieceImage) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.internal_static_TextPieceImage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.internal_static_TextPieceImage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + image_ = null; + if (imageBuilder_ != null) { + imageBuilder_.dispose(); + imageBuilder_ = null; + } + scalingRate_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.internal_static_TextPieceImage_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.image_ = imageBuilder_ == null + ? image_ + : imageBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.scalingRate_ = scalingRate_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.getDefaultInstance()) return this; + if (other.hasImage()) { + mergeImage(other.getImage()); + } + if (other.getScalingRate() != 0F) { + setScalingRate(other.getScalingRate()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getImageFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: { + scalingRate_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image image_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> imageBuilder_; + /** + * .Image image = 1; + * @return Whether the image field is set. + */ + public boolean hasImage() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .Image image = 1; + * @return The image. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getImage() { + if (imageBuilder_ == null) { + return image_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : image_; + } else { + return imageBuilder_.getMessage(); + } + } + /** + * .Image image = 1; + */ + public Builder setImage(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (imageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + image_ = value; + } else { + imageBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Image image = 1; + */ + public Builder setImage( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (imageBuilder_ == null) { + image_ = builderForValue.build(); + } else { + imageBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Image image = 1; + */ + public Builder mergeImage(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (imageBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + image_ != null && + image_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getImageBuilder().mergeFrom(value); + } else { + image_ = value; + } + } else { + imageBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Image image = 1; + */ + public Builder clearImage() { + bitField0_ = (bitField0_ & ~0x00000001); + image_ = null; + if (imageBuilder_ != null) { + imageBuilder_.dispose(); + imageBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image image = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getImageBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getImageFieldBuilder().getBuilder(); + } + /** + * .Image image = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImageOrBuilder() { + if (imageBuilder_ != null) { + return imageBuilder_.getMessageOrBuilder(); + } else { + return image_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : image_; + } + } + /** + * .Image image = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getImageFieldBuilder() { + if (imageBuilder_ == null) { + imageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getImage(), + getParentForChildren(), + isClean()); + image_ = null; + } + return imageBuilder_; + } + + private float scalingRate_ ; + /** + * float scaling_rate = 2; + * @return The scalingRate. + */ + @java.lang.Override + public float getScalingRate() { + return scalingRate_; + } + /** + * float scaling_rate = 2; + * @param value The scalingRate to set. + * @return This builder for chaining. + */ + public Builder setScalingRate(float value) { + + scalingRate_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * float scaling_rate = 2; + * @return This builder for chaining. + */ + public Builder clearScalingRate() { + bitField0_ = (bitField0_ & ~0x00000002); + scalingRate_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:TextPieceImage) + } + + // @@protoc_insertion_point(class_scope:TextPieceImage) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextPieceImage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_TextPieceImage_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_TextPieceImage_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024TextPieceImage.proto\032\013Image.proto\"=\n\016T" + + "extPieceImage\022\025\n\005image\030\001 \001(\0132\006.Image\022\024\n\014" + + "scaling_rate\030\002 \001(\002B8\n6tech.ordinaryroad." + + "live.chat.client.douyin.protobuf.dtob\006pr" + + "oto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.getDescriptor(), + }); + internal_static_TextPieceImage_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_TextPieceImage_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_TextPieceImage_descriptor, + new java.lang.String[] { "Image", "ScalingRate", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceOuterClass.java new file mode 100644 index 0000000..3eecce9 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceOuterClass.java @@ -0,0 +1,1895 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: TextPiece.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class TextPieceOuterClass { + private TextPieceOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TextPieceOrBuilder extends + // @@protoc_insertion_point(interface_extends:TextPiece) + com.google.protobuf.MessageOrBuilder { + + /** + * bool type = 1; + * @return The type. + */ + boolean getType(); + + /** + * .TextFormat format = 2; + * @return Whether the format field is set. + */ + boolean hasFormat(); + /** + * .TextFormat format = 2; + * @return The format. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat getFormat(); + /** + * .TextFormat format = 2; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormatOrBuilder getFormatOrBuilder(); + + /** + * string string_value = 3; + * @return The stringValue. + */ + java.lang.String getStringValue(); + /** + * string string_value = 3; + * @return The bytes for stringValue. + */ + com.google.protobuf.ByteString + getStringValueBytes(); + + /** + * .TextPieceUser user_value = 4; + * @return Whether the userValue field is set. + */ + boolean hasUserValue(); + /** + * .TextPieceUser user_value = 4; + * @return The userValue. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser getUserValue(); + /** + * .TextPieceUser user_value = 4; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUserOrBuilder getUserValueOrBuilder(); + + /** + * .TextPieceGift gift_value = 5; + * @return Whether the giftValue field is set. + */ + boolean hasGiftValue(); + /** + * .TextPieceGift gift_value = 5; + * @return The giftValue. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift getGiftValue(); + /** + * .TextPieceGift gift_value = 5; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGiftOrBuilder getGiftValueOrBuilder(); + + /** + * .TextPieceHeart heart_value = 6; + * @return Whether the heartValue field is set. + */ + boolean hasHeartValue(); + /** + * .TextPieceHeart heart_value = 6; + * @return The heartValue. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart getHeartValue(); + /** + * .TextPieceHeart heart_value = 6; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeartOrBuilder getHeartValueOrBuilder(); + + /** + * .TextPiecePatternRef pattern_ref_value = 7; + * @return Whether the patternRefValue field is set. + */ + boolean hasPatternRefValue(); + /** + * .TextPiecePatternRef pattern_ref_value = 7; + * @return The patternRefValue. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef getPatternRefValue(); + /** + * .TextPiecePatternRef pattern_ref_value = 7; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRefOrBuilder getPatternRefValueOrBuilder(); + + /** + * .TextPieceImage image_value = 8; + * @return Whether the imageValue field is set. + */ + boolean hasImageValue(); + /** + * .TextPieceImage image_value = 8; + * @return The imageValue. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage getImageValue(); + /** + * .TextPieceImage image_value = 8; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImageOrBuilder getImageValueOrBuilder(); + } + /** + * Protobuf type {@code TextPiece} + */ + public static final class TextPiece extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:TextPiece) + TextPieceOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextPiece.newBuilder() to construct. + private TextPiece(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextPiece() { + stringValue_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TextPiece(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.internal_static_TextPiece_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.internal_static_TextPiece_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private boolean type_ = false; + /** + * bool type = 1; + * @return The type. + */ + @java.lang.Override + public boolean getType() { + return type_; + } + + public static final int FORMAT_FIELD_NUMBER = 2; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat format_; + /** + * .TextFormat format = 2; + * @return Whether the format field is set. + */ + @java.lang.Override + public boolean hasFormat() { + return format_ != null; + } + /** + * .TextFormat format = 2; + * @return The format. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat getFormat() { + return format_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.getDefaultInstance() : format_; + } + /** + * .TextFormat format = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormatOrBuilder getFormatOrBuilder() { + return format_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.getDefaultInstance() : format_; + } + + public static final int STRING_VALUE_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object stringValue_ = ""; + /** + * string string_value = 3; + * @return The stringValue. + */ + @java.lang.Override + public java.lang.String getStringValue() { + java.lang.Object ref = stringValue_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stringValue_ = s; + return s; + } + } + /** + * string string_value = 3; + * @return The bytes for stringValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStringValueBytes() { + java.lang.Object ref = stringValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + stringValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_VALUE_FIELD_NUMBER = 4; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser userValue_; + /** + * .TextPieceUser user_value = 4; + * @return Whether the userValue field is set. + */ + @java.lang.Override + public boolean hasUserValue() { + return userValue_ != null; + } + /** + * .TextPieceUser user_value = 4; + * @return The userValue. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser getUserValue() { + return userValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.getDefaultInstance() : userValue_; + } + /** + * .TextPieceUser user_value = 4; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUserOrBuilder getUserValueOrBuilder() { + return userValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.getDefaultInstance() : userValue_; + } + + public static final int GIFT_VALUE_FIELD_NUMBER = 5; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift giftValue_; + /** + * .TextPieceGift gift_value = 5; + * @return Whether the giftValue field is set. + */ + @java.lang.Override + public boolean hasGiftValue() { + return giftValue_ != null; + } + /** + * .TextPieceGift gift_value = 5; + * @return The giftValue. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift getGiftValue() { + return giftValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.getDefaultInstance() : giftValue_; + } + /** + * .TextPieceGift gift_value = 5; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGiftOrBuilder getGiftValueOrBuilder() { + return giftValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.getDefaultInstance() : giftValue_; + } + + public static final int HEART_VALUE_FIELD_NUMBER = 6; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart heartValue_; + /** + * .TextPieceHeart heart_value = 6; + * @return Whether the heartValue field is set. + */ + @java.lang.Override + public boolean hasHeartValue() { + return heartValue_ != null; + } + /** + * .TextPieceHeart heart_value = 6; + * @return The heartValue. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart getHeartValue() { + return heartValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.getDefaultInstance() : heartValue_; + } + /** + * .TextPieceHeart heart_value = 6; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeartOrBuilder getHeartValueOrBuilder() { + return heartValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.getDefaultInstance() : heartValue_; + } + + public static final int PATTERN_REF_VALUE_FIELD_NUMBER = 7; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef patternRefValue_; + /** + * .TextPiecePatternRef pattern_ref_value = 7; + * @return Whether the patternRefValue field is set. + */ + @java.lang.Override + public boolean hasPatternRefValue() { + return patternRefValue_ != null; + } + /** + * .TextPiecePatternRef pattern_ref_value = 7; + * @return The patternRefValue. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef getPatternRefValue() { + return patternRefValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.getDefaultInstance() : patternRefValue_; + } + /** + * .TextPiecePatternRef pattern_ref_value = 7; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRefOrBuilder getPatternRefValueOrBuilder() { + return patternRefValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.getDefaultInstance() : patternRefValue_; + } + + public static final int IMAGE_VALUE_FIELD_NUMBER = 8; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage imageValue_; + /** + * .TextPieceImage image_value = 8; + * @return Whether the imageValue field is set. + */ + @java.lang.Override + public boolean hasImageValue() { + return imageValue_ != null; + } + /** + * .TextPieceImage image_value = 8; + * @return The imageValue. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage getImageValue() { + return imageValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.getDefaultInstance() : imageValue_; + } + /** + * .TextPieceImage image_value = 8; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImageOrBuilder getImageValueOrBuilder() { + return imageValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.getDefaultInstance() : imageValue_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (type_ != false) { + output.writeBool(1, type_); + } + if (format_ != null) { + output.writeMessage(2, getFormat()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stringValue_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, stringValue_); + } + if (userValue_ != null) { + output.writeMessage(4, getUserValue()); + } + if (giftValue_ != null) { + output.writeMessage(5, getGiftValue()); + } + if (heartValue_ != null) { + output.writeMessage(6, getHeartValue()); + } + if (patternRefValue_ != null) { + output.writeMessage(7, getPatternRefValue()); + } + if (imageValue_ != null) { + output.writeMessage(8, getImageValue()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, type_); + } + if (format_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getFormat()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stringValue_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, stringValue_); + } + if (userValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getUserValue()); + } + if (giftValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getGiftValue()); + } + if (heartValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getHeartValue()); + } + if (patternRefValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getPatternRefValue()); + } + if (imageValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getImageValue()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece) obj; + + if (getType() + != other.getType()) return false; + if (hasFormat() != other.hasFormat()) return false; + if (hasFormat()) { + if (!getFormat() + .equals(other.getFormat())) return false; + } + if (!getStringValue() + .equals(other.getStringValue())) return false; + if (hasUserValue() != other.hasUserValue()) return false; + if (hasUserValue()) { + if (!getUserValue() + .equals(other.getUserValue())) return false; + } + if (hasGiftValue() != other.hasGiftValue()) return false; + if (hasGiftValue()) { + if (!getGiftValue() + .equals(other.getGiftValue())) return false; + } + if (hasHeartValue() != other.hasHeartValue()) return false; + if (hasHeartValue()) { + if (!getHeartValue() + .equals(other.getHeartValue())) return false; + } + if (hasPatternRefValue() != other.hasPatternRefValue()) return false; + if (hasPatternRefValue()) { + if (!getPatternRefValue() + .equals(other.getPatternRefValue())) return false; + } + if (hasImageValue() != other.hasImageValue()) return false; + if (hasImageValue()) { + if (!getImageValue() + .equals(other.getImageValue())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getType()); + if (hasFormat()) { + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + } + hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getStringValue().hashCode(); + if (hasUserValue()) { + hash = (37 * hash) + USER_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getUserValue().hashCode(); + } + if (hasGiftValue()) { + hash = (37 * hash) + GIFT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getGiftValue().hashCode(); + } + if (hasHeartValue()) { + hash = (37 * hash) + HEART_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getHeartValue().hashCode(); + } + if (hasPatternRefValue()) { + hash = (37 * hash) + PATTERN_REF_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getPatternRefValue().hashCode(); + } + if (hasImageValue()) { + hash = (37 * hash) + IMAGE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getImageValue().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code TextPiece} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:TextPiece) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPieceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.internal_static_TextPiece_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.internal_static_TextPiece_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = false; + format_ = null; + if (formatBuilder_ != null) { + formatBuilder_.dispose(); + formatBuilder_ = null; + } + stringValue_ = ""; + userValue_ = null; + if (userValueBuilder_ != null) { + userValueBuilder_.dispose(); + userValueBuilder_ = null; + } + giftValue_ = null; + if (giftValueBuilder_ != null) { + giftValueBuilder_.dispose(); + giftValueBuilder_ = null; + } + heartValue_ = null; + if (heartValueBuilder_ != null) { + heartValueBuilder_.dispose(); + heartValueBuilder_ = null; + } + patternRefValue_ = null; + if (patternRefValueBuilder_ != null) { + patternRefValueBuilder_.dispose(); + patternRefValueBuilder_ = null; + } + imageValue_ = null; + if (imageValueBuilder_ != null) { + imageValueBuilder_.dispose(); + imageValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.internal_static_TextPiece_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.format_ = formatBuilder_ == null + ? format_ + : formatBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.stringValue_ = stringValue_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.userValue_ = userValueBuilder_ == null + ? userValue_ + : userValueBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.giftValue_ = giftValueBuilder_ == null + ? giftValue_ + : giftValueBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.heartValue_ = heartValueBuilder_ == null + ? heartValue_ + : heartValueBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.patternRefValue_ = patternRefValueBuilder_ == null + ? patternRefValue_ + : patternRefValueBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.imageValue_ = imageValueBuilder_ == null + ? imageValue_ + : imageValueBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece.getDefaultInstance()) return this; + if (other.getType() != false) { + setType(other.getType()); + } + if (other.hasFormat()) { + mergeFormat(other.getFormat()); + } + if (!other.getStringValue().isEmpty()) { + stringValue_ = other.stringValue_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasUserValue()) { + mergeUserValue(other.getUserValue()); + } + if (other.hasGiftValue()) { + mergeGiftValue(other.getGiftValue()); + } + if (other.hasHeartValue()) { + mergeHeartValue(other.getHeartValue()); + } + if (other.hasPatternRefValue()) { + mergePatternRefValue(other.getPatternRefValue()); + } + if (other.hasImageValue()) { + mergeImageValue(other.getImageValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + type_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getFormatFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + stringValue_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + input.readMessage( + getUserValueFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + input.readMessage( + getGiftValueFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + input.readMessage( + getHeartValueFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + input.readMessage( + getPatternRefValueFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: { + input.readMessage( + getImageValueFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean type_ ; + /** + * bool type = 1; + * @return The type. + */ + @java.lang.Override + public boolean getType() { + return type_; + } + /** + * bool type = 1; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(boolean value) { + + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bool type = 1; + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = false; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat format_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormatOrBuilder> formatBuilder_; + /** + * .TextFormat format = 2; + * @return Whether the format field is set. + */ + public boolean hasFormat() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .TextFormat format = 2; + * @return The format. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat getFormat() { + if (formatBuilder_ == null) { + return format_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.getDefaultInstance() : format_; + } else { + return formatBuilder_.getMessage(); + } + } + /** + * .TextFormat format = 2; + */ + public Builder setFormat(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat value) { + if (formatBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + format_ = value; + } else { + formatBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .TextFormat format = 2; + */ + public Builder setFormat( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.Builder builderForValue) { + if (formatBuilder_ == null) { + format_ = builderForValue.build(); + } else { + formatBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .TextFormat format = 2; + */ + public Builder mergeFormat(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat value) { + if (formatBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + format_ != null && + format_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.getDefaultInstance()) { + getFormatBuilder().mergeFrom(value); + } else { + format_ = value; + } + } else { + formatBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .TextFormat format = 2; + */ + public Builder clearFormat() { + bitField0_ = (bitField0_ & ~0x00000002); + format_ = null; + if (formatBuilder_ != null) { + formatBuilder_.dispose(); + formatBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .TextFormat format = 2; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.Builder getFormatBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getFormatFieldBuilder().getBuilder(); + } + /** + * .TextFormat format = 2; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormatOrBuilder getFormatOrBuilder() { + if (formatBuilder_ != null) { + return formatBuilder_.getMessageOrBuilder(); + } else { + return format_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.getDefaultInstance() : format_; + } + } + /** + * .TextFormat format = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormatOrBuilder> + getFormatFieldBuilder() { + if (formatBuilder_ == null) { + formatBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormat.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.TextFormatOrBuilder>( + getFormat(), + getParentForChildren(), + isClean()); + format_ = null; + } + return formatBuilder_; + } + + private java.lang.Object stringValue_ = ""; + /** + * string string_value = 3; + * @return The stringValue. + */ + public java.lang.String getStringValue() { + java.lang.Object ref = stringValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stringValue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string string_value = 3; + * @return The bytes for stringValue. + */ + public com.google.protobuf.ByteString + getStringValueBytes() { + java.lang.Object ref = stringValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + stringValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string string_value = 3; + * @param value The stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValue( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + stringValue_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * string string_value = 3; + * @return This builder for chaining. + */ + public Builder clearStringValue() { + stringValue_ = getDefaultInstance().getStringValue(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * string string_value = 3; + * @param value The bytes for stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + stringValue_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser userValue_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUserOrBuilder> userValueBuilder_; + /** + * .TextPieceUser user_value = 4; + * @return Whether the userValue field is set. + */ + public boolean hasUserValue() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * .TextPieceUser user_value = 4; + * @return The userValue. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser getUserValue() { + if (userValueBuilder_ == null) { + return userValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.getDefaultInstance() : userValue_; + } else { + return userValueBuilder_.getMessage(); + } + } + /** + * .TextPieceUser user_value = 4; + */ + public Builder setUserValue(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser value) { + if (userValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userValue_ = value; + } else { + userValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .TextPieceUser user_value = 4; + */ + public Builder setUserValue( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.Builder builderForValue) { + if (userValueBuilder_ == null) { + userValue_ = builderForValue.build(); + } else { + userValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .TextPieceUser user_value = 4; + */ + public Builder mergeUserValue(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser value) { + if (userValueBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + userValue_ != null && + userValue_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.getDefaultInstance()) { + getUserValueBuilder().mergeFrom(value); + } else { + userValue_ = value; + } + } else { + userValueBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .TextPieceUser user_value = 4; + */ + public Builder clearUserValue() { + bitField0_ = (bitField0_ & ~0x00000008); + userValue_ = null; + if (userValueBuilder_ != null) { + userValueBuilder_.dispose(); + userValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .TextPieceUser user_value = 4; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.Builder getUserValueBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getUserValueFieldBuilder().getBuilder(); + } + /** + * .TextPieceUser user_value = 4; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUserOrBuilder getUserValueOrBuilder() { + if (userValueBuilder_ != null) { + return userValueBuilder_.getMessageOrBuilder(); + } else { + return userValue_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.getDefaultInstance() : userValue_; + } + } + /** + * .TextPieceUser user_value = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUserOrBuilder> + getUserValueFieldBuilder() { + if (userValueBuilder_ == null) { + userValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUserOrBuilder>( + getUserValue(), + getParentForChildren(), + isClean()); + userValue_ = null; + } + return userValueBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift giftValue_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGiftOrBuilder> giftValueBuilder_; + /** + * .TextPieceGift gift_value = 5; + * @return Whether the giftValue field is set. + */ + public boolean hasGiftValue() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * .TextPieceGift gift_value = 5; + * @return The giftValue. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift getGiftValue() { + if (giftValueBuilder_ == null) { + return giftValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.getDefaultInstance() : giftValue_; + } else { + return giftValueBuilder_.getMessage(); + } + } + /** + * .TextPieceGift gift_value = 5; + */ + public Builder setGiftValue(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift value) { + if (giftValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + giftValue_ = value; + } else { + giftValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .TextPieceGift gift_value = 5; + */ + public Builder setGiftValue( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.Builder builderForValue) { + if (giftValueBuilder_ == null) { + giftValue_ = builderForValue.build(); + } else { + giftValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .TextPieceGift gift_value = 5; + */ + public Builder mergeGiftValue(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift value) { + if (giftValueBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + giftValue_ != null && + giftValue_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.getDefaultInstance()) { + getGiftValueBuilder().mergeFrom(value); + } else { + giftValue_ = value; + } + } else { + giftValueBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .TextPieceGift gift_value = 5; + */ + public Builder clearGiftValue() { + bitField0_ = (bitField0_ & ~0x00000010); + giftValue_ = null; + if (giftValueBuilder_ != null) { + giftValueBuilder_.dispose(); + giftValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .TextPieceGift gift_value = 5; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.Builder getGiftValueBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getGiftValueFieldBuilder().getBuilder(); + } + /** + * .TextPieceGift gift_value = 5; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGiftOrBuilder getGiftValueOrBuilder() { + if (giftValueBuilder_ != null) { + return giftValueBuilder_.getMessageOrBuilder(); + } else { + return giftValue_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.getDefaultInstance() : giftValue_; + } + } + /** + * .TextPieceGift gift_value = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGiftOrBuilder> + getGiftValueFieldBuilder() { + if (giftValueBuilder_ == null) { + giftValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGift.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.TextPieceGiftOrBuilder>( + getGiftValue(), + getParentForChildren(), + isClean()); + giftValue_ = null; + } + return giftValueBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart heartValue_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeartOrBuilder> heartValueBuilder_; + /** + * .TextPieceHeart heart_value = 6; + * @return Whether the heartValue field is set. + */ + public boolean hasHeartValue() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * .TextPieceHeart heart_value = 6; + * @return The heartValue. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart getHeartValue() { + if (heartValueBuilder_ == null) { + return heartValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.getDefaultInstance() : heartValue_; + } else { + return heartValueBuilder_.getMessage(); + } + } + /** + * .TextPieceHeart heart_value = 6; + */ + public Builder setHeartValue(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart value) { + if (heartValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + heartValue_ = value; + } else { + heartValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * .TextPieceHeart heart_value = 6; + */ + public Builder setHeartValue( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.Builder builderForValue) { + if (heartValueBuilder_ == null) { + heartValue_ = builderForValue.build(); + } else { + heartValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * .TextPieceHeart heart_value = 6; + */ + public Builder mergeHeartValue(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart value) { + if (heartValueBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + heartValue_ != null && + heartValue_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.getDefaultInstance()) { + getHeartValueBuilder().mergeFrom(value); + } else { + heartValue_ = value; + } + } else { + heartValueBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * .TextPieceHeart heart_value = 6; + */ + public Builder clearHeartValue() { + bitField0_ = (bitField0_ & ~0x00000020); + heartValue_ = null; + if (heartValueBuilder_ != null) { + heartValueBuilder_.dispose(); + heartValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .TextPieceHeart heart_value = 6; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.Builder getHeartValueBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getHeartValueFieldBuilder().getBuilder(); + } + /** + * .TextPieceHeart heart_value = 6; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeartOrBuilder getHeartValueOrBuilder() { + if (heartValueBuilder_ != null) { + return heartValueBuilder_.getMessageOrBuilder(); + } else { + return heartValue_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.getDefaultInstance() : heartValue_; + } + } + /** + * .TextPieceHeart heart_value = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeartOrBuilder> + getHeartValueFieldBuilder() { + if (heartValueBuilder_ == null) { + heartValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeart.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.TextPieceHeartOrBuilder>( + getHeartValue(), + getParentForChildren(), + isClean()); + heartValue_ = null; + } + return heartValueBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef patternRefValue_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRefOrBuilder> patternRefValueBuilder_; + /** + * .TextPiecePatternRef pattern_ref_value = 7; + * @return Whether the patternRefValue field is set. + */ + public boolean hasPatternRefValue() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * .TextPiecePatternRef pattern_ref_value = 7; + * @return The patternRefValue. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef getPatternRefValue() { + if (patternRefValueBuilder_ == null) { + return patternRefValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.getDefaultInstance() : patternRefValue_; + } else { + return patternRefValueBuilder_.getMessage(); + } + } + /** + * .TextPiecePatternRef pattern_ref_value = 7; + */ + public Builder setPatternRefValue(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef value) { + if (patternRefValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + patternRefValue_ = value; + } else { + patternRefValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .TextPiecePatternRef pattern_ref_value = 7; + */ + public Builder setPatternRefValue( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.Builder builderForValue) { + if (patternRefValueBuilder_ == null) { + patternRefValue_ = builderForValue.build(); + } else { + patternRefValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .TextPiecePatternRef pattern_ref_value = 7; + */ + public Builder mergePatternRefValue(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef value) { + if (patternRefValueBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + patternRefValue_ != null && + patternRefValue_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.getDefaultInstance()) { + getPatternRefValueBuilder().mergeFrom(value); + } else { + patternRefValue_ = value; + } + } else { + patternRefValueBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .TextPiecePatternRef pattern_ref_value = 7; + */ + public Builder clearPatternRefValue() { + bitField0_ = (bitField0_ & ~0x00000040); + patternRefValue_ = null; + if (patternRefValueBuilder_ != null) { + patternRefValueBuilder_.dispose(); + patternRefValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .TextPiecePatternRef pattern_ref_value = 7; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.Builder getPatternRefValueBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getPatternRefValueFieldBuilder().getBuilder(); + } + /** + * .TextPiecePatternRef pattern_ref_value = 7; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRefOrBuilder getPatternRefValueOrBuilder() { + if (patternRefValueBuilder_ != null) { + return patternRefValueBuilder_.getMessageOrBuilder(); + } else { + return patternRefValue_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.getDefaultInstance() : patternRefValue_; + } + } + /** + * .TextPiecePatternRef pattern_ref_value = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRefOrBuilder> + getPatternRefValueFieldBuilder() { + if (patternRefValueBuilder_ == null) { + patternRefValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRefOrBuilder>( + getPatternRefValue(), + getParentForChildren(), + isClean()); + patternRefValue_ = null; + } + return patternRefValueBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage imageValue_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImageOrBuilder> imageValueBuilder_; + /** + * .TextPieceImage image_value = 8; + * @return Whether the imageValue field is set. + */ + public boolean hasImageValue() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * .TextPieceImage image_value = 8; + * @return The imageValue. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage getImageValue() { + if (imageValueBuilder_ == null) { + return imageValue_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.getDefaultInstance() : imageValue_; + } else { + return imageValueBuilder_.getMessage(); + } + } + /** + * .TextPieceImage image_value = 8; + */ + public Builder setImageValue(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage value) { + if (imageValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + imageValue_ = value; + } else { + imageValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * .TextPieceImage image_value = 8; + */ + public Builder setImageValue( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.Builder builderForValue) { + if (imageValueBuilder_ == null) { + imageValue_ = builderForValue.build(); + } else { + imageValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * .TextPieceImage image_value = 8; + */ + public Builder mergeImageValue(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage value) { + if (imageValueBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) && + imageValue_ != null && + imageValue_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.getDefaultInstance()) { + getImageValueBuilder().mergeFrom(value); + } else { + imageValue_ = value; + } + } else { + imageValueBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * .TextPieceImage image_value = 8; + */ + public Builder clearImageValue() { + bitField0_ = (bitField0_ & ~0x00000080); + imageValue_ = null; + if (imageValueBuilder_ != null) { + imageValueBuilder_.dispose(); + imageValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .TextPieceImage image_value = 8; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.Builder getImageValueBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getImageValueFieldBuilder().getBuilder(); + } + /** + * .TextPieceImage image_value = 8; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImageOrBuilder getImageValueOrBuilder() { + if (imageValueBuilder_ != null) { + return imageValueBuilder_.getMessageOrBuilder(); + } else { + return imageValue_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.getDefaultInstance() : imageValue_; + } + } + /** + * .TextPieceImage image_value = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImageOrBuilder> + getImageValueFieldBuilder() { + if (imageValueBuilder_ == null) { + imageValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImage.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.TextPieceImageOrBuilder>( + getImageValue(), + getParentForChildren(), + isClean()); + imageValue_ = null; + } + return imageValueBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:TextPiece) + } + + // @@protoc_insertion_point(class_scope:TextPiece) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextPiece parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceOuterClass.TextPiece getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_TextPiece_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_TextPiece_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\017TextPiece.proto\032\020TextFormat.proto\032\024Tex" + + "tPieceImage.proto\032\031TextPiecePatternRef.p" + + "roto\032\024TextPieceHeart.proto\032\023TextPieceGif" + + "t.proto\032\023TextPieceUser.proto\"\221\002\n\tTextPie" + + "ce\022\014\n\004type\030\001 \001(\010\022\033\n\006format\030\002 \001(\0132\013.TextF" + + "ormat\022\024\n\014string_value\030\003 \001(\t\022\"\n\nuser_valu" + + "e\030\004 \001(\0132\016.TextPieceUser\022\"\n\ngift_value\030\005 " + + "\001(\0132\016.TextPieceGift\022$\n\013heart_value\030\006 \001(\013" + + "2\017.TextPieceHeart\022/\n\021pattern_ref_value\030\007" + + " \001(\0132\024.TextPiecePatternRef\022$\n\013image_valu" + + "e\030\010 \001(\0132\017.TextPieceImageB8\n6tech.ordinar" + + "yroad.live.chat.client.douyin.protobuf.d" + + "tob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.getDescriptor(), + }); + internal_static_TextPiece_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_TextPiece_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_TextPiece_descriptor, + new java.lang.String[] { "Type", "Format", "StringValue", "UserValue", "GiftValue", "HeartValue", "PatternRefValue", "ImageValue", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextFormatOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceImageOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceHeartOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceGiftOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPiecePatternRefOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPiecePatternRefOuterClass.java new file mode 100644 index 0000000..1a928e5 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPiecePatternRefOuterClass.java @@ -0,0 +1,773 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: TextPiecePatternRef.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class TextPiecePatternRefOuterClass { + private TextPiecePatternRefOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TextPiecePatternRefOrBuilder extends + // @@protoc_insertion_point(interface_extends:TextPiecePatternRef) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + * @return The key. + */ + java.lang.String getKey(); + /** + * string key = 1; + * @return The bytes for key. + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * string default_pattern = 2; + * @return The defaultPattern. + */ + java.lang.String getDefaultPattern(); + /** + * string default_pattern = 2; + * @return The bytes for defaultPattern. + */ + com.google.protobuf.ByteString + getDefaultPatternBytes(); + } + /** + * Protobuf type {@code TextPiecePatternRef} + */ + public static final class TextPiecePatternRef extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:TextPiecePatternRef) + TextPiecePatternRefOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextPiecePatternRef.newBuilder() to construct. + private TextPiecePatternRef(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextPiecePatternRef() { + key_ = ""; + defaultPattern_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TextPiecePatternRef(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.internal_static_TextPiecePatternRef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.internal_static_TextPiecePatternRef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + /** + * string key = 1; + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEFAULT_PATTERN_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object defaultPattern_ = ""; + /** + * string default_pattern = 2; + * @return The defaultPattern. + */ + @java.lang.Override + public java.lang.String getDefaultPattern() { + java.lang.Object ref = defaultPattern_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + defaultPattern_ = s; + return s; + } + } + /** + * string default_pattern = 2; + * @return The bytes for defaultPattern. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDefaultPatternBytes() { + java.lang.Object ref = defaultPattern_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + defaultPattern_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultPattern_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, defaultPattern_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultPattern_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, defaultPattern_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef) obj; + + if (!getKey() + .equals(other.getKey())) return false; + if (!getDefaultPattern() + .equals(other.getDefaultPattern())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + DEFAULT_PATTERN_FIELD_NUMBER; + hash = (53 * hash) + getDefaultPattern().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code TextPiecePatternRef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:TextPiecePatternRef) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.internal_static_TextPiecePatternRef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.internal_static_TextPiecePatternRef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = ""; + defaultPattern_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.internal_static_TextPiecePatternRef_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.defaultPattern_ = defaultPattern_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDefaultPattern().isEmpty()) { + defaultPattern_ = other.defaultPattern_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + key_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + defaultPattern_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + * @return The bytes for key. + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string key = 1; + * @return This builder for chaining. + */ + public Builder clearKey() { + key_ = getDefaultInstance().getKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string key = 1; + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object defaultPattern_ = ""; + /** + * string default_pattern = 2; + * @return The defaultPattern. + */ + public java.lang.String getDefaultPattern() { + java.lang.Object ref = defaultPattern_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + defaultPattern_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string default_pattern = 2; + * @return The bytes for defaultPattern. + */ + public com.google.protobuf.ByteString + getDefaultPatternBytes() { + java.lang.Object ref = defaultPattern_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + defaultPattern_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string default_pattern = 2; + * @param value The defaultPattern to set. + * @return This builder for chaining. + */ + public Builder setDefaultPattern( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + defaultPattern_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string default_pattern = 2; + * @return This builder for chaining. + */ + public Builder clearDefaultPattern() { + defaultPattern_ = getDefaultInstance().getDefaultPattern(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string default_pattern = 2; + * @param value The bytes for defaultPattern to set. + * @return This builder for chaining. + */ + public Builder setDefaultPatternBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + defaultPattern_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:TextPiecePatternRef) + } + + // @@protoc_insertion_point(class_scope:TextPiecePatternRef) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextPiecePatternRef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPiecePatternRefOuterClass.TextPiecePatternRef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_TextPiecePatternRef_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_TextPiecePatternRef_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\031TextPiecePatternRef.proto\";\n\023TextPiece" + + "PatternRef\022\013\n\003key\030\001 \001(\t\022\027\n\017default_patte" + + "rn\030\002 \001(\tB8\n6tech.ordinaryroad.live.chat." + + "client.douyin.protobuf.dtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_TextPiecePatternRef_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_TextPiecePatternRef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_TextPiecePatternRef_descriptor, + new java.lang.String[] { "Key", "DefaultPattern", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceUserOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceUserOuterClass.java new file mode 100644 index 0000000..2d0fc47 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/TextPieceUserOuterClass.java @@ -0,0 +1,748 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: TextPieceUser.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class TextPieceUserOuterClass { + private TextPieceUserOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TextPieceUserOrBuilder extends + // @@protoc_insertion_point(interface_extends:TextPieceUser) + com.google.protobuf.MessageOrBuilder { + + /** + * .User user = 1; + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * .User user = 1; + * @return The user. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser(); + /** + * .User user = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder(); + + /** + * bool with_colon = 2; + * @return The withColon. + */ + boolean getWithColon(); + } + /** + * Protobuf type {@code TextPieceUser} + */ + public static final class TextPieceUser extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:TextPieceUser) + TextPieceUserOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextPieceUser.newBuilder() to construct. + private TextPieceUser(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextPieceUser() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TextPieceUser(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.internal_static_TextPieceUser_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.internal_static_TextPieceUser_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.Builder.class); + } + + public static final int USER_FIELD_NUMBER = 1; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User user_; + /** + * .User user = 1; + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * .User user = 1; + * @return The user. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser() { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + /** + * .User user = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder() { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + + public static final int WITH_COLON_FIELD_NUMBER = 2; + private boolean withColon_ = false; + /** + * bool with_colon = 2; + * @return The withColon. + */ + @java.lang.Override + public boolean getWithColon() { + return withColon_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (user_ != null) { + output.writeMessage(1, getUser()); + } + if (withColon_ != false) { + output.writeBool(2, withColon_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getUser()); + } + if (withColon_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, withColon_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser) obj; + + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser() + .equals(other.getUser())) return false; + } + if (getWithColon() + != other.getWithColon()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + WITH_COLON_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getWithColon()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code TextPieceUser} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:TextPieceUser) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUserOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.internal_static_TextPieceUser_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.internal_static_TextPieceUser_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + withColon_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.internal_static_TextPieceUser_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.user_ = userBuilder_ == null + ? user_ + : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.withColon_ = withColon_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser.getDefaultInstance()) return this; + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (other.getWithColon() != false) { + setWithColon(other.getWithColon()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getUserFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + withColon_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> userBuilder_; + /** + * .User user = 1; + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .User user = 1; + * @return The user. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * .User user = 1; + */ + public Builder setUser(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .User user = 1; + */ + public Builder setUser( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .User user = 1; + */ + public Builder mergeUser(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + user_ != null && + user_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .User user = 1; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000001); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User user = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder getUserBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * .User user = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance() : user_; + } + } + /** + * .User user = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + + private boolean withColon_ ; + /** + * bool with_colon = 2; + * @return The withColon. + */ + @java.lang.Override + public boolean getWithColon() { + return withColon_; + } + /** + * bool with_colon = 2; + * @param value The withColon to set. + * @return This builder for chaining. + */ + public Builder setWithColon(boolean value) { + + withColon_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * bool with_colon = 2; + * @return This builder for chaining. + */ + public Builder clearWithColon() { + bitField0_ = (bitField0_ & ~0x00000002); + withColon_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:TextPieceUser) + } + + // @@protoc_insertion_point(class_scope:TextPieceUser) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextPieceUser parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.TextPieceUserOuterClass.TextPieceUser getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_TextPieceUser_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_TextPieceUser_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\023TextPieceUser.proto\032\nUser.proto\"8\n\rTex" + + "tPieceUser\022\023\n\004user\030\001 \001(\0132\005.User\022\022\n\nwith_" + + "colon\030\002 \001(\010B8\n6tech.ordinaryroad.live.ch" + + "at.client.douyin.protobuf.dtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.getDescriptor(), + }); + internal_static_TextPieceUser_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_TextPieceUser_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_TextPieceUser_descriptor, + new java.lang.String[] { "User", "WithColon", }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/UserOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/UserOuterClass.java new file mode 100644 index 0000000..e8d3b53 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/java/tech/ordinaryroad/live/chat/client/douyin/protobuf/dto/UserOuterClass.java @@ -0,0 +1,33138 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: User.proto + +package tech.ordinaryroad.live.chat.client.douyin.protobuf.dto; + +public final class UserOuterClass { + private UserOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface UserOrBuilder extends + // @@protoc_insertion_point(interface_extends:User) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 id = 1; + * @return The id. + */ + long getId(); + + /** + * uint64 shortId = 2; + * @return The shortId. + */ + long getShortId(); + + /** + * string nickname = 3; + * @return The nickname. + */ + java.lang.String getNickname(); + /** + * string nickname = 3; + * @return The bytes for nickname. + */ + com.google.protobuf.ByteString + getNicknameBytes(); + + /** + * uint32 gender = 4; + * @return The gender. + */ + int getGender(); + + /** + * string signature = 5; + * @return The signature. + */ + java.lang.String getSignature(); + /** + * string signature = 5; + * @return The bytes for signature. + */ + com.google.protobuf.ByteString + getSignatureBytes(); + + /** + * uint32 level = 6; + * @return The level. + */ + int getLevel(); + + /** + * uint64 birthday = 7; + * @return The birthday. + */ + long getBirthday(); + + /** + * string telephone = 8; + * @return The telephone. + */ + java.lang.String getTelephone(); + /** + * string telephone = 8; + * @return The bytes for telephone. + */ + com.google.protobuf.ByteString + getTelephoneBytes(); + + /** + * .Image avatarThumb = 9; + * @return Whether the avatarThumb field is set. + */ + boolean hasAvatarThumb(); + /** + * .Image avatarThumb = 9; + * @return The avatarThumb. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarThumb(); + /** + * .Image avatarThumb = 9; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarThumbOrBuilder(); + + /** + * .Image avatarMedium = 10; + * @return Whether the avatarMedium field is set. + */ + boolean hasAvatarMedium(); + /** + * .Image avatarMedium = 10; + * @return The avatarMedium. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarMedium(); + /** + * .Image avatarMedium = 10; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarMediumOrBuilder(); + + /** + * .Image avatarLarge = 11; + * @return Whether the avatarLarge field is set. + */ + boolean hasAvatarLarge(); + /** + * .Image avatarLarge = 11; + * @return The avatarLarge. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarLarge(); + /** + * .Image avatarLarge = 11; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarLargeOrBuilder(); + + /** + * bool verified = 12; + * @return The verified. + */ + boolean getVerified(); + + /** + * int32 experience = 13; + * @return The experience. + */ + int getExperience(); + + /** + * string city = 14; + * @return The city. + */ + java.lang.String getCity(); + /** + * string city = 14; + * @return The bytes for city. + */ + com.google.protobuf.ByteString + getCityBytes(); + + /** + * int32 status = 15; + * @return The status. + */ + int getStatus(); + + /** + * int64 createTime = 16; + * @return The createTime. + */ + long getCreateTime(); + + /** + * int64 modifyTime = 17; + * @return The modifyTime. + */ + long getModifyTime(); + + /** + * int32 secret = 18; + * @return The secret. + */ + int getSecret(); + + /** + * string shareQrcodeUri = 19; + * @return The shareQrcodeUri. + */ + java.lang.String getShareQrcodeUri(); + /** + * string shareQrcodeUri = 19; + * @return The bytes for shareQrcodeUri. + */ + com.google.protobuf.ByteString + getShareQrcodeUriBytes(); + + /** + * int32 incomeSharePercent = 20; + * @return The incomeSharePercent. + */ + int getIncomeSharePercent(); + + /** + * .Image badgeImageListList = 21; + * @return Whether the badgeImageListList field is set. + */ + boolean hasBadgeImageListList(); + /** + * .Image badgeImageListList = 21; + * @return The badgeImageListList. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBadgeImageListList(); + /** + * .Image badgeImageListList = 21; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBadgeImageListListOrBuilder(); + + /** + * .User.FollowInfo followInfo = 22; + * @return Whether the followInfo field is set. + */ + boolean hasFollowInfo(); + /** + * .User.FollowInfo followInfo = 22; + * @return The followInfo. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo getFollowInfo(); + /** + * .User.FollowInfo followInfo = 22; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfoOrBuilder getFollowInfoOrBuilder(); + + /** + * .User.PayGrade payGrade = 23; + * @return Whether the payGrade field is set. + */ + boolean hasPayGrade(); + /** + * .User.PayGrade payGrade = 23; + * @return The payGrade. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade getPayGrade(); + /** + * .User.PayGrade payGrade = 23; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGradeOrBuilder getPayGradeOrBuilder(); + + /** + * .User.FansClub fansClub = 24; + * @return Whether the fansClub field is set. + */ + boolean hasFansClub(); + /** + * .User.FansClub fansClub = 24; + * @return The fansClub. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub getFansClub(); + /** + * .User.FansClub fansClub = 24; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClubOrBuilder getFansClubOrBuilder(); + + /** + * .User.Border border = 25; + * @return Whether the border field is set. + */ + boolean hasBorder(); + /** + * .User.Border border = 25; + * @return The border. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border getBorder(); + /** + * .User.Border border = 25; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BorderOrBuilder getBorderOrBuilder(); + + /** + * string specialId = 26; + * @return The specialId. + */ + java.lang.String getSpecialId(); + /** + * string specialId = 26; + * @return The bytes for specialId. + */ + com.google.protobuf.ByteString + getSpecialIdBytes(); + + /** + * .Image avatarBorder = 27; + * @return Whether the avatarBorder field is set. + */ + boolean hasAvatarBorder(); + /** + * .Image avatarBorder = 27; + * @return The avatarBorder. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarBorder(); + /** + * .Image avatarBorder = 27; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarBorderOrBuilder(); + + /** + * .Image medal = 28; + * @return Whether the medal field is set. + */ + boolean hasMedal(); + /** + * .Image medal = 28; + * @return The medal. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getMedal(); + /** + * .Image medal = 28; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getMedalOrBuilder(); + + /** + * repeated .Image realTimeIconsList = 29; + */ + java.util.List + getRealTimeIconsListList(); + /** + * repeated .Image realTimeIconsList = 29; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getRealTimeIconsList(int index); + /** + * repeated .Image realTimeIconsList = 29; + */ + int getRealTimeIconsListCount(); + /** + * repeated .Image realTimeIconsList = 29; + */ + java.util.List + getRealTimeIconsListOrBuilderList(); + /** + * repeated .Image realTimeIconsList = 29; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getRealTimeIconsListOrBuilder( + int index); + + /** + * repeated .Image newRealTimeIconsList = 30; + */ + java.util.List + getNewRealTimeIconsListList(); + /** + * repeated .Image newRealTimeIconsList = 30; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getNewRealTimeIconsList(int index); + /** + * repeated .Image newRealTimeIconsList = 30; + */ + int getNewRealTimeIconsListCount(); + /** + * repeated .Image newRealTimeIconsList = 30; + */ + java.util.List + getNewRealTimeIconsListOrBuilderList(); + /** + * repeated .Image newRealTimeIconsList = 30; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getNewRealTimeIconsListOrBuilder( + int index); + + /** + * int64 topVipNo = 31; + * @return The topVipNo. + */ + long getTopVipNo(); + + /** + * .User.UserAttr userAttr = 32; + * @return Whether the userAttr field is set. + */ + boolean hasUserAttr(); + /** + * .User.UserAttr userAttr = 32; + * @return The userAttr. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr getUserAttr(); + /** + * .User.UserAttr userAttr = 32; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttrOrBuilder getUserAttrOrBuilder(); + + /** + * .User.OwnRoom ownRoom = 33; + * @return Whether the ownRoom field is set. + */ + boolean hasOwnRoom(); + /** + * .User.OwnRoom ownRoom = 33; + * @return The ownRoom. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom getOwnRoom(); + /** + * .User.OwnRoom ownRoom = 33; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoomOrBuilder getOwnRoomOrBuilder(); + + /** + * int64 payScore = 34; + * @return The payScore. + */ + long getPayScore(); + + /** + * int64 ticketCount = 35; + * @return The ticketCount. + */ + long getTicketCount(); + + /** + * .User.AnchorInfo anchorInfo = 36; + * @return Whether the anchorInfo field is set. + */ + boolean hasAnchorInfo(); + /** + * .User.AnchorInfo anchorInfo = 36; + * @return The anchorInfo. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo getAnchorInfo(); + /** + * .User.AnchorInfo anchorInfo = 36; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfoOrBuilder getAnchorInfoOrBuilder(); + + /** + * int32 linkMicStats = 37; + * @return The linkMicStats. + */ + int getLinkMicStats(); + + /** + * string displayId = 38; + * @return The displayId. + */ + java.lang.String getDisplayId(); + /** + * string displayId = 38; + * @return The bytes for displayId. + */ + com.google.protobuf.ByteString + getDisplayIdBytes(); + + /** + * bool withCommercePermission = 39; + * @return The withCommercePermission. + */ + boolean getWithCommercePermission(); + + /** + * bool withFusionShopEntry = 40; + * @return The withFusionShopEntry. + */ + boolean getWithFusionShopEntry(); + + /** + * int64 totalRechargeDiamondCount = 41; + * @return The totalRechargeDiamondCount. + */ + long getTotalRechargeDiamondCount(); + + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + * @return Whether the webcastAnchorLevel field is set. + */ + boolean hasWebcastAnchorLevel(); + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + * @return The webcastAnchorLevel. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel getWebcastAnchorLevel(); + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevelOrBuilder getWebcastAnchorLevelOrBuilder(); + + /** + * string verifiedContent = 43; + * @return The verifiedContent. + */ + java.lang.String getVerifiedContent(); + /** + * string verifiedContent = 43; + * @return The bytes for verifiedContent. + */ + com.google.protobuf.ByteString + getVerifiedContentBytes(); + + /** + * .User.AuthorStats authorStats = 44; + * @return Whether the authorStats field is set. + */ + boolean hasAuthorStats(); + /** + * .User.AuthorStats authorStats = 44; + * @return The authorStats. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats getAuthorStats(); + /** + * .User.AuthorStats authorStats = 44; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStatsOrBuilder getAuthorStatsOrBuilder(); + + /** + * repeated .User topFansList = 45; + */ + java.util.List + getTopFansListList(); + /** + * repeated .User topFansList = 45; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getTopFansList(int index); + /** + * repeated .User topFansList = 45; + */ + int getTopFansListCount(); + /** + * repeated .User topFansList = 45; + */ + java.util.List + getTopFansListOrBuilderList(); + /** + * repeated .User topFansList = 45; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getTopFansListOrBuilder( + int index); + + /** + * string secUid = 46; + * @return The secUid. + */ + java.lang.String getSecUid(); + /** + * string secUid = 46; + * @return The bytes for secUid. + */ + com.google.protobuf.ByteString + getSecUidBytes(); + + /** + * int32 userRole = 47; + * @return The userRole. + */ + int getUserRole(); + + /** + * .User.XiguaParams xiguaInfo = 48; + * @return Whether the xiguaInfo field is set. + */ + boolean hasXiguaInfo(); + /** + * .User.XiguaParams xiguaInfo = 48; + * @return The xiguaInfo. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams getXiguaInfo(); + /** + * .User.XiguaParams xiguaInfo = 48; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParamsOrBuilder getXiguaInfoOrBuilder(); + + /** + * .User.ActivityInfo activityReward = 49; + * @return Whether the activityReward field is set. + */ + boolean hasActivityReward(); + /** + * .User.ActivityInfo activityReward = 49; + * @return The activityReward. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo getActivityReward(); + /** + * .User.ActivityInfo activityReward = 49; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfoOrBuilder getActivityRewardOrBuilder(); + + /** + * .User.NobleLevelInfo nobleInfo = 50; + * @return Whether the nobleInfo field is set. + */ + boolean hasNobleInfo(); + /** + * .User.NobleLevelInfo nobleInfo = 50; + * @return The nobleInfo. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo getNobleInfo(); + /** + * .User.NobleLevelInfo nobleInfo = 50; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfoOrBuilder getNobleInfoOrBuilder(); + + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + * @return Whether the brotherhoodInfo field is set. + */ + boolean hasBrotherhoodInfo(); + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + * @return The brotherhoodInfo. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo getBrotherhoodInfo(); + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfoOrBuilder getBrotherhoodInfoOrBuilder(); + + /** + * .Image personalCard = 52; + * @return Whether the personalCard field is set. + */ + boolean hasPersonalCard(); + /** + * .Image personalCard = 52; + * @return The personalCard. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getPersonalCard(); + /** + * .Image personalCard = 52; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getPersonalCardOrBuilder(); + + /** + * .User.AuthenticationInfo authenticationInfo = 53; + * @return Whether the authenticationInfo field is set. + */ + boolean hasAuthenticationInfo(); + /** + * .User.AuthenticationInfo authenticationInfo = 53; + * @return The authenticationInfo. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo getAuthenticationInfo(); + /** + * .User.AuthenticationInfo authenticationInfo = 53; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfoOrBuilder getAuthenticationInfoOrBuilder(); + + /** + * int32 authorizationInfo = 54; + * @return The authorizationInfo. + */ + int getAuthorizationInfo(); + + /** + * int32 adversaryAuthorizationInfo = 55; + * @return The adversaryAuthorizationInfo. + */ + int getAdversaryAuthorizationInfo(); + + /** + * .User.PoiInfo poiInfo = 56; + * @return Whether the poiInfo field is set. + */ + boolean hasPoiInfo(); + /** + * .User.PoiInfo poiInfo = 56; + * @return The poiInfo. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo getPoiInfo(); + /** + * .User.PoiInfo poiInfo = 56; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfoOrBuilder getPoiInfoOrBuilder(); + + /** + * .Image mediaBadgeImageListList = 57; + * @return Whether the mediaBadgeImageListList field is set. + */ + boolean hasMediaBadgeImageListList(); + /** + * .Image mediaBadgeImageListList = 57; + * @return The mediaBadgeImageListList. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getMediaBadgeImageListList(); + /** + * .Image mediaBadgeImageListList = 57; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getMediaBadgeImageListListOrBuilder(); + + /** + * int32 adversaryUserStatus = 58; + * @return The adversaryUserStatus. + */ + int getAdversaryUserStatus(); + + /** + * .User.UserVIPInfo userVipInfo = 59; + * @return Whether the userVipInfo field is set. + */ + boolean hasUserVipInfo(); + /** + * .User.UserVIPInfo userVipInfo = 59; + * @return The userVipInfo. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo getUserVipInfo(); + /** + * .User.UserVIPInfo userVipInfo = 59; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfoOrBuilder getUserVipInfoOrBuilder(); + + /** + * repeated int64 commerceWebcastConfigIdsList = 60; + * @return A list containing the commerceWebcastConfigIdsList. + */ + java.util.List getCommerceWebcastConfigIdsListList(); + /** + * repeated int64 commerceWebcastConfigIdsList = 60; + * @return The count of commerceWebcastConfigIdsList. + */ + int getCommerceWebcastConfigIdsListCount(); + /** + * repeated int64 commerceWebcastConfigIdsList = 60; + * @param index The index of the element to return. + * @return The commerceWebcastConfigIdsList at the given index. + */ + long getCommerceWebcastConfigIdsList(int index); + + /** + * .Image badgeImageListV2List = 61; + * @return Whether the badgeImageListV2List field is set. + */ + boolean hasBadgeImageListV2List(); + /** + * .Image badgeImageListV2List = 61; + * @return The badgeImageListV2List. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBadgeImageListV2List(); + /** + * .Image badgeImageListV2List = 61; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBadgeImageListV2ListOrBuilder(); + + /** + *
+     * IndustryCertification  industryCertification = 62;
+     * 
+ * + * string locationCity = 63; + * @return The locationCity. + */ + java.lang.String getLocationCity(); + /** + *
+     * IndustryCertification  industryCertification = 62;
+     * 
+ * + * string locationCity = 63; + * @return The bytes for locationCity. + */ + com.google.protobuf.ByteString + getLocationCityBytes(); + + /** + * .User.FansGroupInfo fansGroupInfo = 64; + * @return Whether the fansGroupInfo field is set. + */ + boolean hasFansGroupInfo(); + /** + * .User.FansGroupInfo fansGroupInfo = 64; + * @return The fansGroupInfo. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo getFansGroupInfo(); + /** + * .User.FansGroupInfo fansGroupInfo = 64; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfoOrBuilder getFansGroupInfoOrBuilder(); + + /** + * string remarkName = 65; + * @return The remarkName. + */ + java.lang.String getRemarkName(); + /** + * string remarkName = 65; + * @return The bytes for remarkName. + */ + com.google.protobuf.ByteString + getRemarkNameBytes(); + + /** + * int32 mysteryMan = 66; + * @return The mysteryMan. + */ + int getMysteryMan(); + + /** + * string webRid = 67; + * @return The webRid. + */ + java.lang.String getWebRid(); + /** + * string webRid = 67; + * @return The bytes for webRid. + */ + com.google.protobuf.ByteString + getWebRidBytes(); + + /** + * string desensitizedNickname = 68; + * @return The desensitizedNickname. + */ + java.lang.String getDesensitizedNickname(); + /** + * string desensitizedNickname = 68; + * @return The bytes for desensitizedNickname. + */ + com.google.protobuf.ByteString + getDesensitizedNicknameBytes(); + + /** + * .User.JAccreditInfo jAccreditInfo = 69; + * @return Whether the jAccreditInfo field is set. + */ + boolean hasJAccreditInfo(); + /** + * .User.JAccreditInfo jAccreditInfo = 69; + * @return The jAccreditInfo. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo getJAccreditInfo(); + /** + * .User.JAccreditInfo jAccreditInfo = 69; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfoOrBuilder getJAccreditInfoOrBuilder(); + + /** + * .User.Subscribe subscribe = 70; + * @return Whether the subscribe field is set. + */ + boolean hasSubscribe(); + /** + * .User.Subscribe subscribe = 70; + * @return The subscribe. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe getSubscribe(); + /** + * .User.Subscribe subscribe = 70; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.SubscribeOrBuilder getSubscribeOrBuilder(); + + /** + * bool isAnonymous = 71; + * @return The isAnonymous. + */ + boolean getIsAnonymous(); + + /** + * int32 consumeDiamondLevel = 72; + * @return The consumeDiamondLevel. + */ + int getConsumeDiamondLevel(); + + /** + * string webcastUid = 73; + * @return The webcastUid. + */ + java.lang.String getWebcastUid(); + /** + * string webcastUid = 73; + * @return The bytes for webcastUid. + */ + com.google.protobuf.ByteString + getWebcastUidBytes(); + + /** + * .User.ProfileStyleParams profileStyleParams = 74; + * @return Whether the profileStyleParams field is set. + */ + boolean hasProfileStyleParams(); + /** + * .User.ProfileStyleParams profileStyleParams = 74; + * @return The profileStyleParams. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams getProfileStyleParams(); + /** + * .User.ProfileStyleParams profileStyleParams = 74; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParamsOrBuilder getProfileStyleParamsOrBuilder(); + + /** + * .User.UserDressInfo userDressInfo = 75; + * @return Whether the userDressInfo field is set. + */ + boolean hasUserDressInfo(); + /** + * .User.UserDressInfo userDressInfo = 75; + * @return The userDressInfo. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo getUserDressInfo(); + /** + * .User.UserDressInfo userDressInfo = 75; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfoOrBuilder getUserDressInfoOrBuilder(); + + /** + * bool allowBeLocated = 1001; + * @return The allowBeLocated. + */ + boolean getAllowBeLocated(); + + /** + * bool allowFindByContacts = 1002; + * @return The allowFindByContacts. + */ + boolean getAllowFindByContacts(); + + /** + * bool allowOthersDownloadVideo = 1003; + * @return The allowOthersDownloadVideo. + */ + boolean getAllowOthersDownloadVideo(); + + /** + * bool allowOthersDownloadWhenSharingVideo = 1004; + * @return The allowOthersDownloadWhenSharingVideo. + */ + boolean getAllowOthersDownloadWhenSharingVideo(); + + /** + * bool allowShareShowProfile = 1005; + * @return The allowShareShowProfile. + */ + boolean getAllowShareShowProfile(); + + /** + * bool allowShowInGossip = 1006; + * @return The allowShowInGossip. + */ + boolean getAllowShowInGossip(); + + /** + * bool allowShowMyAction = 1007; + * @return The allowShowMyAction. + */ + boolean getAllowShowMyAction(); + + /** + * bool allowStrangeComment = 1008; + * @return The allowStrangeComment. + */ + boolean getAllowStrangeComment(); + + /** + * bool allowUnfollowerComment = 1009; + * @return The allowUnfollowerComment. + */ + boolean getAllowUnfollowerComment(); + + /** + * bool allowUseLinkmic = 1010; + * @return The allowUseLinkmic. + */ + boolean getAllowUseLinkmic(); + + /** + * .User.AnchorLevel anchorLevel = 1011; + * @return Whether the anchorLevel field is set. + */ + boolean hasAnchorLevel(); + /** + * .User.AnchorLevel anchorLevel = 1011; + * @return The anchorLevel. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel getAnchorLevel(); + /** + * .User.AnchorLevel anchorLevel = 1011; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevelOrBuilder getAnchorLevelOrBuilder(); + + /** + * .Image avatarJpg = 1012; + * @return Whether the avatarJpg field is set. + */ + boolean hasAvatarJpg(); + /** + * .Image avatarJpg = 1012; + * @return The avatarJpg. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarJpg(); + /** + * .Image avatarJpg = 1012; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarJpgOrBuilder(); + + /** + * string bgImgUrl = 1013; + * @return The bgImgUrl. + */ + java.lang.String getBgImgUrl(); + /** + * string bgImgUrl = 1013; + * @return The bytes for bgImgUrl. + */ + com.google.protobuf.ByteString + getBgImgUrlBytes(); + + /** + * string birthdayDescription = 1014; + * @return The birthdayDescription. + */ + java.lang.String getBirthdayDescription(); + /** + * string birthdayDescription = 1014; + * @return The bytes for birthdayDescription. + */ + com.google.protobuf.ByteString + getBirthdayDescriptionBytes(); + + /** + * bool birthdayValid = 1015; + * @return The birthdayValid. + */ + boolean getBirthdayValid(); + + /** + * int32 blockStatus = 1016; + * @return The blockStatus. + */ + int getBlockStatus(); + + /** + * int32 commentRestrict = 1017; + * @return The commentRestrict. + */ + int getCommentRestrict(); + + /** + * string constellation = 1018; + * @return The constellation. + */ + java.lang.String getConstellation(); + /** + * string constellation = 1018; + * @return The bytes for constellation. + */ + com.google.protobuf.ByteString + getConstellationBytes(); + + /** + * int32 disableIchat = 1019; + * @return The disableIchat. + */ + int getDisableIchat(); + + /** + * int64 enableIchatImg = 1020; + * @return The enableIchatImg. + */ + long getEnableIchatImg(); + + /** + * int32 exp = 1021; + * @return The exp. + */ + int getExp(); + + /** + * int64 fanTicketCount = 1022; + * @return The fanTicketCount. + */ + long getFanTicketCount(); + + /** + * bool foldStrangerChat = 1023; + * @return The foldStrangerChat. + */ + boolean getFoldStrangerChat(); + + /** + * int64 followStatus = 1024; + * @return The followStatus. + */ + long getFollowStatus(); + + /** + * bool hotsoonVerified = 1025; + * @return The hotsoonVerified. + */ + boolean getHotsoonVerified(); + + /** + * string hotsoonVerifiedReason = 1026; + * @return The hotsoonVerifiedReason. + */ + java.lang.String getHotsoonVerifiedReason(); + /** + * string hotsoonVerifiedReason = 1026; + * @return The bytes for hotsoonVerifiedReason. + */ + com.google.protobuf.ByteString + getHotsoonVerifiedReasonBytes(); + + /** + * int32 ichatRestrictType = 1027; + * @return The ichatRestrictType. + */ + int getIchatRestrictType(); + + /** + * string idStr = 1028; + * @return The idStr. + */ + java.lang.String getIdStr(); + /** + * string idStr = 1028; + * @return The bytes for idStr. + */ + com.google.protobuf.ByteString + getIdStrBytes(); + + /** + * bool isFollower = 1029; + * @return The isFollower. + */ + boolean getIsFollower(); + + /** + * bool isFollowing = 1030; + * @return The isFollowing. + */ + boolean getIsFollowing(); + + /** + * bool needProfileGuide = 1031; + * @return The needProfileGuide. + */ + boolean getNeedProfileGuide(); + + /** + * int64 payScores = 1032; + * @return The payScores. + */ + long getPayScores(); + + /** + * bool pushCommentStatus = 1033; + * @return The pushCommentStatus. + */ + boolean getPushCommentStatus(); + + /** + * bool pushDigg = 1034; + * @return The pushDigg. + */ + boolean getPushDigg(); + + /** + * bool pushFollow = 1035; + * @return The pushFollow. + */ + boolean getPushFollow(); + + /** + * bool pushFriendAction = 1036; + * @return The pushFriendAction. + */ + boolean getPushFriendAction(); + + /** + * bool pushIchat = 1037; + * @return The pushIchat. + */ + boolean getPushIchat(); + + /** + * bool pushStatus = 1038; + * @return The pushStatus. + */ + boolean getPushStatus(); + + /** + * bool pushVideoPost = 1039; + * @return The pushVideoPost. + */ + boolean getPushVideoPost(); + + /** + * bool pushVideoRecommend = 1040; + * @return The pushVideoRecommend. + */ + boolean getPushVideoRecommend(); + + /** + * .User.UserStats stats = 1041; + * @return Whether the stats field is set. + */ + boolean hasStats(); + /** + * .User.UserStats stats = 1041; + * @return The stats. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats getStats(); + /** + * .User.UserStats stats = 1041; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStatsOrBuilder getStatsOrBuilder(); + + /** + * bool verifiedMobile = 1042; + * @return The verifiedMobile. + */ + boolean getVerifiedMobile(); + + /** + * string verifiedReason = 1043; + * @return The verifiedReason. + */ + java.lang.String getVerifiedReason(); + /** + * string verifiedReason = 1043; + * @return The bytes for verifiedReason. + */ + com.google.protobuf.ByteString + getVerifiedReasonBytes(); + + /** + * bool withCarManagementPermission = 1044; + * @return The withCarManagementPermission. + */ + boolean getWithCarManagementPermission(); + + /** + * int32 ageRange = 1045; + * @return The ageRange. + */ + int getAgeRange(); + + /** + * int64 watchDurationMonth = 1046; + * @return The watchDurationMonth. + */ + long getWatchDurationMonth(); + } + /** + * Protobuf type {@code User} + */ + public static final class User extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User) + UserOrBuilder { + private static final long serialVersionUID = 0L; + // Use User.newBuilder() to construct. + private User(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private User() { + nickname_ = ""; + signature_ = ""; + telephone_ = ""; + city_ = ""; + shareQrcodeUri_ = ""; + specialId_ = ""; + realTimeIconsList_ = java.util.Collections.emptyList(); + newRealTimeIconsList_ = java.util.Collections.emptyList(); + displayId_ = ""; + verifiedContent_ = ""; + topFansList_ = java.util.Collections.emptyList(); + secUid_ = ""; + commerceWebcastConfigIdsList_ = emptyLongList(); + locationCity_ = ""; + remarkName_ = ""; + webRid_ = ""; + desensitizedNickname_ = ""; + webcastUid_ = ""; + bgImgUrl_ = ""; + birthdayDescription_ = ""; + constellation_ = ""; + hotsoonVerifiedReason_ = ""; + idStr_ = ""; + verifiedReason_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new User(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder.class); + } + + public interface ActivityInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.ActivityInfo) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.ActivityInfo} + */ + public static final class ActivityInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.ActivityInfo) + ActivityInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ActivityInfo.newBuilder() to construct. + private ActivityInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ActivityInfo() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ActivityInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_ActivityInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_ActivityInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.ActivityInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.ActivityInfo) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_ActivityInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_ActivityInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_ActivityInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.ActivityInfo) + } + + // @@protoc_insertion_point(class_scope:User.ActivityInfo) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ActivityInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AnchorInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.AnchorInfo) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.AnchorInfo} + */ + public static final class AnchorInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.AnchorInfo) + AnchorInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use AnchorInfo.newBuilder() to construct. + private AnchorInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AnchorInfo() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AnchorInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AnchorInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AnchorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.AnchorInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.AnchorInfo) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AnchorInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AnchorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AnchorInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.AnchorInfo) + } + + // @@protoc_insertion_point(class_scope:User.AnchorInfo) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AnchorInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AnchorLevelOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.AnchorLevel) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.AnchorLevel} + */ + public static final class AnchorLevel extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.AnchorLevel) + AnchorLevelOrBuilder { + private static final long serialVersionUID = 0L; + // Use AnchorLevel.newBuilder() to construct. + private AnchorLevel(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AnchorLevel() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AnchorLevel(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AnchorLevel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AnchorLevel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.AnchorLevel} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.AnchorLevel) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AnchorLevel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AnchorLevel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AnchorLevel_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.AnchorLevel) + } + + // @@protoc_insertion_point(class_scope:User.AnchorLevel) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AnchorLevel parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AuthenticationInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.AuthenticationInfo) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.AuthenticationInfo} + */ + public static final class AuthenticationInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.AuthenticationInfo) + AuthenticationInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use AuthenticationInfo.newBuilder() to construct. + private AuthenticationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AuthenticationInfo() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AuthenticationInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AuthenticationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AuthenticationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.AuthenticationInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.AuthenticationInfo) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AuthenticationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AuthenticationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AuthenticationInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.AuthenticationInfo) + } + + // @@protoc_insertion_point(class_scope:User.AuthenticationInfo) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthenticationInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AuthorStatsOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.AuthorStats) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.AuthorStats} + */ + public static final class AuthorStats extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.AuthorStats) + AuthorStatsOrBuilder { + private static final long serialVersionUID = 0L; + // Use AuthorStats.newBuilder() to construct. + private AuthorStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AuthorStats() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AuthorStats(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AuthorStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AuthorStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.AuthorStats} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.AuthorStats) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AuthorStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AuthorStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_AuthorStats_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.AuthorStats) + } + + // @@protoc_insertion_point(class_scope:User.AuthorStats) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthorStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface BorderOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.Border) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.Border} + */ + public static final class Border extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.Border) + BorderOrBuilder { + private static final long serialVersionUID = 0L; + // Use Border.newBuilder() to construct. + private Border(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Border() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Border(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_Border_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_Border_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.Border} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.Border) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BorderOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_Border_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_Border_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_Border_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.Border) + } + + // @@protoc_insertion_point(class_scope:User.Border) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Border parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface BrotherhoodInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.BrotherhoodInfo) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.BrotherhoodInfo} + */ + public static final class BrotherhoodInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.BrotherhoodInfo) + BrotherhoodInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use BrotherhoodInfo.newBuilder() to construct. + private BrotherhoodInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BrotherhoodInfo() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new BrotherhoodInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_BrotherhoodInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_BrotherhoodInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.BrotherhoodInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.BrotherhoodInfo) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_BrotherhoodInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_BrotherhoodInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_BrotherhoodInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.BrotherhoodInfo) + } + + // @@protoc_insertion_point(class_scope:User.BrotherhoodInfo) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BrotherhoodInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FansClubOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.FansClub) + com.google.protobuf.MessageOrBuilder { + + /** + * .User.FansClub.FansClubData data = 1; + * @return Whether the data field is set. + */ + boolean hasData(); + /** + * .User.FansClub.FansClubData data = 1; + * @return The data. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData getData(); + /** + * .User.FansClub.FansClubData data = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubDataOrBuilder getDataOrBuilder(); + + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + int getPreferDataCount(); + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + boolean containsPreferData( + int key); + /** + * Use {@link #getPreferDataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getPreferData(); + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + java.util.Map + getPreferDataMap(); + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + /* nullable */ +tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData getPreferDataOrDefault( + int key, + /* nullable */ +tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData defaultValue); + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData getPreferDataOrThrow( + int key); + } + /** + * Protobuf type {@code User.FansClub} + */ + public static final class FansClub extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.FansClub) + FansClubOrBuilder { + private static final long serialVersionUID = 0L; + // Use FansClub.newBuilder() to construct. + private FansClub(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FansClub() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new FansClub(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 2: + return internalGetPreferData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.Builder.class); + } + + public interface FansClubDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.FansClub.FansClubData) + com.google.protobuf.MessageOrBuilder { + + /** + * string clubName = 1; + * @return The clubName. + */ + java.lang.String getClubName(); + /** + * string clubName = 1; + * @return The bytes for clubName. + */ + com.google.protobuf.ByteString + getClubNameBytes(); + + /** + * int32 level = 2; + * @return The level. + */ + int getLevel(); + + /** + * int32 userFansClubStatus = 3; + * @return The userFansClubStatus. + */ + int getUserFansClubStatus(); + + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + * @return Whether the badge field is set. + */ + boolean hasBadge(); + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + * @return The badge. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge getBadge(); + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadgeOrBuilder getBadgeOrBuilder(); + + /** + * repeated int64 availableGiftIds = 5; + * @return A list containing the availableGiftIds. + */ + java.util.List getAvailableGiftIdsList(); + /** + * repeated int64 availableGiftIds = 5; + * @return The count of availableGiftIds. + */ + int getAvailableGiftIdsCount(); + /** + * repeated int64 availableGiftIds = 5; + * @param index The index of the element to return. + * @return The availableGiftIds at the given index. + */ + long getAvailableGiftIds(int index); + + /** + * int64 anchorId = 6; + * @return The anchorId. + */ + long getAnchorId(); + } + /** + * Protobuf type {@code User.FansClub.FansClubData} + */ + public static final class FansClubData extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.FansClub.FansClubData) + FansClubDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use FansClubData.newBuilder() to construct. + private FansClubData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FansClubData() { + clubName_ = ""; + availableGiftIds_ = emptyLongList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new FansClubData(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_FansClubData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_FansClubData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.Builder.class); + } + + public interface UserBadgeOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.FansClub.FansClubData.UserBadge) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, .Image> icons = 1; + */ + int getIconsCount(); + /** + * map<int32, .Image> icons = 1; + */ + boolean containsIcons( + int key); + /** + * Use {@link #getIconsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getIcons(); + /** + * map<int32, .Image> icons = 1; + */ + java.util.Map + getIconsMap(); + /** + * map<int32, .Image> icons = 1; + */ + /* nullable */ +tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIconsOrDefault( + int key, + /* nullable */ +tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image defaultValue); + /** + * map<int32, .Image> icons = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIconsOrThrow( + int key); + + /** + * string title = 2; + * @return The title. + */ + java.lang.String getTitle(); + /** + * string title = 2; + * @return The bytes for title. + */ + com.google.protobuf.ByteString + getTitleBytes(); + } + /** + * Protobuf type {@code User.FansClub.FansClubData.UserBadge} + */ + public static final class UserBadge extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.FansClub.FansClubData.UserBadge) + UserBadgeOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserBadge.newBuilder() to construct. + private UserBadge(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UserBadge() { + title_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UserBadge(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_FansClubData_UserBadge_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetIcons(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_FansClubData_UserBadge_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.Builder.class); + } + + public static final int ICONS_FIELD_NUMBER = 1; + private static final class IconsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_FansClubData_UserBadge_IconsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image> icons_; + private com.google.protobuf.MapField + internalGetIcons() { + if (icons_ == null) { + return com.google.protobuf.MapField.emptyMapField( + IconsDefaultEntryHolder.defaultEntry); + } + return icons_; + } + public int getIconsCount() { + return internalGetIcons().getMap().size(); + } + /** + * map<int32, .Image> icons = 1; + */ + @java.lang.Override + public boolean containsIcons( + int key) { + + return internalGetIcons().getMap().containsKey(key); + } + /** + * Use {@link #getIconsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getIcons() { + return getIconsMap(); + } + /** + * map<int32, .Image> icons = 1; + */ + @java.lang.Override + public java.util.Map getIconsMap() { + return internalGetIcons().getMap(); + } + /** + * map<int32, .Image> icons = 1; + */ + @java.lang.Override + public /* nullable */ +tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIconsOrDefault( + int key, + /* nullable */ +tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image defaultValue) { + + java.util.Map map = + internalGetIcons().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, .Image> icons = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIconsOrThrow( + int key) { + + java.util.Map map = + internalGetIcons().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TITLE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object title_ = ""; + /** + * string title = 2; + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * string title = 2; + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetIcons(), + IconsDefaultEntryHolder.defaultEntry, + 1); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, title_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetIcons().getMap().entrySet()) { + com.google.protobuf.MapEntry + icons__ = IconsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, icons__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, title_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge) obj; + + if (!internalGetIcons().equals( + other.internalGetIcons())) return false; + if (!getTitle() + .equals(other.getTitle())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetIcons().getMap().isEmpty()) { + hash = (37 * hash) + ICONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetIcons().hashCode(); + } + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.FansClub.FansClubData.UserBadge} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.FansClub.FansClubData.UserBadge) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadgeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_FansClubData_UserBadge_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetIcons(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableIcons(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_FansClubData_UserBadge_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableIcons().clear(); + title_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_FansClubData_UserBadge_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.icons_ = internalGetIcons(); + result.icons_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.title_ = title_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.getDefaultInstance()) return this; + internalGetMutableIcons().mergeFrom( + other.internalGetIcons()); + bitField0_ |= 0x00000001; + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + icons__ = input.readMessage( + IconsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableIcons().getMutableMap().put( + icons__.getKey(), icons__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + title_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image> icons_; + private com.google.protobuf.MapField + internalGetIcons() { + if (icons_ == null) { + return com.google.protobuf.MapField.emptyMapField( + IconsDefaultEntryHolder.defaultEntry); + } + return icons_; + } + private com.google.protobuf.MapField + internalGetMutableIcons() { + if (icons_ == null) { + icons_ = com.google.protobuf.MapField.newMapField( + IconsDefaultEntryHolder.defaultEntry); + } + if (!icons_.isMutable()) { + icons_ = icons_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return icons_; + } + public int getIconsCount() { + return internalGetIcons().getMap().size(); + } + /** + * map<int32, .Image> icons = 1; + */ + @java.lang.Override + public boolean containsIcons( + int key) { + + return internalGetIcons().getMap().containsKey(key); + } + /** + * Use {@link #getIconsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getIcons() { + return getIconsMap(); + } + /** + * map<int32, .Image> icons = 1; + */ + @java.lang.Override + public java.util.Map getIconsMap() { + return internalGetIcons().getMap(); + } + /** + * map<int32, .Image> icons = 1; + */ + @java.lang.Override + public /* nullable */ +tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIconsOrDefault( + int key, + /* nullable */ +tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image defaultValue) { + + java.util.Map map = + internalGetIcons().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, .Image> icons = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIconsOrThrow( + int key) { + + java.util.Map map = + internalGetIcons().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearIcons() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableIcons().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, .Image> icons = 1; + */ + public Builder removeIcons( + int key) { + + internalGetMutableIcons().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableIcons() { + bitField0_ |= 0x00000001; + return internalGetMutableIcons().getMutableMap(); + } + /** + * map<int32, .Image> icons = 1; + */ + public Builder putIcons( + int key, + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableIcons().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, .Image> icons = 1; + */ + public Builder putAllIcons( + java.util.Map values) { + internalGetMutableIcons().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + + private java.lang.Object title_ = ""; + /** + * string title = 2; + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string title = 2; + * @return The bytes for title. + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string title = 2; + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + title_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string title = 2; + * @return This builder for chaining. + */ + public Builder clearTitle() { + title_ = getDefaultInstance().getTitle(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string title = 2; + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + title_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.FansClub.FansClubData.UserBadge) + } + + // @@protoc_insertion_point(class_scope:User.FansClub.FansClubData.UserBadge) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserBadge parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int CLUBNAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object clubName_ = ""; + /** + * string clubName = 1; + * @return The clubName. + */ + @java.lang.Override + public java.lang.String getClubName() { + java.lang.Object ref = clubName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clubName_ = s; + return s; + } + } + /** + * string clubName = 1; + * @return The bytes for clubName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getClubNameBytes() { + java.lang.Object ref = clubName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + clubName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LEVEL_FIELD_NUMBER = 2; + private int level_ = 0; + /** + * int32 level = 2; + * @return The level. + */ + @java.lang.Override + public int getLevel() { + return level_; + } + + public static final int USERFANSCLUBSTATUS_FIELD_NUMBER = 3; + private int userFansClubStatus_ = 0; + /** + * int32 userFansClubStatus = 3; + * @return The userFansClubStatus. + */ + @java.lang.Override + public int getUserFansClubStatus() { + return userFansClubStatus_; + } + + public static final int BADGE_FIELD_NUMBER = 4; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge badge_; + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + * @return Whether the badge field is set. + */ + @java.lang.Override + public boolean hasBadge() { + return badge_ != null; + } + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + * @return The badge. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge getBadge() { + return badge_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.getDefaultInstance() : badge_; + } + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadgeOrBuilder getBadgeOrBuilder() { + return badge_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.getDefaultInstance() : badge_; + } + + public static final int AVAILABLEGIFTIDS_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList availableGiftIds_; + /** + * repeated int64 availableGiftIds = 5; + * @return A list containing the availableGiftIds. + */ + @java.lang.Override + public java.util.List + getAvailableGiftIdsList() { + return availableGiftIds_; + } + /** + * repeated int64 availableGiftIds = 5; + * @return The count of availableGiftIds. + */ + public int getAvailableGiftIdsCount() { + return availableGiftIds_.size(); + } + /** + * repeated int64 availableGiftIds = 5; + * @param index The index of the element to return. + * @return The availableGiftIds at the given index. + */ + public long getAvailableGiftIds(int index) { + return availableGiftIds_.getLong(index); + } + private int availableGiftIdsMemoizedSerializedSize = -1; + + public static final int ANCHORID_FIELD_NUMBER = 6; + private long anchorId_ = 0L; + /** + * int64 anchorId = 6; + * @return The anchorId. + */ + @java.lang.Override + public long getAnchorId() { + return anchorId_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clubName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clubName_); + } + if (level_ != 0) { + output.writeInt32(2, level_); + } + if (userFansClubStatus_ != 0) { + output.writeInt32(3, userFansClubStatus_); + } + if (badge_ != null) { + output.writeMessage(4, getBadge()); + } + if (getAvailableGiftIdsList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(availableGiftIdsMemoizedSerializedSize); + } + for (int i = 0; i < availableGiftIds_.size(); i++) { + output.writeInt64NoTag(availableGiftIds_.getLong(i)); + } + if (anchorId_ != 0L) { + output.writeInt64(6, anchorId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clubName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clubName_); + } + if (level_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, level_); + } + if (userFansClubStatus_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, userFansClubStatus_); + } + if (badge_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getBadge()); + } + { + int dataSize = 0; + for (int i = 0; i < availableGiftIds_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(availableGiftIds_.getLong(i)); + } + size += dataSize; + if (!getAvailableGiftIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + availableGiftIdsMemoizedSerializedSize = dataSize; + } + if (anchorId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(6, anchorId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData) obj; + + if (!getClubName() + .equals(other.getClubName())) return false; + if (getLevel() + != other.getLevel()) return false; + if (getUserFansClubStatus() + != other.getUserFansClubStatus()) return false; + if (hasBadge() != other.hasBadge()) return false; + if (hasBadge()) { + if (!getBadge() + .equals(other.getBadge())) return false; + } + if (!getAvailableGiftIdsList() + .equals(other.getAvailableGiftIdsList())) return false; + if (getAnchorId() + != other.getAnchorId()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CLUBNAME_FIELD_NUMBER; + hash = (53 * hash) + getClubName().hashCode(); + hash = (37 * hash) + LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getLevel(); + hash = (37 * hash) + USERFANSCLUBSTATUS_FIELD_NUMBER; + hash = (53 * hash) + getUserFansClubStatus(); + if (hasBadge()) { + hash = (37 * hash) + BADGE_FIELD_NUMBER; + hash = (53 * hash) + getBadge().hashCode(); + } + if (getAvailableGiftIdsCount() > 0) { + hash = (37 * hash) + AVAILABLEGIFTIDS_FIELD_NUMBER; + hash = (53 * hash) + getAvailableGiftIdsList().hashCode(); + } + hash = (37 * hash) + ANCHORID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAnchorId()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.FansClub.FansClubData} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.FansClub.FansClubData) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_FansClubData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_FansClubData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + clubName_ = ""; + level_ = 0; + userFansClubStatus_ = 0; + badge_ = null; + if (badgeBuilder_ != null) { + badgeBuilder_.dispose(); + badgeBuilder_ = null; + } + availableGiftIds_ = emptyLongList(); + anchorId_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_FansClubData_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData result) { + if (((bitField0_ & 0x00000010) != 0)) { + availableGiftIds_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.availableGiftIds_ = availableGiftIds_; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.clubName_ = clubName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.level_ = level_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.userFansClubStatus_ = userFansClubStatus_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.badge_ = badgeBuilder_ == null + ? badge_ + : badgeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.anchorId_ = anchorId_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.getDefaultInstance()) return this; + if (!other.getClubName().isEmpty()) { + clubName_ = other.clubName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getLevel() != 0) { + setLevel(other.getLevel()); + } + if (other.getUserFansClubStatus() != 0) { + setUserFansClubStatus(other.getUserFansClubStatus()); + } + if (other.hasBadge()) { + mergeBadge(other.getBadge()); + } + if (!other.availableGiftIds_.isEmpty()) { + if (availableGiftIds_.isEmpty()) { + availableGiftIds_ = other.availableGiftIds_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureAvailableGiftIdsIsMutable(); + availableGiftIds_.addAll(other.availableGiftIds_); + } + onChanged(); + } + if (other.getAnchorId() != 0L) { + setAnchorId(other.getAnchorId()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + clubName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + level_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + userFansClubStatus_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + input.readMessage( + getBadgeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: { + long v = input.readInt64(); + ensureAvailableGiftIdsIsMutable(); + availableGiftIds_.addLong(v); + break; + } // case 40 + case 42: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureAvailableGiftIdsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + availableGiftIds_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 42 + case 48: { + anchorId_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object clubName_ = ""; + /** + * string clubName = 1; + * @return The clubName. + */ + public java.lang.String getClubName() { + java.lang.Object ref = clubName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clubName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string clubName = 1; + * @return The bytes for clubName. + */ + public com.google.protobuf.ByteString + getClubNameBytes() { + java.lang.Object ref = clubName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + clubName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string clubName = 1; + * @param value The clubName to set. + * @return This builder for chaining. + */ + public Builder setClubName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + clubName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string clubName = 1; + * @return This builder for chaining. + */ + public Builder clearClubName() { + clubName_ = getDefaultInstance().getClubName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string clubName = 1; + * @param value The bytes for clubName to set. + * @return This builder for chaining. + */ + public Builder setClubNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + clubName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int level_ ; + /** + * int32 level = 2; + * @return The level. + */ + @java.lang.Override + public int getLevel() { + return level_; + } + /** + * int32 level = 2; + * @param value The level to set. + * @return This builder for chaining. + */ + public Builder setLevel(int value) { + + level_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 level = 2; + * @return This builder for chaining. + */ + public Builder clearLevel() { + bitField0_ = (bitField0_ & ~0x00000002); + level_ = 0; + onChanged(); + return this; + } + + private int userFansClubStatus_ ; + /** + * int32 userFansClubStatus = 3; + * @return The userFansClubStatus. + */ + @java.lang.Override + public int getUserFansClubStatus() { + return userFansClubStatus_; + } + /** + * int32 userFansClubStatus = 3; + * @param value The userFansClubStatus to set. + * @return This builder for chaining. + */ + public Builder setUserFansClubStatus(int value) { + + userFansClubStatus_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int32 userFansClubStatus = 3; + * @return This builder for chaining. + */ + public Builder clearUserFansClubStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + userFansClubStatus_ = 0; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge badge_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadgeOrBuilder> badgeBuilder_; + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + * @return Whether the badge field is set. + */ + public boolean hasBadge() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + * @return The badge. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge getBadge() { + if (badgeBuilder_ == null) { + return badge_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.getDefaultInstance() : badge_; + } else { + return badgeBuilder_.getMessage(); + } + } + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + */ + public Builder setBadge(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge value) { + if (badgeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + badge_ = value; + } else { + badgeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + */ + public Builder setBadge( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.Builder builderForValue) { + if (badgeBuilder_ == null) { + badge_ = builderForValue.build(); + } else { + badgeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + */ + public Builder mergeBadge(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge value) { + if (badgeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + badge_ != null && + badge_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.getDefaultInstance()) { + getBadgeBuilder().mergeFrom(value); + } else { + badge_ = value; + } + } else { + badgeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + */ + public Builder clearBadge() { + bitField0_ = (bitField0_ & ~0x00000008); + badge_ = null; + if (badgeBuilder_ != null) { + badgeBuilder_.dispose(); + badgeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.Builder getBadgeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getBadgeFieldBuilder().getBuilder(); + } + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadgeOrBuilder getBadgeOrBuilder() { + if (badgeBuilder_ != null) { + return badgeBuilder_.getMessageOrBuilder(); + } else { + return badge_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.getDefaultInstance() : badge_; + } + } + /** + * .User.FansClub.FansClubData.UserBadge badge = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadgeOrBuilder> + getBadgeFieldBuilder() { + if (badgeBuilder_ == null) { + badgeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadge.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.UserBadgeOrBuilder>( + getBadge(), + getParentForChildren(), + isClean()); + badge_ = null; + } + return badgeBuilder_; + } + + private com.google.protobuf.Internal.LongList availableGiftIds_ = emptyLongList(); + private void ensureAvailableGiftIdsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + availableGiftIds_ = mutableCopy(availableGiftIds_); + bitField0_ |= 0x00000010; + } + } + /** + * repeated int64 availableGiftIds = 5; + * @return A list containing the availableGiftIds. + */ + public java.util.List + getAvailableGiftIdsList() { + return ((bitField0_ & 0x00000010) != 0) ? + java.util.Collections.unmodifiableList(availableGiftIds_) : availableGiftIds_; + } + /** + * repeated int64 availableGiftIds = 5; + * @return The count of availableGiftIds. + */ + public int getAvailableGiftIdsCount() { + return availableGiftIds_.size(); + } + /** + * repeated int64 availableGiftIds = 5; + * @param index The index of the element to return. + * @return The availableGiftIds at the given index. + */ + public long getAvailableGiftIds(int index) { + return availableGiftIds_.getLong(index); + } + /** + * repeated int64 availableGiftIds = 5; + * @param index The index to set the value at. + * @param value The availableGiftIds to set. + * @return This builder for chaining. + */ + public Builder setAvailableGiftIds( + int index, long value) { + + ensureAvailableGiftIdsIsMutable(); + availableGiftIds_.setLong(index, value); + onChanged(); + return this; + } + /** + * repeated int64 availableGiftIds = 5; + * @param value The availableGiftIds to add. + * @return This builder for chaining. + */ + public Builder addAvailableGiftIds(long value) { + + ensureAvailableGiftIdsIsMutable(); + availableGiftIds_.addLong(value); + onChanged(); + return this; + } + /** + * repeated int64 availableGiftIds = 5; + * @param values The availableGiftIds to add. + * @return This builder for chaining. + */ + public Builder addAllAvailableGiftIds( + java.lang.Iterable values) { + ensureAvailableGiftIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, availableGiftIds_); + onChanged(); + return this; + } + /** + * repeated int64 availableGiftIds = 5; + * @return This builder for chaining. + */ + public Builder clearAvailableGiftIds() { + availableGiftIds_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + private long anchorId_ ; + /** + * int64 anchorId = 6; + * @return The anchorId. + */ + @java.lang.Override + public long getAnchorId() { + return anchorId_; + } + /** + * int64 anchorId = 6; + * @param value The anchorId to set. + * @return This builder for chaining. + */ + public Builder setAnchorId(long value) { + + anchorId_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * int64 anchorId = 6; + * @return This builder for chaining. + */ + public Builder clearAnchorId() { + bitField0_ = (bitField0_ & ~0x00000020); + anchorId_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.FansClub.FansClubData) + } + + // @@protoc_insertion_point(class_scope:User.FansClub.FansClubData) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FansClubData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int DATA_FIELD_NUMBER = 1; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData data_; + /** + * .User.FansClub.FansClubData data = 1; + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return data_ != null; + } + /** + * .User.FansClub.FansClubData data = 1; + * @return The data. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData getData() { + return data_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.getDefaultInstance() : data_; + } + /** + * .User.FansClub.FansClubData data = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubDataOrBuilder getDataOrBuilder() { + return data_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.getDefaultInstance() : data_; + } + + public static final int PREFERDATA_FIELD_NUMBER = 2; + private static final class PreferDataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_PreferDataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData> preferData_; + private com.google.protobuf.MapField + internalGetPreferData() { + if (preferData_ == null) { + return com.google.protobuf.MapField.emptyMapField( + PreferDataDefaultEntryHolder.defaultEntry); + } + return preferData_; + } + public int getPreferDataCount() { + return internalGetPreferData().getMap().size(); + } + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + @java.lang.Override + public boolean containsPreferData( + int key) { + + return internalGetPreferData().getMap().containsKey(key); + } + /** + * Use {@link #getPreferDataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getPreferData() { + return getPreferDataMap(); + } + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + @java.lang.Override + public java.util.Map getPreferDataMap() { + return internalGetPreferData().getMap(); + } + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + @java.lang.Override + public /* nullable */ +tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData getPreferDataOrDefault( + int key, + /* nullable */ +tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData defaultValue) { + + java.util.Map map = + internalGetPreferData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData getPreferDataOrThrow( + int key) { + + java.util.Map map = + internalGetPreferData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (data_ != null) { + output.writeMessage(1, getData()); + } + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetPreferData(), + PreferDataDefaultEntryHolder.defaultEntry, + 2); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (data_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getData()); + } + for (java.util.Map.Entry entry + : internalGetPreferData().getMap().entrySet()) { + com.google.protobuf.MapEntry + preferData__ = PreferDataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, preferData__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub) obj; + + if (hasData() != other.hasData()) return false; + if (hasData()) { + if (!getData() + .equals(other.getData())) return false; + } + if (!internalGetPreferData().equals( + other.internalGetPreferData())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasData()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + } + if (!internalGetPreferData().getMap().isEmpty()) { + hash = (37 * hash) + PREFERDATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetPreferData().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.FansClub} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.FansClub) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClubOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 2: + return internalGetPreferData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 2: + return internalGetMutablePreferData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + data_ = null; + if (dataBuilder_ != null) { + dataBuilder_.dispose(); + dataBuilder_ = null; + } + internalGetMutablePreferData().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansClub_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.data_ = dataBuilder_ == null + ? data_ + : dataBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.preferData_ = internalGetPreferData(); + result.preferData_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.getDefaultInstance()) return this; + if (other.hasData()) { + mergeData(other.getData()); + } + internalGetMutablePreferData().mergeFrom( + other.internalGetPreferData()); + bitField0_ |= 0x00000002; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getDataFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + com.google.protobuf.MapEntry + preferData__ = input.readMessage( + PreferDataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutablePreferData().getMutableMap().put( + preferData__.getKey(), preferData__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData data_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubDataOrBuilder> dataBuilder_; + /** + * .User.FansClub.FansClubData data = 1; + * @return Whether the data field is set. + */ + public boolean hasData() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .User.FansClub.FansClubData data = 1; + * @return The data. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData getData() { + if (dataBuilder_ == null) { + return data_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.getDefaultInstance() : data_; + } else { + return dataBuilder_.getMessage(); + } + } + /** + * .User.FansClub.FansClubData data = 1; + */ + public Builder setData(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData value) { + if (dataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + } else { + dataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .User.FansClub.FansClubData data = 1; + */ + public Builder setData( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.Builder builderForValue) { + if (dataBuilder_ == null) { + data_ = builderForValue.build(); + } else { + dataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .User.FansClub.FansClubData data = 1; + */ + public Builder mergeData(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData value) { + if (dataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + data_ != null && + data_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.getDefaultInstance()) { + getDataBuilder().mergeFrom(value); + } else { + data_ = value; + } + } else { + dataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .User.FansClub.FansClubData data = 1; + */ + public Builder clearData() { + bitField0_ = (bitField0_ & ~0x00000001); + data_ = null; + if (dataBuilder_ != null) { + dataBuilder_.dispose(); + dataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.FansClub.FansClubData data = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.Builder getDataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDataFieldBuilder().getBuilder(); + } + /** + * .User.FansClub.FansClubData data = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubDataOrBuilder getDataOrBuilder() { + if (dataBuilder_ != null) { + return dataBuilder_.getMessageOrBuilder(); + } else { + return data_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.getDefaultInstance() : data_; + } + } + /** + * .User.FansClub.FansClubData data = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubDataOrBuilder> + getDataFieldBuilder() { + if (dataBuilder_ == null) { + dataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubDataOrBuilder>( + getData(), + getParentForChildren(), + isClean()); + data_ = null; + } + return dataBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.Integer, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData> preferData_; + private com.google.protobuf.MapField + internalGetPreferData() { + if (preferData_ == null) { + return com.google.protobuf.MapField.emptyMapField( + PreferDataDefaultEntryHolder.defaultEntry); + } + return preferData_; + } + private com.google.protobuf.MapField + internalGetMutablePreferData() { + if (preferData_ == null) { + preferData_ = com.google.protobuf.MapField.newMapField( + PreferDataDefaultEntryHolder.defaultEntry); + } + if (!preferData_.isMutable()) { + preferData_ = preferData_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return preferData_; + } + public int getPreferDataCount() { + return internalGetPreferData().getMap().size(); + } + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + @java.lang.Override + public boolean containsPreferData( + int key) { + + return internalGetPreferData().getMap().containsKey(key); + } + /** + * Use {@link #getPreferDataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getPreferData() { + return getPreferDataMap(); + } + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + @java.lang.Override + public java.util.Map getPreferDataMap() { + return internalGetPreferData().getMap(); + } + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + @java.lang.Override + public /* nullable */ +tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData getPreferDataOrDefault( + int key, + /* nullable */ +tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData defaultValue) { + + java.util.Map map = + internalGetPreferData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData getPreferDataOrThrow( + int key) { + + java.util.Map map = + internalGetPreferData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearPreferData() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutablePreferData().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + public Builder removePreferData( + int key) { + + internalGetMutablePreferData().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutablePreferData() { + bitField0_ |= 0x00000002; + return internalGetMutablePreferData().getMutableMap(); + } + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + public Builder putPreferData( + int key, + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.FansClubData value) { + + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutablePreferData().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + * map<int32, .User.FansClub.FansClubData> preferData = 2; + */ + public Builder putAllPreferData( + java.util.Map values) { + internalGetMutablePreferData().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000002; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.FansClub) + } + + // @@protoc_insertion_point(class_scope:User.FansClub) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FansClub parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FansGroupInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.FansGroupInfo) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.FansGroupInfo} + */ + public static final class FansGroupInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.FansGroupInfo) + FansGroupInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use FansGroupInfo.newBuilder() to construct. + private FansGroupInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FansGroupInfo() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new FansGroupInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansGroupInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansGroupInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.FansGroupInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.FansGroupInfo) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansGroupInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansGroupInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FansGroupInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.FansGroupInfo) + } + + // @@protoc_insertion_point(class_scope:User.FansGroupInfo) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FansGroupInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FollowInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.FollowInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 followingCount = 1; + * @return The followingCount. + */ + long getFollowingCount(); + + /** + * int64 followerCount = 2; + * @return The followerCount. + */ + long getFollowerCount(); + + /** + * int64 followStatus = 3; + * @return The followStatus. + */ + long getFollowStatus(); + + /** + * int64 pushStatus = 4; + * @return The pushStatus. + */ + long getPushStatus(); + + /** + * string remarkName = 5; + * @return The remarkName. + */ + java.lang.String getRemarkName(); + /** + * string remarkName = 5; + * @return The bytes for remarkName. + */ + com.google.protobuf.ByteString + getRemarkNameBytes(); + } + /** + * Protobuf type {@code User.FollowInfo} + */ + public static final class FollowInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.FollowInfo) + FollowInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use FollowInfo.newBuilder() to construct. + private FollowInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FollowInfo() { + remarkName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new FollowInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FollowInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FollowInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.Builder.class); + } + + public static final int FOLLOWINGCOUNT_FIELD_NUMBER = 1; + private long followingCount_ = 0L; + /** + * int64 followingCount = 1; + * @return The followingCount. + */ + @java.lang.Override + public long getFollowingCount() { + return followingCount_; + } + + public static final int FOLLOWERCOUNT_FIELD_NUMBER = 2; + private long followerCount_ = 0L; + /** + * int64 followerCount = 2; + * @return The followerCount. + */ + @java.lang.Override + public long getFollowerCount() { + return followerCount_; + } + + public static final int FOLLOWSTATUS_FIELD_NUMBER = 3; + private long followStatus_ = 0L; + /** + * int64 followStatus = 3; + * @return The followStatus. + */ + @java.lang.Override + public long getFollowStatus() { + return followStatus_; + } + + public static final int PUSHSTATUS_FIELD_NUMBER = 4; + private long pushStatus_ = 0L; + /** + * int64 pushStatus = 4; + * @return The pushStatus. + */ + @java.lang.Override + public long getPushStatus() { + return pushStatus_; + } + + public static final int REMARKNAME_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object remarkName_ = ""; + /** + * string remarkName = 5; + * @return The remarkName. + */ + @java.lang.Override + public java.lang.String getRemarkName() { + java.lang.Object ref = remarkName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remarkName_ = s; + return s; + } + } + /** + * string remarkName = 5; + * @return The bytes for remarkName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRemarkNameBytes() { + java.lang.Object ref = remarkName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + remarkName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (followingCount_ != 0L) { + output.writeInt64(1, followingCount_); + } + if (followerCount_ != 0L) { + output.writeInt64(2, followerCount_); + } + if (followStatus_ != 0L) { + output.writeInt64(3, followStatus_); + } + if (pushStatus_ != 0L) { + output.writeInt64(4, pushStatus_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remarkName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, remarkName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (followingCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, followingCount_); + } + if (followerCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, followerCount_); + } + if (followStatus_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, followStatus_); + } + if (pushStatus_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, pushStatus_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remarkName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, remarkName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo) obj; + + if (getFollowingCount() + != other.getFollowingCount()) return false; + if (getFollowerCount() + != other.getFollowerCount()) return false; + if (getFollowStatus() + != other.getFollowStatus()) return false; + if (getPushStatus() + != other.getPushStatus()) return false; + if (!getRemarkName() + .equals(other.getRemarkName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FOLLOWINGCOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFollowingCount()); + hash = (37 * hash) + FOLLOWERCOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFollowerCount()); + hash = (37 * hash) + FOLLOWSTATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFollowStatus()); + hash = (37 * hash) + PUSHSTATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPushStatus()); + hash = (37 * hash) + REMARKNAME_FIELD_NUMBER; + hash = (53 * hash) + getRemarkName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.FollowInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.FollowInfo) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FollowInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FollowInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + followingCount_ = 0L; + followerCount_ = 0L; + followStatus_ = 0L; + pushStatus_ = 0L; + remarkName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_FollowInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.followingCount_ = followingCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.followerCount_ = followerCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.followStatus_ = followStatus_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pushStatus_ = pushStatus_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.remarkName_ = remarkName_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.getDefaultInstance()) return this; + if (other.getFollowingCount() != 0L) { + setFollowingCount(other.getFollowingCount()); + } + if (other.getFollowerCount() != 0L) { + setFollowerCount(other.getFollowerCount()); + } + if (other.getFollowStatus() != 0L) { + setFollowStatus(other.getFollowStatus()); + } + if (other.getPushStatus() != 0L) { + setPushStatus(other.getPushStatus()); + } + if (!other.getRemarkName().isEmpty()) { + remarkName_ = other.remarkName_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + followingCount_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + followerCount_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + followStatus_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + pushStatus_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + remarkName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long followingCount_ ; + /** + * int64 followingCount = 1; + * @return The followingCount. + */ + @java.lang.Override + public long getFollowingCount() { + return followingCount_; + } + /** + * int64 followingCount = 1; + * @param value The followingCount to set. + * @return This builder for chaining. + */ + public Builder setFollowingCount(long value) { + + followingCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 followingCount = 1; + * @return This builder for chaining. + */ + public Builder clearFollowingCount() { + bitField0_ = (bitField0_ & ~0x00000001); + followingCount_ = 0L; + onChanged(); + return this; + } + + private long followerCount_ ; + /** + * int64 followerCount = 2; + * @return The followerCount. + */ + @java.lang.Override + public long getFollowerCount() { + return followerCount_; + } + /** + * int64 followerCount = 2; + * @param value The followerCount to set. + * @return This builder for chaining. + */ + public Builder setFollowerCount(long value) { + + followerCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int64 followerCount = 2; + * @return This builder for chaining. + */ + public Builder clearFollowerCount() { + bitField0_ = (bitField0_ & ~0x00000002); + followerCount_ = 0L; + onChanged(); + return this; + } + + private long followStatus_ ; + /** + * int64 followStatus = 3; + * @return The followStatus. + */ + @java.lang.Override + public long getFollowStatus() { + return followStatus_; + } + /** + * int64 followStatus = 3; + * @param value The followStatus to set. + * @return This builder for chaining. + */ + public Builder setFollowStatus(long value) { + + followStatus_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 followStatus = 3; + * @return This builder for chaining. + */ + public Builder clearFollowStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + followStatus_ = 0L; + onChanged(); + return this; + } + + private long pushStatus_ ; + /** + * int64 pushStatus = 4; + * @return The pushStatus. + */ + @java.lang.Override + public long getPushStatus() { + return pushStatus_; + } + /** + * int64 pushStatus = 4; + * @param value The pushStatus to set. + * @return This builder for chaining. + */ + public Builder setPushStatus(long value) { + + pushStatus_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int64 pushStatus = 4; + * @return This builder for chaining. + */ + public Builder clearPushStatus() { + bitField0_ = (bitField0_ & ~0x00000008); + pushStatus_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object remarkName_ = ""; + /** + * string remarkName = 5; + * @return The remarkName. + */ + public java.lang.String getRemarkName() { + java.lang.Object ref = remarkName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remarkName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string remarkName = 5; + * @return The bytes for remarkName. + */ + public com.google.protobuf.ByteString + getRemarkNameBytes() { + java.lang.Object ref = remarkName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + remarkName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string remarkName = 5; + * @param value The remarkName to set. + * @return This builder for chaining. + */ + public Builder setRemarkName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + remarkName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * string remarkName = 5; + * @return This builder for chaining. + */ + public Builder clearRemarkName() { + remarkName_ = getDefaultInstance().getRemarkName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * string remarkName = 5; + * @param value The bytes for remarkName to set. + * @return This builder for chaining. + */ + public Builder setRemarkNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + remarkName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.FollowInfo) + } + + // @@protoc_insertion_point(class_scope:User.FollowInfo) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FollowInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface JAccreditInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.JAccreditInfo) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.JAccreditInfo} + */ + public static final class JAccreditInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.JAccreditInfo) + JAccreditInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use JAccreditInfo.newBuilder() to construct. + private JAccreditInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private JAccreditInfo() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new JAccreditInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_JAccreditInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_JAccreditInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.JAccreditInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.JAccreditInfo) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_JAccreditInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_JAccreditInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_JAccreditInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.JAccreditInfo) + } + + // @@protoc_insertion_point(class_scope:User.JAccreditInfo) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public JAccreditInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface NobleLevelInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.NobleLevelInfo) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.NobleLevelInfo} + */ + public static final class NobleLevelInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.NobleLevelInfo) + NobleLevelInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use NobleLevelInfo.newBuilder() to construct. + private NobleLevelInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private NobleLevelInfo() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new NobleLevelInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_NobleLevelInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_NobleLevelInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.NobleLevelInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.NobleLevelInfo) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_NobleLevelInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_NobleLevelInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_NobleLevelInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.NobleLevelInfo) + } + + // @@protoc_insertion_point(class_scope:User.NobleLevelInfo) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NobleLevelInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface OwnRoomOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.OwnRoom) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.OwnRoom} + */ + public static final class OwnRoom extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.OwnRoom) + OwnRoomOrBuilder { + private static final long serialVersionUID = 0L; + // Use OwnRoom.newBuilder() to construct. + private OwnRoom(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private OwnRoom() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new OwnRoom(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_OwnRoom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_OwnRoom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.OwnRoom} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.OwnRoom) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_OwnRoom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_OwnRoom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_OwnRoom_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.OwnRoom) + } + + // @@protoc_insertion_point(class_scope:User.OwnRoom) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OwnRoom parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PayGradeOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.PayGrade) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 totalDiamondCount = 1; + * @return The totalDiamondCount. + */ + long getTotalDiamondCount(); + + /** + * .Image diamondIcon = 2; + * @return Whether the diamondIcon field is set. + */ + boolean hasDiamondIcon(); + /** + * .Image diamondIcon = 2; + * @return The diamondIcon. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getDiamondIcon(); + /** + * .Image diamondIcon = 2; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getDiamondIconOrBuilder(); + + /** + * string name = 3; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 3; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * .Image icon = 4; + * @return Whether the icon field is set. + */ + boolean hasIcon(); + /** + * .Image icon = 4; + * @return The icon. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIcon(); + /** + * .Image icon = 4; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getIconOrBuilder(); + + /** + * string nextName = 5; + * @return The nextName. + */ + java.lang.String getNextName(); + /** + * string nextName = 5; + * @return The bytes for nextName. + */ + com.google.protobuf.ByteString + getNextNameBytes(); + + /** + * int64 level = 6; + * @return The level. + */ + long getLevel(); + + /** + * .Image nextIcon = 7; + * @return Whether the nextIcon field is set. + */ + boolean hasNextIcon(); + /** + * .Image nextIcon = 7; + * @return The nextIcon. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getNextIcon(); + /** + * .Image nextIcon = 7; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getNextIconOrBuilder(); + + /** + * int64 nextDiamond = 8; + * @return The nextDiamond. + */ + long getNextDiamond(); + + /** + * int64 nowDiamond = 9; + * @return The nowDiamond. + */ + long getNowDiamond(); + + /** + * int64 thisGradeMinDiamond = 10; + * @return The thisGradeMinDiamond. + */ + long getThisGradeMinDiamond(); + + /** + * int64 thisGradeMaxDiamond = 11; + * @return The thisGradeMaxDiamond. + */ + long getThisGradeMaxDiamond(); + + /** + * int64 payDiamondBak = 12; + * @return The payDiamondBak. + */ + long getPayDiamondBak(); + + /** + * string gradeDescribe = 13; + * @return The gradeDescribe. + */ + java.lang.String getGradeDescribe(); + /** + * string gradeDescribe = 13; + * @return The bytes for gradeDescribe. + */ + com.google.protobuf.ByteString + getGradeDescribeBytes(); + + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + java.util.List + getGradeIconListList(); + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon getGradeIconList(int index); + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + int getGradeIconListCount(); + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + java.util.List + getGradeIconListOrBuilderList(); + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIconOrBuilder getGradeIconListOrBuilder( + int index); + + /** + * int64 screenChatType = 15; + * @return The screenChatType. + */ + long getScreenChatType(); + + /** + * .Image imIcon = 16; + * @return Whether the imIcon field is set. + */ + boolean hasImIcon(); + /** + * .Image imIcon = 16; + * @return The imIcon. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getImIcon(); + /** + * .Image imIcon = 16; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImIconOrBuilder(); + + /** + * .Image imIconWithLevel = 17; + * @return Whether the imIconWithLevel field is set. + */ + boolean hasImIconWithLevel(); + /** + * .Image imIconWithLevel = 17; + * @return The imIconWithLevel. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getImIconWithLevel(); + /** + * .Image imIconWithLevel = 17; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImIconWithLevelOrBuilder(); + + /** + * .Image liveIcon = 18; + * @return Whether the liveIcon field is set. + */ + boolean hasLiveIcon(); + /** + * .Image liveIcon = 18; + * @return The liveIcon. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getLiveIcon(); + /** + * .Image liveIcon = 18; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getLiveIconOrBuilder(); + + /** + * .Image newImIconWithLevel = 19; + * @return Whether the newImIconWithLevel field is set. + */ + boolean hasNewImIconWithLevel(); + /** + * .Image newImIconWithLevel = 19; + * @return The newImIconWithLevel. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getNewImIconWithLevel(); + /** + * .Image newImIconWithLevel = 19; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getNewImIconWithLevelOrBuilder(); + + /** + * .Image newLiveIcon = 20; + * @return Whether the newLiveIcon field is set. + */ + boolean hasNewLiveIcon(); + /** + * .Image newLiveIcon = 20; + * @return The newLiveIcon. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getNewLiveIcon(); + /** + * .Image newLiveIcon = 20; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getNewLiveIconOrBuilder(); + + /** + * int64 upgradeNeedConsume = 21; + * @return The upgradeNeedConsume. + */ + long getUpgradeNeedConsume(); + + /** + * string nextPrivileges = 22; + * @return The nextPrivileges. + */ + java.lang.String getNextPrivileges(); + /** + * string nextPrivileges = 22; + * @return The bytes for nextPrivileges. + */ + com.google.protobuf.ByteString + getNextPrivilegesBytes(); + + /** + * .Image background = 23; + * @return Whether the background field is set. + */ + boolean hasBackground(); + /** + * .Image background = 23; + * @return The background. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackground(); + /** + * .Image background = 23; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundOrBuilder(); + + /** + * .Image backgroundBack = 24; + * @return Whether the backgroundBack field is set. + */ + boolean hasBackgroundBack(); + /** + * .Image backgroundBack = 24; + * @return The backgroundBack. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundBack(); + /** + * .Image backgroundBack = 24; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundBackOrBuilder(); + + /** + * int64 score = 25; + * @return The score. + */ + long getScore(); + + /** + *
+       * GradeBuffInfo buffInfo = 26;
+       * 
+ * + * string gradeBanner = 1001; + * @return The gradeBanner. + */ + java.lang.String getGradeBanner(); + /** + *
+       * GradeBuffInfo buffInfo = 26;
+       * 
+ * + * string gradeBanner = 1001; + * @return The bytes for gradeBanner. + */ + com.google.protobuf.ByteString + getGradeBannerBytes(); + + /** + * .Image profileDialogBg = 1002; + * @return Whether the profileDialogBg field is set. + */ + boolean hasProfileDialogBg(); + /** + * .Image profileDialogBg = 1002; + * @return The profileDialogBg. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getProfileDialogBg(); + /** + * .Image profileDialogBg = 1002; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getProfileDialogBgOrBuilder(); + + /** + * .Image profileDialogBgBack = 1003; + * @return Whether the profileDialogBgBack field is set. + */ + boolean hasProfileDialogBgBack(); + /** + * .Image profileDialogBgBack = 1003; + * @return The profileDialogBgBack. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getProfileDialogBgBack(); + /** + * .Image profileDialogBgBack = 1003; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getProfileDialogBgBackOrBuilder(); + } + /** + * Protobuf type {@code User.PayGrade} + */ + public static final class PayGrade extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.PayGrade) + PayGradeOrBuilder { + private static final long serialVersionUID = 0L; + // Use PayGrade.newBuilder() to construct. + private PayGrade(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PayGrade() { + name_ = ""; + nextName_ = ""; + gradeDescribe_ = ""; + gradeIconList_ = java.util.Collections.emptyList(); + nextPrivileges_ = ""; + gradeBanner_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PayGrade(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PayGrade_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PayGrade_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.Builder.class); + } + + public interface GradeIconOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.PayGrade.GradeIcon) + com.google.protobuf.MessageOrBuilder { + + /** + * .Image icon = 1; + * @return Whether the icon field is set. + */ + boolean hasIcon(); + /** + * .Image icon = 1; + * @return The icon. + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIcon(); + /** + * .Image icon = 1; + */ + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getIconOrBuilder(); + + /** + * int64 iconDiamond = 2; + * @return The iconDiamond. + */ + long getIconDiamond(); + + /** + * int64 level = 3; + * @return The level. + */ + long getLevel(); + + /** + * string levelStr = 4; + * @return The levelStr. + */ + java.lang.String getLevelStr(); + /** + * string levelStr = 4; + * @return The bytes for levelStr. + */ + com.google.protobuf.ByteString + getLevelStrBytes(); + } + /** + * Protobuf type {@code User.PayGrade.GradeIcon} + */ + public static final class GradeIcon extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.PayGrade.GradeIcon) + GradeIconOrBuilder { + private static final long serialVersionUID = 0L; + // Use GradeIcon.newBuilder() to construct. + private GradeIcon(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GradeIcon() { + levelStr_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GradeIcon(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PayGrade_GradeIcon_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PayGrade_GradeIcon_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.Builder.class); + } + + public static final int ICON_FIELD_NUMBER = 1; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image icon_; + /** + * .Image icon = 1; + * @return Whether the icon field is set. + */ + @java.lang.Override + public boolean hasIcon() { + return icon_ != null; + } + /** + * .Image icon = 1; + * @return The icon. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIcon() { + return icon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : icon_; + } + /** + * .Image icon = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getIconOrBuilder() { + return icon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : icon_; + } + + public static final int ICONDIAMOND_FIELD_NUMBER = 2; + private long iconDiamond_ = 0L; + /** + * int64 iconDiamond = 2; + * @return The iconDiamond. + */ + @java.lang.Override + public long getIconDiamond() { + return iconDiamond_; + } + + public static final int LEVEL_FIELD_NUMBER = 3; + private long level_ = 0L; + /** + * int64 level = 3; + * @return The level. + */ + @java.lang.Override + public long getLevel() { + return level_; + } + + public static final int LEVELSTR_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object levelStr_ = ""; + /** + * string levelStr = 4; + * @return The levelStr. + */ + @java.lang.Override + public java.lang.String getLevelStr() { + java.lang.Object ref = levelStr_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + levelStr_ = s; + return s; + } + } + /** + * string levelStr = 4; + * @return The bytes for levelStr. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLevelStrBytes() { + java.lang.Object ref = levelStr_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + levelStr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (icon_ != null) { + output.writeMessage(1, getIcon()); + } + if (iconDiamond_ != 0L) { + output.writeInt64(2, iconDiamond_); + } + if (level_ != 0L) { + output.writeInt64(3, level_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(levelStr_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, levelStr_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (icon_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getIcon()); + } + if (iconDiamond_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, iconDiamond_); + } + if (level_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, level_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(levelStr_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, levelStr_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon) obj; + + if (hasIcon() != other.hasIcon()) return false; + if (hasIcon()) { + if (!getIcon() + .equals(other.getIcon())) return false; + } + if (getIconDiamond() + != other.getIconDiamond()) return false; + if (getLevel() + != other.getLevel()) return false; + if (!getLevelStr() + .equals(other.getLevelStr())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasIcon()) { + hash = (37 * hash) + ICON_FIELD_NUMBER; + hash = (53 * hash) + getIcon().hashCode(); + } + hash = (37 * hash) + ICONDIAMOND_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getIconDiamond()); + hash = (37 * hash) + LEVEL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLevel()); + hash = (37 * hash) + LEVELSTR_FIELD_NUMBER; + hash = (53 * hash) + getLevelStr().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.PayGrade.GradeIcon} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.PayGrade.GradeIcon) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIconOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PayGrade_GradeIcon_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PayGrade_GradeIcon_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + icon_ = null; + if (iconBuilder_ != null) { + iconBuilder_.dispose(); + iconBuilder_ = null; + } + iconDiamond_ = 0L; + level_ = 0L; + levelStr_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PayGrade_GradeIcon_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.icon_ = iconBuilder_ == null + ? icon_ + : iconBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.iconDiamond_ = iconDiamond_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.level_ = level_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.levelStr_ = levelStr_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.getDefaultInstance()) return this; + if (other.hasIcon()) { + mergeIcon(other.getIcon()); + } + if (other.getIconDiamond() != 0L) { + setIconDiamond(other.getIconDiamond()); + } + if (other.getLevel() != 0L) { + setLevel(other.getLevel()); + } + if (!other.getLevelStr().isEmpty()) { + levelStr_ = other.levelStr_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getIconFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + iconDiamond_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + level_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + levelStr_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image icon_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> iconBuilder_; + /** + * .Image icon = 1; + * @return Whether the icon field is set. + */ + public boolean hasIcon() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .Image icon = 1; + * @return The icon. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIcon() { + if (iconBuilder_ == null) { + return icon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : icon_; + } else { + return iconBuilder_.getMessage(); + } + } + /** + * .Image icon = 1; + */ + public Builder setIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (iconBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + icon_ = value; + } else { + iconBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Image icon = 1; + */ + public Builder setIcon( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (iconBuilder_ == null) { + icon_ = builderForValue.build(); + } else { + iconBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Image icon = 1; + */ + public Builder mergeIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (iconBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + icon_ != null && + icon_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getIconBuilder().mergeFrom(value); + } else { + icon_ = value; + } + } else { + iconBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .Image icon = 1; + */ + public Builder clearIcon() { + bitField0_ = (bitField0_ & ~0x00000001); + icon_ = null; + if (iconBuilder_ != null) { + iconBuilder_.dispose(); + iconBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image icon = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getIconBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getIconFieldBuilder().getBuilder(); + } + /** + * .Image icon = 1; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getIconOrBuilder() { + if (iconBuilder_ != null) { + return iconBuilder_.getMessageOrBuilder(); + } else { + return icon_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : icon_; + } + } + /** + * .Image icon = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getIconFieldBuilder() { + if (iconBuilder_ == null) { + iconBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getIcon(), + getParentForChildren(), + isClean()); + icon_ = null; + } + return iconBuilder_; + } + + private long iconDiamond_ ; + /** + * int64 iconDiamond = 2; + * @return The iconDiamond. + */ + @java.lang.Override + public long getIconDiamond() { + return iconDiamond_; + } + /** + * int64 iconDiamond = 2; + * @param value The iconDiamond to set. + * @return This builder for chaining. + */ + public Builder setIconDiamond(long value) { + + iconDiamond_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int64 iconDiamond = 2; + * @return This builder for chaining. + */ + public Builder clearIconDiamond() { + bitField0_ = (bitField0_ & ~0x00000002); + iconDiamond_ = 0L; + onChanged(); + return this; + } + + private long level_ ; + /** + * int64 level = 3; + * @return The level. + */ + @java.lang.Override + public long getLevel() { + return level_; + } + /** + * int64 level = 3; + * @param value The level to set. + * @return This builder for chaining. + */ + public Builder setLevel(long value) { + + level_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 level = 3; + * @return This builder for chaining. + */ + public Builder clearLevel() { + bitField0_ = (bitField0_ & ~0x00000004); + level_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object levelStr_ = ""; + /** + * string levelStr = 4; + * @return The levelStr. + */ + public java.lang.String getLevelStr() { + java.lang.Object ref = levelStr_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + levelStr_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string levelStr = 4; + * @return The bytes for levelStr. + */ + public com.google.protobuf.ByteString + getLevelStrBytes() { + java.lang.Object ref = levelStr_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + levelStr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string levelStr = 4; + * @param value The levelStr to set. + * @return This builder for chaining. + */ + public Builder setLevelStr( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + levelStr_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * string levelStr = 4; + * @return This builder for chaining. + */ + public Builder clearLevelStr() { + levelStr_ = getDefaultInstance().getLevelStr(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * string levelStr = 4; + * @param value The bytes for levelStr to set. + * @return This builder for chaining. + */ + public Builder setLevelStrBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + levelStr_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.PayGrade.GradeIcon) + } + + // @@protoc_insertion_point(class_scope:User.PayGrade.GradeIcon) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GradeIcon parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int TOTALDIAMONDCOUNT_FIELD_NUMBER = 1; + private long totalDiamondCount_ = 0L; + /** + * int64 totalDiamondCount = 1; + * @return The totalDiamondCount. + */ + @java.lang.Override + public long getTotalDiamondCount() { + return totalDiamondCount_; + } + + public static final int DIAMONDICON_FIELD_NUMBER = 2; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image diamondIcon_; + /** + * .Image diamondIcon = 2; + * @return Whether the diamondIcon field is set. + */ + @java.lang.Override + public boolean hasDiamondIcon() { + return diamondIcon_ != null; + } + /** + * .Image diamondIcon = 2; + * @return The diamondIcon. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getDiamondIcon() { + return diamondIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : diamondIcon_; + } + /** + * .Image diamondIcon = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getDiamondIconOrBuilder() { + return diamondIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : diamondIcon_; + } + + public static final int NAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 3; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * string name = 3; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ICON_FIELD_NUMBER = 4; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image icon_; + /** + * .Image icon = 4; + * @return Whether the icon field is set. + */ + @java.lang.Override + public boolean hasIcon() { + return icon_ != null; + } + /** + * .Image icon = 4; + * @return The icon. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIcon() { + return icon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : icon_; + } + /** + * .Image icon = 4; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getIconOrBuilder() { + return icon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : icon_; + } + + public static final int NEXTNAME_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object nextName_ = ""; + /** + * string nextName = 5; + * @return The nextName. + */ + @java.lang.Override + public java.lang.String getNextName() { + java.lang.Object ref = nextName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextName_ = s; + return s; + } + } + /** + * string nextName = 5; + * @return The bytes for nextName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextNameBytes() { + java.lang.Object ref = nextName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LEVEL_FIELD_NUMBER = 6; + private long level_ = 0L; + /** + * int64 level = 6; + * @return The level. + */ + @java.lang.Override + public long getLevel() { + return level_; + } + + public static final int NEXTICON_FIELD_NUMBER = 7; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image nextIcon_; + /** + * .Image nextIcon = 7; + * @return Whether the nextIcon field is set. + */ + @java.lang.Override + public boolean hasNextIcon() { + return nextIcon_ != null; + } + /** + * .Image nextIcon = 7; + * @return The nextIcon. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getNextIcon() { + return nextIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : nextIcon_; + } + /** + * .Image nextIcon = 7; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getNextIconOrBuilder() { + return nextIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : nextIcon_; + } + + public static final int NEXTDIAMOND_FIELD_NUMBER = 8; + private long nextDiamond_ = 0L; + /** + * int64 nextDiamond = 8; + * @return The nextDiamond. + */ + @java.lang.Override + public long getNextDiamond() { + return nextDiamond_; + } + + public static final int NOWDIAMOND_FIELD_NUMBER = 9; + private long nowDiamond_ = 0L; + /** + * int64 nowDiamond = 9; + * @return The nowDiamond. + */ + @java.lang.Override + public long getNowDiamond() { + return nowDiamond_; + } + + public static final int THISGRADEMINDIAMOND_FIELD_NUMBER = 10; + private long thisGradeMinDiamond_ = 0L; + /** + * int64 thisGradeMinDiamond = 10; + * @return The thisGradeMinDiamond. + */ + @java.lang.Override + public long getThisGradeMinDiamond() { + return thisGradeMinDiamond_; + } + + public static final int THISGRADEMAXDIAMOND_FIELD_NUMBER = 11; + private long thisGradeMaxDiamond_ = 0L; + /** + * int64 thisGradeMaxDiamond = 11; + * @return The thisGradeMaxDiamond. + */ + @java.lang.Override + public long getThisGradeMaxDiamond() { + return thisGradeMaxDiamond_; + } + + public static final int PAYDIAMONDBAK_FIELD_NUMBER = 12; + private long payDiamondBak_ = 0L; + /** + * int64 payDiamondBak = 12; + * @return The payDiamondBak. + */ + @java.lang.Override + public long getPayDiamondBak() { + return payDiamondBak_; + } + + public static final int GRADEDESCRIBE_FIELD_NUMBER = 13; + @SuppressWarnings("serial") + private volatile java.lang.Object gradeDescribe_ = ""; + /** + * string gradeDescribe = 13; + * @return The gradeDescribe. + */ + @java.lang.Override + public java.lang.String getGradeDescribe() { + java.lang.Object ref = gradeDescribe_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gradeDescribe_ = s; + return s; + } + } + /** + * string gradeDescribe = 13; + * @return The bytes for gradeDescribe. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGradeDescribeBytes() { + java.lang.Object ref = gradeDescribe_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + gradeDescribe_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GRADEICONLIST_FIELD_NUMBER = 14; + @SuppressWarnings("serial") + private java.util.List gradeIconList_; + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + @java.lang.Override + public java.util.List getGradeIconListList() { + return gradeIconList_; + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + @java.lang.Override + public java.util.List + getGradeIconListOrBuilderList() { + return gradeIconList_; + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + @java.lang.Override + public int getGradeIconListCount() { + return gradeIconList_.size(); + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon getGradeIconList(int index) { + return gradeIconList_.get(index); + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIconOrBuilder getGradeIconListOrBuilder( + int index) { + return gradeIconList_.get(index); + } + + public static final int SCREENCHATTYPE_FIELD_NUMBER = 15; + private long screenChatType_ = 0L; + /** + * int64 screenChatType = 15; + * @return The screenChatType. + */ + @java.lang.Override + public long getScreenChatType() { + return screenChatType_; + } + + public static final int IMICON_FIELD_NUMBER = 16; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image imIcon_; + /** + * .Image imIcon = 16; + * @return Whether the imIcon field is set. + */ + @java.lang.Override + public boolean hasImIcon() { + return imIcon_ != null; + } + /** + * .Image imIcon = 16; + * @return The imIcon. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getImIcon() { + return imIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : imIcon_; + } + /** + * .Image imIcon = 16; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImIconOrBuilder() { + return imIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : imIcon_; + } + + public static final int IMICONWITHLEVEL_FIELD_NUMBER = 17; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image imIconWithLevel_; + /** + * .Image imIconWithLevel = 17; + * @return Whether the imIconWithLevel field is set. + */ + @java.lang.Override + public boolean hasImIconWithLevel() { + return imIconWithLevel_ != null; + } + /** + * .Image imIconWithLevel = 17; + * @return The imIconWithLevel. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getImIconWithLevel() { + return imIconWithLevel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : imIconWithLevel_; + } + /** + * .Image imIconWithLevel = 17; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImIconWithLevelOrBuilder() { + return imIconWithLevel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : imIconWithLevel_; + } + + public static final int LIVEICON_FIELD_NUMBER = 18; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image liveIcon_; + /** + * .Image liveIcon = 18; + * @return Whether the liveIcon field is set. + */ + @java.lang.Override + public boolean hasLiveIcon() { + return liveIcon_ != null; + } + /** + * .Image liveIcon = 18; + * @return The liveIcon. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getLiveIcon() { + return liveIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : liveIcon_; + } + /** + * .Image liveIcon = 18; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getLiveIconOrBuilder() { + return liveIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : liveIcon_; + } + + public static final int NEWIMICONWITHLEVEL_FIELD_NUMBER = 19; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image newImIconWithLevel_; + /** + * .Image newImIconWithLevel = 19; + * @return Whether the newImIconWithLevel field is set. + */ + @java.lang.Override + public boolean hasNewImIconWithLevel() { + return newImIconWithLevel_ != null; + } + /** + * .Image newImIconWithLevel = 19; + * @return The newImIconWithLevel. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getNewImIconWithLevel() { + return newImIconWithLevel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : newImIconWithLevel_; + } + /** + * .Image newImIconWithLevel = 19; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getNewImIconWithLevelOrBuilder() { + return newImIconWithLevel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : newImIconWithLevel_; + } + + public static final int NEWLIVEICON_FIELD_NUMBER = 20; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image newLiveIcon_; + /** + * .Image newLiveIcon = 20; + * @return Whether the newLiveIcon field is set. + */ + @java.lang.Override + public boolean hasNewLiveIcon() { + return newLiveIcon_ != null; + } + /** + * .Image newLiveIcon = 20; + * @return The newLiveIcon. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getNewLiveIcon() { + return newLiveIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : newLiveIcon_; + } + /** + * .Image newLiveIcon = 20; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getNewLiveIconOrBuilder() { + return newLiveIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : newLiveIcon_; + } + + public static final int UPGRADENEEDCONSUME_FIELD_NUMBER = 21; + private long upgradeNeedConsume_ = 0L; + /** + * int64 upgradeNeedConsume = 21; + * @return The upgradeNeedConsume. + */ + @java.lang.Override + public long getUpgradeNeedConsume() { + return upgradeNeedConsume_; + } + + public static final int NEXTPRIVILEGES_FIELD_NUMBER = 22; + @SuppressWarnings("serial") + private volatile java.lang.Object nextPrivileges_ = ""; + /** + * string nextPrivileges = 22; + * @return The nextPrivileges. + */ + @java.lang.Override + public java.lang.String getNextPrivileges() { + java.lang.Object ref = nextPrivileges_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPrivileges_ = s; + return s; + } + } + /** + * string nextPrivileges = 22; + * @return The bytes for nextPrivileges. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPrivilegesBytes() { + java.lang.Object ref = nextPrivileges_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPrivileges_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKGROUND_FIELD_NUMBER = 23; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image background_; + /** + * .Image background = 23; + * @return Whether the background field is set. + */ + @java.lang.Override + public boolean hasBackground() { + return background_ != null; + } + /** + * .Image background = 23; + * @return The background. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackground() { + return background_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : background_; + } + /** + * .Image background = 23; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundOrBuilder() { + return background_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : background_; + } + + public static final int BACKGROUNDBACK_FIELD_NUMBER = 24; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image backgroundBack_; + /** + * .Image backgroundBack = 24; + * @return Whether the backgroundBack field is set. + */ + @java.lang.Override + public boolean hasBackgroundBack() { + return backgroundBack_ != null; + } + /** + * .Image backgroundBack = 24; + * @return The backgroundBack. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundBack() { + return backgroundBack_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundBack_; + } + /** + * .Image backgroundBack = 24; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundBackOrBuilder() { + return backgroundBack_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundBack_; + } + + public static final int SCORE_FIELD_NUMBER = 25; + private long score_ = 0L; + /** + * int64 score = 25; + * @return The score. + */ + @java.lang.Override + public long getScore() { + return score_; + } + + public static final int GRADEBANNER_FIELD_NUMBER = 1001; + @SuppressWarnings("serial") + private volatile java.lang.Object gradeBanner_ = ""; + /** + *
+       * GradeBuffInfo buffInfo = 26;
+       * 
+ * + * string gradeBanner = 1001; + * @return The gradeBanner. + */ + @java.lang.Override + public java.lang.String getGradeBanner() { + java.lang.Object ref = gradeBanner_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gradeBanner_ = s; + return s; + } + } + /** + *
+       * GradeBuffInfo buffInfo = 26;
+       * 
+ * + * string gradeBanner = 1001; + * @return The bytes for gradeBanner. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGradeBannerBytes() { + java.lang.Object ref = gradeBanner_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + gradeBanner_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROFILEDIALOGBG_FIELD_NUMBER = 1002; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image profileDialogBg_; + /** + * .Image profileDialogBg = 1002; + * @return Whether the profileDialogBg field is set. + */ + @java.lang.Override + public boolean hasProfileDialogBg() { + return profileDialogBg_ != null; + } + /** + * .Image profileDialogBg = 1002; + * @return The profileDialogBg. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getProfileDialogBg() { + return profileDialogBg_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : profileDialogBg_; + } + /** + * .Image profileDialogBg = 1002; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getProfileDialogBgOrBuilder() { + return profileDialogBg_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : profileDialogBg_; + } + + public static final int PROFILEDIALOGBGBACK_FIELD_NUMBER = 1003; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image profileDialogBgBack_; + /** + * .Image profileDialogBgBack = 1003; + * @return Whether the profileDialogBgBack field is set. + */ + @java.lang.Override + public boolean hasProfileDialogBgBack() { + return profileDialogBgBack_ != null; + } + /** + * .Image profileDialogBgBack = 1003; + * @return The profileDialogBgBack. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getProfileDialogBgBack() { + return profileDialogBgBack_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : profileDialogBgBack_; + } + /** + * .Image profileDialogBgBack = 1003; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getProfileDialogBgBackOrBuilder() { + return profileDialogBgBack_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : profileDialogBgBack_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (totalDiamondCount_ != 0L) { + output.writeInt64(1, totalDiamondCount_); + } + if (diamondIcon_ != null) { + output.writeMessage(2, getDiamondIcon()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); + } + if (icon_ != null) { + output.writeMessage(4, getIcon()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, nextName_); + } + if (level_ != 0L) { + output.writeInt64(6, level_); + } + if (nextIcon_ != null) { + output.writeMessage(7, getNextIcon()); + } + if (nextDiamond_ != 0L) { + output.writeInt64(8, nextDiamond_); + } + if (nowDiamond_ != 0L) { + output.writeInt64(9, nowDiamond_); + } + if (thisGradeMinDiamond_ != 0L) { + output.writeInt64(10, thisGradeMinDiamond_); + } + if (thisGradeMaxDiamond_ != 0L) { + output.writeInt64(11, thisGradeMaxDiamond_); + } + if (payDiamondBak_ != 0L) { + output.writeInt64(12, payDiamondBak_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gradeDescribe_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, gradeDescribe_); + } + for (int i = 0; i < gradeIconList_.size(); i++) { + output.writeMessage(14, gradeIconList_.get(i)); + } + if (screenChatType_ != 0L) { + output.writeInt64(15, screenChatType_); + } + if (imIcon_ != null) { + output.writeMessage(16, getImIcon()); + } + if (imIconWithLevel_ != null) { + output.writeMessage(17, getImIconWithLevel()); + } + if (liveIcon_ != null) { + output.writeMessage(18, getLiveIcon()); + } + if (newImIconWithLevel_ != null) { + output.writeMessage(19, getNewImIconWithLevel()); + } + if (newLiveIcon_ != null) { + output.writeMessage(20, getNewLiveIcon()); + } + if (upgradeNeedConsume_ != 0L) { + output.writeInt64(21, upgradeNeedConsume_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPrivileges_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 22, nextPrivileges_); + } + if (background_ != null) { + output.writeMessage(23, getBackground()); + } + if (backgroundBack_ != null) { + output.writeMessage(24, getBackgroundBack()); + } + if (score_ != 0L) { + output.writeInt64(25, score_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gradeBanner_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1001, gradeBanner_); + } + if (profileDialogBg_ != null) { + output.writeMessage(1002, getProfileDialogBg()); + } + if (profileDialogBgBack_ != null) { + output.writeMessage(1003, getProfileDialogBgBack()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (totalDiamondCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, totalDiamondCount_); + } + if (diamondIcon_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getDiamondIcon()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); + } + if (icon_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getIcon()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, nextName_); + } + if (level_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(6, level_); + } + if (nextIcon_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getNextIcon()); + } + if (nextDiamond_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(8, nextDiamond_); + } + if (nowDiamond_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, nowDiamond_); + } + if (thisGradeMinDiamond_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(10, thisGradeMinDiamond_); + } + if (thisGradeMaxDiamond_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(11, thisGradeMaxDiamond_); + } + if (payDiamondBak_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(12, payDiamondBak_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gradeDescribe_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, gradeDescribe_); + } + for (int i = 0; i < gradeIconList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, gradeIconList_.get(i)); + } + if (screenChatType_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(15, screenChatType_); + } + if (imIcon_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(16, getImIcon()); + } + if (imIconWithLevel_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(17, getImIconWithLevel()); + } + if (liveIcon_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(18, getLiveIcon()); + } + if (newImIconWithLevel_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(19, getNewImIconWithLevel()); + } + if (newLiveIcon_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(20, getNewLiveIcon()); + } + if (upgradeNeedConsume_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(21, upgradeNeedConsume_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPrivileges_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, nextPrivileges_); + } + if (background_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(23, getBackground()); + } + if (backgroundBack_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(24, getBackgroundBack()); + } + if (score_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(25, score_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gradeBanner_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1001, gradeBanner_); + } + if (profileDialogBg_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1002, getProfileDialogBg()); + } + if (profileDialogBgBack_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1003, getProfileDialogBgBack()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade) obj; + + if (getTotalDiamondCount() + != other.getTotalDiamondCount()) return false; + if (hasDiamondIcon() != other.hasDiamondIcon()) return false; + if (hasDiamondIcon()) { + if (!getDiamondIcon() + .equals(other.getDiamondIcon())) return false; + } + if (!getName() + .equals(other.getName())) return false; + if (hasIcon() != other.hasIcon()) return false; + if (hasIcon()) { + if (!getIcon() + .equals(other.getIcon())) return false; + } + if (!getNextName() + .equals(other.getNextName())) return false; + if (getLevel() + != other.getLevel()) return false; + if (hasNextIcon() != other.hasNextIcon()) return false; + if (hasNextIcon()) { + if (!getNextIcon() + .equals(other.getNextIcon())) return false; + } + if (getNextDiamond() + != other.getNextDiamond()) return false; + if (getNowDiamond() + != other.getNowDiamond()) return false; + if (getThisGradeMinDiamond() + != other.getThisGradeMinDiamond()) return false; + if (getThisGradeMaxDiamond() + != other.getThisGradeMaxDiamond()) return false; + if (getPayDiamondBak() + != other.getPayDiamondBak()) return false; + if (!getGradeDescribe() + .equals(other.getGradeDescribe())) return false; + if (!getGradeIconListList() + .equals(other.getGradeIconListList())) return false; + if (getScreenChatType() + != other.getScreenChatType()) return false; + if (hasImIcon() != other.hasImIcon()) return false; + if (hasImIcon()) { + if (!getImIcon() + .equals(other.getImIcon())) return false; + } + if (hasImIconWithLevel() != other.hasImIconWithLevel()) return false; + if (hasImIconWithLevel()) { + if (!getImIconWithLevel() + .equals(other.getImIconWithLevel())) return false; + } + if (hasLiveIcon() != other.hasLiveIcon()) return false; + if (hasLiveIcon()) { + if (!getLiveIcon() + .equals(other.getLiveIcon())) return false; + } + if (hasNewImIconWithLevel() != other.hasNewImIconWithLevel()) return false; + if (hasNewImIconWithLevel()) { + if (!getNewImIconWithLevel() + .equals(other.getNewImIconWithLevel())) return false; + } + if (hasNewLiveIcon() != other.hasNewLiveIcon()) return false; + if (hasNewLiveIcon()) { + if (!getNewLiveIcon() + .equals(other.getNewLiveIcon())) return false; + } + if (getUpgradeNeedConsume() + != other.getUpgradeNeedConsume()) return false; + if (!getNextPrivileges() + .equals(other.getNextPrivileges())) return false; + if (hasBackground() != other.hasBackground()) return false; + if (hasBackground()) { + if (!getBackground() + .equals(other.getBackground())) return false; + } + if (hasBackgroundBack() != other.hasBackgroundBack()) return false; + if (hasBackgroundBack()) { + if (!getBackgroundBack() + .equals(other.getBackgroundBack())) return false; + } + if (getScore() + != other.getScore()) return false; + if (!getGradeBanner() + .equals(other.getGradeBanner())) return false; + if (hasProfileDialogBg() != other.hasProfileDialogBg()) return false; + if (hasProfileDialogBg()) { + if (!getProfileDialogBg() + .equals(other.getProfileDialogBg())) return false; + } + if (hasProfileDialogBgBack() != other.hasProfileDialogBgBack()) return false; + if (hasProfileDialogBgBack()) { + if (!getProfileDialogBgBack() + .equals(other.getProfileDialogBgBack())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TOTALDIAMONDCOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTotalDiamondCount()); + if (hasDiamondIcon()) { + hash = (37 * hash) + DIAMONDICON_FIELD_NUMBER; + hash = (53 * hash) + getDiamondIcon().hashCode(); + } + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasIcon()) { + hash = (37 * hash) + ICON_FIELD_NUMBER; + hash = (53 * hash) + getIcon().hashCode(); + } + hash = (37 * hash) + NEXTNAME_FIELD_NUMBER; + hash = (53 * hash) + getNextName().hashCode(); + hash = (37 * hash) + LEVEL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLevel()); + if (hasNextIcon()) { + hash = (37 * hash) + NEXTICON_FIELD_NUMBER; + hash = (53 * hash) + getNextIcon().hashCode(); + } + hash = (37 * hash) + NEXTDIAMOND_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNextDiamond()); + hash = (37 * hash) + NOWDIAMOND_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNowDiamond()); + hash = (37 * hash) + THISGRADEMINDIAMOND_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getThisGradeMinDiamond()); + hash = (37 * hash) + THISGRADEMAXDIAMOND_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getThisGradeMaxDiamond()); + hash = (37 * hash) + PAYDIAMONDBAK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPayDiamondBak()); + hash = (37 * hash) + GRADEDESCRIBE_FIELD_NUMBER; + hash = (53 * hash) + getGradeDescribe().hashCode(); + if (getGradeIconListCount() > 0) { + hash = (37 * hash) + GRADEICONLIST_FIELD_NUMBER; + hash = (53 * hash) + getGradeIconListList().hashCode(); + } + hash = (37 * hash) + SCREENCHATTYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getScreenChatType()); + if (hasImIcon()) { + hash = (37 * hash) + IMICON_FIELD_NUMBER; + hash = (53 * hash) + getImIcon().hashCode(); + } + if (hasImIconWithLevel()) { + hash = (37 * hash) + IMICONWITHLEVEL_FIELD_NUMBER; + hash = (53 * hash) + getImIconWithLevel().hashCode(); + } + if (hasLiveIcon()) { + hash = (37 * hash) + LIVEICON_FIELD_NUMBER; + hash = (53 * hash) + getLiveIcon().hashCode(); + } + if (hasNewImIconWithLevel()) { + hash = (37 * hash) + NEWIMICONWITHLEVEL_FIELD_NUMBER; + hash = (53 * hash) + getNewImIconWithLevel().hashCode(); + } + if (hasNewLiveIcon()) { + hash = (37 * hash) + NEWLIVEICON_FIELD_NUMBER; + hash = (53 * hash) + getNewLiveIcon().hashCode(); + } + hash = (37 * hash) + UPGRADENEEDCONSUME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getUpgradeNeedConsume()); + hash = (37 * hash) + NEXTPRIVILEGES_FIELD_NUMBER; + hash = (53 * hash) + getNextPrivileges().hashCode(); + if (hasBackground()) { + hash = (37 * hash) + BACKGROUND_FIELD_NUMBER; + hash = (53 * hash) + getBackground().hashCode(); + } + if (hasBackgroundBack()) { + hash = (37 * hash) + BACKGROUNDBACK_FIELD_NUMBER; + hash = (53 * hash) + getBackgroundBack().hashCode(); + } + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getScore()); + hash = (37 * hash) + GRADEBANNER_FIELD_NUMBER; + hash = (53 * hash) + getGradeBanner().hashCode(); + if (hasProfileDialogBg()) { + hash = (37 * hash) + PROFILEDIALOGBG_FIELD_NUMBER; + hash = (53 * hash) + getProfileDialogBg().hashCode(); + } + if (hasProfileDialogBgBack()) { + hash = (37 * hash) + PROFILEDIALOGBGBACK_FIELD_NUMBER; + hash = (53 * hash) + getProfileDialogBgBack().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.PayGrade} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.PayGrade) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGradeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PayGrade_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PayGrade_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + totalDiamondCount_ = 0L; + diamondIcon_ = null; + if (diamondIconBuilder_ != null) { + diamondIconBuilder_.dispose(); + diamondIconBuilder_ = null; + } + name_ = ""; + icon_ = null; + if (iconBuilder_ != null) { + iconBuilder_.dispose(); + iconBuilder_ = null; + } + nextName_ = ""; + level_ = 0L; + nextIcon_ = null; + if (nextIconBuilder_ != null) { + nextIconBuilder_.dispose(); + nextIconBuilder_ = null; + } + nextDiamond_ = 0L; + nowDiamond_ = 0L; + thisGradeMinDiamond_ = 0L; + thisGradeMaxDiamond_ = 0L; + payDiamondBak_ = 0L; + gradeDescribe_ = ""; + if (gradeIconListBuilder_ == null) { + gradeIconList_ = java.util.Collections.emptyList(); + } else { + gradeIconList_ = null; + gradeIconListBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00002000); + screenChatType_ = 0L; + imIcon_ = null; + if (imIconBuilder_ != null) { + imIconBuilder_.dispose(); + imIconBuilder_ = null; + } + imIconWithLevel_ = null; + if (imIconWithLevelBuilder_ != null) { + imIconWithLevelBuilder_.dispose(); + imIconWithLevelBuilder_ = null; + } + liveIcon_ = null; + if (liveIconBuilder_ != null) { + liveIconBuilder_.dispose(); + liveIconBuilder_ = null; + } + newImIconWithLevel_ = null; + if (newImIconWithLevelBuilder_ != null) { + newImIconWithLevelBuilder_.dispose(); + newImIconWithLevelBuilder_ = null; + } + newLiveIcon_ = null; + if (newLiveIconBuilder_ != null) { + newLiveIconBuilder_.dispose(); + newLiveIconBuilder_ = null; + } + upgradeNeedConsume_ = 0L; + nextPrivileges_ = ""; + background_ = null; + if (backgroundBuilder_ != null) { + backgroundBuilder_.dispose(); + backgroundBuilder_ = null; + } + backgroundBack_ = null; + if (backgroundBackBuilder_ != null) { + backgroundBackBuilder_.dispose(); + backgroundBackBuilder_ = null; + } + score_ = 0L; + gradeBanner_ = ""; + profileDialogBg_ = null; + if (profileDialogBgBuilder_ != null) { + profileDialogBgBuilder_.dispose(); + profileDialogBgBuilder_ = null; + } + profileDialogBgBack_ = null; + if (profileDialogBgBackBuilder_ != null) { + profileDialogBgBackBuilder_.dispose(); + profileDialogBgBackBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PayGrade_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade result) { + if (gradeIconListBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0)) { + gradeIconList_ = java.util.Collections.unmodifiableList(gradeIconList_); + bitField0_ = (bitField0_ & ~0x00002000); + } + result.gradeIconList_ = gradeIconList_; + } else { + result.gradeIconList_ = gradeIconListBuilder_.build(); + } + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.totalDiamondCount_ = totalDiamondCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.diamondIcon_ = diamondIconBuilder_ == null + ? diamondIcon_ + : diamondIconBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.icon_ = iconBuilder_ == null + ? icon_ + : iconBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.nextName_ = nextName_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.level_ = level_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.nextIcon_ = nextIconBuilder_ == null + ? nextIcon_ + : nextIconBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.nextDiamond_ = nextDiamond_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.nowDiamond_ = nowDiamond_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.thisGradeMinDiamond_ = thisGradeMinDiamond_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.thisGradeMaxDiamond_ = thisGradeMaxDiamond_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.payDiamondBak_ = payDiamondBak_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.gradeDescribe_ = gradeDescribe_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.screenChatType_ = screenChatType_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.imIcon_ = imIconBuilder_ == null + ? imIcon_ + : imIconBuilder_.build(); + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.imIconWithLevel_ = imIconWithLevelBuilder_ == null + ? imIconWithLevel_ + : imIconWithLevelBuilder_.build(); + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.liveIcon_ = liveIconBuilder_ == null + ? liveIcon_ + : liveIconBuilder_.build(); + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.newImIconWithLevel_ = newImIconWithLevelBuilder_ == null + ? newImIconWithLevel_ + : newImIconWithLevelBuilder_.build(); + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.newLiveIcon_ = newLiveIconBuilder_ == null + ? newLiveIcon_ + : newLiveIconBuilder_.build(); + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.upgradeNeedConsume_ = upgradeNeedConsume_; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.nextPrivileges_ = nextPrivileges_; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.background_ = backgroundBuilder_ == null + ? background_ + : backgroundBuilder_.build(); + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.backgroundBack_ = backgroundBackBuilder_ == null + ? backgroundBack_ + : backgroundBackBuilder_.build(); + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.score_ = score_; + } + if (((from_bitField0_ & 0x02000000) != 0)) { + result.gradeBanner_ = gradeBanner_; + } + if (((from_bitField0_ & 0x04000000) != 0)) { + result.profileDialogBg_ = profileDialogBgBuilder_ == null + ? profileDialogBg_ + : profileDialogBgBuilder_.build(); + } + if (((from_bitField0_ & 0x08000000) != 0)) { + result.profileDialogBgBack_ = profileDialogBgBackBuilder_ == null + ? profileDialogBgBack_ + : profileDialogBgBackBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.getDefaultInstance()) return this; + if (other.getTotalDiamondCount() != 0L) { + setTotalDiamondCount(other.getTotalDiamondCount()); + } + if (other.hasDiamondIcon()) { + mergeDiamondIcon(other.getDiamondIcon()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasIcon()) { + mergeIcon(other.getIcon()); + } + if (!other.getNextName().isEmpty()) { + nextName_ = other.nextName_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getLevel() != 0L) { + setLevel(other.getLevel()); + } + if (other.hasNextIcon()) { + mergeNextIcon(other.getNextIcon()); + } + if (other.getNextDiamond() != 0L) { + setNextDiamond(other.getNextDiamond()); + } + if (other.getNowDiamond() != 0L) { + setNowDiamond(other.getNowDiamond()); + } + if (other.getThisGradeMinDiamond() != 0L) { + setThisGradeMinDiamond(other.getThisGradeMinDiamond()); + } + if (other.getThisGradeMaxDiamond() != 0L) { + setThisGradeMaxDiamond(other.getThisGradeMaxDiamond()); + } + if (other.getPayDiamondBak() != 0L) { + setPayDiamondBak(other.getPayDiamondBak()); + } + if (!other.getGradeDescribe().isEmpty()) { + gradeDescribe_ = other.gradeDescribe_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (gradeIconListBuilder_ == null) { + if (!other.gradeIconList_.isEmpty()) { + if (gradeIconList_.isEmpty()) { + gradeIconList_ = other.gradeIconList_; + bitField0_ = (bitField0_ & ~0x00002000); + } else { + ensureGradeIconListIsMutable(); + gradeIconList_.addAll(other.gradeIconList_); + } + onChanged(); + } + } else { + if (!other.gradeIconList_.isEmpty()) { + if (gradeIconListBuilder_.isEmpty()) { + gradeIconListBuilder_.dispose(); + gradeIconListBuilder_ = null; + gradeIconList_ = other.gradeIconList_; + bitField0_ = (bitField0_ & ~0x00002000); + gradeIconListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getGradeIconListFieldBuilder() : null; + } else { + gradeIconListBuilder_.addAllMessages(other.gradeIconList_); + } + } + } + if (other.getScreenChatType() != 0L) { + setScreenChatType(other.getScreenChatType()); + } + if (other.hasImIcon()) { + mergeImIcon(other.getImIcon()); + } + if (other.hasImIconWithLevel()) { + mergeImIconWithLevel(other.getImIconWithLevel()); + } + if (other.hasLiveIcon()) { + mergeLiveIcon(other.getLiveIcon()); + } + if (other.hasNewImIconWithLevel()) { + mergeNewImIconWithLevel(other.getNewImIconWithLevel()); + } + if (other.hasNewLiveIcon()) { + mergeNewLiveIcon(other.getNewLiveIcon()); + } + if (other.getUpgradeNeedConsume() != 0L) { + setUpgradeNeedConsume(other.getUpgradeNeedConsume()); + } + if (!other.getNextPrivileges().isEmpty()) { + nextPrivileges_ = other.nextPrivileges_; + bitField0_ |= 0x00200000; + onChanged(); + } + if (other.hasBackground()) { + mergeBackground(other.getBackground()); + } + if (other.hasBackgroundBack()) { + mergeBackgroundBack(other.getBackgroundBack()); + } + if (other.getScore() != 0L) { + setScore(other.getScore()); + } + if (!other.getGradeBanner().isEmpty()) { + gradeBanner_ = other.gradeBanner_; + bitField0_ |= 0x02000000; + onChanged(); + } + if (other.hasProfileDialogBg()) { + mergeProfileDialogBg(other.getProfileDialogBg()); + } + if (other.hasProfileDialogBgBack()) { + mergeProfileDialogBgBack(other.getProfileDialogBgBack()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + totalDiamondCount_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getDiamondIconFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + input.readMessage( + getIconFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + nextName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: { + level_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: { + input.readMessage( + getNextIconFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: { + nextDiamond_ = input.readInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + nowDiamond_ = input.readInt64(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: { + thisGradeMinDiamond_ = input.readInt64(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: { + thisGradeMaxDiamond_ = input.readInt64(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 96: { + payDiamondBak_ = input.readInt64(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 106: { + gradeDescribe_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 114: { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon m = + input.readMessage( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.parser(), + extensionRegistry); + if (gradeIconListBuilder_ == null) { + ensureGradeIconListIsMutable(); + gradeIconList_.add(m); + } else { + gradeIconListBuilder_.addMessage(m); + } + break; + } // case 114 + case 120: { + screenChatType_ = input.readInt64(); + bitField0_ |= 0x00004000; + break; + } // case 120 + case 130: { + input.readMessage( + getImIconFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00008000; + break; + } // case 130 + case 138: { + input.readMessage( + getImIconWithLevelFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 138 + case 146: { + input.readMessage( + getLiveIconFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 146 + case 154: { + input.readMessage( + getNewImIconWithLevelFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 154 + case 162: { + input.readMessage( + getNewLiveIconFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 162 + case 168: { + upgradeNeedConsume_ = input.readInt64(); + bitField0_ |= 0x00100000; + break; + } // case 168 + case 178: { + nextPrivileges_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00200000; + break; + } // case 178 + case 186: { + input.readMessage( + getBackgroundFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00400000; + break; + } // case 186 + case 194: { + input.readMessage( + getBackgroundBackFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00800000; + break; + } // case 194 + case 200: { + score_ = input.readInt64(); + bitField0_ |= 0x01000000; + break; + } // case 200 + case 8010: { + gradeBanner_ = input.readStringRequireUtf8(); + bitField0_ |= 0x02000000; + break; + } // case 8010 + case 8018: { + input.readMessage( + getProfileDialogBgFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x04000000; + break; + } // case 8018 + case 8026: { + input.readMessage( + getProfileDialogBgBackFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x08000000; + break; + } // case 8026 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long totalDiamondCount_ ; + /** + * int64 totalDiamondCount = 1; + * @return The totalDiamondCount. + */ + @java.lang.Override + public long getTotalDiamondCount() { + return totalDiamondCount_; + } + /** + * int64 totalDiamondCount = 1; + * @param value The totalDiamondCount to set. + * @return This builder for chaining. + */ + public Builder setTotalDiamondCount(long value) { + + totalDiamondCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 totalDiamondCount = 1; + * @return This builder for chaining. + */ + public Builder clearTotalDiamondCount() { + bitField0_ = (bitField0_ & ~0x00000001); + totalDiamondCount_ = 0L; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image diamondIcon_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> diamondIconBuilder_; + /** + * .Image diamondIcon = 2; + * @return Whether the diamondIcon field is set. + */ + public boolean hasDiamondIcon() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .Image diamondIcon = 2; + * @return The diamondIcon. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getDiamondIcon() { + if (diamondIconBuilder_ == null) { + return diamondIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : diamondIcon_; + } else { + return diamondIconBuilder_.getMessage(); + } + } + /** + * .Image diamondIcon = 2; + */ + public Builder setDiamondIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (diamondIconBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + diamondIcon_ = value; + } else { + diamondIconBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .Image diamondIcon = 2; + */ + public Builder setDiamondIcon( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (diamondIconBuilder_ == null) { + diamondIcon_ = builderForValue.build(); + } else { + diamondIconBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .Image diamondIcon = 2; + */ + public Builder mergeDiamondIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (diamondIconBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + diamondIcon_ != null && + diamondIcon_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getDiamondIconBuilder().mergeFrom(value); + } else { + diamondIcon_ = value; + } + } else { + diamondIconBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .Image diamondIcon = 2; + */ + public Builder clearDiamondIcon() { + bitField0_ = (bitField0_ & ~0x00000002); + diamondIcon_ = null; + if (diamondIconBuilder_ != null) { + diamondIconBuilder_.dispose(); + diamondIconBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image diamondIcon = 2; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getDiamondIconBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDiamondIconFieldBuilder().getBuilder(); + } + /** + * .Image diamondIcon = 2; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getDiamondIconOrBuilder() { + if (diamondIconBuilder_ != null) { + return diamondIconBuilder_.getMessageOrBuilder(); + } else { + return diamondIcon_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : diamondIcon_; + } + } + /** + * .Image diamondIcon = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getDiamondIconFieldBuilder() { + if (diamondIconBuilder_ == null) { + diamondIconBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getDiamondIcon(), + getParentForChildren(), + isClean()); + diamondIcon_ = null; + } + return diamondIconBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * string name = 3; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string name = 3; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string name = 3; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * string name = 3; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * string name = 3; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image icon_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> iconBuilder_; + /** + * .Image icon = 4; + * @return Whether the icon field is set. + */ + public boolean hasIcon() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * .Image icon = 4; + * @return The icon. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getIcon() { + if (iconBuilder_ == null) { + return icon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : icon_; + } else { + return iconBuilder_.getMessage(); + } + } + /** + * .Image icon = 4; + */ + public Builder setIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (iconBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + icon_ = value; + } else { + iconBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .Image icon = 4; + */ + public Builder setIcon( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (iconBuilder_ == null) { + icon_ = builderForValue.build(); + } else { + iconBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .Image icon = 4; + */ + public Builder mergeIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (iconBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + icon_ != null && + icon_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getIconBuilder().mergeFrom(value); + } else { + icon_ = value; + } + } else { + iconBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .Image icon = 4; + */ + public Builder clearIcon() { + bitField0_ = (bitField0_ & ~0x00000008); + icon_ = null; + if (iconBuilder_ != null) { + iconBuilder_.dispose(); + iconBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image icon = 4; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getIconBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getIconFieldBuilder().getBuilder(); + } + /** + * .Image icon = 4; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getIconOrBuilder() { + if (iconBuilder_ != null) { + return iconBuilder_.getMessageOrBuilder(); + } else { + return icon_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : icon_; + } + } + /** + * .Image icon = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getIconFieldBuilder() { + if (iconBuilder_ == null) { + iconBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getIcon(), + getParentForChildren(), + isClean()); + icon_ = null; + } + return iconBuilder_; + } + + private java.lang.Object nextName_ = ""; + /** + * string nextName = 5; + * @return The nextName. + */ + public java.lang.String getNextName() { + java.lang.Object ref = nextName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string nextName = 5; + * @return The bytes for nextName. + */ + public com.google.protobuf.ByteString + getNextNameBytes() { + java.lang.Object ref = nextName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string nextName = 5; + * @param value The nextName to set. + * @return This builder for chaining. + */ + public Builder setNextName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + nextName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * string nextName = 5; + * @return This builder for chaining. + */ + public Builder clearNextName() { + nextName_ = getDefaultInstance().getNextName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * string nextName = 5; + * @param value The bytes for nextName to set. + * @return This builder for chaining. + */ + public Builder setNextNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + nextName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private long level_ ; + /** + * int64 level = 6; + * @return The level. + */ + @java.lang.Override + public long getLevel() { + return level_; + } + /** + * int64 level = 6; + * @param value The level to set. + * @return This builder for chaining. + */ + public Builder setLevel(long value) { + + level_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * int64 level = 6; + * @return This builder for chaining. + */ + public Builder clearLevel() { + bitField0_ = (bitField0_ & ~0x00000020); + level_ = 0L; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image nextIcon_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> nextIconBuilder_; + /** + * .Image nextIcon = 7; + * @return Whether the nextIcon field is set. + */ + public boolean hasNextIcon() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * .Image nextIcon = 7; + * @return The nextIcon. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getNextIcon() { + if (nextIconBuilder_ == null) { + return nextIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : nextIcon_; + } else { + return nextIconBuilder_.getMessage(); + } + } + /** + * .Image nextIcon = 7; + */ + public Builder setNextIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (nextIconBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + nextIcon_ = value; + } else { + nextIconBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .Image nextIcon = 7; + */ + public Builder setNextIcon( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (nextIconBuilder_ == null) { + nextIcon_ = builderForValue.build(); + } else { + nextIconBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .Image nextIcon = 7; + */ + public Builder mergeNextIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (nextIconBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + nextIcon_ != null && + nextIcon_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getNextIconBuilder().mergeFrom(value); + } else { + nextIcon_ = value; + } + } else { + nextIconBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .Image nextIcon = 7; + */ + public Builder clearNextIcon() { + bitField0_ = (bitField0_ & ~0x00000040); + nextIcon_ = null; + if (nextIconBuilder_ != null) { + nextIconBuilder_.dispose(); + nextIconBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image nextIcon = 7; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getNextIconBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getNextIconFieldBuilder().getBuilder(); + } + /** + * .Image nextIcon = 7; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getNextIconOrBuilder() { + if (nextIconBuilder_ != null) { + return nextIconBuilder_.getMessageOrBuilder(); + } else { + return nextIcon_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : nextIcon_; + } + } + /** + * .Image nextIcon = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getNextIconFieldBuilder() { + if (nextIconBuilder_ == null) { + nextIconBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getNextIcon(), + getParentForChildren(), + isClean()); + nextIcon_ = null; + } + return nextIconBuilder_; + } + + private long nextDiamond_ ; + /** + * int64 nextDiamond = 8; + * @return The nextDiamond. + */ + @java.lang.Override + public long getNextDiamond() { + return nextDiamond_; + } + /** + * int64 nextDiamond = 8; + * @param value The nextDiamond to set. + * @return This builder for chaining. + */ + public Builder setNextDiamond(long value) { + + nextDiamond_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * int64 nextDiamond = 8; + * @return This builder for chaining. + */ + public Builder clearNextDiamond() { + bitField0_ = (bitField0_ & ~0x00000080); + nextDiamond_ = 0L; + onChanged(); + return this; + } + + private long nowDiamond_ ; + /** + * int64 nowDiamond = 9; + * @return The nowDiamond. + */ + @java.lang.Override + public long getNowDiamond() { + return nowDiamond_; + } + /** + * int64 nowDiamond = 9; + * @param value The nowDiamond to set. + * @return This builder for chaining. + */ + public Builder setNowDiamond(long value) { + + nowDiamond_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * int64 nowDiamond = 9; + * @return This builder for chaining. + */ + public Builder clearNowDiamond() { + bitField0_ = (bitField0_ & ~0x00000100); + nowDiamond_ = 0L; + onChanged(); + return this; + } + + private long thisGradeMinDiamond_ ; + /** + * int64 thisGradeMinDiamond = 10; + * @return The thisGradeMinDiamond. + */ + @java.lang.Override + public long getThisGradeMinDiamond() { + return thisGradeMinDiamond_; + } + /** + * int64 thisGradeMinDiamond = 10; + * @param value The thisGradeMinDiamond to set. + * @return This builder for chaining. + */ + public Builder setThisGradeMinDiamond(long value) { + + thisGradeMinDiamond_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * int64 thisGradeMinDiamond = 10; + * @return This builder for chaining. + */ + public Builder clearThisGradeMinDiamond() { + bitField0_ = (bitField0_ & ~0x00000200); + thisGradeMinDiamond_ = 0L; + onChanged(); + return this; + } + + private long thisGradeMaxDiamond_ ; + /** + * int64 thisGradeMaxDiamond = 11; + * @return The thisGradeMaxDiamond. + */ + @java.lang.Override + public long getThisGradeMaxDiamond() { + return thisGradeMaxDiamond_; + } + /** + * int64 thisGradeMaxDiamond = 11; + * @param value The thisGradeMaxDiamond to set. + * @return This builder for chaining. + */ + public Builder setThisGradeMaxDiamond(long value) { + + thisGradeMaxDiamond_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * int64 thisGradeMaxDiamond = 11; + * @return This builder for chaining. + */ + public Builder clearThisGradeMaxDiamond() { + bitField0_ = (bitField0_ & ~0x00000400); + thisGradeMaxDiamond_ = 0L; + onChanged(); + return this; + } + + private long payDiamondBak_ ; + /** + * int64 payDiamondBak = 12; + * @return The payDiamondBak. + */ + @java.lang.Override + public long getPayDiamondBak() { + return payDiamondBak_; + } + /** + * int64 payDiamondBak = 12; + * @param value The payDiamondBak to set. + * @return This builder for chaining. + */ + public Builder setPayDiamondBak(long value) { + + payDiamondBak_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * int64 payDiamondBak = 12; + * @return This builder for chaining. + */ + public Builder clearPayDiamondBak() { + bitField0_ = (bitField0_ & ~0x00000800); + payDiamondBak_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object gradeDescribe_ = ""; + /** + * string gradeDescribe = 13; + * @return The gradeDescribe. + */ + public java.lang.String getGradeDescribe() { + java.lang.Object ref = gradeDescribe_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gradeDescribe_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string gradeDescribe = 13; + * @return The bytes for gradeDescribe. + */ + public com.google.protobuf.ByteString + getGradeDescribeBytes() { + java.lang.Object ref = gradeDescribe_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + gradeDescribe_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string gradeDescribe = 13; + * @param value The gradeDescribe to set. + * @return This builder for chaining. + */ + public Builder setGradeDescribe( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + gradeDescribe_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * string gradeDescribe = 13; + * @return This builder for chaining. + */ + public Builder clearGradeDescribe() { + gradeDescribe_ = getDefaultInstance().getGradeDescribe(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + /** + * string gradeDescribe = 13; + * @param value The bytes for gradeDescribe to set. + * @return This builder for chaining. + */ + public Builder setGradeDescribeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + gradeDescribe_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private java.util.List gradeIconList_ = + java.util.Collections.emptyList(); + private void ensureGradeIconListIsMutable() { + if (!((bitField0_ & 0x00002000) != 0)) { + gradeIconList_ = new java.util.ArrayList(gradeIconList_); + bitField0_ |= 0x00002000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIconOrBuilder> gradeIconListBuilder_; + + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public java.util.List getGradeIconListList() { + if (gradeIconListBuilder_ == null) { + return java.util.Collections.unmodifiableList(gradeIconList_); + } else { + return gradeIconListBuilder_.getMessageList(); + } + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public int getGradeIconListCount() { + if (gradeIconListBuilder_ == null) { + return gradeIconList_.size(); + } else { + return gradeIconListBuilder_.getCount(); + } + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon getGradeIconList(int index) { + if (gradeIconListBuilder_ == null) { + return gradeIconList_.get(index); + } else { + return gradeIconListBuilder_.getMessage(index); + } + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public Builder setGradeIconList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon value) { + if (gradeIconListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGradeIconListIsMutable(); + gradeIconList_.set(index, value); + onChanged(); + } else { + gradeIconListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public Builder setGradeIconList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.Builder builderForValue) { + if (gradeIconListBuilder_ == null) { + ensureGradeIconListIsMutable(); + gradeIconList_.set(index, builderForValue.build()); + onChanged(); + } else { + gradeIconListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public Builder addGradeIconList(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon value) { + if (gradeIconListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGradeIconListIsMutable(); + gradeIconList_.add(value); + onChanged(); + } else { + gradeIconListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public Builder addGradeIconList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon value) { + if (gradeIconListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGradeIconListIsMutable(); + gradeIconList_.add(index, value); + onChanged(); + } else { + gradeIconListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public Builder addGradeIconList( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.Builder builderForValue) { + if (gradeIconListBuilder_ == null) { + ensureGradeIconListIsMutable(); + gradeIconList_.add(builderForValue.build()); + onChanged(); + } else { + gradeIconListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public Builder addGradeIconList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.Builder builderForValue) { + if (gradeIconListBuilder_ == null) { + ensureGradeIconListIsMutable(); + gradeIconList_.add(index, builderForValue.build()); + onChanged(); + } else { + gradeIconListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public Builder addAllGradeIconList( + java.lang.Iterable values) { + if (gradeIconListBuilder_ == null) { + ensureGradeIconListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, gradeIconList_); + onChanged(); + } else { + gradeIconListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public Builder clearGradeIconList() { + if (gradeIconListBuilder_ == null) { + gradeIconList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + } else { + gradeIconListBuilder_.clear(); + } + return this; + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public Builder removeGradeIconList(int index) { + if (gradeIconListBuilder_ == null) { + ensureGradeIconListIsMutable(); + gradeIconList_.remove(index); + onChanged(); + } else { + gradeIconListBuilder_.remove(index); + } + return this; + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.Builder getGradeIconListBuilder( + int index) { + return getGradeIconListFieldBuilder().getBuilder(index); + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIconOrBuilder getGradeIconListOrBuilder( + int index) { + if (gradeIconListBuilder_ == null) { + return gradeIconList_.get(index); } else { + return gradeIconListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public java.util.List + getGradeIconListOrBuilderList() { + if (gradeIconListBuilder_ != null) { + return gradeIconListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(gradeIconList_); + } + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.Builder addGradeIconListBuilder() { + return getGradeIconListFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.getDefaultInstance()); + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.Builder addGradeIconListBuilder( + int index) { + return getGradeIconListFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.getDefaultInstance()); + } + /** + * repeated .User.PayGrade.GradeIcon gradeIconList = 14; + */ + public java.util.List + getGradeIconListBuilderList() { + return getGradeIconListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIconOrBuilder> + getGradeIconListFieldBuilder() { + if (gradeIconListBuilder_ == null) { + gradeIconListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIcon.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.GradeIconOrBuilder>( + gradeIconList_, + ((bitField0_ & 0x00002000) != 0), + getParentForChildren(), + isClean()); + gradeIconList_ = null; + } + return gradeIconListBuilder_; + } + + private long screenChatType_ ; + /** + * int64 screenChatType = 15; + * @return The screenChatType. + */ + @java.lang.Override + public long getScreenChatType() { + return screenChatType_; + } + /** + * int64 screenChatType = 15; + * @param value The screenChatType to set. + * @return This builder for chaining. + */ + public Builder setScreenChatType(long value) { + + screenChatType_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * int64 screenChatType = 15; + * @return This builder for chaining. + */ + public Builder clearScreenChatType() { + bitField0_ = (bitField0_ & ~0x00004000); + screenChatType_ = 0L; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image imIcon_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> imIconBuilder_; + /** + * .Image imIcon = 16; + * @return Whether the imIcon field is set. + */ + public boolean hasImIcon() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + * .Image imIcon = 16; + * @return The imIcon. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getImIcon() { + if (imIconBuilder_ == null) { + return imIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : imIcon_; + } else { + return imIconBuilder_.getMessage(); + } + } + /** + * .Image imIcon = 16; + */ + public Builder setImIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (imIconBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + imIcon_ = value; + } else { + imIconBuilder_.setMessage(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * .Image imIcon = 16; + */ + public Builder setImIcon( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (imIconBuilder_ == null) { + imIcon_ = builderForValue.build(); + } else { + imIconBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * .Image imIcon = 16; + */ + public Builder mergeImIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (imIconBuilder_ == null) { + if (((bitField0_ & 0x00008000) != 0) && + imIcon_ != null && + imIcon_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getImIconBuilder().mergeFrom(value); + } else { + imIcon_ = value; + } + } else { + imIconBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * .Image imIcon = 16; + */ + public Builder clearImIcon() { + bitField0_ = (bitField0_ & ~0x00008000); + imIcon_ = null; + if (imIconBuilder_ != null) { + imIconBuilder_.dispose(); + imIconBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image imIcon = 16; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getImIconBuilder() { + bitField0_ |= 0x00008000; + onChanged(); + return getImIconFieldBuilder().getBuilder(); + } + /** + * .Image imIcon = 16; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImIconOrBuilder() { + if (imIconBuilder_ != null) { + return imIconBuilder_.getMessageOrBuilder(); + } else { + return imIcon_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : imIcon_; + } + } + /** + * .Image imIcon = 16; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getImIconFieldBuilder() { + if (imIconBuilder_ == null) { + imIconBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getImIcon(), + getParentForChildren(), + isClean()); + imIcon_ = null; + } + return imIconBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image imIconWithLevel_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> imIconWithLevelBuilder_; + /** + * .Image imIconWithLevel = 17; + * @return Whether the imIconWithLevel field is set. + */ + public boolean hasImIconWithLevel() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * .Image imIconWithLevel = 17; + * @return The imIconWithLevel. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getImIconWithLevel() { + if (imIconWithLevelBuilder_ == null) { + return imIconWithLevel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : imIconWithLevel_; + } else { + return imIconWithLevelBuilder_.getMessage(); + } + } + /** + * .Image imIconWithLevel = 17; + */ + public Builder setImIconWithLevel(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (imIconWithLevelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + imIconWithLevel_ = value; + } else { + imIconWithLevelBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * .Image imIconWithLevel = 17; + */ + public Builder setImIconWithLevel( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (imIconWithLevelBuilder_ == null) { + imIconWithLevel_ = builderForValue.build(); + } else { + imIconWithLevelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * .Image imIconWithLevel = 17; + */ + public Builder mergeImIconWithLevel(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (imIconWithLevelBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) && + imIconWithLevel_ != null && + imIconWithLevel_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getImIconWithLevelBuilder().mergeFrom(value); + } else { + imIconWithLevel_ = value; + } + } else { + imIconWithLevelBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * .Image imIconWithLevel = 17; + */ + public Builder clearImIconWithLevel() { + bitField0_ = (bitField0_ & ~0x00010000); + imIconWithLevel_ = null; + if (imIconWithLevelBuilder_ != null) { + imIconWithLevelBuilder_.dispose(); + imIconWithLevelBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image imIconWithLevel = 17; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getImIconWithLevelBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return getImIconWithLevelFieldBuilder().getBuilder(); + } + /** + * .Image imIconWithLevel = 17; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getImIconWithLevelOrBuilder() { + if (imIconWithLevelBuilder_ != null) { + return imIconWithLevelBuilder_.getMessageOrBuilder(); + } else { + return imIconWithLevel_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : imIconWithLevel_; + } + } + /** + * .Image imIconWithLevel = 17; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getImIconWithLevelFieldBuilder() { + if (imIconWithLevelBuilder_ == null) { + imIconWithLevelBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getImIconWithLevel(), + getParentForChildren(), + isClean()); + imIconWithLevel_ = null; + } + return imIconWithLevelBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image liveIcon_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> liveIconBuilder_; + /** + * .Image liveIcon = 18; + * @return Whether the liveIcon field is set. + */ + public boolean hasLiveIcon() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * .Image liveIcon = 18; + * @return The liveIcon. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getLiveIcon() { + if (liveIconBuilder_ == null) { + return liveIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : liveIcon_; + } else { + return liveIconBuilder_.getMessage(); + } + } + /** + * .Image liveIcon = 18; + */ + public Builder setLiveIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (liveIconBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + liveIcon_ = value; + } else { + liveIconBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * .Image liveIcon = 18; + */ + public Builder setLiveIcon( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (liveIconBuilder_ == null) { + liveIcon_ = builderForValue.build(); + } else { + liveIconBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * .Image liveIcon = 18; + */ + public Builder mergeLiveIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (liveIconBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) && + liveIcon_ != null && + liveIcon_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getLiveIconBuilder().mergeFrom(value); + } else { + liveIcon_ = value; + } + } else { + liveIconBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * .Image liveIcon = 18; + */ + public Builder clearLiveIcon() { + bitField0_ = (bitField0_ & ~0x00020000); + liveIcon_ = null; + if (liveIconBuilder_ != null) { + liveIconBuilder_.dispose(); + liveIconBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image liveIcon = 18; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getLiveIconBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return getLiveIconFieldBuilder().getBuilder(); + } + /** + * .Image liveIcon = 18; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getLiveIconOrBuilder() { + if (liveIconBuilder_ != null) { + return liveIconBuilder_.getMessageOrBuilder(); + } else { + return liveIcon_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : liveIcon_; + } + } + /** + * .Image liveIcon = 18; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getLiveIconFieldBuilder() { + if (liveIconBuilder_ == null) { + liveIconBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getLiveIcon(), + getParentForChildren(), + isClean()); + liveIcon_ = null; + } + return liveIconBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image newImIconWithLevel_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> newImIconWithLevelBuilder_; + /** + * .Image newImIconWithLevel = 19; + * @return Whether the newImIconWithLevel field is set. + */ + public boolean hasNewImIconWithLevel() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * .Image newImIconWithLevel = 19; + * @return The newImIconWithLevel. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getNewImIconWithLevel() { + if (newImIconWithLevelBuilder_ == null) { + return newImIconWithLevel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : newImIconWithLevel_; + } else { + return newImIconWithLevelBuilder_.getMessage(); + } + } + /** + * .Image newImIconWithLevel = 19; + */ + public Builder setNewImIconWithLevel(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (newImIconWithLevelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + newImIconWithLevel_ = value; + } else { + newImIconWithLevelBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .Image newImIconWithLevel = 19; + */ + public Builder setNewImIconWithLevel( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (newImIconWithLevelBuilder_ == null) { + newImIconWithLevel_ = builderForValue.build(); + } else { + newImIconWithLevelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .Image newImIconWithLevel = 19; + */ + public Builder mergeNewImIconWithLevel(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (newImIconWithLevelBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) && + newImIconWithLevel_ != null && + newImIconWithLevel_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getNewImIconWithLevelBuilder().mergeFrom(value); + } else { + newImIconWithLevel_ = value; + } + } else { + newImIconWithLevelBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .Image newImIconWithLevel = 19; + */ + public Builder clearNewImIconWithLevel() { + bitField0_ = (bitField0_ & ~0x00040000); + newImIconWithLevel_ = null; + if (newImIconWithLevelBuilder_ != null) { + newImIconWithLevelBuilder_.dispose(); + newImIconWithLevelBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image newImIconWithLevel = 19; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getNewImIconWithLevelBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return getNewImIconWithLevelFieldBuilder().getBuilder(); + } + /** + * .Image newImIconWithLevel = 19; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getNewImIconWithLevelOrBuilder() { + if (newImIconWithLevelBuilder_ != null) { + return newImIconWithLevelBuilder_.getMessageOrBuilder(); + } else { + return newImIconWithLevel_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : newImIconWithLevel_; + } + } + /** + * .Image newImIconWithLevel = 19; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getNewImIconWithLevelFieldBuilder() { + if (newImIconWithLevelBuilder_ == null) { + newImIconWithLevelBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getNewImIconWithLevel(), + getParentForChildren(), + isClean()); + newImIconWithLevel_ = null; + } + return newImIconWithLevelBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image newLiveIcon_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> newLiveIconBuilder_; + /** + * .Image newLiveIcon = 20; + * @return Whether the newLiveIcon field is set. + */ + public boolean hasNewLiveIcon() { + return ((bitField0_ & 0x00080000) != 0); + } + /** + * .Image newLiveIcon = 20; + * @return The newLiveIcon. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getNewLiveIcon() { + if (newLiveIconBuilder_ == null) { + return newLiveIcon_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : newLiveIcon_; + } else { + return newLiveIconBuilder_.getMessage(); + } + } + /** + * .Image newLiveIcon = 20; + */ + public Builder setNewLiveIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (newLiveIconBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + newLiveIcon_ = value; + } else { + newLiveIconBuilder_.setMessage(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * .Image newLiveIcon = 20; + */ + public Builder setNewLiveIcon( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (newLiveIconBuilder_ == null) { + newLiveIcon_ = builderForValue.build(); + } else { + newLiveIconBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * .Image newLiveIcon = 20; + */ + public Builder mergeNewLiveIcon(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (newLiveIconBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0) && + newLiveIcon_ != null && + newLiveIcon_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getNewLiveIconBuilder().mergeFrom(value); + } else { + newLiveIcon_ = value; + } + } else { + newLiveIconBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * .Image newLiveIcon = 20; + */ + public Builder clearNewLiveIcon() { + bitField0_ = (bitField0_ & ~0x00080000); + newLiveIcon_ = null; + if (newLiveIconBuilder_ != null) { + newLiveIconBuilder_.dispose(); + newLiveIconBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image newLiveIcon = 20; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getNewLiveIconBuilder() { + bitField0_ |= 0x00080000; + onChanged(); + return getNewLiveIconFieldBuilder().getBuilder(); + } + /** + * .Image newLiveIcon = 20; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getNewLiveIconOrBuilder() { + if (newLiveIconBuilder_ != null) { + return newLiveIconBuilder_.getMessageOrBuilder(); + } else { + return newLiveIcon_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : newLiveIcon_; + } + } + /** + * .Image newLiveIcon = 20; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getNewLiveIconFieldBuilder() { + if (newLiveIconBuilder_ == null) { + newLiveIconBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getNewLiveIcon(), + getParentForChildren(), + isClean()); + newLiveIcon_ = null; + } + return newLiveIconBuilder_; + } + + private long upgradeNeedConsume_ ; + /** + * int64 upgradeNeedConsume = 21; + * @return The upgradeNeedConsume. + */ + @java.lang.Override + public long getUpgradeNeedConsume() { + return upgradeNeedConsume_; + } + /** + * int64 upgradeNeedConsume = 21; + * @param value The upgradeNeedConsume to set. + * @return This builder for chaining. + */ + public Builder setUpgradeNeedConsume(long value) { + + upgradeNeedConsume_ = value; + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * int64 upgradeNeedConsume = 21; + * @return This builder for chaining. + */ + public Builder clearUpgradeNeedConsume() { + bitField0_ = (bitField0_ & ~0x00100000); + upgradeNeedConsume_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object nextPrivileges_ = ""; + /** + * string nextPrivileges = 22; + * @return The nextPrivileges. + */ + public java.lang.String getNextPrivileges() { + java.lang.Object ref = nextPrivileges_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPrivileges_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string nextPrivileges = 22; + * @return The bytes for nextPrivileges. + */ + public com.google.protobuf.ByteString + getNextPrivilegesBytes() { + java.lang.Object ref = nextPrivileges_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPrivileges_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string nextPrivileges = 22; + * @param value The nextPrivileges to set. + * @return This builder for chaining. + */ + public Builder setNextPrivileges( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + nextPrivileges_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * string nextPrivileges = 22; + * @return This builder for chaining. + */ + public Builder clearNextPrivileges() { + nextPrivileges_ = getDefaultInstance().getNextPrivileges(); + bitField0_ = (bitField0_ & ~0x00200000); + onChanged(); + return this; + } + /** + * string nextPrivileges = 22; + * @param value The bytes for nextPrivileges to set. + * @return This builder for chaining. + */ + public Builder setNextPrivilegesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + nextPrivileges_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image background_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> backgroundBuilder_; + /** + * .Image background = 23; + * @return Whether the background field is set. + */ + public boolean hasBackground() { + return ((bitField0_ & 0x00400000) != 0); + } + /** + * .Image background = 23; + * @return The background. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackground() { + if (backgroundBuilder_ == null) { + return background_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : background_; + } else { + return backgroundBuilder_.getMessage(); + } + } + /** + * .Image background = 23; + */ + public Builder setBackground(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (backgroundBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + background_ = value; + } else { + backgroundBuilder_.setMessage(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * .Image background = 23; + */ + public Builder setBackground( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (backgroundBuilder_ == null) { + background_ = builderForValue.build(); + } else { + backgroundBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * .Image background = 23; + */ + public Builder mergeBackground(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (backgroundBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0) && + background_ != null && + background_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getBackgroundBuilder().mergeFrom(value); + } else { + background_ = value; + } + } else { + backgroundBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * .Image background = 23; + */ + public Builder clearBackground() { + bitField0_ = (bitField0_ & ~0x00400000); + background_ = null; + if (backgroundBuilder_ != null) { + backgroundBuilder_.dispose(); + backgroundBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image background = 23; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getBackgroundBuilder() { + bitField0_ |= 0x00400000; + onChanged(); + return getBackgroundFieldBuilder().getBuilder(); + } + /** + * .Image background = 23; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundOrBuilder() { + if (backgroundBuilder_ != null) { + return backgroundBuilder_.getMessageOrBuilder(); + } else { + return background_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : background_; + } + } + /** + * .Image background = 23; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getBackgroundFieldBuilder() { + if (backgroundBuilder_ == null) { + backgroundBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getBackground(), + getParentForChildren(), + isClean()); + background_ = null; + } + return backgroundBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image backgroundBack_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> backgroundBackBuilder_; + /** + * .Image backgroundBack = 24; + * @return Whether the backgroundBack field is set. + */ + public boolean hasBackgroundBack() { + return ((bitField0_ & 0x00800000) != 0); + } + /** + * .Image backgroundBack = 24; + * @return The backgroundBack. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBackgroundBack() { + if (backgroundBackBuilder_ == null) { + return backgroundBack_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundBack_; + } else { + return backgroundBackBuilder_.getMessage(); + } + } + /** + * .Image backgroundBack = 24; + */ + public Builder setBackgroundBack(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (backgroundBackBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backgroundBack_ = value; + } else { + backgroundBackBuilder_.setMessage(value); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * .Image backgroundBack = 24; + */ + public Builder setBackgroundBack( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (backgroundBackBuilder_ == null) { + backgroundBack_ = builderForValue.build(); + } else { + backgroundBackBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * .Image backgroundBack = 24; + */ + public Builder mergeBackgroundBack(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (backgroundBackBuilder_ == null) { + if (((bitField0_ & 0x00800000) != 0) && + backgroundBack_ != null && + backgroundBack_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getBackgroundBackBuilder().mergeFrom(value); + } else { + backgroundBack_ = value; + } + } else { + backgroundBackBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * .Image backgroundBack = 24; + */ + public Builder clearBackgroundBack() { + bitField0_ = (bitField0_ & ~0x00800000); + backgroundBack_ = null; + if (backgroundBackBuilder_ != null) { + backgroundBackBuilder_.dispose(); + backgroundBackBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image backgroundBack = 24; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getBackgroundBackBuilder() { + bitField0_ |= 0x00800000; + onChanged(); + return getBackgroundBackFieldBuilder().getBuilder(); + } + /** + * .Image backgroundBack = 24; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBackgroundBackOrBuilder() { + if (backgroundBackBuilder_ != null) { + return backgroundBackBuilder_.getMessageOrBuilder(); + } else { + return backgroundBack_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : backgroundBack_; + } + } + /** + * .Image backgroundBack = 24; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getBackgroundBackFieldBuilder() { + if (backgroundBackBuilder_ == null) { + backgroundBackBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getBackgroundBack(), + getParentForChildren(), + isClean()); + backgroundBack_ = null; + } + return backgroundBackBuilder_; + } + + private long score_ ; + /** + * int64 score = 25; + * @return The score. + */ + @java.lang.Override + public long getScore() { + return score_; + } + /** + * int64 score = 25; + * @param value The score to set. + * @return This builder for chaining. + */ + public Builder setScore(long value) { + + score_ = value; + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * int64 score = 25; + * @return This builder for chaining. + */ + public Builder clearScore() { + bitField0_ = (bitField0_ & ~0x01000000); + score_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object gradeBanner_ = ""; + /** + *
+         * GradeBuffInfo buffInfo = 26;
+         * 
+ * + * string gradeBanner = 1001; + * @return The gradeBanner. + */ + public java.lang.String getGradeBanner() { + java.lang.Object ref = gradeBanner_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gradeBanner_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+         * GradeBuffInfo buffInfo = 26;
+         * 
+ * + * string gradeBanner = 1001; + * @return The bytes for gradeBanner. + */ + public com.google.protobuf.ByteString + getGradeBannerBytes() { + java.lang.Object ref = gradeBanner_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + gradeBanner_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+         * GradeBuffInfo buffInfo = 26;
+         * 
+ * + * string gradeBanner = 1001; + * @param value The gradeBanner to set. + * @return This builder for chaining. + */ + public Builder setGradeBanner( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + gradeBanner_ = value; + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + /** + *
+         * GradeBuffInfo buffInfo = 26;
+         * 
+ * + * string gradeBanner = 1001; + * @return This builder for chaining. + */ + public Builder clearGradeBanner() { + gradeBanner_ = getDefaultInstance().getGradeBanner(); + bitField0_ = (bitField0_ & ~0x02000000); + onChanged(); + return this; + } + /** + *
+         * GradeBuffInfo buffInfo = 26;
+         * 
+ * + * string gradeBanner = 1001; + * @param value The bytes for gradeBanner to set. + * @return This builder for chaining. + */ + public Builder setGradeBannerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + gradeBanner_ = value; + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image profileDialogBg_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> profileDialogBgBuilder_; + /** + * .Image profileDialogBg = 1002; + * @return Whether the profileDialogBg field is set. + */ + public boolean hasProfileDialogBg() { + return ((bitField0_ & 0x04000000) != 0); + } + /** + * .Image profileDialogBg = 1002; + * @return The profileDialogBg. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getProfileDialogBg() { + if (profileDialogBgBuilder_ == null) { + return profileDialogBg_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : profileDialogBg_; + } else { + return profileDialogBgBuilder_.getMessage(); + } + } + /** + * .Image profileDialogBg = 1002; + */ + public Builder setProfileDialogBg(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (profileDialogBgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + profileDialogBg_ = value; + } else { + profileDialogBgBuilder_.setMessage(value); + } + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + /** + * .Image profileDialogBg = 1002; + */ + public Builder setProfileDialogBg( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (profileDialogBgBuilder_ == null) { + profileDialogBg_ = builderForValue.build(); + } else { + profileDialogBgBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + /** + * .Image profileDialogBg = 1002; + */ + public Builder mergeProfileDialogBg(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (profileDialogBgBuilder_ == null) { + if (((bitField0_ & 0x04000000) != 0) && + profileDialogBg_ != null && + profileDialogBg_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getProfileDialogBgBuilder().mergeFrom(value); + } else { + profileDialogBg_ = value; + } + } else { + profileDialogBgBuilder_.mergeFrom(value); + } + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + /** + * .Image profileDialogBg = 1002; + */ + public Builder clearProfileDialogBg() { + bitField0_ = (bitField0_ & ~0x04000000); + profileDialogBg_ = null; + if (profileDialogBgBuilder_ != null) { + profileDialogBgBuilder_.dispose(); + profileDialogBgBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image profileDialogBg = 1002; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getProfileDialogBgBuilder() { + bitField0_ |= 0x04000000; + onChanged(); + return getProfileDialogBgFieldBuilder().getBuilder(); + } + /** + * .Image profileDialogBg = 1002; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getProfileDialogBgOrBuilder() { + if (profileDialogBgBuilder_ != null) { + return profileDialogBgBuilder_.getMessageOrBuilder(); + } else { + return profileDialogBg_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : profileDialogBg_; + } + } + /** + * .Image profileDialogBg = 1002; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getProfileDialogBgFieldBuilder() { + if (profileDialogBgBuilder_ == null) { + profileDialogBgBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getProfileDialogBg(), + getParentForChildren(), + isClean()); + profileDialogBg_ = null; + } + return profileDialogBgBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image profileDialogBgBack_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> profileDialogBgBackBuilder_; + /** + * .Image profileDialogBgBack = 1003; + * @return Whether the profileDialogBgBack field is set. + */ + public boolean hasProfileDialogBgBack() { + return ((bitField0_ & 0x08000000) != 0); + } + /** + * .Image profileDialogBgBack = 1003; + * @return The profileDialogBgBack. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getProfileDialogBgBack() { + if (profileDialogBgBackBuilder_ == null) { + return profileDialogBgBack_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : profileDialogBgBack_; + } else { + return profileDialogBgBackBuilder_.getMessage(); + } + } + /** + * .Image profileDialogBgBack = 1003; + */ + public Builder setProfileDialogBgBack(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (profileDialogBgBackBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + profileDialogBgBack_ = value; + } else { + profileDialogBgBackBuilder_.setMessage(value); + } + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + /** + * .Image profileDialogBgBack = 1003; + */ + public Builder setProfileDialogBgBack( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (profileDialogBgBackBuilder_ == null) { + profileDialogBgBack_ = builderForValue.build(); + } else { + profileDialogBgBackBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + /** + * .Image profileDialogBgBack = 1003; + */ + public Builder mergeProfileDialogBgBack(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (profileDialogBgBackBuilder_ == null) { + if (((bitField0_ & 0x08000000) != 0) && + profileDialogBgBack_ != null && + profileDialogBgBack_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getProfileDialogBgBackBuilder().mergeFrom(value); + } else { + profileDialogBgBack_ = value; + } + } else { + profileDialogBgBackBuilder_.mergeFrom(value); + } + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + /** + * .Image profileDialogBgBack = 1003; + */ + public Builder clearProfileDialogBgBack() { + bitField0_ = (bitField0_ & ~0x08000000); + profileDialogBgBack_ = null; + if (profileDialogBgBackBuilder_ != null) { + profileDialogBgBackBuilder_.dispose(); + profileDialogBgBackBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image profileDialogBgBack = 1003; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getProfileDialogBgBackBuilder() { + bitField0_ |= 0x08000000; + onChanged(); + return getProfileDialogBgBackFieldBuilder().getBuilder(); + } + /** + * .Image profileDialogBgBack = 1003; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getProfileDialogBgBackOrBuilder() { + if (profileDialogBgBackBuilder_ != null) { + return profileDialogBgBackBuilder_.getMessageOrBuilder(); + } else { + return profileDialogBgBack_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : profileDialogBgBack_; + } + } + /** + * .Image profileDialogBgBack = 1003; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getProfileDialogBgBackFieldBuilder() { + if (profileDialogBgBackBuilder_ == null) { + profileDialogBgBackBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getProfileDialogBgBack(), + getParentForChildren(), + isClean()); + profileDialogBgBack_ = null; + } + return profileDialogBgBackBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.PayGrade) + } + + // @@protoc_insertion_point(class_scope:User.PayGrade) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PayGrade parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PoiInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.PoiInfo) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.PoiInfo} + */ + public static final class PoiInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.PoiInfo) + PoiInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use PoiInfo.newBuilder() to construct. + private PoiInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PoiInfo() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PoiInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PoiInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PoiInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.PoiInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.PoiInfo) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PoiInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PoiInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_PoiInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.PoiInfo) + } + + // @@protoc_insertion_point(class_scope:User.PoiInfo) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PoiInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ProfileStyleParamsOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.ProfileStyleParams) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.ProfileStyleParams} + */ + public static final class ProfileStyleParams extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.ProfileStyleParams) + ProfileStyleParamsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProfileStyleParams.newBuilder() to construct. + private ProfileStyleParams(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ProfileStyleParams() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ProfileStyleParams(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_ProfileStyleParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_ProfileStyleParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.ProfileStyleParams} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.ProfileStyleParams) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_ProfileStyleParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_ProfileStyleParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_ProfileStyleParams_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.ProfileStyleParams) + } + + // @@protoc_insertion_point(class_scope:User.ProfileStyleParams) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProfileStyleParams parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SubscribeOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.Subscribe) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.Subscribe} + */ + public static final class Subscribe extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.Subscribe) + SubscribeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Subscribe.newBuilder() to construct. + private Subscribe(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Subscribe() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Subscribe(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_Subscribe_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_Subscribe_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.Subscribe} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.Subscribe) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.SubscribeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_Subscribe_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_Subscribe_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_Subscribe_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.Subscribe) + } + + // @@protoc_insertion_point(class_scope:User.Subscribe) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Subscribe parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface UserAttrOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.UserAttr) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.UserAttr} + */ + public static final class UserAttr extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.UserAttr) + UserAttrOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserAttr.newBuilder() to construct. + private UserAttr(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UserAttr() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UserAttr(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserAttr_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserAttr_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.UserAttr} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.UserAttr) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttrOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserAttr_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserAttr_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserAttr_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.UserAttr) + } + + // @@protoc_insertion_point(class_scope:User.UserAttr) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserAttr parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface UserDressInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.UserDressInfo) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.UserDressInfo} + */ + public static final class UserDressInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.UserDressInfo) + UserDressInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserDressInfo.newBuilder() to construct. + private UserDressInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UserDressInfo() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UserDressInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserDressInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserDressInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.UserDressInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.UserDressInfo) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserDressInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserDressInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserDressInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.UserDressInfo) + } + + // @@protoc_insertion_point(class_scope:User.UserDressInfo) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserDressInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface UserVIPInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.UserVIPInfo) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.UserVIPInfo} + */ + public static final class UserVIPInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.UserVIPInfo) + UserVIPInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserVIPInfo.newBuilder() to construct. + private UserVIPInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UserVIPInfo() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UserVIPInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserVIPInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserVIPInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.UserVIPInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.UserVIPInfo) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserVIPInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserVIPInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserVIPInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.UserVIPInfo) + } + + // @@protoc_insertion_point(class_scope:User.UserVIPInfo) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserVIPInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface UserStatsOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.UserStats) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.UserStats} + */ + public static final class UserStats extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.UserStats) + UserStatsOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserStats.newBuilder() to construct. + private UserStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UserStats() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UserStats(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.UserStats} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.UserStats) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_UserStats_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.UserStats) + } + + // @@protoc_insertion_point(class_scope:User.UserStats) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface XiguaParamsOrBuilder extends + // @@protoc_insertion_point(interface_extends:User.XiguaParams) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code User.XiguaParams} + */ + public static final class XiguaParams extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:User.XiguaParams) + XiguaParamsOrBuilder { + private static final long serialVersionUID = 0L; + // Use XiguaParams.newBuilder() to construct. + private XiguaParams(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private XiguaParams() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new XiguaParams(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_XiguaParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_XiguaParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User.XiguaParams} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User.XiguaParams) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_XiguaParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_XiguaParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_XiguaParams_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User.XiguaParams) + } + + // @@protoc_insertion_point(class_scope:User.XiguaParams) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public XiguaParams parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_ = 0L; + /** + * uint64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int SHORTID_FIELD_NUMBER = 2; + private long shortId_ = 0L; + /** + * uint64 shortId = 2; + * @return The shortId. + */ + @java.lang.Override + public long getShortId() { + return shortId_; + } + + public static final int NICKNAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object nickname_ = ""; + /** + * string nickname = 3; + * @return The nickname. + */ + @java.lang.Override + public java.lang.String getNickname() { + java.lang.Object ref = nickname_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nickname_ = s; + return s; + } + } + /** + * string nickname = 3; + * @return The bytes for nickname. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNicknameBytes() { + java.lang.Object ref = nickname_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GENDER_FIELD_NUMBER = 4; + private int gender_ = 0; + /** + * uint32 gender = 4; + * @return The gender. + */ + @java.lang.Override + public int getGender() { + return gender_; + } + + public static final int SIGNATURE_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object signature_ = ""; + /** + * string signature = 5; + * @return The signature. + */ + @java.lang.Override + public java.lang.String getSignature() { + java.lang.Object ref = signature_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + signature_ = s; + return s; + } + } + /** + * string signature = 5; + * @return The bytes for signature. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSignatureBytes() { + java.lang.Object ref = signature_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + signature_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LEVEL_FIELD_NUMBER = 6; + private int level_ = 0; + /** + * uint32 level = 6; + * @return The level. + */ + @java.lang.Override + public int getLevel() { + return level_; + } + + public static final int BIRTHDAY_FIELD_NUMBER = 7; + private long birthday_ = 0L; + /** + * uint64 birthday = 7; + * @return The birthday. + */ + @java.lang.Override + public long getBirthday() { + return birthday_; + } + + public static final int TELEPHONE_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private volatile java.lang.Object telephone_ = ""; + /** + * string telephone = 8; + * @return The telephone. + */ + @java.lang.Override + public java.lang.String getTelephone() { + java.lang.Object ref = telephone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + telephone_ = s; + return s; + } + } + /** + * string telephone = 8; + * @return The bytes for telephone. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTelephoneBytes() { + java.lang.Object ref = telephone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + telephone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AVATARTHUMB_FIELD_NUMBER = 9; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image avatarThumb_; + /** + * .Image avatarThumb = 9; + * @return Whether the avatarThumb field is set. + */ + @java.lang.Override + public boolean hasAvatarThumb() { + return avatarThumb_ != null; + } + /** + * .Image avatarThumb = 9; + * @return The avatarThumb. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarThumb() { + return avatarThumb_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarThumb_; + } + /** + * .Image avatarThumb = 9; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarThumbOrBuilder() { + return avatarThumb_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarThumb_; + } + + public static final int AVATARMEDIUM_FIELD_NUMBER = 10; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image avatarMedium_; + /** + * .Image avatarMedium = 10; + * @return Whether the avatarMedium field is set. + */ + @java.lang.Override + public boolean hasAvatarMedium() { + return avatarMedium_ != null; + } + /** + * .Image avatarMedium = 10; + * @return The avatarMedium. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarMedium() { + return avatarMedium_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarMedium_; + } + /** + * .Image avatarMedium = 10; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarMediumOrBuilder() { + return avatarMedium_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarMedium_; + } + + public static final int AVATARLARGE_FIELD_NUMBER = 11; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image avatarLarge_; + /** + * .Image avatarLarge = 11; + * @return Whether the avatarLarge field is set. + */ + @java.lang.Override + public boolean hasAvatarLarge() { + return avatarLarge_ != null; + } + /** + * .Image avatarLarge = 11; + * @return The avatarLarge. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarLarge() { + return avatarLarge_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarLarge_; + } + /** + * .Image avatarLarge = 11; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarLargeOrBuilder() { + return avatarLarge_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarLarge_; + } + + public static final int VERIFIED_FIELD_NUMBER = 12; + private boolean verified_ = false; + /** + * bool verified = 12; + * @return The verified. + */ + @java.lang.Override + public boolean getVerified() { + return verified_; + } + + public static final int EXPERIENCE_FIELD_NUMBER = 13; + private int experience_ = 0; + /** + * int32 experience = 13; + * @return The experience. + */ + @java.lang.Override + public int getExperience() { + return experience_; + } + + public static final int CITY_FIELD_NUMBER = 14; + @SuppressWarnings("serial") + private volatile java.lang.Object city_ = ""; + /** + * string city = 14; + * @return The city. + */ + @java.lang.Override + public java.lang.String getCity() { + java.lang.Object ref = city_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + city_ = s; + return s; + } + } + /** + * string city = 14; + * @return The bytes for city. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCityBytes() { + java.lang.Object ref = city_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + city_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 15; + private int status_ = 0; + /** + * int32 status = 15; + * @return The status. + */ + @java.lang.Override + public int getStatus() { + return status_; + } + + public static final int CREATETIME_FIELD_NUMBER = 16; + private long createTime_ = 0L; + /** + * int64 createTime = 16; + * @return The createTime. + */ + @java.lang.Override + public long getCreateTime() { + return createTime_; + } + + public static final int MODIFYTIME_FIELD_NUMBER = 17; + private long modifyTime_ = 0L; + /** + * int64 modifyTime = 17; + * @return The modifyTime. + */ + @java.lang.Override + public long getModifyTime() { + return modifyTime_; + } + + public static final int SECRET_FIELD_NUMBER = 18; + private int secret_ = 0; + /** + * int32 secret = 18; + * @return The secret. + */ + @java.lang.Override + public int getSecret() { + return secret_; + } + + public static final int SHAREQRCODEURI_FIELD_NUMBER = 19; + @SuppressWarnings("serial") + private volatile java.lang.Object shareQrcodeUri_ = ""; + /** + * string shareQrcodeUri = 19; + * @return The shareQrcodeUri. + */ + @java.lang.Override + public java.lang.String getShareQrcodeUri() { + java.lang.Object ref = shareQrcodeUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shareQrcodeUri_ = s; + return s; + } + } + /** + * string shareQrcodeUri = 19; + * @return The bytes for shareQrcodeUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getShareQrcodeUriBytes() { + java.lang.Object ref = shareQrcodeUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + shareQrcodeUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INCOMESHAREPERCENT_FIELD_NUMBER = 20; + private int incomeSharePercent_ = 0; + /** + * int32 incomeSharePercent = 20; + * @return The incomeSharePercent. + */ + @java.lang.Override + public int getIncomeSharePercent() { + return incomeSharePercent_; + } + + public static final int BADGEIMAGELISTLIST_FIELD_NUMBER = 21; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image badgeImageListList_; + /** + * .Image badgeImageListList = 21; + * @return Whether the badgeImageListList field is set. + */ + @java.lang.Override + public boolean hasBadgeImageListList() { + return badgeImageListList_ != null; + } + /** + * .Image badgeImageListList = 21; + * @return The badgeImageListList. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBadgeImageListList() { + return badgeImageListList_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : badgeImageListList_; + } + /** + * .Image badgeImageListList = 21; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBadgeImageListListOrBuilder() { + return badgeImageListList_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : badgeImageListList_; + } + + public static final int FOLLOWINFO_FIELD_NUMBER = 22; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo followInfo_; + /** + * .User.FollowInfo followInfo = 22; + * @return Whether the followInfo field is set. + */ + @java.lang.Override + public boolean hasFollowInfo() { + return followInfo_ != null; + } + /** + * .User.FollowInfo followInfo = 22; + * @return The followInfo. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo getFollowInfo() { + return followInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.getDefaultInstance() : followInfo_; + } + /** + * .User.FollowInfo followInfo = 22; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfoOrBuilder getFollowInfoOrBuilder() { + return followInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.getDefaultInstance() : followInfo_; + } + + public static final int PAYGRADE_FIELD_NUMBER = 23; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade payGrade_; + /** + * .User.PayGrade payGrade = 23; + * @return Whether the payGrade field is set. + */ + @java.lang.Override + public boolean hasPayGrade() { + return payGrade_ != null; + } + /** + * .User.PayGrade payGrade = 23; + * @return The payGrade. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade getPayGrade() { + return payGrade_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.getDefaultInstance() : payGrade_; + } + /** + * .User.PayGrade payGrade = 23; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGradeOrBuilder getPayGradeOrBuilder() { + return payGrade_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.getDefaultInstance() : payGrade_; + } + + public static final int FANSCLUB_FIELD_NUMBER = 24; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub fansClub_; + /** + * .User.FansClub fansClub = 24; + * @return Whether the fansClub field is set. + */ + @java.lang.Override + public boolean hasFansClub() { + return fansClub_ != null; + } + /** + * .User.FansClub fansClub = 24; + * @return The fansClub. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub getFansClub() { + return fansClub_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.getDefaultInstance() : fansClub_; + } + /** + * .User.FansClub fansClub = 24; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClubOrBuilder getFansClubOrBuilder() { + return fansClub_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.getDefaultInstance() : fansClub_; + } + + public static final int BORDER_FIELD_NUMBER = 25; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border border_; + /** + * .User.Border border = 25; + * @return Whether the border field is set. + */ + @java.lang.Override + public boolean hasBorder() { + return border_ != null; + } + /** + * .User.Border border = 25; + * @return The border. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border getBorder() { + return border_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.getDefaultInstance() : border_; + } + /** + * .User.Border border = 25; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BorderOrBuilder getBorderOrBuilder() { + return border_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.getDefaultInstance() : border_; + } + + public static final int SPECIALID_FIELD_NUMBER = 26; + @SuppressWarnings("serial") + private volatile java.lang.Object specialId_ = ""; + /** + * string specialId = 26; + * @return The specialId. + */ + @java.lang.Override + public java.lang.String getSpecialId() { + java.lang.Object ref = specialId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + specialId_ = s; + return s; + } + } + /** + * string specialId = 26; + * @return The bytes for specialId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSpecialIdBytes() { + java.lang.Object ref = specialId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + specialId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AVATARBORDER_FIELD_NUMBER = 27; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image avatarBorder_; + /** + * .Image avatarBorder = 27; + * @return Whether the avatarBorder field is set. + */ + @java.lang.Override + public boolean hasAvatarBorder() { + return avatarBorder_ != null; + } + /** + * .Image avatarBorder = 27; + * @return The avatarBorder. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarBorder() { + return avatarBorder_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarBorder_; + } + /** + * .Image avatarBorder = 27; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarBorderOrBuilder() { + return avatarBorder_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarBorder_; + } + + public static final int MEDAL_FIELD_NUMBER = 28; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image medal_; + /** + * .Image medal = 28; + * @return Whether the medal field is set. + */ + @java.lang.Override + public boolean hasMedal() { + return medal_ != null; + } + /** + * .Image medal = 28; + * @return The medal. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getMedal() { + return medal_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : medal_; + } + /** + * .Image medal = 28; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getMedalOrBuilder() { + return medal_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : medal_; + } + + public static final int REALTIMEICONSLIST_FIELD_NUMBER = 29; + @SuppressWarnings("serial") + private java.util.List realTimeIconsList_; + /** + * repeated .Image realTimeIconsList = 29; + */ + @java.lang.Override + public java.util.List getRealTimeIconsListList() { + return realTimeIconsList_; + } + /** + * repeated .Image realTimeIconsList = 29; + */ + @java.lang.Override + public java.util.List + getRealTimeIconsListOrBuilderList() { + return realTimeIconsList_; + } + /** + * repeated .Image realTimeIconsList = 29; + */ + @java.lang.Override + public int getRealTimeIconsListCount() { + return realTimeIconsList_.size(); + } + /** + * repeated .Image realTimeIconsList = 29; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getRealTimeIconsList(int index) { + return realTimeIconsList_.get(index); + } + /** + * repeated .Image realTimeIconsList = 29; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getRealTimeIconsListOrBuilder( + int index) { + return realTimeIconsList_.get(index); + } + + public static final int NEWREALTIMEICONSLIST_FIELD_NUMBER = 30; + @SuppressWarnings("serial") + private java.util.List newRealTimeIconsList_; + /** + * repeated .Image newRealTimeIconsList = 30; + */ + @java.lang.Override + public java.util.List getNewRealTimeIconsListList() { + return newRealTimeIconsList_; + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + @java.lang.Override + public java.util.List + getNewRealTimeIconsListOrBuilderList() { + return newRealTimeIconsList_; + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + @java.lang.Override + public int getNewRealTimeIconsListCount() { + return newRealTimeIconsList_.size(); + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getNewRealTimeIconsList(int index) { + return newRealTimeIconsList_.get(index); + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getNewRealTimeIconsListOrBuilder( + int index) { + return newRealTimeIconsList_.get(index); + } + + public static final int TOPVIPNO_FIELD_NUMBER = 31; + private long topVipNo_ = 0L; + /** + * int64 topVipNo = 31; + * @return The topVipNo. + */ + @java.lang.Override + public long getTopVipNo() { + return topVipNo_; + } + + public static final int USERATTR_FIELD_NUMBER = 32; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr userAttr_; + /** + * .User.UserAttr userAttr = 32; + * @return Whether the userAttr field is set. + */ + @java.lang.Override + public boolean hasUserAttr() { + return userAttr_ != null; + } + /** + * .User.UserAttr userAttr = 32; + * @return The userAttr. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr getUserAttr() { + return userAttr_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.getDefaultInstance() : userAttr_; + } + /** + * .User.UserAttr userAttr = 32; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttrOrBuilder getUserAttrOrBuilder() { + return userAttr_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.getDefaultInstance() : userAttr_; + } + + public static final int OWNROOM_FIELD_NUMBER = 33; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom ownRoom_; + /** + * .User.OwnRoom ownRoom = 33; + * @return Whether the ownRoom field is set. + */ + @java.lang.Override + public boolean hasOwnRoom() { + return ownRoom_ != null; + } + /** + * .User.OwnRoom ownRoom = 33; + * @return The ownRoom. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom getOwnRoom() { + return ownRoom_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.getDefaultInstance() : ownRoom_; + } + /** + * .User.OwnRoom ownRoom = 33; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoomOrBuilder getOwnRoomOrBuilder() { + return ownRoom_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.getDefaultInstance() : ownRoom_; + } + + public static final int PAYSCORE_FIELD_NUMBER = 34; + private long payScore_ = 0L; + /** + * int64 payScore = 34; + * @return The payScore. + */ + @java.lang.Override + public long getPayScore() { + return payScore_; + } + + public static final int TICKETCOUNT_FIELD_NUMBER = 35; + private long ticketCount_ = 0L; + /** + * int64 ticketCount = 35; + * @return The ticketCount. + */ + @java.lang.Override + public long getTicketCount() { + return ticketCount_; + } + + public static final int ANCHORINFO_FIELD_NUMBER = 36; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo anchorInfo_; + /** + * .User.AnchorInfo anchorInfo = 36; + * @return Whether the anchorInfo field is set. + */ + @java.lang.Override + public boolean hasAnchorInfo() { + return anchorInfo_ != null; + } + /** + * .User.AnchorInfo anchorInfo = 36; + * @return The anchorInfo. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo getAnchorInfo() { + return anchorInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.getDefaultInstance() : anchorInfo_; + } + /** + * .User.AnchorInfo anchorInfo = 36; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfoOrBuilder getAnchorInfoOrBuilder() { + return anchorInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.getDefaultInstance() : anchorInfo_; + } + + public static final int LINKMICSTATS_FIELD_NUMBER = 37; + private int linkMicStats_ = 0; + /** + * int32 linkMicStats = 37; + * @return The linkMicStats. + */ + @java.lang.Override + public int getLinkMicStats() { + return linkMicStats_; + } + + public static final int DISPLAYID_FIELD_NUMBER = 38; + @SuppressWarnings("serial") + private volatile java.lang.Object displayId_ = ""; + /** + * string displayId = 38; + * @return The displayId. + */ + @java.lang.Override + public java.lang.String getDisplayId() { + java.lang.Object ref = displayId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayId_ = s; + return s; + } + } + /** + * string displayId = 38; + * @return The bytes for displayId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDisplayIdBytes() { + java.lang.Object ref = displayId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WITHCOMMERCEPERMISSION_FIELD_NUMBER = 39; + private boolean withCommercePermission_ = false; + /** + * bool withCommercePermission = 39; + * @return The withCommercePermission. + */ + @java.lang.Override + public boolean getWithCommercePermission() { + return withCommercePermission_; + } + + public static final int WITHFUSIONSHOPENTRY_FIELD_NUMBER = 40; + private boolean withFusionShopEntry_ = false; + /** + * bool withFusionShopEntry = 40; + * @return The withFusionShopEntry. + */ + @java.lang.Override + public boolean getWithFusionShopEntry() { + return withFusionShopEntry_; + } + + public static final int TOTALRECHARGEDIAMONDCOUNT_FIELD_NUMBER = 41; + private long totalRechargeDiamondCount_ = 0L; + /** + * int64 totalRechargeDiamondCount = 41; + * @return The totalRechargeDiamondCount. + */ + @java.lang.Override + public long getTotalRechargeDiamondCount() { + return totalRechargeDiamondCount_; + } + + public static final int WEBCASTANCHORLEVEL_FIELD_NUMBER = 42; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel webcastAnchorLevel_; + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + * @return Whether the webcastAnchorLevel field is set. + */ + @java.lang.Override + public boolean hasWebcastAnchorLevel() { + return webcastAnchorLevel_ != null; + } + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + * @return The webcastAnchorLevel. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel getWebcastAnchorLevel() { + return webcastAnchorLevel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.getDefaultInstance() : webcastAnchorLevel_; + } + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevelOrBuilder getWebcastAnchorLevelOrBuilder() { + return webcastAnchorLevel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.getDefaultInstance() : webcastAnchorLevel_; + } + + public static final int VERIFIEDCONTENT_FIELD_NUMBER = 43; + @SuppressWarnings("serial") + private volatile java.lang.Object verifiedContent_ = ""; + /** + * string verifiedContent = 43; + * @return The verifiedContent. + */ + @java.lang.Override + public java.lang.String getVerifiedContent() { + java.lang.Object ref = verifiedContent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verifiedContent_ = s; + return s; + } + } + /** + * string verifiedContent = 43; + * @return The bytes for verifiedContent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVerifiedContentBytes() { + java.lang.Object ref = verifiedContent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + verifiedContent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTHORSTATS_FIELD_NUMBER = 44; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats authorStats_; + /** + * .User.AuthorStats authorStats = 44; + * @return Whether the authorStats field is set. + */ + @java.lang.Override + public boolean hasAuthorStats() { + return authorStats_ != null; + } + /** + * .User.AuthorStats authorStats = 44; + * @return The authorStats. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats getAuthorStats() { + return authorStats_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.getDefaultInstance() : authorStats_; + } + /** + * .User.AuthorStats authorStats = 44; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStatsOrBuilder getAuthorStatsOrBuilder() { + return authorStats_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.getDefaultInstance() : authorStats_; + } + + public static final int TOPFANSLIST_FIELD_NUMBER = 45; + @SuppressWarnings("serial") + private java.util.List topFansList_; + /** + * repeated .User topFansList = 45; + */ + @java.lang.Override + public java.util.List getTopFansListList() { + return topFansList_; + } + /** + * repeated .User topFansList = 45; + */ + @java.lang.Override + public java.util.List + getTopFansListOrBuilderList() { + return topFansList_; + } + /** + * repeated .User topFansList = 45; + */ + @java.lang.Override + public int getTopFansListCount() { + return topFansList_.size(); + } + /** + * repeated .User topFansList = 45; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getTopFansList(int index) { + return topFansList_.get(index); + } + /** + * repeated .User topFansList = 45; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getTopFansListOrBuilder( + int index) { + return topFansList_.get(index); + } + + public static final int SECUID_FIELD_NUMBER = 46; + @SuppressWarnings("serial") + private volatile java.lang.Object secUid_ = ""; + /** + * string secUid = 46; + * @return The secUid. + */ + @java.lang.Override + public java.lang.String getSecUid() { + java.lang.Object ref = secUid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secUid_ = s; + return s; + } + } + /** + * string secUid = 46; + * @return The bytes for secUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSecUidBytes() { + java.lang.Object ref = secUid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + secUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERROLE_FIELD_NUMBER = 47; + private int userRole_ = 0; + /** + * int32 userRole = 47; + * @return The userRole. + */ + @java.lang.Override + public int getUserRole() { + return userRole_; + } + + public static final int XIGUAINFO_FIELD_NUMBER = 48; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams xiguaInfo_; + /** + * .User.XiguaParams xiguaInfo = 48; + * @return Whether the xiguaInfo field is set. + */ + @java.lang.Override + public boolean hasXiguaInfo() { + return xiguaInfo_ != null; + } + /** + * .User.XiguaParams xiguaInfo = 48; + * @return The xiguaInfo. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams getXiguaInfo() { + return xiguaInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.getDefaultInstance() : xiguaInfo_; + } + /** + * .User.XiguaParams xiguaInfo = 48; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParamsOrBuilder getXiguaInfoOrBuilder() { + return xiguaInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.getDefaultInstance() : xiguaInfo_; + } + + public static final int ACTIVITYREWARD_FIELD_NUMBER = 49; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo activityReward_; + /** + * .User.ActivityInfo activityReward = 49; + * @return Whether the activityReward field is set. + */ + @java.lang.Override + public boolean hasActivityReward() { + return activityReward_ != null; + } + /** + * .User.ActivityInfo activityReward = 49; + * @return The activityReward. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo getActivityReward() { + return activityReward_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.getDefaultInstance() : activityReward_; + } + /** + * .User.ActivityInfo activityReward = 49; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfoOrBuilder getActivityRewardOrBuilder() { + return activityReward_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.getDefaultInstance() : activityReward_; + } + + public static final int NOBLEINFO_FIELD_NUMBER = 50; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo nobleInfo_; + /** + * .User.NobleLevelInfo nobleInfo = 50; + * @return Whether the nobleInfo field is set. + */ + @java.lang.Override + public boolean hasNobleInfo() { + return nobleInfo_ != null; + } + /** + * .User.NobleLevelInfo nobleInfo = 50; + * @return The nobleInfo. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo getNobleInfo() { + return nobleInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.getDefaultInstance() : nobleInfo_; + } + /** + * .User.NobleLevelInfo nobleInfo = 50; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfoOrBuilder getNobleInfoOrBuilder() { + return nobleInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.getDefaultInstance() : nobleInfo_; + } + + public static final int BROTHERHOODINFO_FIELD_NUMBER = 51; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo brotherhoodInfo_; + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + * @return Whether the brotherhoodInfo field is set. + */ + @java.lang.Override + public boolean hasBrotherhoodInfo() { + return brotherhoodInfo_ != null; + } + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + * @return The brotherhoodInfo. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo getBrotherhoodInfo() { + return brotherhoodInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.getDefaultInstance() : brotherhoodInfo_; + } + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfoOrBuilder getBrotherhoodInfoOrBuilder() { + return brotherhoodInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.getDefaultInstance() : brotherhoodInfo_; + } + + public static final int PERSONALCARD_FIELD_NUMBER = 52; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image personalCard_; + /** + * .Image personalCard = 52; + * @return Whether the personalCard field is set. + */ + @java.lang.Override + public boolean hasPersonalCard() { + return personalCard_ != null; + } + /** + * .Image personalCard = 52; + * @return The personalCard. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getPersonalCard() { + return personalCard_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : personalCard_; + } + /** + * .Image personalCard = 52; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getPersonalCardOrBuilder() { + return personalCard_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : personalCard_; + } + + public static final int AUTHENTICATIONINFO_FIELD_NUMBER = 53; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo authenticationInfo_; + /** + * .User.AuthenticationInfo authenticationInfo = 53; + * @return Whether the authenticationInfo field is set. + */ + @java.lang.Override + public boolean hasAuthenticationInfo() { + return authenticationInfo_ != null; + } + /** + * .User.AuthenticationInfo authenticationInfo = 53; + * @return The authenticationInfo. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo getAuthenticationInfo() { + return authenticationInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.getDefaultInstance() : authenticationInfo_; + } + /** + * .User.AuthenticationInfo authenticationInfo = 53; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfoOrBuilder getAuthenticationInfoOrBuilder() { + return authenticationInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.getDefaultInstance() : authenticationInfo_; + } + + public static final int AUTHORIZATIONINFO_FIELD_NUMBER = 54; + private int authorizationInfo_ = 0; + /** + * int32 authorizationInfo = 54; + * @return The authorizationInfo. + */ + @java.lang.Override + public int getAuthorizationInfo() { + return authorizationInfo_; + } + + public static final int ADVERSARYAUTHORIZATIONINFO_FIELD_NUMBER = 55; + private int adversaryAuthorizationInfo_ = 0; + /** + * int32 adversaryAuthorizationInfo = 55; + * @return The adversaryAuthorizationInfo. + */ + @java.lang.Override + public int getAdversaryAuthorizationInfo() { + return adversaryAuthorizationInfo_; + } + + public static final int POIINFO_FIELD_NUMBER = 56; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo poiInfo_; + /** + * .User.PoiInfo poiInfo = 56; + * @return Whether the poiInfo field is set. + */ + @java.lang.Override + public boolean hasPoiInfo() { + return poiInfo_ != null; + } + /** + * .User.PoiInfo poiInfo = 56; + * @return The poiInfo. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo getPoiInfo() { + return poiInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.getDefaultInstance() : poiInfo_; + } + /** + * .User.PoiInfo poiInfo = 56; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfoOrBuilder getPoiInfoOrBuilder() { + return poiInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.getDefaultInstance() : poiInfo_; + } + + public static final int MEDIABADGEIMAGELISTLIST_FIELD_NUMBER = 57; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image mediaBadgeImageListList_; + /** + * .Image mediaBadgeImageListList = 57; + * @return Whether the mediaBadgeImageListList field is set. + */ + @java.lang.Override + public boolean hasMediaBadgeImageListList() { + return mediaBadgeImageListList_ != null; + } + /** + * .Image mediaBadgeImageListList = 57; + * @return The mediaBadgeImageListList. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getMediaBadgeImageListList() { + return mediaBadgeImageListList_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : mediaBadgeImageListList_; + } + /** + * .Image mediaBadgeImageListList = 57; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getMediaBadgeImageListListOrBuilder() { + return mediaBadgeImageListList_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : mediaBadgeImageListList_; + } + + public static final int ADVERSARYUSERSTATUS_FIELD_NUMBER = 58; + private int adversaryUserStatus_ = 0; + /** + * int32 adversaryUserStatus = 58; + * @return The adversaryUserStatus. + */ + @java.lang.Override + public int getAdversaryUserStatus() { + return adversaryUserStatus_; + } + + public static final int USERVIPINFO_FIELD_NUMBER = 59; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo userVipInfo_; + /** + * .User.UserVIPInfo userVipInfo = 59; + * @return Whether the userVipInfo field is set. + */ + @java.lang.Override + public boolean hasUserVipInfo() { + return userVipInfo_ != null; + } + /** + * .User.UserVIPInfo userVipInfo = 59; + * @return The userVipInfo. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo getUserVipInfo() { + return userVipInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.getDefaultInstance() : userVipInfo_; + } + /** + * .User.UserVIPInfo userVipInfo = 59; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfoOrBuilder getUserVipInfoOrBuilder() { + return userVipInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.getDefaultInstance() : userVipInfo_; + } + + public static final int COMMERCEWEBCASTCONFIGIDSLIST_FIELD_NUMBER = 60; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList commerceWebcastConfigIdsList_; + /** + * repeated int64 commerceWebcastConfigIdsList = 60; + * @return A list containing the commerceWebcastConfigIdsList. + */ + @java.lang.Override + public java.util.List + getCommerceWebcastConfigIdsListList() { + return commerceWebcastConfigIdsList_; + } + /** + * repeated int64 commerceWebcastConfigIdsList = 60; + * @return The count of commerceWebcastConfigIdsList. + */ + public int getCommerceWebcastConfigIdsListCount() { + return commerceWebcastConfigIdsList_.size(); + } + /** + * repeated int64 commerceWebcastConfigIdsList = 60; + * @param index The index of the element to return. + * @return The commerceWebcastConfigIdsList at the given index. + */ + public long getCommerceWebcastConfigIdsList(int index) { + return commerceWebcastConfigIdsList_.getLong(index); + } + private int commerceWebcastConfigIdsListMemoizedSerializedSize = -1; + + public static final int BADGEIMAGELISTV2LIST_FIELD_NUMBER = 61; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image badgeImageListV2List_; + /** + * .Image badgeImageListV2List = 61; + * @return Whether the badgeImageListV2List field is set. + */ + @java.lang.Override + public boolean hasBadgeImageListV2List() { + return badgeImageListV2List_ != null; + } + /** + * .Image badgeImageListV2List = 61; + * @return The badgeImageListV2List. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBadgeImageListV2List() { + return badgeImageListV2List_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : badgeImageListV2List_; + } + /** + * .Image badgeImageListV2List = 61; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBadgeImageListV2ListOrBuilder() { + return badgeImageListV2List_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : badgeImageListV2List_; + } + + public static final int LOCATIONCITY_FIELD_NUMBER = 63; + @SuppressWarnings("serial") + private volatile java.lang.Object locationCity_ = ""; + /** + *
+     * IndustryCertification  industryCertification = 62;
+     * 
+ * + * string locationCity = 63; + * @return The locationCity. + */ + @java.lang.Override + public java.lang.String getLocationCity() { + java.lang.Object ref = locationCity_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationCity_ = s; + return s; + } + } + /** + *
+     * IndustryCertification  industryCertification = 62;
+     * 
+ * + * string locationCity = 63; + * @return The bytes for locationCity. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLocationCityBytes() { + java.lang.Object ref = locationCity_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + locationCity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FANSGROUPINFO_FIELD_NUMBER = 64; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo fansGroupInfo_; + /** + * .User.FansGroupInfo fansGroupInfo = 64; + * @return Whether the fansGroupInfo field is set. + */ + @java.lang.Override + public boolean hasFansGroupInfo() { + return fansGroupInfo_ != null; + } + /** + * .User.FansGroupInfo fansGroupInfo = 64; + * @return The fansGroupInfo. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo getFansGroupInfo() { + return fansGroupInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.getDefaultInstance() : fansGroupInfo_; + } + /** + * .User.FansGroupInfo fansGroupInfo = 64; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfoOrBuilder getFansGroupInfoOrBuilder() { + return fansGroupInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.getDefaultInstance() : fansGroupInfo_; + } + + public static final int REMARKNAME_FIELD_NUMBER = 65; + @SuppressWarnings("serial") + private volatile java.lang.Object remarkName_ = ""; + /** + * string remarkName = 65; + * @return The remarkName. + */ + @java.lang.Override + public java.lang.String getRemarkName() { + java.lang.Object ref = remarkName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remarkName_ = s; + return s; + } + } + /** + * string remarkName = 65; + * @return The bytes for remarkName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRemarkNameBytes() { + java.lang.Object ref = remarkName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + remarkName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MYSTERYMAN_FIELD_NUMBER = 66; + private int mysteryMan_ = 0; + /** + * int32 mysteryMan = 66; + * @return The mysteryMan. + */ + @java.lang.Override + public int getMysteryMan() { + return mysteryMan_; + } + + public static final int WEBRID_FIELD_NUMBER = 67; + @SuppressWarnings("serial") + private volatile java.lang.Object webRid_ = ""; + /** + * string webRid = 67; + * @return The webRid. + */ + @java.lang.Override + public java.lang.String getWebRid() { + java.lang.Object ref = webRid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + webRid_ = s; + return s; + } + } + /** + * string webRid = 67; + * @return The bytes for webRid. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getWebRidBytes() { + java.lang.Object ref = webRid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + webRid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESENSITIZEDNICKNAME_FIELD_NUMBER = 68; + @SuppressWarnings("serial") + private volatile java.lang.Object desensitizedNickname_ = ""; + /** + * string desensitizedNickname = 68; + * @return The desensitizedNickname. + */ + @java.lang.Override + public java.lang.String getDesensitizedNickname() { + java.lang.Object ref = desensitizedNickname_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + desensitizedNickname_ = s; + return s; + } + } + /** + * string desensitizedNickname = 68; + * @return The bytes for desensitizedNickname. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDesensitizedNicknameBytes() { + java.lang.Object ref = desensitizedNickname_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + desensitizedNickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int JACCREDITINFO_FIELD_NUMBER = 69; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo jAccreditInfo_; + /** + * .User.JAccreditInfo jAccreditInfo = 69; + * @return Whether the jAccreditInfo field is set. + */ + @java.lang.Override + public boolean hasJAccreditInfo() { + return jAccreditInfo_ != null; + } + /** + * .User.JAccreditInfo jAccreditInfo = 69; + * @return The jAccreditInfo. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo getJAccreditInfo() { + return jAccreditInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.getDefaultInstance() : jAccreditInfo_; + } + /** + * .User.JAccreditInfo jAccreditInfo = 69; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfoOrBuilder getJAccreditInfoOrBuilder() { + return jAccreditInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.getDefaultInstance() : jAccreditInfo_; + } + + public static final int SUBSCRIBE_FIELD_NUMBER = 70; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe subscribe_; + /** + * .User.Subscribe subscribe = 70; + * @return Whether the subscribe field is set. + */ + @java.lang.Override + public boolean hasSubscribe() { + return subscribe_ != null; + } + /** + * .User.Subscribe subscribe = 70; + * @return The subscribe. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe getSubscribe() { + return subscribe_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.getDefaultInstance() : subscribe_; + } + /** + * .User.Subscribe subscribe = 70; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.SubscribeOrBuilder getSubscribeOrBuilder() { + return subscribe_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.getDefaultInstance() : subscribe_; + } + + public static final int ISANONYMOUS_FIELD_NUMBER = 71; + private boolean isAnonymous_ = false; + /** + * bool isAnonymous = 71; + * @return The isAnonymous. + */ + @java.lang.Override + public boolean getIsAnonymous() { + return isAnonymous_; + } + + public static final int CONSUMEDIAMONDLEVEL_FIELD_NUMBER = 72; + private int consumeDiamondLevel_ = 0; + /** + * int32 consumeDiamondLevel = 72; + * @return The consumeDiamondLevel. + */ + @java.lang.Override + public int getConsumeDiamondLevel() { + return consumeDiamondLevel_; + } + + public static final int WEBCASTUID_FIELD_NUMBER = 73; + @SuppressWarnings("serial") + private volatile java.lang.Object webcastUid_ = ""; + /** + * string webcastUid = 73; + * @return The webcastUid. + */ + @java.lang.Override + public java.lang.String getWebcastUid() { + java.lang.Object ref = webcastUid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + webcastUid_ = s; + return s; + } + } + /** + * string webcastUid = 73; + * @return The bytes for webcastUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getWebcastUidBytes() { + java.lang.Object ref = webcastUid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + webcastUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROFILESTYLEPARAMS_FIELD_NUMBER = 74; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams profileStyleParams_; + /** + * .User.ProfileStyleParams profileStyleParams = 74; + * @return Whether the profileStyleParams field is set. + */ + @java.lang.Override + public boolean hasProfileStyleParams() { + return profileStyleParams_ != null; + } + /** + * .User.ProfileStyleParams profileStyleParams = 74; + * @return The profileStyleParams. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams getProfileStyleParams() { + return profileStyleParams_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.getDefaultInstance() : profileStyleParams_; + } + /** + * .User.ProfileStyleParams profileStyleParams = 74; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParamsOrBuilder getProfileStyleParamsOrBuilder() { + return profileStyleParams_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.getDefaultInstance() : profileStyleParams_; + } + + public static final int USERDRESSINFO_FIELD_NUMBER = 75; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo userDressInfo_; + /** + * .User.UserDressInfo userDressInfo = 75; + * @return Whether the userDressInfo field is set. + */ + @java.lang.Override + public boolean hasUserDressInfo() { + return userDressInfo_ != null; + } + /** + * .User.UserDressInfo userDressInfo = 75; + * @return The userDressInfo. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo getUserDressInfo() { + return userDressInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.getDefaultInstance() : userDressInfo_; + } + /** + * .User.UserDressInfo userDressInfo = 75; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfoOrBuilder getUserDressInfoOrBuilder() { + return userDressInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.getDefaultInstance() : userDressInfo_; + } + + public static final int ALLOWBELOCATED_FIELD_NUMBER = 1001; + private boolean allowBeLocated_ = false; + /** + * bool allowBeLocated = 1001; + * @return The allowBeLocated. + */ + @java.lang.Override + public boolean getAllowBeLocated() { + return allowBeLocated_; + } + + public static final int ALLOWFINDBYCONTACTS_FIELD_NUMBER = 1002; + private boolean allowFindByContacts_ = false; + /** + * bool allowFindByContacts = 1002; + * @return The allowFindByContacts. + */ + @java.lang.Override + public boolean getAllowFindByContacts() { + return allowFindByContacts_; + } + + public static final int ALLOWOTHERSDOWNLOADVIDEO_FIELD_NUMBER = 1003; + private boolean allowOthersDownloadVideo_ = false; + /** + * bool allowOthersDownloadVideo = 1003; + * @return The allowOthersDownloadVideo. + */ + @java.lang.Override + public boolean getAllowOthersDownloadVideo() { + return allowOthersDownloadVideo_; + } + + public static final int ALLOWOTHERSDOWNLOADWHENSHARINGVIDEO_FIELD_NUMBER = 1004; + private boolean allowOthersDownloadWhenSharingVideo_ = false; + /** + * bool allowOthersDownloadWhenSharingVideo = 1004; + * @return The allowOthersDownloadWhenSharingVideo. + */ + @java.lang.Override + public boolean getAllowOthersDownloadWhenSharingVideo() { + return allowOthersDownloadWhenSharingVideo_; + } + + public static final int ALLOWSHARESHOWPROFILE_FIELD_NUMBER = 1005; + private boolean allowShareShowProfile_ = false; + /** + * bool allowShareShowProfile = 1005; + * @return The allowShareShowProfile. + */ + @java.lang.Override + public boolean getAllowShareShowProfile() { + return allowShareShowProfile_; + } + + public static final int ALLOWSHOWINGOSSIP_FIELD_NUMBER = 1006; + private boolean allowShowInGossip_ = false; + /** + * bool allowShowInGossip = 1006; + * @return The allowShowInGossip. + */ + @java.lang.Override + public boolean getAllowShowInGossip() { + return allowShowInGossip_; + } + + public static final int ALLOWSHOWMYACTION_FIELD_NUMBER = 1007; + private boolean allowShowMyAction_ = false; + /** + * bool allowShowMyAction = 1007; + * @return The allowShowMyAction. + */ + @java.lang.Override + public boolean getAllowShowMyAction() { + return allowShowMyAction_; + } + + public static final int ALLOWSTRANGECOMMENT_FIELD_NUMBER = 1008; + private boolean allowStrangeComment_ = false; + /** + * bool allowStrangeComment = 1008; + * @return The allowStrangeComment. + */ + @java.lang.Override + public boolean getAllowStrangeComment() { + return allowStrangeComment_; + } + + public static final int ALLOWUNFOLLOWERCOMMENT_FIELD_NUMBER = 1009; + private boolean allowUnfollowerComment_ = false; + /** + * bool allowUnfollowerComment = 1009; + * @return The allowUnfollowerComment. + */ + @java.lang.Override + public boolean getAllowUnfollowerComment() { + return allowUnfollowerComment_; + } + + public static final int ALLOWUSELINKMIC_FIELD_NUMBER = 1010; + private boolean allowUseLinkmic_ = false; + /** + * bool allowUseLinkmic = 1010; + * @return The allowUseLinkmic. + */ + @java.lang.Override + public boolean getAllowUseLinkmic() { + return allowUseLinkmic_; + } + + public static final int ANCHORLEVEL_FIELD_NUMBER = 1011; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel anchorLevel_; + /** + * .User.AnchorLevel anchorLevel = 1011; + * @return Whether the anchorLevel field is set. + */ + @java.lang.Override + public boolean hasAnchorLevel() { + return anchorLevel_ != null; + } + /** + * .User.AnchorLevel anchorLevel = 1011; + * @return The anchorLevel. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel getAnchorLevel() { + return anchorLevel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.getDefaultInstance() : anchorLevel_; + } + /** + * .User.AnchorLevel anchorLevel = 1011; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevelOrBuilder getAnchorLevelOrBuilder() { + return anchorLevel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.getDefaultInstance() : anchorLevel_; + } + + public static final int AVATARJPG_FIELD_NUMBER = 1012; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image avatarJpg_; + /** + * .Image avatarJpg = 1012; + * @return Whether the avatarJpg field is set. + */ + @java.lang.Override + public boolean hasAvatarJpg() { + return avatarJpg_ != null; + } + /** + * .Image avatarJpg = 1012; + * @return The avatarJpg. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarJpg() { + return avatarJpg_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarJpg_; + } + /** + * .Image avatarJpg = 1012; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarJpgOrBuilder() { + return avatarJpg_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarJpg_; + } + + public static final int BGIMGURL_FIELD_NUMBER = 1013; + @SuppressWarnings("serial") + private volatile java.lang.Object bgImgUrl_ = ""; + /** + * string bgImgUrl = 1013; + * @return The bgImgUrl. + */ + @java.lang.Override + public java.lang.String getBgImgUrl() { + java.lang.Object ref = bgImgUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bgImgUrl_ = s; + return s; + } + } + /** + * string bgImgUrl = 1013; + * @return The bytes for bgImgUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBgImgUrlBytes() { + java.lang.Object ref = bgImgUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + bgImgUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BIRTHDAYDESCRIPTION_FIELD_NUMBER = 1014; + @SuppressWarnings("serial") + private volatile java.lang.Object birthdayDescription_ = ""; + /** + * string birthdayDescription = 1014; + * @return The birthdayDescription. + */ + @java.lang.Override + public java.lang.String getBirthdayDescription() { + java.lang.Object ref = birthdayDescription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + birthdayDescription_ = s; + return s; + } + } + /** + * string birthdayDescription = 1014; + * @return The bytes for birthdayDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBirthdayDescriptionBytes() { + java.lang.Object ref = birthdayDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + birthdayDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BIRTHDAYVALID_FIELD_NUMBER = 1015; + private boolean birthdayValid_ = false; + /** + * bool birthdayValid = 1015; + * @return The birthdayValid. + */ + @java.lang.Override + public boolean getBirthdayValid() { + return birthdayValid_; + } + + public static final int BLOCKSTATUS_FIELD_NUMBER = 1016; + private int blockStatus_ = 0; + /** + * int32 blockStatus = 1016; + * @return The blockStatus. + */ + @java.lang.Override + public int getBlockStatus() { + return blockStatus_; + } + + public static final int COMMENTRESTRICT_FIELD_NUMBER = 1017; + private int commentRestrict_ = 0; + /** + * int32 commentRestrict = 1017; + * @return The commentRestrict. + */ + @java.lang.Override + public int getCommentRestrict() { + return commentRestrict_; + } + + public static final int CONSTELLATION_FIELD_NUMBER = 1018; + @SuppressWarnings("serial") + private volatile java.lang.Object constellation_ = ""; + /** + * string constellation = 1018; + * @return The constellation. + */ + @java.lang.Override + public java.lang.String getConstellation() { + java.lang.Object ref = constellation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + constellation_ = s; + return s; + } + } + /** + * string constellation = 1018; + * @return The bytes for constellation. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getConstellationBytes() { + java.lang.Object ref = constellation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + constellation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISABLEICHAT_FIELD_NUMBER = 1019; + private int disableIchat_ = 0; + /** + * int32 disableIchat = 1019; + * @return The disableIchat. + */ + @java.lang.Override + public int getDisableIchat() { + return disableIchat_; + } + + public static final int ENABLEICHATIMG_FIELD_NUMBER = 1020; + private long enableIchatImg_ = 0L; + /** + * int64 enableIchatImg = 1020; + * @return The enableIchatImg. + */ + @java.lang.Override + public long getEnableIchatImg() { + return enableIchatImg_; + } + + public static final int EXP_FIELD_NUMBER = 1021; + private int exp_ = 0; + /** + * int32 exp = 1021; + * @return The exp. + */ + @java.lang.Override + public int getExp() { + return exp_; + } + + public static final int FANTICKETCOUNT_FIELD_NUMBER = 1022; + private long fanTicketCount_ = 0L; + /** + * int64 fanTicketCount = 1022; + * @return The fanTicketCount. + */ + @java.lang.Override + public long getFanTicketCount() { + return fanTicketCount_; + } + + public static final int FOLDSTRANGERCHAT_FIELD_NUMBER = 1023; + private boolean foldStrangerChat_ = false; + /** + * bool foldStrangerChat = 1023; + * @return The foldStrangerChat. + */ + @java.lang.Override + public boolean getFoldStrangerChat() { + return foldStrangerChat_; + } + + public static final int FOLLOWSTATUS_FIELD_NUMBER = 1024; + private long followStatus_ = 0L; + /** + * int64 followStatus = 1024; + * @return The followStatus. + */ + @java.lang.Override + public long getFollowStatus() { + return followStatus_; + } + + public static final int HOTSOONVERIFIED_FIELD_NUMBER = 1025; + private boolean hotsoonVerified_ = false; + /** + * bool hotsoonVerified = 1025; + * @return The hotsoonVerified. + */ + @java.lang.Override + public boolean getHotsoonVerified() { + return hotsoonVerified_; + } + + public static final int HOTSOONVERIFIEDREASON_FIELD_NUMBER = 1026; + @SuppressWarnings("serial") + private volatile java.lang.Object hotsoonVerifiedReason_ = ""; + /** + * string hotsoonVerifiedReason = 1026; + * @return The hotsoonVerifiedReason. + */ + @java.lang.Override + public java.lang.String getHotsoonVerifiedReason() { + java.lang.Object ref = hotsoonVerifiedReason_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hotsoonVerifiedReason_ = s; + return s; + } + } + /** + * string hotsoonVerifiedReason = 1026; + * @return The bytes for hotsoonVerifiedReason. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getHotsoonVerifiedReasonBytes() { + java.lang.Object ref = hotsoonVerifiedReason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + hotsoonVerifiedReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ICHATRESTRICTTYPE_FIELD_NUMBER = 1027; + private int ichatRestrictType_ = 0; + /** + * int32 ichatRestrictType = 1027; + * @return The ichatRestrictType. + */ + @java.lang.Override + public int getIchatRestrictType() { + return ichatRestrictType_; + } + + public static final int IDSTR_FIELD_NUMBER = 1028; + @SuppressWarnings("serial") + private volatile java.lang.Object idStr_ = ""; + /** + * string idStr = 1028; + * @return The idStr. + */ + @java.lang.Override + public java.lang.String getIdStr() { + java.lang.Object ref = idStr_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + idStr_ = s; + return s; + } + } + /** + * string idStr = 1028; + * @return The bytes for idStr. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdStrBytes() { + java.lang.Object ref = idStr_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + idStr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ISFOLLOWER_FIELD_NUMBER = 1029; + private boolean isFollower_ = false; + /** + * bool isFollower = 1029; + * @return The isFollower. + */ + @java.lang.Override + public boolean getIsFollower() { + return isFollower_; + } + + public static final int ISFOLLOWING_FIELD_NUMBER = 1030; + private boolean isFollowing_ = false; + /** + * bool isFollowing = 1030; + * @return The isFollowing. + */ + @java.lang.Override + public boolean getIsFollowing() { + return isFollowing_; + } + + public static final int NEEDPROFILEGUIDE_FIELD_NUMBER = 1031; + private boolean needProfileGuide_ = false; + /** + * bool needProfileGuide = 1031; + * @return The needProfileGuide. + */ + @java.lang.Override + public boolean getNeedProfileGuide() { + return needProfileGuide_; + } + + public static final int PAYSCORES_FIELD_NUMBER = 1032; + private long payScores_ = 0L; + /** + * int64 payScores = 1032; + * @return The payScores. + */ + @java.lang.Override + public long getPayScores() { + return payScores_; + } + + public static final int PUSHCOMMENTSTATUS_FIELD_NUMBER = 1033; + private boolean pushCommentStatus_ = false; + /** + * bool pushCommentStatus = 1033; + * @return The pushCommentStatus. + */ + @java.lang.Override + public boolean getPushCommentStatus() { + return pushCommentStatus_; + } + + public static final int PUSHDIGG_FIELD_NUMBER = 1034; + private boolean pushDigg_ = false; + /** + * bool pushDigg = 1034; + * @return The pushDigg. + */ + @java.lang.Override + public boolean getPushDigg() { + return pushDigg_; + } + + public static final int PUSHFOLLOW_FIELD_NUMBER = 1035; + private boolean pushFollow_ = false; + /** + * bool pushFollow = 1035; + * @return The pushFollow. + */ + @java.lang.Override + public boolean getPushFollow() { + return pushFollow_; + } + + public static final int PUSHFRIENDACTION_FIELD_NUMBER = 1036; + private boolean pushFriendAction_ = false; + /** + * bool pushFriendAction = 1036; + * @return The pushFriendAction. + */ + @java.lang.Override + public boolean getPushFriendAction() { + return pushFriendAction_; + } + + public static final int PUSHICHAT_FIELD_NUMBER = 1037; + private boolean pushIchat_ = false; + /** + * bool pushIchat = 1037; + * @return The pushIchat. + */ + @java.lang.Override + public boolean getPushIchat() { + return pushIchat_; + } + + public static final int PUSHSTATUS_FIELD_NUMBER = 1038; + private boolean pushStatus_ = false; + /** + * bool pushStatus = 1038; + * @return The pushStatus. + */ + @java.lang.Override + public boolean getPushStatus() { + return pushStatus_; + } + + public static final int PUSHVIDEOPOST_FIELD_NUMBER = 1039; + private boolean pushVideoPost_ = false; + /** + * bool pushVideoPost = 1039; + * @return The pushVideoPost. + */ + @java.lang.Override + public boolean getPushVideoPost() { + return pushVideoPost_; + } + + public static final int PUSHVIDEORECOMMEND_FIELD_NUMBER = 1040; + private boolean pushVideoRecommend_ = false; + /** + * bool pushVideoRecommend = 1040; + * @return The pushVideoRecommend. + */ + @java.lang.Override + public boolean getPushVideoRecommend() { + return pushVideoRecommend_; + } + + public static final int STATS_FIELD_NUMBER = 1041; + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats stats_; + /** + * .User.UserStats stats = 1041; + * @return Whether the stats field is set. + */ + @java.lang.Override + public boolean hasStats() { + return stats_ != null; + } + /** + * .User.UserStats stats = 1041; + * @return The stats. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats getStats() { + return stats_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.getDefaultInstance() : stats_; + } + /** + * .User.UserStats stats = 1041; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStatsOrBuilder getStatsOrBuilder() { + return stats_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.getDefaultInstance() : stats_; + } + + public static final int VERIFIEDMOBILE_FIELD_NUMBER = 1042; + private boolean verifiedMobile_ = false; + /** + * bool verifiedMobile = 1042; + * @return The verifiedMobile. + */ + @java.lang.Override + public boolean getVerifiedMobile() { + return verifiedMobile_; + } + + public static final int VERIFIEDREASON_FIELD_NUMBER = 1043; + @SuppressWarnings("serial") + private volatile java.lang.Object verifiedReason_ = ""; + /** + * string verifiedReason = 1043; + * @return The verifiedReason. + */ + @java.lang.Override + public java.lang.String getVerifiedReason() { + java.lang.Object ref = verifiedReason_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verifiedReason_ = s; + return s; + } + } + /** + * string verifiedReason = 1043; + * @return The bytes for verifiedReason. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVerifiedReasonBytes() { + java.lang.Object ref = verifiedReason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + verifiedReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WITHCARMANAGEMENTPERMISSION_FIELD_NUMBER = 1044; + private boolean withCarManagementPermission_ = false; + /** + * bool withCarManagementPermission = 1044; + * @return The withCarManagementPermission. + */ + @java.lang.Override + public boolean getWithCarManagementPermission() { + return withCarManagementPermission_; + } + + public static final int AGERANGE_FIELD_NUMBER = 1045; + private int ageRange_ = 0; + /** + * int32 ageRange = 1045; + * @return The ageRange. + */ + @java.lang.Override + public int getAgeRange() { + return ageRange_; + } + + public static final int WATCHDURATIONMONTH_FIELD_NUMBER = 1046; + private long watchDurationMonth_ = 0L; + /** + * int64 watchDurationMonth = 1046; + * @return The watchDurationMonth. + */ + @java.lang.Override + public long getWatchDurationMonth() { + return watchDurationMonth_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (id_ != 0L) { + output.writeUInt64(1, id_); + } + if (shortId_ != 0L) { + output.writeUInt64(2, shortId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nickname_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nickname_); + } + if (gender_ != 0) { + output.writeUInt32(4, gender_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(signature_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, signature_); + } + if (level_ != 0) { + output.writeUInt32(6, level_); + } + if (birthday_ != 0L) { + output.writeUInt64(7, birthday_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(telephone_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, telephone_); + } + if (avatarThumb_ != null) { + output.writeMessage(9, getAvatarThumb()); + } + if (avatarMedium_ != null) { + output.writeMessage(10, getAvatarMedium()); + } + if (avatarLarge_ != null) { + output.writeMessage(11, getAvatarLarge()); + } + if (verified_ != false) { + output.writeBool(12, verified_); + } + if (experience_ != 0) { + output.writeInt32(13, experience_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(city_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, city_); + } + if (status_ != 0) { + output.writeInt32(15, status_); + } + if (createTime_ != 0L) { + output.writeInt64(16, createTime_); + } + if (modifyTime_ != 0L) { + output.writeInt64(17, modifyTime_); + } + if (secret_ != 0) { + output.writeInt32(18, secret_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(shareQrcodeUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 19, shareQrcodeUri_); + } + if (incomeSharePercent_ != 0) { + output.writeInt32(20, incomeSharePercent_); + } + if (badgeImageListList_ != null) { + output.writeMessage(21, getBadgeImageListList()); + } + if (followInfo_ != null) { + output.writeMessage(22, getFollowInfo()); + } + if (payGrade_ != null) { + output.writeMessage(23, getPayGrade()); + } + if (fansClub_ != null) { + output.writeMessage(24, getFansClub()); + } + if (border_ != null) { + output.writeMessage(25, getBorder()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(specialId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 26, specialId_); + } + if (avatarBorder_ != null) { + output.writeMessage(27, getAvatarBorder()); + } + if (medal_ != null) { + output.writeMessage(28, getMedal()); + } + for (int i = 0; i < realTimeIconsList_.size(); i++) { + output.writeMessage(29, realTimeIconsList_.get(i)); + } + for (int i = 0; i < newRealTimeIconsList_.size(); i++) { + output.writeMessage(30, newRealTimeIconsList_.get(i)); + } + if (topVipNo_ != 0L) { + output.writeInt64(31, topVipNo_); + } + if (userAttr_ != null) { + output.writeMessage(32, getUserAttr()); + } + if (ownRoom_ != null) { + output.writeMessage(33, getOwnRoom()); + } + if (payScore_ != 0L) { + output.writeInt64(34, payScore_); + } + if (ticketCount_ != 0L) { + output.writeInt64(35, ticketCount_); + } + if (anchorInfo_ != null) { + output.writeMessage(36, getAnchorInfo()); + } + if (linkMicStats_ != 0) { + output.writeInt32(37, linkMicStats_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 38, displayId_); + } + if (withCommercePermission_ != false) { + output.writeBool(39, withCommercePermission_); + } + if (withFusionShopEntry_ != false) { + output.writeBool(40, withFusionShopEntry_); + } + if (totalRechargeDiamondCount_ != 0L) { + output.writeInt64(41, totalRechargeDiamondCount_); + } + if (webcastAnchorLevel_ != null) { + output.writeMessage(42, getWebcastAnchorLevel()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verifiedContent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 43, verifiedContent_); + } + if (authorStats_ != null) { + output.writeMessage(44, getAuthorStats()); + } + for (int i = 0; i < topFansList_.size(); i++) { + output.writeMessage(45, topFansList_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secUid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 46, secUid_); + } + if (userRole_ != 0) { + output.writeInt32(47, userRole_); + } + if (xiguaInfo_ != null) { + output.writeMessage(48, getXiguaInfo()); + } + if (activityReward_ != null) { + output.writeMessage(49, getActivityReward()); + } + if (nobleInfo_ != null) { + output.writeMessage(50, getNobleInfo()); + } + if (brotherhoodInfo_ != null) { + output.writeMessage(51, getBrotherhoodInfo()); + } + if (personalCard_ != null) { + output.writeMessage(52, getPersonalCard()); + } + if (authenticationInfo_ != null) { + output.writeMessage(53, getAuthenticationInfo()); + } + if (authorizationInfo_ != 0) { + output.writeInt32(54, authorizationInfo_); + } + if (adversaryAuthorizationInfo_ != 0) { + output.writeInt32(55, adversaryAuthorizationInfo_); + } + if (poiInfo_ != null) { + output.writeMessage(56, getPoiInfo()); + } + if (mediaBadgeImageListList_ != null) { + output.writeMessage(57, getMediaBadgeImageListList()); + } + if (adversaryUserStatus_ != 0) { + output.writeInt32(58, adversaryUserStatus_); + } + if (userVipInfo_ != null) { + output.writeMessage(59, getUserVipInfo()); + } + if (getCommerceWebcastConfigIdsListList().size() > 0) { + output.writeUInt32NoTag(482); + output.writeUInt32NoTag(commerceWebcastConfigIdsListMemoizedSerializedSize); + } + for (int i = 0; i < commerceWebcastConfigIdsList_.size(); i++) { + output.writeInt64NoTag(commerceWebcastConfigIdsList_.getLong(i)); + } + if (badgeImageListV2List_ != null) { + output.writeMessage(61, getBadgeImageListV2List()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locationCity_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 63, locationCity_); + } + if (fansGroupInfo_ != null) { + output.writeMessage(64, getFansGroupInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remarkName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 65, remarkName_); + } + if (mysteryMan_ != 0) { + output.writeInt32(66, mysteryMan_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(webRid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 67, webRid_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(desensitizedNickname_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 68, desensitizedNickname_); + } + if (jAccreditInfo_ != null) { + output.writeMessage(69, getJAccreditInfo()); + } + if (subscribe_ != null) { + output.writeMessage(70, getSubscribe()); + } + if (isAnonymous_ != false) { + output.writeBool(71, isAnonymous_); + } + if (consumeDiamondLevel_ != 0) { + output.writeInt32(72, consumeDiamondLevel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(webcastUid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 73, webcastUid_); + } + if (profileStyleParams_ != null) { + output.writeMessage(74, getProfileStyleParams()); + } + if (userDressInfo_ != null) { + output.writeMessage(75, getUserDressInfo()); + } + if (allowBeLocated_ != false) { + output.writeBool(1001, allowBeLocated_); + } + if (allowFindByContacts_ != false) { + output.writeBool(1002, allowFindByContacts_); + } + if (allowOthersDownloadVideo_ != false) { + output.writeBool(1003, allowOthersDownloadVideo_); + } + if (allowOthersDownloadWhenSharingVideo_ != false) { + output.writeBool(1004, allowOthersDownloadWhenSharingVideo_); + } + if (allowShareShowProfile_ != false) { + output.writeBool(1005, allowShareShowProfile_); + } + if (allowShowInGossip_ != false) { + output.writeBool(1006, allowShowInGossip_); + } + if (allowShowMyAction_ != false) { + output.writeBool(1007, allowShowMyAction_); + } + if (allowStrangeComment_ != false) { + output.writeBool(1008, allowStrangeComment_); + } + if (allowUnfollowerComment_ != false) { + output.writeBool(1009, allowUnfollowerComment_); + } + if (allowUseLinkmic_ != false) { + output.writeBool(1010, allowUseLinkmic_); + } + if (anchorLevel_ != null) { + output.writeMessage(1011, getAnchorLevel()); + } + if (avatarJpg_ != null) { + output.writeMessage(1012, getAvatarJpg()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bgImgUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1013, bgImgUrl_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(birthdayDescription_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1014, birthdayDescription_); + } + if (birthdayValid_ != false) { + output.writeBool(1015, birthdayValid_); + } + if (blockStatus_ != 0) { + output.writeInt32(1016, blockStatus_); + } + if (commentRestrict_ != 0) { + output.writeInt32(1017, commentRestrict_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(constellation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1018, constellation_); + } + if (disableIchat_ != 0) { + output.writeInt32(1019, disableIchat_); + } + if (enableIchatImg_ != 0L) { + output.writeInt64(1020, enableIchatImg_); + } + if (exp_ != 0) { + output.writeInt32(1021, exp_); + } + if (fanTicketCount_ != 0L) { + output.writeInt64(1022, fanTicketCount_); + } + if (foldStrangerChat_ != false) { + output.writeBool(1023, foldStrangerChat_); + } + if (followStatus_ != 0L) { + output.writeInt64(1024, followStatus_); + } + if (hotsoonVerified_ != false) { + output.writeBool(1025, hotsoonVerified_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(hotsoonVerifiedReason_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1026, hotsoonVerifiedReason_); + } + if (ichatRestrictType_ != 0) { + output.writeInt32(1027, ichatRestrictType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(idStr_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1028, idStr_); + } + if (isFollower_ != false) { + output.writeBool(1029, isFollower_); + } + if (isFollowing_ != false) { + output.writeBool(1030, isFollowing_); + } + if (needProfileGuide_ != false) { + output.writeBool(1031, needProfileGuide_); + } + if (payScores_ != 0L) { + output.writeInt64(1032, payScores_); + } + if (pushCommentStatus_ != false) { + output.writeBool(1033, pushCommentStatus_); + } + if (pushDigg_ != false) { + output.writeBool(1034, pushDigg_); + } + if (pushFollow_ != false) { + output.writeBool(1035, pushFollow_); + } + if (pushFriendAction_ != false) { + output.writeBool(1036, pushFriendAction_); + } + if (pushIchat_ != false) { + output.writeBool(1037, pushIchat_); + } + if (pushStatus_ != false) { + output.writeBool(1038, pushStatus_); + } + if (pushVideoPost_ != false) { + output.writeBool(1039, pushVideoPost_); + } + if (pushVideoRecommend_ != false) { + output.writeBool(1040, pushVideoRecommend_); + } + if (stats_ != null) { + output.writeMessage(1041, getStats()); + } + if (verifiedMobile_ != false) { + output.writeBool(1042, verifiedMobile_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verifiedReason_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1043, verifiedReason_); + } + if (withCarManagementPermission_ != false) { + output.writeBool(1044, withCarManagementPermission_); + } + if (ageRange_ != 0) { + output.writeInt32(1045, ageRange_); + } + if (watchDurationMonth_ != 0L) { + output.writeInt64(1046, watchDurationMonth_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, id_); + } + if (shortId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, shortId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nickname_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nickname_); + } + if (gender_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, gender_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(signature_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, signature_); + } + if (level_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(6, level_); + } + if (birthday_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(7, birthday_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(telephone_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, telephone_); + } + if (avatarThumb_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getAvatarThumb()); + } + if (avatarMedium_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, getAvatarMedium()); + } + if (avatarLarge_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, getAvatarLarge()); + } + if (verified_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(12, verified_); + } + if (experience_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(13, experience_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(city_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, city_); + } + if (status_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(15, status_); + } + if (createTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(16, createTime_); + } + if (modifyTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(17, modifyTime_); + } + if (secret_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(18, secret_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(shareQrcodeUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(19, shareQrcodeUri_); + } + if (incomeSharePercent_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(20, incomeSharePercent_); + } + if (badgeImageListList_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(21, getBadgeImageListList()); + } + if (followInfo_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(22, getFollowInfo()); + } + if (payGrade_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(23, getPayGrade()); + } + if (fansClub_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(24, getFansClub()); + } + if (border_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(25, getBorder()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(specialId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(26, specialId_); + } + if (avatarBorder_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(27, getAvatarBorder()); + } + if (medal_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(28, getMedal()); + } + for (int i = 0; i < realTimeIconsList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(29, realTimeIconsList_.get(i)); + } + for (int i = 0; i < newRealTimeIconsList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(30, newRealTimeIconsList_.get(i)); + } + if (topVipNo_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(31, topVipNo_); + } + if (userAttr_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(32, getUserAttr()); + } + if (ownRoom_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(33, getOwnRoom()); + } + if (payScore_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(34, payScore_); + } + if (ticketCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(35, ticketCount_); + } + if (anchorInfo_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(36, getAnchorInfo()); + } + if (linkMicStats_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(37, linkMicStats_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(38, displayId_); + } + if (withCommercePermission_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(39, withCommercePermission_); + } + if (withFusionShopEntry_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(40, withFusionShopEntry_); + } + if (totalRechargeDiamondCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(41, totalRechargeDiamondCount_); + } + if (webcastAnchorLevel_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(42, getWebcastAnchorLevel()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verifiedContent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(43, verifiedContent_); + } + if (authorStats_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(44, getAuthorStats()); + } + for (int i = 0; i < topFansList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(45, topFansList_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secUid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(46, secUid_); + } + if (userRole_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(47, userRole_); + } + if (xiguaInfo_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(48, getXiguaInfo()); + } + if (activityReward_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(49, getActivityReward()); + } + if (nobleInfo_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(50, getNobleInfo()); + } + if (brotherhoodInfo_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(51, getBrotherhoodInfo()); + } + if (personalCard_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(52, getPersonalCard()); + } + if (authenticationInfo_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(53, getAuthenticationInfo()); + } + if (authorizationInfo_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(54, authorizationInfo_); + } + if (adversaryAuthorizationInfo_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(55, adversaryAuthorizationInfo_); + } + if (poiInfo_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(56, getPoiInfo()); + } + if (mediaBadgeImageListList_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(57, getMediaBadgeImageListList()); + } + if (adversaryUserStatus_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(58, adversaryUserStatus_); + } + if (userVipInfo_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(59, getUserVipInfo()); + } + { + int dataSize = 0; + for (int i = 0; i < commerceWebcastConfigIdsList_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(commerceWebcastConfigIdsList_.getLong(i)); + } + size += dataSize; + if (!getCommerceWebcastConfigIdsListList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + commerceWebcastConfigIdsListMemoizedSerializedSize = dataSize; + } + if (badgeImageListV2List_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(61, getBadgeImageListV2List()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locationCity_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(63, locationCity_); + } + if (fansGroupInfo_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(64, getFansGroupInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remarkName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(65, remarkName_); + } + if (mysteryMan_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(66, mysteryMan_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(webRid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(67, webRid_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(desensitizedNickname_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(68, desensitizedNickname_); + } + if (jAccreditInfo_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(69, getJAccreditInfo()); + } + if (subscribe_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(70, getSubscribe()); + } + if (isAnonymous_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(71, isAnonymous_); + } + if (consumeDiamondLevel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(72, consumeDiamondLevel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(webcastUid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(73, webcastUid_); + } + if (profileStyleParams_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(74, getProfileStyleParams()); + } + if (userDressInfo_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(75, getUserDressInfo()); + } + if (allowBeLocated_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1001, allowBeLocated_); + } + if (allowFindByContacts_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1002, allowFindByContacts_); + } + if (allowOthersDownloadVideo_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1003, allowOthersDownloadVideo_); + } + if (allowOthersDownloadWhenSharingVideo_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1004, allowOthersDownloadWhenSharingVideo_); + } + if (allowShareShowProfile_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1005, allowShareShowProfile_); + } + if (allowShowInGossip_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1006, allowShowInGossip_); + } + if (allowShowMyAction_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1007, allowShowMyAction_); + } + if (allowStrangeComment_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1008, allowStrangeComment_); + } + if (allowUnfollowerComment_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1009, allowUnfollowerComment_); + } + if (allowUseLinkmic_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1010, allowUseLinkmic_); + } + if (anchorLevel_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1011, getAnchorLevel()); + } + if (avatarJpg_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1012, getAvatarJpg()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bgImgUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1013, bgImgUrl_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(birthdayDescription_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1014, birthdayDescription_); + } + if (birthdayValid_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1015, birthdayValid_); + } + if (blockStatus_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1016, blockStatus_); + } + if (commentRestrict_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1017, commentRestrict_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(constellation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1018, constellation_); + } + if (disableIchat_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1019, disableIchat_); + } + if (enableIchatImg_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1020, enableIchatImg_); + } + if (exp_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1021, exp_); + } + if (fanTicketCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1022, fanTicketCount_); + } + if (foldStrangerChat_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1023, foldStrangerChat_); + } + if (followStatus_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1024, followStatus_); + } + if (hotsoonVerified_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1025, hotsoonVerified_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(hotsoonVerifiedReason_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1026, hotsoonVerifiedReason_); + } + if (ichatRestrictType_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1027, ichatRestrictType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(idStr_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1028, idStr_); + } + if (isFollower_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1029, isFollower_); + } + if (isFollowing_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1030, isFollowing_); + } + if (needProfileGuide_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1031, needProfileGuide_); + } + if (payScores_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1032, payScores_); + } + if (pushCommentStatus_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1033, pushCommentStatus_); + } + if (pushDigg_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1034, pushDigg_); + } + if (pushFollow_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1035, pushFollow_); + } + if (pushFriendAction_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1036, pushFriendAction_); + } + if (pushIchat_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1037, pushIchat_); + } + if (pushStatus_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1038, pushStatus_); + } + if (pushVideoPost_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1039, pushVideoPost_); + } + if (pushVideoRecommend_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1040, pushVideoRecommend_); + } + if (stats_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1041, getStats()); + } + if (verifiedMobile_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1042, verifiedMobile_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verifiedReason_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1043, verifiedReason_); + } + if (withCarManagementPermission_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1044, withCarManagementPermission_); + } + if (ageRange_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1045, ageRange_); + } + if (watchDurationMonth_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1046, watchDurationMonth_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User other = (tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User) obj; + + if (getId() + != other.getId()) return false; + if (getShortId() + != other.getShortId()) return false; + if (!getNickname() + .equals(other.getNickname())) return false; + if (getGender() + != other.getGender()) return false; + if (!getSignature() + .equals(other.getSignature())) return false; + if (getLevel() + != other.getLevel()) return false; + if (getBirthday() + != other.getBirthday()) return false; + if (!getTelephone() + .equals(other.getTelephone())) return false; + if (hasAvatarThumb() != other.hasAvatarThumb()) return false; + if (hasAvatarThumb()) { + if (!getAvatarThumb() + .equals(other.getAvatarThumb())) return false; + } + if (hasAvatarMedium() != other.hasAvatarMedium()) return false; + if (hasAvatarMedium()) { + if (!getAvatarMedium() + .equals(other.getAvatarMedium())) return false; + } + if (hasAvatarLarge() != other.hasAvatarLarge()) return false; + if (hasAvatarLarge()) { + if (!getAvatarLarge() + .equals(other.getAvatarLarge())) return false; + } + if (getVerified() + != other.getVerified()) return false; + if (getExperience() + != other.getExperience()) return false; + if (!getCity() + .equals(other.getCity())) return false; + if (getStatus() + != other.getStatus()) return false; + if (getCreateTime() + != other.getCreateTime()) return false; + if (getModifyTime() + != other.getModifyTime()) return false; + if (getSecret() + != other.getSecret()) return false; + if (!getShareQrcodeUri() + .equals(other.getShareQrcodeUri())) return false; + if (getIncomeSharePercent() + != other.getIncomeSharePercent()) return false; + if (hasBadgeImageListList() != other.hasBadgeImageListList()) return false; + if (hasBadgeImageListList()) { + if (!getBadgeImageListList() + .equals(other.getBadgeImageListList())) return false; + } + if (hasFollowInfo() != other.hasFollowInfo()) return false; + if (hasFollowInfo()) { + if (!getFollowInfo() + .equals(other.getFollowInfo())) return false; + } + if (hasPayGrade() != other.hasPayGrade()) return false; + if (hasPayGrade()) { + if (!getPayGrade() + .equals(other.getPayGrade())) return false; + } + if (hasFansClub() != other.hasFansClub()) return false; + if (hasFansClub()) { + if (!getFansClub() + .equals(other.getFansClub())) return false; + } + if (hasBorder() != other.hasBorder()) return false; + if (hasBorder()) { + if (!getBorder() + .equals(other.getBorder())) return false; + } + if (!getSpecialId() + .equals(other.getSpecialId())) return false; + if (hasAvatarBorder() != other.hasAvatarBorder()) return false; + if (hasAvatarBorder()) { + if (!getAvatarBorder() + .equals(other.getAvatarBorder())) return false; + } + if (hasMedal() != other.hasMedal()) return false; + if (hasMedal()) { + if (!getMedal() + .equals(other.getMedal())) return false; + } + if (!getRealTimeIconsListList() + .equals(other.getRealTimeIconsListList())) return false; + if (!getNewRealTimeIconsListList() + .equals(other.getNewRealTimeIconsListList())) return false; + if (getTopVipNo() + != other.getTopVipNo()) return false; + if (hasUserAttr() != other.hasUserAttr()) return false; + if (hasUserAttr()) { + if (!getUserAttr() + .equals(other.getUserAttr())) return false; + } + if (hasOwnRoom() != other.hasOwnRoom()) return false; + if (hasOwnRoom()) { + if (!getOwnRoom() + .equals(other.getOwnRoom())) return false; + } + if (getPayScore() + != other.getPayScore()) return false; + if (getTicketCount() + != other.getTicketCount()) return false; + if (hasAnchorInfo() != other.hasAnchorInfo()) return false; + if (hasAnchorInfo()) { + if (!getAnchorInfo() + .equals(other.getAnchorInfo())) return false; + } + if (getLinkMicStats() + != other.getLinkMicStats()) return false; + if (!getDisplayId() + .equals(other.getDisplayId())) return false; + if (getWithCommercePermission() + != other.getWithCommercePermission()) return false; + if (getWithFusionShopEntry() + != other.getWithFusionShopEntry()) return false; + if (getTotalRechargeDiamondCount() + != other.getTotalRechargeDiamondCount()) return false; + if (hasWebcastAnchorLevel() != other.hasWebcastAnchorLevel()) return false; + if (hasWebcastAnchorLevel()) { + if (!getWebcastAnchorLevel() + .equals(other.getWebcastAnchorLevel())) return false; + } + if (!getVerifiedContent() + .equals(other.getVerifiedContent())) return false; + if (hasAuthorStats() != other.hasAuthorStats()) return false; + if (hasAuthorStats()) { + if (!getAuthorStats() + .equals(other.getAuthorStats())) return false; + } + if (!getTopFansListList() + .equals(other.getTopFansListList())) return false; + if (!getSecUid() + .equals(other.getSecUid())) return false; + if (getUserRole() + != other.getUserRole()) return false; + if (hasXiguaInfo() != other.hasXiguaInfo()) return false; + if (hasXiguaInfo()) { + if (!getXiguaInfo() + .equals(other.getXiguaInfo())) return false; + } + if (hasActivityReward() != other.hasActivityReward()) return false; + if (hasActivityReward()) { + if (!getActivityReward() + .equals(other.getActivityReward())) return false; + } + if (hasNobleInfo() != other.hasNobleInfo()) return false; + if (hasNobleInfo()) { + if (!getNobleInfo() + .equals(other.getNobleInfo())) return false; + } + if (hasBrotherhoodInfo() != other.hasBrotherhoodInfo()) return false; + if (hasBrotherhoodInfo()) { + if (!getBrotherhoodInfo() + .equals(other.getBrotherhoodInfo())) return false; + } + if (hasPersonalCard() != other.hasPersonalCard()) return false; + if (hasPersonalCard()) { + if (!getPersonalCard() + .equals(other.getPersonalCard())) return false; + } + if (hasAuthenticationInfo() != other.hasAuthenticationInfo()) return false; + if (hasAuthenticationInfo()) { + if (!getAuthenticationInfo() + .equals(other.getAuthenticationInfo())) return false; + } + if (getAuthorizationInfo() + != other.getAuthorizationInfo()) return false; + if (getAdversaryAuthorizationInfo() + != other.getAdversaryAuthorizationInfo()) return false; + if (hasPoiInfo() != other.hasPoiInfo()) return false; + if (hasPoiInfo()) { + if (!getPoiInfo() + .equals(other.getPoiInfo())) return false; + } + if (hasMediaBadgeImageListList() != other.hasMediaBadgeImageListList()) return false; + if (hasMediaBadgeImageListList()) { + if (!getMediaBadgeImageListList() + .equals(other.getMediaBadgeImageListList())) return false; + } + if (getAdversaryUserStatus() + != other.getAdversaryUserStatus()) return false; + if (hasUserVipInfo() != other.hasUserVipInfo()) return false; + if (hasUserVipInfo()) { + if (!getUserVipInfo() + .equals(other.getUserVipInfo())) return false; + } + if (!getCommerceWebcastConfigIdsListList() + .equals(other.getCommerceWebcastConfigIdsListList())) return false; + if (hasBadgeImageListV2List() != other.hasBadgeImageListV2List()) return false; + if (hasBadgeImageListV2List()) { + if (!getBadgeImageListV2List() + .equals(other.getBadgeImageListV2List())) return false; + } + if (!getLocationCity() + .equals(other.getLocationCity())) return false; + if (hasFansGroupInfo() != other.hasFansGroupInfo()) return false; + if (hasFansGroupInfo()) { + if (!getFansGroupInfo() + .equals(other.getFansGroupInfo())) return false; + } + if (!getRemarkName() + .equals(other.getRemarkName())) return false; + if (getMysteryMan() + != other.getMysteryMan()) return false; + if (!getWebRid() + .equals(other.getWebRid())) return false; + if (!getDesensitizedNickname() + .equals(other.getDesensitizedNickname())) return false; + if (hasJAccreditInfo() != other.hasJAccreditInfo()) return false; + if (hasJAccreditInfo()) { + if (!getJAccreditInfo() + .equals(other.getJAccreditInfo())) return false; + } + if (hasSubscribe() != other.hasSubscribe()) return false; + if (hasSubscribe()) { + if (!getSubscribe() + .equals(other.getSubscribe())) return false; + } + if (getIsAnonymous() + != other.getIsAnonymous()) return false; + if (getConsumeDiamondLevel() + != other.getConsumeDiamondLevel()) return false; + if (!getWebcastUid() + .equals(other.getWebcastUid())) return false; + if (hasProfileStyleParams() != other.hasProfileStyleParams()) return false; + if (hasProfileStyleParams()) { + if (!getProfileStyleParams() + .equals(other.getProfileStyleParams())) return false; + } + if (hasUserDressInfo() != other.hasUserDressInfo()) return false; + if (hasUserDressInfo()) { + if (!getUserDressInfo() + .equals(other.getUserDressInfo())) return false; + } + if (getAllowBeLocated() + != other.getAllowBeLocated()) return false; + if (getAllowFindByContacts() + != other.getAllowFindByContacts()) return false; + if (getAllowOthersDownloadVideo() + != other.getAllowOthersDownloadVideo()) return false; + if (getAllowOthersDownloadWhenSharingVideo() + != other.getAllowOthersDownloadWhenSharingVideo()) return false; + if (getAllowShareShowProfile() + != other.getAllowShareShowProfile()) return false; + if (getAllowShowInGossip() + != other.getAllowShowInGossip()) return false; + if (getAllowShowMyAction() + != other.getAllowShowMyAction()) return false; + if (getAllowStrangeComment() + != other.getAllowStrangeComment()) return false; + if (getAllowUnfollowerComment() + != other.getAllowUnfollowerComment()) return false; + if (getAllowUseLinkmic() + != other.getAllowUseLinkmic()) return false; + if (hasAnchorLevel() != other.hasAnchorLevel()) return false; + if (hasAnchorLevel()) { + if (!getAnchorLevel() + .equals(other.getAnchorLevel())) return false; + } + if (hasAvatarJpg() != other.hasAvatarJpg()) return false; + if (hasAvatarJpg()) { + if (!getAvatarJpg() + .equals(other.getAvatarJpg())) return false; + } + if (!getBgImgUrl() + .equals(other.getBgImgUrl())) return false; + if (!getBirthdayDescription() + .equals(other.getBirthdayDescription())) return false; + if (getBirthdayValid() + != other.getBirthdayValid()) return false; + if (getBlockStatus() + != other.getBlockStatus()) return false; + if (getCommentRestrict() + != other.getCommentRestrict()) return false; + if (!getConstellation() + .equals(other.getConstellation())) return false; + if (getDisableIchat() + != other.getDisableIchat()) return false; + if (getEnableIchatImg() + != other.getEnableIchatImg()) return false; + if (getExp() + != other.getExp()) return false; + if (getFanTicketCount() + != other.getFanTicketCount()) return false; + if (getFoldStrangerChat() + != other.getFoldStrangerChat()) return false; + if (getFollowStatus() + != other.getFollowStatus()) return false; + if (getHotsoonVerified() + != other.getHotsoonVerified()) return false; + if (!getHotsoonVerifiedReason() + .equals(other.getHotsoonVerifiedReason())) return false; + if (getIchatRestrictType() + != other.getIchatRestrictType()) return false; + if (!getIdStr() + .equals(other.getIdStr())) return false; + if (getIsFollower() + != other.getIsFollower()) return false; + if (getIsFollowing() + != other.getIsFollowing()) return false; + if (getNeedProfileGuide() + != other.getNeedProfileGuide()) return false; + if (getPayScores() + != other.getPayScores()) return false; + if (getPushCommentStatus() + != other.getPushCommentStatus()) return false; + if (getPushDigg() + != other.getPushDigg()) return false; + if (getPushFollow() + != other.getPushFollow()) return false; + if (getPushFriendAction() + != other.getPushFriendAction()) return false; + if (getPushIchat() + != other.getPushIchat()) return false; + if (getPushStatus() + != other.getPushStatus()) return false; + if (getPushVideoPost() + != other.getPushVideoPost()) return false; + if (getPushVideoRecommend() + != other.getPushVideoRecommend()) return false; + if (hasStats() != other.hasStats()) return false; + if (hasStats()) { + if (!getStats() + .equals(other.getStats())) return false; + } + if (getVerifiedMobile() + != other.getVerifiedMobile()) return false; + if (!getVerifiedReason() + .equals(other.getVerifiedReason())) return false; + if (getWithCarManagementPermission() + != other.getWithCarManagementPermission()) return false; + if (getAgeRange() + != other.getAgeRange()) return false; + if (getWatchDurationMonth() + != other.getWatchDurationMonth()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + SHORTID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getShortId()); + hash = (37 * hash) + NICKNAME_FIELD_NUMBER; + hash = (53 * hash) + getNickname().hashCode(); + hash = (37 * hash) + GENDER_FIELD_NUMBER; + hash = (53 * hash) + getGender(); + hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getSignature().hashCode(); + hash = (37 * hash) + LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getLevel(); + hash = (37 * hash) + BIRTHDAY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBirthday()); + hash = (37 * hash) + TELEPHONE_FIELD_NUMBER; + hash = (53 * hash) + getTelephone().hashCode(); + if (hasAvatarThumb()) { + hash = (37 * hash) + AVATARTHUMB_FIELD_NUMBER; + hash = (53 * hash) + getAvatarThumb().hashCode(); + } + if (hasAvatarMedium()) { + hash = (37 * hash) + AVATARMEDIUM_FIELD_NUMBER; + hash = (53 * hash) + getAvatarMedium().hashCode(); + } + if (hasAvatarLarge()) { + hash = (37 * hash) + AVATARLARGE_FIELD_NUMBER; + hash = (53 * hash) + getAvatarLarge().hashCode(); + } + hash = (37 * hash) + VERIFIED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getVerified()); + hash = (37 * hash) + EXPERIENCE_FIELD_NUMBER; + hash = (53 * hash) + getExperience(); + hash = (37 * hash) + CITY_FIELD_NUMBER; + hash = (53 * hash) + getCity().hashCode(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus(); + hash = (37 * hash) + CREATETIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCreateTime()); + hash = (37 * hash) + MODIFYTIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getModifyTime()); + hash = (37 * hash) + SECRET_FIELD_NUMBER; + hash = (53 * hash) + getSecret(); + hash = (37 * hash) + SHAREQRCODEURI_FIELD_NUMBER; + hash = (53 * hash) + getShareQrcodeUri().hashCode(); + hash = (37 * hash) + INCOMESHAREPERCENT_FIELD_NUMBER; + hash = (53 * hash) + getIncomeSharePercent(); + if (hasBadgeImageListList()) { + hash = (37 * hash) + BADGEIMAGELISTLIST_FIELD_NUMBER; + hash = (53 * hash) + getBadgeImageListList().hashCode(); + } + if (hasFollowInfo()) { + hash = (37 * hash) + FOLLOWINFO_FIELD_NUMBER; + hash = (53 * hash) + getFollowInfo().hashCode(); + } + if (hasPayGrade()) { + hash = (37 * hash) + PAYGRADE_FIELD_NUMBER; + hash = (53 * hash) + getPayGrade().hashCode(); + } + if (hasFansClub()) { + hash = (37 * hash) + FANSCLUB_FIELD_NUMBER; + hash = (53 * hash) + getFansClub().hashCode(); + } + if (hasBorder()) { + hash = (37 * hash) + BORDER_FIELD_NUMBER; + hash = (53 * hash) + getBorder().hashCode(); + } + hash = (37 * hash) + SPECIALID_FIELD_NUMBER; + hash = (53 * hash) + getSpecialId().hashCode(); + if (hasAvatarBorder()) { + hash = (37 * hash) + AVATARBORDER_FIELD_NUMBER; + hash = (53 * hash) + getAvatarBorder().hashCode(); + } + if (hasMedal()) { + hash = (37 * hash) + MEDAL_FIELD_NUMBER; + hash = (53 * hash) + getMedal().hashCode(); + } + if (getRealTimeIconsListCount() > 0) { + hash = (37 * hash) + REALTIMEICONSLIST_FIELD_NUMBER; + hash = (53 * hash) + getRealTimeIconsListList().hashCode(); + } + if (getNewRealTimeIconsListCount() > 0) { + hash = (37 * hash) + NEWREALTIMEICONSLIST_FIELD_NUMBER; + hash = (53 * hash) + getNewRealTimeIconsListList().hashCode(); + } + hash = (37 * hash) + TOPVIPNO_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTopVipNo()); + if (hasUserAttr()) { + hash = (37 * hash) + USERATTR_FIELD_NUMBER; + hash = (53 * hash) + getUserAttr().hashCode(); + } + if (hasOwnRoom()) { + hash = (37 * hash) + OWNROOM_FIELD_NUMBER; + hash = (53 * hash) + getOwnRoom().hashCode(); + } + hash = (37 * hash) + PAYSCORE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPayScore()); + hash = (37 * hash) + TICKETCOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTicketCount()); + if (hasAnchorInfo()) { + hash = (37 * hash) + ANCHORINFO_FIELD_NUMBER; + hash = (53 * hash) + getAnchorInfo().hashCode(); + } + hash = (37 * hash) + LINKMICSTATS_FIELD_NUMBER; + hash = (53 * hash) + getLinkMicStats(); + hash = (37 * hash) + DISPLAYID_FIELD_NUMBER; + hash = (53 * hash) + getDisplayId().hashCode(); + hash = (37 * hash) + WITHCOMMERCEPERMISSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getWithCommercePermission()); + hash = (37 * hash) + WITHFUSIONSHOPENTRY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getWithFusionShopEntry()); + hash = (37 * hash) + TOTALRECHARGEDIAMONDCOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTotalRechargeDiamondCount()); + if (hasWebcastAnchorLevel()) { + hash = (37 * hash) + WEBCASTANCHORLEVEL_FIELD_NUMBER; + hash = (53 * hash) + getWebcastAnchorLevel().hashCode(); + } + hash = (37 * hash) + VERIFIEDCONTENT_FIELD_NUMBER; + hash = (53 * hash) + getVerifiedContent().hashCode(); + if (hasAuthorStats()) { + hash = (37 * hash) + AUTHORSTATS_FIELD_NUMBER; + hash = (53 * hash) + getAuthorStats().hashCode(); + } + if (getTopFansListCount() > 0) { + hash = (37 * hash) + TOPFANSLIST_FIELD_NUMBER; + hash = (53 * hash) + getTopFansListList().hashCode(); + } + hash = (37 * hash) + SECUID_FIELD_NUMBER; + hash = (53 * hash) + getSecUid().hashCode(); + hash = (37 * hash) + USERROLE_FIELD_NUMBER; + hash = (53 * hash) + getUserRole(); + if (hasXiguaInfo()) { + hash = (37 * hash) + XIGUAINFO_FIELD_NUMBER; + hash = (53 * hash) + getXiguaInfo().hashCode(); + } + if (hasActivityReward()) { + hash = (37 * hash) + ACTIVITYREWARD_FIELD_NUMBER; + hash = (53 * hash) + getActivityReward().hashCode(); + } + if (hasNobleInfo()) { + hash = (37 * hash) + NOBLEINFO_FIELD_NUMBER; + hash = (53 * hash) + getNobleInfo().hashCode(); + } + if (hasBrotherhoodInfo()) { + hash = (37 * hash) + BROTHERHOODINFO_FIELD_NUMBER; + hash = (53 * hash) + getBrotherhoodInfo().hashCode(); + } + if (hasPersonalCard()) { + hash = (37 * hash) + PERSONALCARD_FIELD_NUMBER; + hash = (53 * hash) + getPersonalCard().hashCode(); + } + if (hasAuthenticationInfo()) { + hash = (37 * hash) + AUTHENTICATIONINFO_FIELD_NUMBER; + hash = (53 * hash) + getAuthenticationInfo().hashCode(); + } + hash = (37 * hash) + AUTHORIZATIONINFO_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizationInfo(); + hash = (37 * hash) + ADVERSARYAUTHORIZATIONINFO_FIELD_NUMBER; + hash = (53 * hash) + getAdversaryAuthorizationInfo(); + if (hasPoiInfo()) { + hash = (37 * hash) + POIINFO_FIELD_NUMBER; + hash = (53 * hash) + getPoiInfo().hashCode(); + } + if (hasMediaBadgeImageListList()) { + hash = (37 * hash) + MEDIABADGEIMAGELISTLIST_FIELD_NUMBER; + hash = (53 * hash) + getMediaBadgeImageListList().hashCode(); + } + hash = (37 * hash) + ADVERSARYUSERSTATUS_FIELD_NUMBER; + hash = (53 * hash) + getAdversaryUserStatus(); + if (hasUserVipInfo()) { + hash = (37 * hash) + USERVIPINFO_FIELD_NUMBER; + hash = (53 * hash) + getUserVipInfo().hashCode(); + } + if (getCommerceWebcastConfigIdsListCount() > 0) { + hash = (37 * hash) + COMMERCEWEBCASTCONFIGIDSLIST_FIELD_NUMBER; + hash = (53 * hash) + getCommerceWebcastConfigIdsListList().hashCode(); + } + if (hasBadgeImageListV2List()) { + hash = (37 * hash) + BADGEIMAGELISTV2LIST_FIELD_NUMBER; + hash = (53 * hash) + getBadgeImageListV2List().hashCode(); + } + hash = (37 * hash) + LOCATIONCITY_FIELD_NUMBER; + hash = (53 * hash) + getLocationCity().hashCode(); + if (hasFansGroupInfo()) { + hash = (37 * hash) + FANSGROUPINFO_FIELD_NUMBER; + hash = (53 * hash) + getFansGroupInfo().hashCode(); + } + hash = (37 * hash) + REMARKNAME_FIELD_NUMBER; + hash = (53 * hash) + getRemarkName().hashCode(); + hash = (37 * hash) + MYSTERYMAN_FIELD_NUMBER; + hash = (53 * hash) + getMysteryMan(); + hash = (37 * hash) + WEBRID_FIELD_NUMBER; + hash = (53 * hash) + getWebRid().hashCode(); + hash = (37 * hash) + DESENSITIZEDNICKNAME_FIELD_NUMBER; + hash = (53 * hash) + getDesensitizedNickname().hashCode(); + if (hasJAccreditInfo()) { + hash = (37 * hash) + JACCREDITINFO_FIELD_NUMBER; + hash = (53 * hash) + getJAccreditInfo().hashCode(); + } + if (hasSubscribe()) { + hash = (37 * hash) + SUBSCRIBE_FIELD_NUMBER; + hash = (53 * hash) + getSubscribe().hashCode(); + } + hash = (37 * hash) + ISANONYMOUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsAnonymous()); + hash = (37 * hash) + CONSUMEDIAMONDLEVEL_FIELD_NUMBER; + hash = (53 * hash) + getConsumeDiamondLevel(); + hash = (37 * hash) + WEBCASTUID_FIELD_NUMBER; + hash = (53 * hash) + getWebcastUid().hashCode(); + if (hasProfileStyleParams()) { + hash = (37 * hash) + PROFILESTYLEPARAMS_FIELD_NUMBER; + hash = (53 * hash) + getProfileStyleParams().hashCode(); + } + if (hasUserDressInfo()) { + hash = (37 * hash) + USERDRESSINFO_FIELD_NUMBER; + hash = (53 * hash) + getUserDressInfo().hashCode(); + } + hash = (37 * hash) + ALLOWBELOCATED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllowBeLocated()); + hash = (37 * hash) + ALLOWFINDBYCONTACTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllowFindByContacts()); + hash = (37 * hash) + ALLOWOTHERSDOWNLOADVIDEO_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllowOthersDownloadVideo()); + hash = (37 * hash) + ALLOWOTHERSDOWNLOADWHENSHARINGVIDEO_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllowOthersDownloadWhenSharingVideo()); + hash = (37 * hash) + ALLOWSHARESHOWPROFILE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllowShareShowProfile()); + hash = (37 * hash) + ALLOWSHOWINGOSSIP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllowShowInGossip()); + hash = (37 * hash) + ALLOWSHOWMYACTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllowShowMyAction()); + hash = (37 * hash) + ALLOWSTRANGECOMMENT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllowStrangeComment()); + hash = (37 * hash) + ALLOWUNFOLLOWERCOMMENT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllowUnfollowerComment()); + hash = (37 * hash) + ALLOWUSELINKMIC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllowUseLinkmic()); + if (hasAnchorLevel()) { + hash = (37 * hash) + ANCHORLEVEL_FIELD_NUMBER; + hash = (53 * hash) + getAnchorLevel().hashCode(); + } + if (hasAvatarJpg()) { + hash = (37 * hash) + AVATARJPG_FIELD_NUMBER; + hash = (53 * hash) + getAvatarJpg().hashCode(); + } + hash = (37 * hash) + BGIMGURL_FIELD_NUMBER; + hash = (53 * hash) + getBgImgUrl().hashCode(); + hash = (37 * hash) + BIRTHDAYDESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getBirthdayDescription().hashCode(); + hash = (37 * hash) + BIRTHDAYVALID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getBirthdayValid()); + hash = (37 * hash) + BLOCKSTATUS_FIELD_NUMBER; + hash = (53 * hash) + getBlockStatus(); + hash = (37 * hash) + COMMENTRESTRICT_FIELD_NUMBER; + hash = (53 * hash) + getCommentRestrict(); + hash = (37 * hash) + CONSTELLATION_FIELD_NUMBER; + hash = (53 * hash) + getConstellation().hashCode(); + hash = (37 * hash) + DISABLEICHAT_FIELD_NUMBER; + hash = (53 * hash) + getDisableIchat(); + hash = (37 * hash) + ENABLEICHATIMG_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getEnableIchatImg()); + hash = (37 * hash) + EXP_FIELD_NUMBER; + hash = (53 * hash) + getExp(); + hash = (37 * hash) + FANTICKETCOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFanTicketCount()); + hash = (37 * hash) + FOLDSTRANGERCHAT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFoldStrangerChat()); + hash = (37 * hash) + FOLLOWSTATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFollowStatus()); + hash = (37 * hash) + HOTSOONVERIFIED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getHotsoonVerified()); + hash = (37 * hash) + HOTSOONVERIFIEDREASON_FIELD_NUMBER; + hash = (53 * hash) + getHotsoonVerifiedReason().hashCode(); + hash = (37 * hash) + ICHATRESTRICTTYPE_FIELD_NUMBER; + hash = (53 * hash) + getIchatRestrictType(); + hash = (37 * hash) + IDSTR_FIELD_NUMBER; + hash = (53 * hash) + getIdStr().hashCode(); + hash = (37 * hash) + ISFOLLOWER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsFollower()); + hash = (37 * hash) + ISFOLLOWING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsFollowing()); + hash = (37 * hash) + NEEDPROFILEGUIDE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getNeedProfileGuide()); + hash = (37 * hash) + PAYSCORES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPayScores()); + hash = (37 * hash) + PUSHCOMMENTSTATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPushCommentStatus()); + hash = (37 * hash) + PUSHDIGG_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPushDigg()); + hash = (37 * hash) + PUSHFOLLOW_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPushFollow()); + hash = (37 * hash) + PUSHFRIENDACTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPushFriendAction()); + hash = (37 * hash) + PUSHICHAT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPushIchat()); + hash = (37 * hash) + PUSHSTATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPushStatus()); + hash = (37 * hash) + PUSHVIDEOPOST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPushVideoPost()); + hash = (37 * hash) + PUSHVIDEORECOMMEND_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPushVideoRecommend()); + if (hasStats()) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStats().hashCode(); + } + hash = (37 * hash) + VERIFIEDMOBILE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getVerifiedMobile()); + hash = (37 * hash) + VERIFIEDREASON_FIELD_NUMBER; + hash = (53 * hash) + getVerifiedReason().hashCode(); + hash = (37 * hash) + WITHCARMANAGEMENTPERMISSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getWithCarManagementPermission()); + hash = (37 * hash) + AGERANGE_FIELD_NUMBER; + hash = (53 * hash) + getAgeRange(); + hash = (37 * hash) + WATCHDURATIONMONTH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getWatchDurationMonth()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code User} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:User) + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.class, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bitField1_ = 0; + bitField2_ = 0; + bitField3_ = 0; + id_ = 0L; + shortId_ = 0L; + nickname_ = ""; + gender_ = 0; + signature_ = ""; + level_ = 0; + birthday_ = 0L; + telephone_ = ""; + avatarThumb_ = null; + if (avatarThumbBuilder_ != null) { + avatarThumbBuilder_.dispose(); + avatarThumbBuilder_ = null; + } + avatarMedium_ = null; + if (avatarMediumBuilder_ != null) { + avatarMediumBuilder_.dispose(); + avatarMediumBuilder_ = null; + } + avatarLarge_ = null; + if (avatarLargeBuilder_ != null) { + avatarLargeBuilder_.dispose(); + avatarLargeBuilder_ = null; + } + verified_ = false; + experience_ = 0; + city_ = ""; + status_ = 0; + createTime_ = 0L; + modifyTime_ = 0L; + secret_ = 0; + shareQrcodeUri_ = ""; + incomeSharePercent_ = 0; + badgeImageListList_ = null; + if (badgeImageListListBuilder_ != null) { + badgeImageListListBuilder_.dispose(); + badgeImageListListBuilder_ = null; + } + followInfo_ = null; + if (followInfoBuilder_ != null) { + followInfoBuilder_.dispose(); + followInfoBuilder_ = null; + } + payGrade_ = null; + if (payGradeBuilder_ != null) { + payGradeBuilder_.dispose(); + payGradeBuilder_ = null; + } + fansClub_ = null; + if (fansClubBuilder_ != null) { + fansClubBuilder_.dispose(); + fansClubBuilder_ = null; + } + border_ = null; + if (borderBuilder_ != null) { + borderBuilder_.dispose(); + borderBuilder_ = null; + } + specialId_ = ""; + avatarBorder_ = null; + if (avatarBorderBuilder_ != null) { + avatarBorderBuilder_.dispose(); + avatarBorderBuilder_ = null; + } + medal_ = null; + if (medalBuilder_ != null) { + medalBuilder_.dispose(); + medalBuilder_ = null; + } + if (realTimeIconsListBuilder_ == null) { + realTimeIconsList_ = java.util.Collections.emptyList(); + } else { + realTimeIconsList_ = null; + realTimeIconsListBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x10000000); + if (newRealTimeIconsListBuilder_ == null) { + newRealTimeIconsList_ = java.util.Collections.emptyList(); + } else { + newRealTimeIconsList_ = null; + newRealTimeIconsListBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x20000000); + topVipNo_ = 0L; + userAttr_ = null; + if (userAttrBuilder_ != null) { + userAttrBuilder_.dispose(); + userAttrBuilder_ = null; + } + ownRoom_ = null; + if (ownRoomBuilder_ != null) { + ownRoomBuilder_.dispose(); + ownRoomBuilder_ = null; + } + payScore_ = 0L; + ticketCount_ = 0L; + anchorInfo_ = null; + if (anchorInfoBuilder_ != null) { + anchorInfoBuilder_.dispose(); + anchorInfoBuilder_ = null; + } + linkMicStats_ = 0; + displayId_ = ""; + withCommercePermission_ = false; + withFusionShopEntry_ = false; + totalRechargeDiamondCount_ = 0L; + webcastAnchorLevel_ = null; + if (webcastAnchorLevelBuilder_ != null) { + webcastAnchorLevelBuilder_.dispose(); + webcastAnchorLevelBuilder_ = null; + } + verifiedContent_ = ""; + authorStats_ = null; + if (authorStatsBuilder_ != null) { + authorStatsBuilder_.dispose(); + authorStatsBuilder_ = null; + } + if (topFansListBuilder_ == null) { + topFansList_ = java.util.Collections.emptyList(); + } else { + topFansList_ = null; + topFansListBuilder_.clear(); + } + bitField1_ = (bitField1_ & ~0x00001000); + secUid_ = ""; + userRole_ = 0; + xiguaInfo_ = null; + if (xiguaInfoBuilder_ != null) { + xiguaInfoBuilder_.dispose(); + xiguaInfoBuilder_ = null; + } + activityReward_ = null; + if (activityRewardBuilder_ != null) { + activityRewardBuilder_.dispose(); + activityRewardBuilder_ = null; + } + nobleInfo_ = null; + if (nobleInfoBuilder_ != null) { + nobleInfoBuilder_.dispose(); + nobleInfoBuilder_ = null; + } + brotherhoodInfo_ = null; + if (brotherhoodInfoBuilder_ != null) { + brotherhoodInfoBuilder_.dispose(); + brotherhoodInfoBuilder_ = null; + } + personalCard_ = null; + if (personalCardBuilder_ != null) { + personalCardBuilder_.dispose(); + personalCardBuilder_ = null; + } + authenticationInfo_ = null; + if (authenticationInfoBuilder_ != null) { + authenticationInfoBuilder_.dispose(); + authenticationInfoBuilder_ = null; + } + authorizationInfo_ = 0; + adversaryAuthorizationInfo_ = 0; + poiInfo_ = null; + if (poiInfoBuilder_ != null) { + poiInfoBuilder_.dispose(); + poiInfoBuilder_ = null; + } + mediaBadgeImageListList_ = null; + if (mediaBadgeImageListListBuilder_ != null) { + mediaBadgeImageListListBuilder_.dispose(); + mediaBadgeImageListListBuilder_ = null; + } + adversaryUserStatus_ = 0; + userVipInfo_ = null; + if (userVipInfoBuilder_ != null) { + userVipInfoBuilder_.dispose(); + userVipInfoBuilder_ = null; + } + commerceWebcastConfigIdsList_ = emptyLongList(); + badgeImageListV2List_ = null; + if (badgeImageListV2ListBuilder_ != null) { + badgeImageListV2ListBuilder_.dispose(); + badgeImageListV2ListBuilder_ = null; + } + locationCity_ = ""; + fansGroupInfo_ = null; + if (fansGroupInfoBuilder_ != null) { + fansGroupInfoBuilder_.dispose(); + fansGroupInfoBuilder_ = null; + } + remarkName_ = ""; + mysteryMan_ = 0; + webRid_ = ""; + desensitizedNickname_ = ""; + jAccreditInfo_ = null; + if (jAccreditInfoBuilder_ != null) { + jAccreditInfoBuilder_.dispose(); + jAccreditInfoBuilder_ = null; + } + subscribe_ = null; + if (subscribeBuilder_ != null) { + subscribeBuilder_.dispose(); + subscribeBuilder_ = null; + } + isAnonymous_ = false; + consumeDiamondLevel_ = 0; + webcastUid_ = ""; + profileStyleParams_ = null; + if (profileStyleParamsBuilder_ != null) { + profileStyleParamsBuilder_.dispose(); + profileStyleParamsBuilder_ = null; + } + userDressInfo_ = null; + if (userDressInfoBuilder_ != null) { + userDressInfoBuilder_.dispose(); + userDressInfoBuilder_ = null; + } + allowBeLocated_ = false; + allowFindByContacts_ = false; + allowOthersDownloadVideo_ = false; + allowOthersDownloadWhenSharingVideo_ = false; + allowShareShowProfile_ = false; + allowShowInGossip_ = false; + allowShowMyAction_ = false; + allowStrangeComment_ = false; + allowUnfollowerComment_ = false; + allowUseLinkmic_ = false; + anchorLevel_ = null; + if (anchorLevelBuilder_ != null) { + anchorLevelBuilder_.dispose(); + anchorLevelBuilder_ = null; + } + avatarJpg_ = null; + if (avatarJpgBuilder_ != null) { + avatarJpgBuilder_.dispose(); + avatarJpgBuilder_ = null; + } + bgImgUrl_ = ""; + birthdayDescription_ = ""; + birthdayValid_ = false; + blockStatus_ = 0; + commentRestrict_ = 0; + constellation_ = ""; + disableIchat_ = 0; + enableIchatImg_ = 0L; + exp_ = 0; + fanTicketCount_ = 0L; + foldStrangerChat_ = false; + followStatus_ = 0L; + hotsoonVerified_ = false; + hotsoonVerifiedReason_ = ""; + ichatRestrictType_ = 0; + idStr_ = ""; + isFollower_ = false; + isFollowing_ = false; + needProfileGuide_ = false; + payScores_ = 0L; + pushCommentStatus_ = false; + pushDigg_ = false; + pushFollow_ = false; + pushFriendAction_ = false; + pushIchat_ = false; + pushStatus_ = false; + pushVideoPost_ = false; + pushVideoRecommend_ = false; + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + verifiedMobile_ = false; + verifiedReason_ = ""; + withCarManagementPermission_ = false; + ageRange_ = 0; + watchDurationMonth_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.internal_static_User_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User build() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User buildPartial() { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User result = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + if (bitField1_ != 0) { buildPartial1(result); } + if (bitField2_ != 0) { buildPartial2(result); } + if (bitField3_ != 0) { buildPartial3(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User result) { + if (realTimeIconsListBuilder_ == null) { + if (((bitField0_ & 0x10000000) != 0)) { + realTimeIconsList_ = java.util.Collections.unmodifiableList(realTimeIconsList_); + bitField0_ = (bitField0_ & ~0x10000000); + } + result.realTimeIconsList_ = realTimeIconsList_; + } else { + result.realTimeIconsList_ = realTimeIconsListBuilder_.build(); + } + if (newRealTimeIconsListBuilder_ == null) { + if (((bitField0_ & 0x20000000) != 0)) { + newRealTimeIconsList_ = java.util.Collections.unmodifiableList(newRealTimeIconsList_); + bitField0_ = (bitField0_ & ~0x20000000); + } + result.newRealTimeIconsList_ = newRealTimeIconsList_; + } else { + result.newRealTimeIconsList_ = newRealTimeIconsListBuilder_.build(); + } + if (topFansListBuilder_ == null) { + if (((bitField1_ & 0x00001000) != 0)) { + topFansList_ = java.util.Collections.unmodifiableList(topFansList_); + bitField1_ = (bitField1_ & ~0x00001000); + } + result.topFansList_ = topFansList_; + } else { + result.topFansList_ = topFansListBuilder_.build(); + } + if (((bitField1_ & 0x08000000) != 0)) { + commerceWebcastConfigIdsList_.makeImmutable(); + bitField1_ = (bitField1_ & ~0x08000000); + } + result.commerceWebcastConfigIdsList_ = commerceWebcastConfigIdsList_; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.shortId_ = shortId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nickname_ = nickname_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.gender_ = gender_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.signature_ = signature_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.level_ = level_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.birthday_ = birthday_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.telephone_ = telephone_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.avatarThumb_ = avatarThumbBuilder_ == null + ? avatarThumb_ + : avatarThumbBuilder_.build(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.avatarMedium_ = avatarMediumBuilder_ == null + ? avatarMedium_ + : avatarMediumBuilder_.build(); + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.avatarLarge_ = avatarLargeBuilder_ == null + ? avatarLarge_ + : avatarLargeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.verified_ = verified_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.experience_ = experience_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.city_ = city_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.status_ = status_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.createTime_ = createTime_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.modifyTime_ = modifyTime_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.secret_ = secret_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.shareQrcodeUri_ = shareQrcodeUri_; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.incomeSharePercent_ = incomeSharePercent_; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.badgeImageListList_ = badgeImageListListBuilder_ == null + ? badgeImageListList_ + : badgeImageListListBuilder_.build(); + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.followInfo_ = followInfoBuilder_ == null + ? followInfo_ + : followInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.payGrade_ = payGradeBuilder_ == null + ? payGrade_ + : payGradeBuilder_.build(); + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.fansClub_ = fansClubBuilder_ == null + ? fansClub_ + : fansClubBuilder_.build(); + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.border_ = borderBuilder_ == null + ? border_ + : borderBuilder_.build(); + } + if (((from_bitField0_ & 0x02000000) != 0)) { + result.specialId_ = specialId_; + } + if (((from_bitField0_ & 0x04000000) != 0)) { + result.avatarBorder_ = avatarBorderBuilder_ == null + ? avatarBorder_ + : avatarBorderBuilder_.build(); + } + if (((from_bitField0_ & 0x08000000) != 0)) { + result.medal_ = medalBuilder_ == null + ? medal_ + : medalBuilder_.build(); + } + if (((from_bitField0_ & 0x40000000) != 0)) { + result.topVipNo_ = topVipNo_; + } + if (((from_bitField0_ & 0x80000000) != 0)) { + result.userAttr_ = userAttrBuilder_ == null + ? userAttr_ + : userAttrBuilder_.build(); + } + } + + private void buildPartial1(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User result) { + int from_bitField1_ = bitField1_; + if (((from_bitField1_ & 0x00000001) != 0)) { + result.ownRoom_ = ownRoomBuilder_ == null + ? ownRoom_ + : ownRoomBuilder_.build(); + } + if (((from_bitField1_ & 0x00000002) != 0)) { + result.payScore_ = payScore_; + } + if (((from_bitField1_ & 0x00000004) != 0)) { + result.ticketCount_ = ticketCount_; + } + if (((from_bitField1_ & 0x00000008) != 0)) { + result.anchorInfo_ = anchorInfoBuilder_ == null + ? anchorInfo_ + : anchorInfoBuilder_.build(); + } + if (((from_bitField1_ & 0x00000010) != 0)) { + result.linkMicStats_ = linkMicStats_; + } + if (((from_bitField1_ & 0x00000020) != 0)) { + result.displayId_ = displayId_; + } + if (((from_bitField1_ & 0x00000040) != 0)) { + result.withCommercePermission_ = withCommercePermission_; + } + if (((from_bitField1_ & 0x00000080) != 0)) { + result.withFusionShopEntry_ = withFusionShopEntry_; + } + if (((from_bitField1_ & 0x00000100) != 0)) { + result.totalRechargeDiamondCount_ = totalRechargeDiamondCount_; + } + if (((from_bitField1_ & 0x00000200) != 0)) { + result.webcastAnchorLevel_ = webcastAnchorLevelBuilder_ == null + ? webcastAnchorLevel_ + : webcastAnchorLevelBuilder_.build(); + } + if (((from_bitField1_ & 0x00000400) != 0)) { + result.verifiedContent_ = verifiedContent_; + } + if (((from_bitField1_ & 0x00000800) != 0)) { + result.authorStats_ = authorStatsBuilder_ == null + ? authorStats_ + : authorStatsBuilder_.build(); + } + if (((from_bitField1_ & 0x00002000) != 0)) { + result.secUid_ = secUid_; + } + if (((from_bitField1_ & 0x00004000) != 0)) { + result.userRole_ = userRole_; + } + if (((from_bitField1_ & 0x00008000) != 0)) { + result.xiguaInfo_ = xiguaInfoBuilder_ == null + ? xiguaInfo_ + : xiguaInfoBuilder_.build(); + } + if (((from_bitField1_ & 0x00010000) != 0)) { + result.activityReward_ = activityRewardBuilder_ == null + ? activityReward_ + : activityRewardBuilder_.build(); + } + if (((from_bitField1_ & 0x00020000) != 0)) { + result.nobleInfo_ = nobleInfoBuilder_ == null + ? nobleInfo_ + : nobleInfoBuilder_.build(); + } + if (((from_bitField1_ & 0x00040000) != 0)) { + result.brotherhoodInfo_ = brotherhoodInfoBuilder_ == null + ? brotherhoodInfo_ + : brotherhoodInfoBuilder_.build(); + } + if (((from_bitField1_ & 0x00080000) != 0)) { + result.personalCard_ = personalCardBuilder_ == null + ? personalCard_ + : personalCardBuilder_.build(); + } + if (((from_bitField1_ & 0x00100000) != 0)) { + result.authenticationInfo_ = authenticationInfoBuilder_ == null + ? authenticationInfo_ + : authenticationInfoBuilder_.build(); + } + if (((from_bitField1_ & 0x00200000) != 0)) { + result.authorizationInfo_ = authorizationInfo_; + } + if (((from_bitField1_ & 0x00400000) != 0)) { + result.adversaryAuthorizationInfo_ = adversaryAuthorizationInfo_; + } + if (((from_bitField1_ & 0x00800000) != 0)) { + result.poiInfo_ = poiInfoBuilder_ == null + ? poiInfo_ + : poiInfoBuilder_.build(); + } + if (((from_bitField1_ & 0x01000000) != 0)) { + result.mediaBadgeImageListList_ = mediaBadgeImageListListBuilder_ == null + ? mediaBadgeImageListList_ + : mediaBadgeImageListListBuilder_.build(); + } + if (((from_bitField1_ & 0x02000000) != 0)) { + result.adversaryUserStatus_ = adversaryUserStatus_; + } + if (((from_bitField1_ & 0x04000000) != 0)) { + result.userVipInfo_ = userVipInfoBuilder_ == null + ? userVipInfo_ + : userVipInfoBuilder_.build(); + } + if (((from_bitField1_ & 0x10000000) != 0)) { + result.badgeImageListV2List_ = badgeImageListV2ListBuilder_ == null + ? badgeImageListV2List_ + : badgeImageListV2ListBuilder_.build(); + } + if (((from_bitField1_ & 0x20000000) != 0)) { + result.locationCity_ = locationCity_; + } + if (((from_bitField1_ & 0x40000000) != 0)) { + result.fansGroupInfo_ = fansGroupInfoBuilder_ == null + ? fansGroupInfo_ + : fansGroupInfoBuilder_.build(); + } + if (((from_bitField1_ & 0x80000000) != 0)) { + result.remarkName_ = remarkName_; + } + } + + private void buildPartial2(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User result) { + int from_bitField2_ = bitField2_; + if (((from_bitField2_ & 0x00000001) != 0)) { + result.mysteryMan_ = mysteryMan_; + } + if (((from_bitField2_ & 0x00000002) != 0)) { + result.webRid_ = webRid_; + } + if (((from_bitField2_ & 0x00000004) != 0)) { + result.desensitizedNickname_ = desensitizedNickname_; + } + if (((from_bitField2_ & 0x00000008) != 0)) { + result.jAccreditInfo_ = jAccreditInfoBuilder_ == null + ? jAccreditInfo_ + : jAccreditInfoBuilder_.build(); + } + if (((from_bitField2_ & 0x00000010) != 0)) { + result.subscribe_ = subscribeBuilder_ == null + ? subscribe_ + : subscribeBuilder_.build(); + } + if (((from_bitField2_ & 0x00000020) != 0)) { + result.isAnonymous_ = isAnonymous_; + } + if (((from_bitField2_ & 0x00000040) != 0)) { + result.consumeDiamondLevel_ = consumeDiamondLevel_; + } + if (((from_bitField2_ & 0x00000080) != 0)) { + result.webcastUid_ = webcastUid_; + } + if (((from_bitField2_ & 0x00000100) != 0)) { + result.profileStyleParams_ = profileStyleParamsBuilder_ == null + ? profileStyleParams_ + : profileStyleParamsBuilder_.build(); + } + if (((from_bitField2_ & 0x00000200) != 0)) { + result.userDressInfo_ = userDressInfoBuilder_ == null + ? userDressInfo_ + : userDressInfoBuilder_.build(); + } + if (((from_bitField2_ & 0x00000400) != 0)) { + result.allowBeLocated_ = allowBeLocated_; + } + if (((from_bitField2_ & 0x00000800) != 0)) { + result.allowFindByContacts_ = allowFindByContacts_; + } + if (((from_bitField2_ & 0x00001000) != 0)) { + result.allowOthersDownloadVideo_ = allowOthersDownloadVideo_; + } + if (((from_bitField2_ & 0x00002000) != 0)) { + result.allowOthersDownloadWhenSharingVideo_ = allowOthersDownloadWhenSharingVideo_; + } + if (((from_bitField2_ & 0x00004000) != 0)) { + result.allowShareShowProfile_ = allowShareShowProfile_; + } + if (((from_bitField2_ & 0x00008000) != 0)) { + result.allowShowInGossip_ = allowShowInGossip_; + } + if (((from_bitField2_ & 0x00010000) != 0)) { + result.allowShowMyAction_ = allowShowMyAction_; + } + if (((from_bitField2_ & 0x00020000) != 0)) { + result.allowStrangeComment_ = allowStrangeComment_; + } + if (((from_bitField2_ & 0x00040000) != 0)) { + result.allowUnfollowerComment_ = allowUnfollowerComment_; + } + if (((from_bitField2_ & 0x00080000) != 0)) { + result.allowUseLinkmic_ = allowUseLinkmic_; + } + if (((from_bitField2_ & 0x00100000) != 0)) { + result.anchorLevel_ = anchorLevelBuilder_ == null + ? anchorLevel_ + : anchorLevelBuilder_.build(); + } + if (((from_bitField2_ & 0x00200000) != 0)) { + result.avatarJpg_ = avatarJpgBuilder_ == null + ? avatarJpg_ + : avatarJpgBuilder_.build(); + } + if (((from_bitField2_ & 0x00400000) != 0)) { + result.bgImgUrl_ = bgImgUrl_; + } + if (((from_bitField2_ & 0x00800000) != 0)) { + result.birthdayDescription_ = birthdayDescription_; + } + if (((from_bitField2_ & 0x01000000) != 0)) { + result.birthdayValid_ = birthdayValid_; + } + if (((from_bitField2_ & 0x02000000) != 0)) { + result.blockStatus_ = blockStatus_; + } + if (((from_bitField2_ & 0x04000000) != 0)) { + result.commentRestrict_ = commentRestrict_; + } + if (((from_bitField2_ & 0x08000000) != 0)) { + result.constellation_ = constellation_; + } + if (((from_bitField2_ & 0x10000000) != 0)) { + result.disableIchat_ = disableIchat_; + } + if (((from_bitField2_ & 0x20000000) != 0)) { + result.enableIchatImg_ = enableIchatImg_; + } + if (((from_bitField2_ & 0x40000000) != 0)) { + result.exp_ = exp_; + } + if (((from_bitField2_ & 0x80000000) != 0)) { + result.fanTicketCount_ = fanTicketCount_; + } + } + + private void buildPartial3(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User result) { + int from_bitField3_ = bitField3_; + if (((from_bitField3_ & 0x00000001) != 0)) { + result.foldStrangerChat_ = foldStrangerChat_; + } + if (((from_bitField3_ & 0x00000002) != 0)) { + result.followStatus_ = followStatus_; + } + if (((from_bitField3_ & 0x00000004) != 0)) { + result.hotsoonVerified_ = hotsoonVerified_; + } + if (((from_bitField3_ & 0x00000008) != 0)) { + result.hotsoonVerifiedReason_ = hotsoonVerifiedReason_; + } + if (((from_bitField3_ & 0x00000010) != 0)) { + result.ichatRestrictType_ = ichatRestrictType_; + } + if (((from_bitField3_ & 0x00000020) != 0)) { + result.idStr_ = idStr_; + } + if (((from_bitField3_ & 0x00000040) != 0)) { + result.isFollower_ = isFollower_; + } + if (((from_bitField3_ & 0x00000080) != 0)) { + result.isFollowing_ = isFollowing_; + } + if (((from_bitField3_ & 0x00000100) != 0)) { + result.needProfileGuide_ = needProfileGuide_; + } + if (((from_bitField3_ & 0x00000200) != 0)) { + result.payScores_ = payScores_; + } + if (((from_bitField3_ & 0x00000400) != 0)) { + result.pushCommentStatus_ = pushCommentStatus_; + } + if (((from_bitField3_ & 0x00000800) != 0)) { + result.pushDigg_ = pushDigg_; + } + if (((from_bitField3_ & 0x00001000) != 0)) { + result.pushFollow_ = pushFollow_; + } + if (((from_bitField3_ & 0x00002000) != 0)) { + result.pushFriendAction_ = pushFriendAction_; + } + if (((from_bitField3_ & 0x00004000) != 0)) { + result.pushIchat_ = pushIchat_; + } + if (((from_bitField3_ & 0x00008000) != 0)) { + result.pushStatus_ = pushStatus_; + } + if (((from_bitField3_ & 0x00010000) != 0)) { + result.pushVideoPost_ = pushVideoPost_; + } + if (((from_bitField3_ & 0x00020000) != 0)) { + result.pushVideoRecommend_ = pushVideoRecommend_; + } + if (((from_bitField3_ & 0x00040000) != 0)) { + result.stats_ = statsBuilder_ == null + ? stats_ + : statsBuilder_.build(); + } + if (((from_bitField3_ & 0x00080000) != 0)) { + result.verifiedMobile_ = verifiedMobile_; + } + if (((from_bitField3_ & 0x00100000) != 0)) { + result.verifiedReason_ = verifiedReason_; + } + if (((from_bitField3_ & 0x00200000) != 0)) { + result.withCarManagementPermission_ = withCarManagementPermission_; + } + if (((from_bitField3_ & 0x00400000) != 0)) { + result.ageRange_ = ageRange_; + } + if (((from_bitField3_ & 0x00800000) != 0)) { + result.watchDurationMonth_ = watchDurationMonth_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User) { + return mergeFrom((tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User other) { + if (other == tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (other.getShortId() != 0L) { + setShortId(other.getShortId()); + } + if (!other.getNickname().isEmpty()) { + nickname_ = other.nickname_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getGender() != 0) { + setGender(other.getGender()); + } + if (!other.getSignature().isEmpty()) { + signature_ = other.signature_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getLevel() != 0) { + setLevel(other.getLevel()); + } + if (other.getBirthday() != 0L) { + setBirthday(other.getBirthday()); + } + if (!other.getTelephone().isEmpty()) { + telephone_ = other.telephone_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.hasAvatarThumb()) { + mergeAvatarThumb(other.getAvatarThumb()); + } + if (other.hasAvatarMedium()) { + mergeAvatarMedium(other.getAvatarMedium()); + } + if (other.hasAvatarLarge()) { + mergeAvatarLarge(other.getAvatarLarge()); + } + if (other.getVerified() != false) { + setVerified(other.getVerified()); + } + if (other.getExperience() != 0) { + setExperience(other.getExperience()); + } + if (!other.getCity().isEmpty()) { + city_ = other.city_; + bitField0_ |= 0x00002000; + onChanged(); + } + if (other.getStatus() != 0) { + setStatus(other.getStatus()); + } + if (other.getCreateTime() != 0L) { + setCreateTime(other.getCreateTime()); + } + if (other.getModifyTime() != 0L) { + setModifyTime(other.getModifyTime()); + } + if (other.getSecret() != 0) { + setSecret(other.getSecret()); + } + if (!other.getShareQrcodeUri().isEmpty()) { + shareQrcodeUri_ = other.shareQrcodeUri_; + bitField0_ |= 0x00040000; + onChanged(); + } + if (other.getIncomeSharePercent() != 0) { + setIncomeSharePercent(other.getIncomeSharePercent()); + } + if (other.hasBadgeImageListList()) { + mergeBadgeImageListList(other.getBadgeImageListList()); + } + if (other.hasFollowInfo()) { + mergeFollowInfo(other.getFollowInfo()); + } + if (other.hasPayGrade()) { + mergePayGrade(other.getPayGrade()); + } + if (other.hasFansClub()) { + mergeFansClub(other.getFansClub()); + } + if (other.hasBorder()) { + mergeBorder(other.getBorder()); + } + if (!other.getSpecialId().isEmpty()) { + specialId_ = other.specialId_; + bitField0_ |= 0x02000000; + onChanged(); + } + if (other.hasAvatarBorder()) { + mergeAvatarBorder(other.getAvatarBorder()); + } + if (other.hasMedal()) { + mergeMedal(other.getMedal()); + } + if (realTimeIconsListBuilder_ == null) { + if (!other.realTimeIconsList_.isEmpty()) { + if (realTimeIconsList_.isEmpty()) { + realTimeIconsList_ = other.realTimeIconsList_; + bitField0_ = (bitField0_ & ~0x10000000); + } else { + ensureRealTimeIconsListIsMutable(); + realTimeIconsList_.addAll(other.realTimeIconsList_); + } + onChanged(); + } + } else { + if (!other.realTimeIconsList_.isEmpty()) { + if (realTimeIconsListBuilder_.isEmpty()) { + realTimeIconsListBuilder_.dispose(); + realTimeIconsListBuilder_ = null; + realTimeIconsList_ = other.realTimeIconsList_; + bitField0_ = (bitField0_ & ~0x10000000); + realTimeIconsListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getRealTimeIconsListFieldBuilder() : null; + } else { + realTimeIconsListBuilder_.addAllMessages(other.realTimeIconsList_); + } + } + } + if (newRealTimeIconsListBuilder_ == null) { + if (!other.newRealTimeIconsList_.isEmpty()) { + if (newRealTimeIconsList_.isEmpty()) { + newRealTimeIconsList_ = other.newRealTimeIconsList_; + bitField0_ = (bitField0_ & ~0x20000000); + } else { + ensureNewRealTimeIconsListIsMutable(); + newRealTimeIconsList_.addAll(other.newRealTimeIconsList_); + } + onChanged(); + } + } else { + if (!other.newRealTimeIconsList_.isEmpty()) { + if (newRealTimeIconsListBuilder_.isEmpty()) { + newRealTimeIconsListBuilder_.dispose(); + newRealTimeIconsListBuilder_ = null; + newRealTimeIconsList_ = other.newRealTimeIconsList_; + bitField0_ = (bitField0_ & ~0x20000000); + newRealTimeIconsListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getNewRealTimeIconsListFieldBuilder() : null; + } else { + newRealTimeIconsListBuilder_.addAllMessages(other.newRealTimeIconsList_); + } + } + } + if (other.getTopVipNo() != 0L) { + setTopVipNo(other.getTopVipNo()); + } + if (other.hasUserAttr()) { + mergeUserAttr(other.getUserAttr()); + } + if (other.hasOwnRoom()) { + mergeOwnRoom(other.getOwnRoom()); + } + if (other.getPayScore() != 0L) { + setPayScore(other.getPayScore()); + } + if (other.getTicketCount() != 0L) { + setTicketCount(other.getTicketCount()); + } + if (other.hasAnchorInfo()) { + mergeAnchorInfo(other.getAnchorInfo()); + } + if (other.getLinkMicStats() != 0) { + setLinkMicStats(other.getLinkMicStats()); + } + if (!other.getDisplayId().isEmpty()) { + displayId_ = other.displayId_; + bitField1_ |= 0x00000020; + onChanged(); + } + if (other.getWithCommercePermission() != false) { + setWithCommercePermission(other.getWithCommercePermission()); + } + if (other.getWithFusionShopEntry() != false) { + setWithFusionShopEntry(other.getWithFusionShopEntry()); + } + if (other.getTotalRechargeDiamondCount() != 0L) { + setTotalRechargeDiamondCount(other.getTotalRechargeDiamondCount()); + } + if (other.hasWebcastAnchorLevel()) { + mergeWebcastAnchorLevel(other.getWebcastAnchorLevel()); + } + if (!other.getVerifiedContent().isEmpty()) { + verifiedContent_ = other.verifiedContent_; + bitField1_ |= 0x00000400; + onChanged(); + } + if (other.hasAuthorStats()) { + mergeAuthorStats(other.getAuthorStats()); + } + if (topFansListBuilder_ == null) { + if (!other.topFansList_.isEmpty()) { + if (topFansList_.isEmpty()) { + topFansList_ = other.topFansList_; + bitField1_ = (bitField1_ & ~0x00001000); + } else { + ensureTopFansListIsMutable(); + topFansList_.addAll(other.topFansList_); + } + onChanged(); + } + } else { + if (!other.topFansList_.isEmpty()) { + if (topFansListBuilder_.isEmpty()) { + topFansListBuilder_.dispose(); + topFansListBuilder_ = null; + topFansList_ = other.topFansList_; + bitField1_ = (bitField1_ & ~0x00001000); + topFansListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTopFansListFieldBuilder() : null; + } else { + topFansListBuilder_.addAllMessages(other.topFansList_); + } + } + } + if (!other.getSecUid().isEmpty()) { + secUid_ = other.secUid_; + bitField1_ |= 0x00002000; + onChanged(); + } + if (other.getUserRole() != 0) { + setUserRole(other.getUserRole()); + } + if (other.hasXiguaInfo()) { + mergeXiguaInfo(other.getXiguaInfo()); + } + if (other.hasActivityReward()) { + mergeActivityReward(other.getActivityReward()); + } + if (other.hasNobleInfo()) { + mergeNobleInfo(other.getNobleInfo()); + } + if (other.hasBrotherhoodInfo()) { + mergeBrotherhoodInfo(other.getBrotherhoodInfo()); + } + if (other.hasPersonalCard()) { + mergePersonalCard(other.getPersonalCard()); + } + if (other.hasAuthenticationInfo()) { + mergeAuthenticationInfo(other.getAuthenticationInfo()); + } + if (other.getAuthorizationInfo() != 0) { + setAuthorizationInfo(other.getAuthorizationInfo()); + } + if (other.getAdversaryAuthorizationInfo() != 0) { + setAdversaryAuthorizationInfo(other.getAdversaryAuthorizationInfo()); + } + if (other.hasPoiInfo()) { + mergePoiInfo(other.getPoiInfo()); + } + if (other.hasMediaBadgeImageListList()) { + mergeMediaBadgeImageListList(other.getMediaBadgeImageListList()); + } + if (other.getAdversaryUserStatus() != 0) { + setAdversaryUserStatus(other.getAdversaryUserStatus()); + } + if (other.hasUserVipInfo()) { + mergeUserVipInfo(other.getUserVipInfo()); + } + if (!other.commerceWebcastConfigIdsList_.isEmpty()) { + if (commerceWebcastConfigIdsList_.isEmpty()) { + commerceWebcastConfigIdsList_ = other.commerceWebcastConfigIdsList_; + bitField1_ = (bitField1_ & ~0x08000000); + } else { + ensureCommerceWebcastConfigIdsListIsMutable(); + commerceWebcastConfigIdsList_.addAll(other.commerceWebcastConfigIdsList_); + } + onChanged(); + } + if (other.hasBadgeImageListV2List()) { + mergeBadgeImageListV2List(other.getBadgeImageListV2List()); + } + if (!other.getLocationCity().isEmpty()) { + locationCity_ = other.locationCity_; + bitField1_ |= 0x20000000; + onChanged(); + } + if (other.hasFansGroupInfo()) { + mergeFansGroupInfo(other.getFansGroupInfo()); + } + if (!other.getRemarkName().isEmpty()) { + remarkName_ = other.remarkName_; + bitField1_ |= 0x80000000; + onChanged(); + } + if (other.getMysteryMan() != 0) { + setMysteryMan(other.getMysteryMan()); + } + if (!other.getWebRid().isEmpty()) { + webRid_ = other.webRid_; + bitField2_ |= 0x00000002; + onChanged(); + } + if (!other.getDesensitizedNickname().isEmpty()) { + desensitizedNickname_ = other.desensitizedNickname_; + bitField2_ |= 0x00000004; + onChanged(); + } + if (other.hasJAccreditInfo()) { + mergeJAccreditInfo(other.getJAccreditInfo()); + } + if (other.hasSubscribe()) { + mergeSubscribe(other.getSubscribe()); + } + if (other.getIsAnonymous() != false) { + setIsAnonymous(other.getIsAnonymous()); + } + if (other.getConsumeDiamondLevel() != 0) { + setConsumeDiamondLevel(other.getConsumeDiamondLevel()); + } + if (!other.getWebcastUid().isEmpty()) { + webcastUid_ = other.webcastUid_; + bitField2_ |= 0x00000080; + onChanged(); + } + if (other.hasProfileStyleParams()) { + mergeProfileStyleParams(other.getProfileStyleParams()); + } + if (other.hasUserDressInfo()) { + mergeUserDressInfo(other.getUserDressInfo()); + } + if (other.getAllowBeLocated() != false) { + setAllowBeLocated(other.getAllowBeLocated()); + } + if (other.getAllowFindByContacts() != false) { + setAllowFindByContacts(other.getAllowFindByContacts()); + } + if (other.getAllowOthersDownloadVideo() != false) { + setAllowOthersDownloadVideo(other.getAllowOthersDownloadVideo()); + } + if (other.getAllowOthersDownloadWhenSharingVideo() != false) { + setAllowOthersDownloadWhenSharingVideo(other.getAllowOthersDownloadWhenSharingVideo()); + } + if (other.getAllowShareShowProfile() != false) { + setAllowShareShowProfile(other.getAllowShareShowProfile()); + } + if (other.getAllowShowInGossip() != false) { + setAllowShowInGossip(other.getAllowShowInGossip()); + } + if (other.getAllowShowMyAction() != false) { + setAllowShowMyAction(other.getAllowShowMyAction()); + } + if (other.getAllowStrangeComment() != false) { + setAllowStrangeComment(other.getAllowStrangeComment()); + } + if (other.getAllowUnfollowerComment() != false) { + setAllowUnfollowerComment(other.getAllowUnfollowerComment()); + } + if (other.getAllowUseLinkmic() != false) { + setAllowUseLinkmic(other.getAllowUseLinkmic()); + } + if (other.hasAnchorLevel()) { + mergeAnchorLevel(other.getAnchorLevel()); + } + if (other.hasAvatarJpg()) { + mergeAvatarJpg(other.getAvatarJpg()); + } + if (!other.getBgImgUrl().isEmpty()) { + bgImgUrl_ = other.bgImgUrl_; + bitField2_ |= 0x00400000; + onChanged(); + } + if (!other.getBirthdayDescription().isEmpty()) { + birthdayDescription_ = other.birthdayDescription_; + bitField2_ |= 0x00800000; + onChanged(); + } + if (other.getBirthdayValid() != false) { + setBirthdayValid(other.getBirthdayValid()); + } + if (other.getBlockStatus() != 0) { + setBlockStatus(other.getBlockStatus()); + } + if (other.getCommentRestrict() != 0) { + setCommentRestrict(other.getCommentRestrict()); + } + if (!other.getConstellation().isEmpty()) { + constellation_ = other.constellation_; + bitField2_ |= 0x08000000; + onChanged(); + } + if (other.getDisableIchat() != 0) { + setDisableIchat(other.getDisableIchat()); + } + if (other.getEnableIchatImg() != 0L) { + setEnableIchatImg(other.getEnableIchatImg()); + } + if (other.getExp() != 0) { + setExp(other.getExp()); + } + if (other.getFanTicketCount() != 0L) { + setFanTicketCount(other.getFanTicketCount()); + } + if (other.getFoldStrangerChat() != false) { + setFoldStrangerChat(other.getFoldStrangerChat()); + } + if (other.getFollowStatus() != 0L) { + setFollowStatus(other.getFollowStatus()); + } + if (other.getHotsoonVerified() != false) { + setHotsoonVerified(other.getHotsoonVerified()); + } + if (!other.getHotsoonVerifiedReason().isEmpty()) { + hotsoonVerifiedReason_ = other.hotsoonVerifiedReason_; + bitField3_ |= 0x00000008; + onChanged(); + } + if (other.getIchatRestrictType() != 0) { + setIchatRestrictType(other.getIchatRestrictType()); + } + if (!other.getIdStr().isEmpty()) { + idStr_ = other.idStr_; + bitField3_ |= 0x00000020; + onChanged(); + } + if (other.getIsFollower() != false) { + setIsFollower(other.getIsFollower()); + } + if (other.getIsFollowing() != false) { + setIsFollowing(other.getIsFollowing()); + } + if (other.getNeedProfileGuide() != false) { + setNeedProfileGuide(other.getNeedProfileGuide()); + } + if (other.getPayScores() != 0L) { + setPayScores(other.getPayScores()); + } + if (other.getPushCommentStatus() != false) { + setPushCommentStatus(other.getPushCommentStatus()); + } + if (other.getPushDigg() != false) { + setPushDigg(other.getPushDigg()); + } + if (other.getPushFollow() != false) { + setPushFollow(other.getPushFollow()); + } + if (other.getPushFriendAction() != false) { + setPushFriendAction(other.getPushFriendAction()); + } + if (other.getPushIchat() != false) { + setPushIchat(other.getPushIchat()); + } + if (other.getPushStatus() != false) { + setPushStatus(other.getPushStatus()); + } + if (other.getPushVideoPost() != false) { + setPushVideoPost(other.getPushVideoPost()); + } + if (other.getPushVideoRecommend() != false) { + setPushVideoRecommend(other.getPushVideoRecommend()); + } + if (other.hasStats()) { + mergeStats(other.getStats()); + } + if (other.getVerifiedMobile() != false) { + setVerifiedMobile(other.getVerifiedMobile()); + } + if (!other.getVerifiedReason().isEmpty()) { + verifiedReason_ = other.verifiedReason_; + bitField3_ |= 0x00100000; + onChanged(); + } + if (other.getWithCarManagementPermission() != false) { + setWithCarManagementPermission(other.getWithCarManagementPermission()); + } + if (other.getAgeRange() != 0) { + setAgeRange(other.getAgeRange()); + } + if (other.getWatchDurationMonth() != 0L) { + setWatchDurationMonth(other.getWatchDurationMonth()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + id_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + shortId_ = input.readUInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + nickname_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + gender_ = input.readUInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + signature_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: { + level_ = input.readUInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + birthday_ = input.readUInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 66: { + telephone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: { + input.readMessage( + getAvatarThumbFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: { + input.readMessage( + getAvatarMediumFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: { + input.readMessage( + getAvatarLargeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 96: { + verified_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 104: { + experience_ = input.readInt32(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 114: { + city_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 120: { + status_ = input.readInt32(); + bitField0_ |= 0x00004000; + break; + } // case 120 + case 128: { + createTime_ = input.readInt64(); + bitField0_ |= 0x00008000; + break; + } // case 128 + case 136: { + modifyTime_ = input.readInt64(); + bitField0_ |= 0x00010000; + break; + } // case 136 + case 144: { + secret_ = input.readInt32(); + bitField0_ |= 0x00020000; + break; + } // case 144 + case 154: { + shareQrcodeUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00040000; + break; + } // case 154 + case 160: { + incomeSharePercent_ = input.readInt32(); + bitField0_ |= 0x00080000; + break; + } // case 160 + case 170: { + input.readMessage( + getBadgeImageListListFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00100000; + break; + } // case 170 + case 178: { + input.readMessage( + getFollowInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00200000; + break; + } // case 178 + case 186: { + input.readMessage( + getPayGradeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00400000; + break; + } // case 186 + case 194: { + input.readMessage( + getFansClubFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00800000; + break; + } // case 194 + case 202: { + input.readMessage( + getBorderFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x01000000; + break; + } // case 202 + case 210: { + specialId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x02000000; + break; + } // case 210 + case 218: { + input.readMessage( + getAvatarBorderFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x04000000; + break; + } // case 218 + case 226: { + input.readMessage( + getMedalFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x08000000; + break; + } // case 226 + case 234: { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image m = + input.readMessage( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.parser(), + extensionRegistry); + if (realTimeIconsListBuilder_ == null) { + ensureRealTimeIconsListIsMutable(); + realTimeIconsList_.add(m); + } else { + realTimeIconsListBuilder_.addMessage(m); + } + break; + } // case 234 + case 242: { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image m = + input.readMessage( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.parser(), + extensionRegistry); + if (newRealTimeIconsListBuilder_ == null) { + ensureNewRealTimeIconsListIsMutable(); + newRealTimeIconsList_.add(m); + } else { + newRealTimeIconsListBuilder_.addMessage(m); + } + break; + } // case 242 + case 248: { + topVipNo_ = input.readInt64(); + bitField0_ |= 0x40000000; + break; + } // case 248 + case 258: { + input.readMessage( + getUserAttrFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x80000000; + break; + } // case 258 + case 266: { + input.readMessage( + getOwnRoomFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000001; + break; + } // case 266 + case 272: { + payScore_ = input.readInt64(); + bitField1_ |= 0x00000002; + break; + } // case 272 + case 280: { + ticketCount_ = input.readInt64(); + bitField1_ |= 0x00000004; + break; + } // case 280 + case 290: { + input.readMessage( + getAnchorInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000008; + break; + } // case 290 + case 296: { + linkMicStats_ = input.readInt32(); + bitField1_ |= 0x00000010; + break; + } // case 296 + case 306: { + displayId_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000020; + break; + } // case 306 + case 312: { + withCommercePermission_ = input.readBool(); + bitField1_ |= 0x00000040; + break; + } // case 312 + case 320: { + withFusionShopEntry_ = input.readBool(); + bitField1_ |= 0x00000080; + break; + } // case 320 + case 328: { + totalRechargeDiamondCount_ = input.readInt64(); + bitField1_ |= 0x00000100; + break; + } // case 328 + case 338: { + input.readMessage( + getWebcastAnchorLevelFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000200; + break; + } // case 338 + case 346: { + verifiedContent_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000400; + break; + } // case 346 + case 354: { + input.readMessage( + getAuthorStatsFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000800; + break; + } // case 354 + case 362: { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User m = + input.readMessage( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.parser(), + extensionRegistry); + if (topFansListBuilder_ == null) { + ensureTopFansListIsMutable(); + topFansList_.add(m); + } else { + topFansListBuilder_.addMessage(m); + } + break; + } // case 362 + case 370: { + secUid_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00002000; + break; + } // case 370 + case 376: { + userRole_ = input.readInt32(); + bitField1_ |= 0x00004000; + break; + } // case 376 + case 386: { + input.readMessage( + getXiguaInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00008000; + break; + } // case 386 + case 394: { + input.readMessage( + getActivityRewardFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00010000; + break; + } // case 394 + case 402: { + input.readMessage( + getNobleInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00020000; + break; + } // case 402 + case 410: { + input.readMessage( + getBrotherhoodInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00040000; + break; + } // case 410 + case 418: { + input.readMessage( + getPersonalCardFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00080000; + break; + } // case 418 + case 426: { + input.readMessage( + getAuthenticationInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00100000; + break; + } // case 426 + case 432: { + authorizationInfo_ = input.readInt32(); + bitField1_ |= 0x00200000; + break; + } // case 432 + case 440: { + adversaryAuthorizationInfo_ = input.readInt32(); + bitField1_ |= 0x00400000; + break; + } // case 440 + case 450: { + input.readMessage( + getPoiInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00800000; + break; + } // case 450 + case 458: { + input.readMessage( + getMediaBadgeImageListListFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x01000000; + break; + } // case 458 + case 464: { + adversaryUserStatus_ = input.readInt32(); + bitField1_ |= 0x02000000; + break; + } // case 464 + case 474: { + input.readMessage( + getUserVipInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x04000000; + break; + } // case 474 + case 480: { + long v = input.readInt64(); + ensureCommerceWebcastConfigIdsListIsMutable(); + commerceWebcastConfigIdsList_.addLong(v); + break; + } // case 480 + case 482: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureCommerceWebcastConfigIdsListIsMutable(); + while (input.getBytesUntilLimit() > 0) { + commerceWebcastConfigIdsList_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 482 + case 490: { + input.readMessage( + getBadgeImageListV2ListFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x10000000; + break; + } // case 490 + case 506: { + locationCity_ = input.readStringRequireUtf8(); + bitField1_ |= 0x20000000; + break; + } // case 506 + case 514: { + input.readMessage( + getFansGroupInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x40000000; + break; + } // case 514 + case 522: { + remarkName_ = input.readStringRequireUtf8(); + bitField1_ |= 0x80000000; + break; + } // case 522 + case 528: { + mysteryMan_ = input.readInt32(); + bitField2_ |= 0x00000001; + break; + } // case 528 + case 538: { + webRid_ = input.readStringRequireUtf8(); + bitField2_ |= 0x00000002; + break; + } // case 538 + case 546: { + desensitizedNickname_ = input.readStringRequireUtf8(); + bitField2_ |= 0x00000004; + break; + } // case 546 + case 554: { + input.readMessage( + getJAccreditInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField2_ |= 0x00000008; + break; + } // case 554 + case 562: { + input.readMessage( + getSubscribeFieldBuilder().getBuilder(), + extensionRegistry); + bitField2_ |= 0x00000010; + break; + } // case 562 + case 568: { + isAnonymous_ = input.readBool(); + bitField2_ |= 0x00000020; + break; + } // case 568 + case 576: { + consumeDiamondLevel_ = input.readInt32(); + bitField2_ |= 0x00000040; + break; + } // case 576 + case 586: { + webcastUid_ = input.readStringRequireUtf8(); + bitField2_ |= 0x00000080; + break; + } // case 586 + case 594: { + input.readMessage( + getProfileStyleParamsFieldBuilder().getBuilder(), + extensionRegistry); + bitField2_ |= 0x00000100; + break; + } // case 594 + case 602: { + input.readMessage( + getUserDressInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField2_ |= 0x00000200; + break; + } // case 602 + case 8008: { + allowBeLocated_ = input.readBool(); + bitField2_ |= 0x00000400; + break; + } // case 8008 + case 8016: { + allowFindByContacts_ = input.readBool(); + bitField2_ |= 0x00000800; + break; + } // case 8016 + case 8024: { + allowOthersDownloadVideo_ = input.readBool(); + bitField2_ |= 0x00001000; + break; + } // case 8024 + case 8032: { + allowOthersDownloadWhenSharingVideo_ = input.readBool(); + bitField2_ |= 0x00002000; + break; + } // case 8032 + case 8040: { + allowShareShowProfile_ = input.readBool(); + bitField2_ |= 0x00004000; + break; + } // case 8040 + case 8048: { + allowShowInGossip_ = input.readBool(); + bitField2_ |= 0x00008000; + break; + } // case 8048 + case 8056: { + allowShowMyAction_ = input.readBool(); + bitField2_ |= 0x00010000; + break; + } // case 8056 + case 8064: { + allowStrangeComment_ = input.readBool(); + bitField2_ |= 0x00020000; + break; + } // case 8064 + case 8072: { + allowUnfollowerComment_ = input.readBool(); + bitField2_ |= 0x00040000; + break; + } // case 8072 + case 8080: { + allowUseLinkmic_ = input.readBool(); + bitField2_ |= 0x00080000; + break; + } // case 8080 + case 8090: { + input.readMessage( + getAnchorLevelFieldBuilder().getBuilder(), + extensionRegistry); + bitField2_ |= 0x00100000; + break; + } // case 8090 + case 8098: { + input.readMessage( + getAvatarJpgFieldBuilder().getBuilder(), + extensionRegistry); + bitField2_ |= 0x00200000; + break; + } // case 8098 + case 8106: { + bgImgUrl_ = input.readStringRequireUtf8(); + bitField2_ |= 0x00400000; + break; + } // case 8106 + case 8114: { + birthdayDescription_ = input.readStringRequireUtf8(); + bitField2_ |= 0x00800000; + break; + } // case 8114 + case 8120: { + birthdayValid_ = input.readBool(); + bitField2_ |= 0x01000000; + break; + } // case 8120 + case 8128: { + blockStatus_ = input.readInt32(); + bitField2_ |= 0x02000000; + break; + } // case 8128 + case 8136: { + commentRestrict_ = input.readInt32(); + bitField2_ |= 0x04000000; + break; + } // case 8136 + case 8146: { + constellation_ = input.readStringRequireUtf8(); + bitField2_ |= 0x08000000; + break; + } // case 8146 + case 8152: { + disableIchat_ = input.readInt32(); + bitField2_ |= 0x10000000; + break; + } // case 8152 + case 8160: { + enableIchatImg_ = input.readInt64(); + bitField2_ |= 0x20000000; + break; + } // case 8160 + case 8168: { + exp_ = input.readInt32(); + bitField2_ |= 0x40000000; + break; + } // case 8168 + case 8176: { + fanTicketCount_ = input.readInt64(); + bitField2_ |= 0x80000000; + break; + } // case 8176 + case 8184: { + foldStrangerChat_ = input.readBool(); + bitField3_ |= 0x00000001; + break; + } // case 8184 + case 8192: { + followStatus_ = input.readInt64(); + bitField3_ |= 0x00000002; + break; + } // case 8192 + case 8200: { + hotsoonVerified_ = input.readBool(); + bitField3_ |= 0x00000004; + break; + } // case 8200 + case 8210: { + hotsoonVerifiedReason_ = input.readStringRequireUtf8(); + bitField3_ |= 0x00000008; + break; + } // case 8210 + case 8216: { + ichatRestrictType_ = input.readInt32(); + bitField3_ |= 0x00000010; + break; + } // case 8216 + case 8226: { + idStr_ = input.readStringRequireUtf8(); + bitField3_ |= 0x00000020; + break; + } // case 8226 + case 8232: { + isFollower_ = input.readBool(); + bitField3_ |= 0x00000040; + break; + } // case 8232 + case 8240: { + isFollowing_ = input.readBool(); + bitField3_ |= 0x00000080; + break; + } // case 8240 + case 8248: { + needProfileGuide_ = input.readBool(); + bitField3_ |= 0x00000100; + break; + } // case 8248 + case 8256: { + payScores_ = input.readInt64(); + bitField3_ |= 0x00000200; + break; + } // case 8256 + case 8264: { + pushCommentStatus_ = input.readBool(); + bitField3_ |= 0x00000400; + break; + } // case 8264 + case 8272: { + pushDigg_ = input.readBool(); + bitField3_ |= 0x00000800; + break; + } // case 8272 + case 8280: { + pushFollow_ = input.readBool(); + bitField3_ |= 0x00001000; + break; + } // case 8280 + case 8288: { + pushFriendAction_ = input.readBool(); + bitField3_ |= 0x00002000; + break; + } // case 8288 + case 8296: { + pushIchat_ = input.readBool(); + bitField3_ |= 0x00004000; + break; + } // case 8296 + case 8304: { + pushStatus_ = input.readBool(); + bitField3_ |= 0x00008000; + break; + } // case 8304 + case 8312: { + pushVideoPost_ = input.readBool(); + bitField3_ |= 0x00010000; + break; + } // case 8312 + case 8320: { + pushVideoRecommend_ = input.readBool(); + bitField3_ |= 0x00020000; + break; + } // case 8320 + case 8330: { + input.readMessage( + getStatsFieldBuilder().getBuilder(), + extensionRegistry); + bitField3_ |= 0x00040000; + break; + } // case 8330 + case 8336: { + verifiedMobile_ = input.readBool(); + bitField3_ |= 0x00080000; + break; + } // case 8336 + case 8346: { + verifiedReason_ = input.readStringRequireUtf8(); + bitField3_ |= 0x00100000; + break; + } // case 8346 + case 8352: { + withCarManagementPermission_ = input.readBool(); + bitField3_ |= 0x00200000; + break; + } // case 8352 + case 8360: { + ageRange_ = input.readInt32(); + bitField3_ |= 0x00400000; + break; + } // case 8360 + case 8368: { + watchDurationMonth_ = input.readInt64(); + bitField3_ |= 0x00800000; + break; + } // case 8368 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + private int bitField1_; + private int bitField2_; + private int bitField3_; + + private long id_ ; + /** + * uint64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + * uint64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private long shortId_ ; + /** + * uint64 shortId = 2; + * @return The shortId. + */ + @java.lang.Override + public long getShortId() { + return shortId_; + } + /** + * uint64 shortId = 2; + * @param value The shortId to set. + * @return This builder for chaining. + */ + public Builder setShortId(long value) { + + shortId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint64 shortId = 2; + * @return This builder for chaining. + */ + public Builder clearShortId() { + bitField0_ = (bitField0_ & ~0x00000002); + shortId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object nickname_ = ""; + /** + * string nickname = 3; + * @return The nickname. + */ + public java.lang.String getNickname() { + java.lang.Object ref = nickname_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nickname_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string nickname = 3; + * @return The bytes for nickname. + */ + public com.google.protobuf.ByteString + getNicknameBytes() { + java.lang.Object ref = nickname_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string nickname = 3; + * @param value The nickname to set. + * @return This builder for chaining. + */ + public Builder setNickname( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + nickname_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * string nickname = 3; + * @return This builder for chaining. + */ + public Builder clearNickname() { + nickname_ = getDefaultInstance().getNickname(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * string nickname = 3; + * @param value The bytes for nickname to set. + * @return This builder for chaining. + */ + public Builder setNicknameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + nickname_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int gender_ ; + /** + * uint32 gender = 4; + * @return The gender. + */ + @java.lang.Override + public int getGender() { + return gender_; + } + /** + * uint32 gender = 4; + * @param value The gender to set. + * @return This builder for chaining. + */ + public Builder setGender(int value) { + + gender_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint32 gender = 4; + * @return This builder for chaining. + */ + public Builder clearGender() { + bitField0_ = (bitField0_ & ~0x00000008); + gender_ = 0; + onChanged(); + return this; + } + + private java.lang.Object signature_ = ""; + /** + * string signature = 5; + * @return The signature. + */ + public java.lang.String getSignature() { + java.lang.Object ref = signature_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + signature_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string signature = 5; + * @return The bytes for signature. + */ + public com.google.protobuf.ByteString + getSignatureBytes() { + java.lang.Object ref = signature_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + signature_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string signature = 5; + * @param value The signature to set. + * @return This builder for chaining. + */ + public Builder setSignature( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + signature_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * string signature = 5; + * @return This builder for chaining. + */ + public Builder clearSignature() { + signature_ = getDefaultInstance().getSignature(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * string signature = 5; + * @param value The bytes for signature to set. + * @return This builder for chaining. + */ + public Builder setSignatureBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + signature_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private int level_ ; + /** + * uint32 level = 6; + * @return The level. + */ + @java.lang.Override + public int getLevel() { + return level_; + } + /** + * uint32 level = 6; + * @param value The level to set. + * @return This builder for chaining. + */ + public Builder setLevel(int value) { + + level_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * uint32 level = 6; + * @return This builder for chaining. + */ + public Builder clearLevel() { + bitField0_ = (bitField0_ & ~0x00000020); + level_ = 0; + onChanged(); + return this; + } + + private long birthday_ ; + /** + * uint64 birthday = 7; + * @return The birthday. + */ + @java.lang.Override + public long getBirthday() { + return birthday_; + } + /** + * uint64 birthday = 7; + * @param value The birthday to set. + * @return This builder for chaining. + */ + public Builder setBirthday(long value) { + + birthday_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * uint64 birthday = 7; + * @return This builder for chaining. + */ + public Builder clearBirthday() { + bitField0_ = (bitField0_ & ~0x00000040); + birthday_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object telephone_ = ""; + /** + * string telephone = 8; + * @return The telephone. + */ + public java.lang.String getTelephone() { + java.lang.Object ref = telephone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + telephone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string telephone = 8; + * @return The bytes for telephone. + */ + public com.google.protobuf.ByteString + getTelephoneBytes() { + java.lang.Object ref = telephone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + telephone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string telephone = 8; + * @param value The telephone to set. + * @return This builder for chaining. + */ + public Builder setTelephone( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + telephone_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * string telephone = 8; + * @return This builder for chaining. + */ + public Builder clearTelephone() { + telephone_ = getDefaultInstance().getTelephone(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * string telephone = 8; + * @param value The bytes for telephone to set. + * @return This builder for chaining. + */ + public Builder setTelephoneBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + telephone_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image avatarThumb_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> avatarThumbBuilder_; + /** + * .Image avatarThumb = 9; + * @return Whether the avatarThumb field is set. + */ + public boolean hasAvatarThumb() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * .Image avatarThumb = 9; + * @return The avatarThumb. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarThumb() { + if (avatarThumbBuilder_ == null) { + return avatarThumb_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarThumb_; + } else { + return avatarThumbBuilder_.getMessage(); + } + } + /** + * .Image avatarThumb = 9; + */ + public Builder setAvatarThumb(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (avatarThumbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + avatarThumb_ = value; + } else { + avatarThumbBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * .Image avatarThumb = 9; + */ + public Builder setAvatarThumb( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (avatarThumbBuilder_ == null) { + avatarThumb_ = builderForValue.build(); + } else { + avatarThumbBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * .Image avatarThumb = 9; + */ + public Builder mergeAvatarThumb(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (avatarThumbBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) && + avatarThumb_ != null && + avatarThumb_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getAvatarThumbBuilder().mergeFrom(value); + } else { + avatarThumb_ = value; + } + } else { + avatarThumbBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * .Image avatarThumb = 9; + */ + public Builder clearAvatarThumb() { + bitField0_ = (bitField0_ & ~0x00000100); + avatarThumb_ = null; + if (avatarThumbBuilder_ != null) { + avatarThumbBuilder_.dispose(); + avatarThumbBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image avatarThumb = 9; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getAvatarThumbBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getAvatarThumbFieldBuilder().getBuilder(); + } + /** + * .Image avatarThumb = 9; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarThumbOrBuilder() { + if (avatarThumbBuilder_ != null) { + return avatarThumbBuilder_.getMessageOrBuilder(); + } else { + return avatarThumb_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarThumb_; + } + } + /** + * .Image avatarThumb = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getAvatarThumbFieldBuilder() { + if (avatarThumbBuilder_ == null) { + avatarThumbBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getAvatarThumb(), + getParentForChildren(), + isClean()); + avatarThumb_ = null; + } + return avatarThumbBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image avatarMedium_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> avatarMediumBuilder_; + /** + * .Image avatarMedium = 10; + * @return Whether the avatarMedium field is set. + */ + public boolean hasAvatarMedium() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * .Image avatarMedium = 10; + * @return The avatarMedium. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarMedium() { + if (avatarMediumBuilder_ == null) { + return avatarMedium_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarMedium_; + } else { + return avatarMediumBuilder_.getMessage(); + } + } + /** + * .Image avatarMedium = 10; + */ + public Builder setAvatarMedium(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (avatarMediumBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + avatarMedium_ = value; + } else { + avatarMediumBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .Image avatarMedium = 10; + */ + public Builder setAvatarMedium( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (avatarMediumBuilder_ == null) { + avatarMedium_ = builderForValue.build(); + } else { + avatarMediumBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .Image avatarMedium = 10; + */ + public Builder mergeAvatarMedium(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (avatarMediumBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) && + avatarMedium_ != null && + avatarMedium_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getAvatarMediumBuilder().mergeFrom(value); + } else { + avatarMedium_ = value; + } + } else { + avatarMediumBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .Image avatarMedium = 10; + */ + public Builder clearAvatarMedium() { + bitField0_ = (bitField0_ & ~0x00000200); + avatarMedium_ = null; + if (avatarMediumBuilder_ != null) { + avatarMediumBuilder_.dispose(); + avatarMediumBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image avatarMedium = 10; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getAvatarMediumBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getAvatarMediumFieldBuilder().getBuilder(); + } + /** + * .Image avatarMedium = 10; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarMediumOrBuilder() { + if (avatarMediumBuilder_ != null) { + return avatarMediumBuilder_.getMessageOrBuilder(); + } else { + return avatarMedium_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarMedium_; + } + } + /** + * .Image avatarMedium = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getAvatarMediumFieldBuilder() { + if (avatarMediumBuilder_ == null) { + avatarMediumBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getAvatarMedium(), + getParentForChildren(), + isClean()); + avatarMedium_ = null; + } + return avatarMediumBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image avatarLarge_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> avatarLargeBuilder_; + /** + * .Image avatarLarge = 11; + * @return Whether the avatarLarge field is set. + */ + public boolean hasAvatarLarge() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * .Image avatarLarge = 11; + * @return The avatarLarge. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarLarge() { + if (avatarLargeBuilder_ == null) { + return avatarLarge_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarLarge_; + } else { + return avatarLargeBuilder_.getMessage(); + } + } + /** + * .Image avatarLarge = 11; + */ + public Builder setAvatarLarge(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (avatarLargeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + avatarLarge_ = value; + } else { + avatarLargeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * .Image avatarLarge = 11; + */ + public Builder setAvatarLarge( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (avatarLargeBuilder_ == null) { + avatarLarge_ = builderForValue.build(); + } else { + avatarLargeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * .Image avatarLarge = 11; + */ + public Builder mergeAvatarLarge(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (avatarLargeBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) && + avatarLarge_ != null && + avatarLarge_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getAvatarLargeBuilder().mergeFrom(value); + } else { + avatarLarge_ = value; + } + } else { + avatarLargeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * .Image avatarLarge = 11; + */ + public Builder clearAvatarLarge() { + bitField0_ = (bitField0_ & ~0x00000400); + avatarLarge_ = null; + if (avatarLargeBuilder_ != null) { + avatarLargeBuilder_.dispose(); + avatarLargeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image avatarLarge = 11; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getAvatarLargeBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getAvatarLargeFieldBuilder().getBuilder(); + } + /** + * .Image avatarLarge = 11; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarLargeOrBuilder() { + if (avatarLargeBuilder_ != null) { + return avatarLargeBuilder_.getMessageOrBuilder(); + } else { + return avatarLarge_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarLarge_; + } + } + /** + * .Image avatarLarge = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getAvatarLargeFieldBuilder() { + if (avatarLargeBuilder_ == null) { + avatarLargeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getAvatarLarge(), + getParentForChildren(), + isClean()); + avatarLarge_ = null; + } + return avatarLargeBuilder_; + } + + private boolean verified_ ; + /** + * bool verified = 12; + * @return The verified. + */ + @java.lang.Override + public boolean getVerified() { + return verified_; + } + /** + * bool verified = 12; + * @param value The verified to set. + * @return This builder for chaining. + */ + public Builder setVerified(boolean value) { + + verified_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * bool verified = 12; + * @return This builder for chaining. + */ + public Builder clearVerified() { + bitField0_ = (bitField0_ & ~0x00000800); + verified_ = false; + onChanged(); + return this; + } + + private int experience_ ; + /** + * int32 experience = 13; + * @return The experience. + */ + @java.lang.Override + public int getExperience() { + return experience_; + } + /** + * int32 experience = 13; + * @param value The experience to set. + * @return This builder for chaining. + */ + public Builder setExperience(int value) { + + experience_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * int32 experience = 13; + * @return This builder for chaining. + */ + public Builder clearExperience() { + bitField0_ = (bitField0_ & ~0x00001000); + experience_ = 0; + onChanged(); + return this; + } + + private java.lang.Object city_ = ""; + /** + * string city = 14; + * @return The city. + */ + public java.lang.String getCity() { + java.lang.Object ref = city_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + city_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string city = 14; + * @return The bytes for city. + */ + public com.google.protobuf.ByteString + getCityBytes() { + java.lang.Object ref = city_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + city_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string city = 14; + * @param value The city to set. + * @return This builder for chaining. + */ + public Builder setCity( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + city_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * string city = 14; + * @return This builder for chaining. + */ + public Builder clearCity() { + city_ = getDefaultInstance().getCity(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + /** + * string city = 14; + * @param value The bytes for city to set. + * @return This builder for chaining. + */ + public Builder setCityBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + city_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + private int status_ ; + /** + * int32 status = 15; + * @return The status. + */ + @java.lang.Override + public int getStatus() { + return status_; + } + /** + * int32 status = 15; + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(int value) { + + status_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * int32 status = 15; + * @return This builder for chaining. + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00004000); + status_ = 0; + onChanged(); + return this; + } + + private long createTime_ ; + /** + * int64 createTime = 16; + * @return The createTime. + */ + @java.lang.Override + public long getCreateTime() { + return createTime_; + } + /** + * int64 createTime = 16; + * @param value The createTime to set. + * @return This builder for chaining. + */ + public Builder setCreateTime(long value) { + + createTime_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * int64 createTime = 16; + * @return This builder for chaining. + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00008000); + createTime_ = 0L; + onChanged(); + return this; + } + + private long modifyTime_ ; + /** + * int64 modifyTime = 17; + * @return The modifyTime. + */ + @java.lang.Override + public long getModifyTime() { + return modifyTime_; + } + /** + * int64 modifyTime = 17; + * @param value The modifyTime to set. + * @return This builder for chaining. + */ + public Builder setModifyTime(long value) { + + modifyTime_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * int64 modifyTime = 17; + * @return This builder for chaining. + */ + public Builder clearModifyTime() { + bitField0_ = (bitField0_ & ~0x00010000); + modifyTime_ = 0L; + onChanged(); + return this; + } + + private int secret_ ; + /** + * int32 secret = 18; + * @return The secret. + */ + @java.lang.Override + public int getSecret() { + return secret_; + } + /** + * int32 secret = 18; + * @param value The secret to set. + * @return This builder for chaining. + */ + public Builder setSecret(int value) { + + secret_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * int32 secret = 18; + * @return This builder for chaining. + */ + public Builder clearSecret() { + bitField0_ = (bitField0_ & ~0x00020000); + secret_ = 0; + onChanged(); + return this; + } + + private java.lang.Object shareQrcodeUri_ = ""; + /** + * string shareQrcodeUri = 19; + * @return The shareQrcodeUri. + */ + public java.lang.String getShareQrcodeUri() { + java.lang.Object ref = shareQrcodeUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shareQrcodeUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string shareQrcodeUri = 19; + * @return The bytes for shareQrcodeUri. + */ + public com.google.protobuf.ByteString + getShareQrcodeUriBytes() { + java.lang.Object ref = shareQrcodeUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + shareQrcodeUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string shareQrcodeUri = 19; + * @param value The shareQrcodeUri to set. + * @return This builder for chaining. + */ + public Builder setShareQrcodeUri( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + shareQrcodeUri_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * string shareQrcodeUri = 19; + * @return This builder for chaining. + */ + public Builder clearShareQrcodeUri() { + shareQrcodeUri_ = getDefaultInstance().getShareQrcodeUri(); + bitField0_ = (bitField0_ & ~0x00040000); + onChanged(); + return this; + } + /** + * string shareQrcodeUri = 19; + * @param value The bytes for shareQrcodeUri to set. + * @return This builder for chaining. + */ + public Builder setShareQrcodeUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + shareQrcodeUri_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + private int incomeSharePercent_ ; + /** + * int32 incomeSharePercent = 20; + * @return The incomeSharePercent. + */ + @java.lang.Override + public int getIncomeSharePercent() { + return incomeSharePercent_; + } + /** + * int32 incomeSharePercent = 20; + * @param value The incomeSharePercent to set. + * @return This builder for chaining. + */ + public Builder setIncomeSharePercent(int value) { + + incomeSharePercent_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * int32 incomeSharePercent = 20; + * @return This builder for chaining. + */ + public Builder clearIncomeSharePercent() { + bitField0_ = (bitField0_ & ~0x00080000); + incomeSharePercent_ = 0; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image badgeImageListList_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> badgeImageListListBuilder_; + /** + * .Image badgeImageListList = 21; + * @return Whether the badgeImageListList field is set. + */ + public boolean hasBadgeImageListList() { + return ((bitField0_ & 0x00100000) != 0); + } + /** + * .Image badgeImageListList = 21; + * @return The badgeImageListList. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBadgeImageListList() { + if (badgeImageListListBuilder_ == null) { + return badgeImageListList_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : badgeImageListList_; + } else { + return badgeImageListListBuilder_.getMessage(); + } + } + /** + * .Image badgeImageListList = 21; + */ + public Builder setBadgeImageListList(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (badgeImageListListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + badgeImageListList_ = value; + } else { + badgeImageListListBuilder_.setMessage(value); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * .Image badgeImageListList = 21; + */ + public Builder setBadgeImageListList( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (badgeImageListListBuilder_ == null) { + badgeImageListList_ = builderForValue.build(); + } else { + badgeImageListListBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * .Image badgeImageListList = 21; + */ + public Builder mergeBadgeImageListList(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (badgeImageListListBuilder_ == null) { + if (((bitField0_ & 0x00100000) != 0) && + badgeImageListList_ != null && + badgeImageListList_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getBadgeImageListListBuilder().mergeFrom(value); + } else { + badgeImageListList_ = value; + } + } else { + badgeImageListListBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * .Image badgeImageListList = 21; + */ + public Builder clearBadgeImageListList() { + bitField0_ = (bitField0_ & ~0x00100000); + badgeImageListList_ = null; + if (badgeImageListListBuilder_ != null) { + badgeImageListListBuilder_.dispose(); + badgeImageListListBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image badgeImageListList = 21; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getBadgeImageListListBuilder() { + bitField0_ |= 0x00100000; + onChanged(); + return getBadgeImageListListFieldBuilder().getBuilder(); + } + /** + * .Image badgeImageListList = 21; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBadgeImageListListOrBuilder() { + if (badgeImageListListBuilder_ != null) { + return badgeImageListListBuilder_.getMessageOrBuilder(); + } else { + return badgeImageListList_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : badgeImageListList_; + } + } + /** + * .Image badgeImageListList = 21; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getBadgeImageListListFieldBuilder() { + if (badgeImageListListBuilder_ == null) { + badgeImageListListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getBadgeImageListList(), + getParentForChildren(), + isClean()); + badgeImageListList_ = null; + } + return badgeImageListListBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo followInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfoOrBuilder> followInfoBuilder_; + /** + * .User.FollowInfo followInfo = 22; + * @return Whether the followInfo field is set. + */ + public boolean hasFollowInfo() { + return ((bitField0_ & 0x00200000) != 0); + } + /** + * .User.FollowInfo followInfo = 22; + * @return The followInfo. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo getFollowInfo() { + if (followInfoBuilder_ == null) { + return followInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.getDefaultInstance() : followInfo_; + } else { + return followInfoBuilder_.getMessage(); + } + } + /** + * .User.FollowInfo followInfo = 22; + */ + public Builder setFollowInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo value) { + if (followInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + followInfo_ = value; + } else { + followInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * .User.FollowInfo followInfo = 22; + */ + public Builder setFollowInfo( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.Builder builderForValue) { + if (followInfoBuilder_ == null) { + followInfo_ = builderForValue.build(); + } else { + followInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * .User.FollowInfo followInfo = 22; + */ + public Builder mergeFollowInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo value) { + if (followInfoBuilder_ == null) { + if (((bitField0_ & 0x00200000) != 0) && + followInfo_ != null && + followInfo_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.getDefaultInstance()) { + getFollowInfoBuilder().mergeFrom(value); + } else { + followInfo_ = value; + } + } else { + followInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * .User.FollowInfo followInfo = 22; + */ + public Builder clearFollowInfo() { + bitField0_ = (bitField0_ & ~0x00200000); + followInfo_ = null; + if (followInfoBuilder_ != null) { + followInfoBuilder_.dispose(); + followInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.FollowInfo followInfo = 22; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.Builder getFollowInfoBuilder() { + bitField0_ |= 0x00200000; + onChanged(); + return getFollowInfoFieldBuilder().getBuilder(); + } + /** + * .User.FollowInfo followInfo = 22; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfoOrBuilder getFollowInfoOrBuilder() { + if (followInfoBuilder_ != null) { + return followInfoBuilder_.getMessageOrBuilder(); + } else { + return followInfo_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.getDefaultInstance() : followInfo_; + } + } + /** + * .User.FollowInfo followInfo = 22; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfoOrBuilder> + getFollowInfoFieldBuilder() { + if (followInfoBuilder_ == null) { + followInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FollowInfoOrBuilder>( + getFollowInfo(), + getParentForChildren(), + isClean()); + followInfo_ = null; + } + return followInfoBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade payGrade_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGradeOrBuilder> payGradeBuilder_; + /** + * .User.PayGrade payGrade = 23; + * @return Whether the payGrade field is set. + */ + public boolean hasPayGrade() { + return ((bitField0_ & 0x00400000) != 0); + } + /** + * .User.PayGrade payGrade = 23; + * @return The payGrade. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade getPayGrade() { + if (payGradeBuilder_ == null) { + return payGrade_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.getDefaultInstance() : payGrade_; + } else { + return payGradeBuilder_.getMessage(); + } + } + /** + * .User.PayGrade payGrade = 23; + */ + public Builder setPayGrade(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade value) { + if (payGradeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payGrade_ = value; + } else { + payGradeBuilder_.setMessage(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * .User.PayGrade payGrade = 23; + */ + public Builder setPayGrade( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.Builder builderForValue) { + if (payGradeBuilder_ == null) { + payGrade_ = builderForValue.build(); + } else { + payGradeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * .User.PayGrade payGrade = 23; + */ + public Builder mergePayGrade(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade value) { + if (payGradeBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0) && + payGrade_ != null && + payGrade_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.getDefaultInstance()) { + getPayGradeBuilder().mergeFrom(value); + } else { + payGrade_ = value; + } + } else { + payGradeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * .User.PayGrade payGrade = 23; + */ + public Builder clearPayGrade() { + bitField0_ = (bitField0_ & ~0x00400000); + payGrade_ = null; + if (payGradeBuilder_ != null) { + payGradeBuilder_.dispose(); + payGradeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.PayGrade payGrade = 23; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.Builder getPayGradeBuilder() { + bitField0_ |= 0x00400000; + onChanged(); + return getPayGradeFieldBuilder().getBuilder(); + } + /** + * .User.PayGrade payGrade = 23; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGradeOrBuilder getPayGradeOrBuilder() { + if (payGradeBuilder_ != null) { + return payGradeBuilder_.getMessageOrBuilder(); + } else { + return payGrade_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.getDefaultInstance() : payGrade_; + } + } + /** + * .User.PayGrade payGrade = 23; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGradeOrBuilder> + getPayGradeFieldBuilder() { + if (payGradeBuilder_ == null) { + payGradeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGrade.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PayGradeOrBuilder>( + getPayGrade(), + getParentForChildren(), + isClean()); + payGrade_ = null; + } + return payGradeBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub fansClub_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClubOrBuilder> fansClubBuilder_; + /** + * .User.FansClub fansClub = 24; + * @return Whether the fansClub field is set. + */ + public boolean hasFansClub() { + return ((bitField0_ & 0x00800000) != 0); + } + /** + * .User.FansClub fansClub = 24; + * @return The fansClub. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub getFansClub() { + if (fansClubBuilder_ == null) { + return fansClub_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.getDefaultInstance() : fansClub_; + } else { + return fansClubBuilder_.getMessage(); + } + } + /** + * .User.FansClub fansClub = 24; + */ + public Builder setFansClub(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub value) { + if (fansClubBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fansClub_ = value; + } else { + fansClubBuilder_.setMessage(value); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * .User.FansClub fansClub = 24; + */ + public Builder setFansClub( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.Builder builderForValue) { + if (fansClubBuilder_ == null) { + fansClub_ = builderForValue.build(); + } else { + fansClubBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * .User.FansClub fansClub = 24; + */ + public Builder mergeFansClub(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub value) { + if (fansClubBuilder_ == null) { + if (((bitField0_ & 0x00800000) != 0) && + fansClub_ != null && + fansClub_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.getDefaultInstance()) { + getFansClubBuilder().mergeFrom(value); + } else { + fansClub_ = value; + } + } else { + fansClubBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * .User.FansClub fansClub = 24; + */ + public Builder clearFansClub() { + bitField0_ = (bitField0_ & ~0x00800000); + fansClub_ = null; + if (fansClubBuilder_ != null) { + fansClubBuilder_.dispose(); + fansClubBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.FansClub fansClub = 24; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.Builder getFansClubBuilder() { + bitField0_ |= 0x00800000; + onChanged(); + return getFansClubFieldBuilder().getBuilder(); + } + /** + * .User.FansClub fansClub = 24; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClubOrBuilder getFansClubOrBuilder() { + if (fansClubBuilder_ != null) { + return fansClubBuilder_.getMessageOrBuilder(); + } else { + return fansClub_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.getDefaultInstance() : fansClub_; + } + } + /** + * .User.FansClub fansClub = 24; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClubOrBuilder> + getFansClubFieldBuilder() { + if (fansClubBuilder_ == null) { + fansClubBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClub.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansClubOrBuilder>( + getFansClub(), + getParentForChildren(), + isClean()); + fansClub_ = null; + } + return fansClubBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border border_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BorderOrBuilder> borderBuilder_; + /** + * .User.Border border = 25; + * @return Whether the border field is set. + */ + public boolean hasBorder() { + return ((bitField0_ & 0x01000000) != 0); + } + /** + * .User.Border border = 25; + * @return The border. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border getBorder() { + if (borderBuilder_ == null) { + return border_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.getDefaultInstance() : border_; + } else { + return borderBuilder_.getMessage(); + } + } + /** + * .User.Border border = 25; + */ + public Builder setBorder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border value) { + if (borderBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + border_ = value; + } else { + borderBuilder_.setMessage(value); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * .User.Border border = 25; + */ + public Builder setBorder( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.Builder builderForValue) { + if (borderBuilder_ == null) { + border_ = builderForValue.build(); + } else { + borderBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * .User.Border border = 25; + */ + public Builder mergeBorder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border value) { + if (borderBuilder_ == null) { + if (((bitField0_ & 0x01000000) != 0) && + border_ != null && + border_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.getDefaultInstance()) { + getBorderBuilder().mergeFrom(value); + } else { + border_ = value; + } + } else { + borderBuilder_.mergeFrom(value); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * .User.Border border = 25; + */ + public Builder clearBorder() { + bitField0_ = (bitField0_ & ~0x01000000); + border_ = null; + if (borderBuilder_ != null) { + borderBuilder_.dispose(); + borderBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.Border border = 25; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.Builder getBorderBuilder() { + bitField0_ |= 0x01000000; + onChanged(); + return getBorderFieldBuilder().getBuilder(); + } + /** + * .User.Border border = 25; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BorderOrBuilder getBorderOrBuilder() { + if (borderBuilder_ != null) { + return borderBuilder_.getMessageOrBuilder(); + } else { + return border_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.getDefaultInstance() : border_; + } + } + /** + * .User.Border border = 25; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BorderOrBuilder> + getBorderFieldBuilder() { + if (borderBuilder_ == null) { + borderBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Border.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BorderOrBuilder>( + getBorder(), + getParentForChildren(), + isClean()); + border_ = null; + } + return borderBuilder_; + } + + private java.lang.Object specialId_ = ""; + /** + * string specialId = 26; + * @return The specialId. + */ + public java.lang.String getSpecialId() { + java.lang.Object ref = specialId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + specialId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string specialId = 26; + * @return The bytes for specialId. + */ + public com.google.protobuf.ByteString + getSpecialIdBytes() { + java.lang.Object ref = specialId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + specialId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string specialId = 26; + * @param value The specialId to set. + * @return This builder for chaining. + */ + public Builder setSpecialId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + specialId_ = value; + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + /** + * string specialId = 26; + * @return This builder for chaining. + */ + public Builder clearSpecialId() { + specialId_ = getDefaultInstance().getSpecialId(); + bitField0_ = (bitField0_ & ~0x02000000); + onChanged(); + return this; + } + /** + * string specialId = 26; + * @param value The bytes for specialId to set. + * @return This builder for chaining. + */ + public Builder setSpecialIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + specialId_ = value; + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image avatarBorder_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> avatarBorderBuilder_; + /** + * .Image avatarBorder = 27; + * @return Whether the avatarBorder field is set. + */ + public boolean hasAvatarBorder() { + return ((bitField0_ & 0x04000000) != 0); + } + /** + * .Image avatarBorder = 27; + * @return The avatarBorder. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarBorder() { + if (avatarBorderBuilder_ == null) { + return avatarBorder_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarBorder_; + } else { + return avatarBorderBuilder_.getMessage(); + } + } + /** + * .Image avatarBorder = 27; + */ + public Builder setAvatarBorder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (avatarBorderBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + avatarBorder_ = value; + } else { + avatarBorderBuilder_.setMessage(value); + } + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + /** + * .Image avatarBorder = 27; + */ + public Builder setAvatarBorder( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (avatarBorderBuilder_ == null) { + avatarBorder_ = builderForValue.build(); + } else { + avatarBorderBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + /** + * .Image avatarBorder = 27; + */ + public Builder mergeAvatarBorder(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (avatarBorderBuilder_ == null) { + if (((bitField0_ & 0x04000000) != 0) && + avatarBorder_ != null && + avatarBorder_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getAvatarBorderBuilder().mergeFrom(value); + } else { + avatarBorder_ = value; + } + } else { + avatarBorderBuilder_.mergeFrom(value); + } + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + /** + * .Image avatarBorder = 27; + */ + public Builder clearAvatarBorder() { + bitField0_ = (bitField0_ & ~0x04000000); + avatarBorder_ = null; + if (avatarBorderBuilder_ != null) { + avatarBorderBuilder_.dispose(); + avatarBorderBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image avatarBorder = 27; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getAvatarBorderBuilder() { + bitField0_ |= 0x04000000; + onChanged(); + return getAvatarBorderFieldBuilder().getBuilder(); + } + /** + * .Image avatarBorder = 27; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarBorderOrBuilder() { + if (avatarBorderBuilder_ != null) { + return avatarBorderBuilder_.getMessageOrBuilder(); + } else { + return avatarBorder_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarBorder_; + } + } + /** + * .Image avatarBorder = 27; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getAvatarBorderFieldBuilder() { + if (avatarBorderBuilder_ == null) { + avatarBorderBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getAvatarBorder(), + getParentForChildren(), + isClean()); + avatarBorder_ = null; + } + return avatarBorderBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image medal_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> medalBuilder_; + /** + * .Image medal = 28; + * @return Whether the medal field is set. + */ + public boolean hasMedal() { + return ((bitField0_ & 0x08000000) != 0); + } + /** + * .Image medal = 28; + * @return The medal. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getMedal() { + if (medalBuilder_ == null) { + return medal_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : medal_; + } else { + return medalBuilder_.getMessage(); + } + } + /** + * .Image medal = 28; + */ + public Builder setMedal(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (medalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + medal_ = value; + } else { + medalBuilder_.setMessage(value); + } + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + /** + * .Image medal = 28; + */ + public Builder setMedal( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (medalBuilder_ == null) { + medal_ = builderForValue.build(); + } else { + medalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + /** + * .Image medal = 28; + */ + public Builder mergeMedal(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (medalBuilder_ == null) { + if (((bitField0_ & 0x08000000) != 0) && + medal_ != null && + medal_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getMedalBuilder().mergeFrom(value); + } else { + medal_ = value; + } + } else { + medalBuilder_.mergeFrom(value); + } + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + /** + * .Image medal = 28; + */ + public Builder clearMedal() { + bitField0_ = (bitField0_ & ~0x08000000); + medal_ = null; + if (medalBuilder_ != null) { + medalBuilder_.dispose(); + medalBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image medal = 28; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getMedalBuilder() { + bitField0_ |= 0x08000000; + onChanged(); + return getMedalFieldBuilder().getBuilder(); + } + /** + * .Image medal = 28; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getMedalOrBuilder() { + if (medalBuilder_ != null) { + return medalBuilder_.getMessageOrBuilder(); + } else { + return medal_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : medal_; + } + } + /** + * .Image medal = 28; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getMedalFieldBuilder() { + if (medalBuilder_ == null) { + medalBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getMedal(), + getParentForChildren(), + isClean()); + medal_ = null; + } + return medalBuilder_; + } + + private java.util.List realTimeIconsList_ = + java.util.Collections.emptyList(); + private void ensureRealTimeIconsListIsMutable() { + if (!((bitField0_ & 0x10000000) != 0)) { + realTimeIconsList_ = new java.util.ArrayList(realTimeIconsList_); + bitField0_ |= 0x10000000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> realTimeIconsListBuilder_; + + /** + * repeated .Image realTimeIconsList = 29; + */ + public java.util.List getRealTimeIconsListList() { + if (realTimeIconsListBuilder_ == null) { + return java.util.Collections.unmodifiableList(realTimeIconsList_); + } else { + return realTimeIconsListBuilder_.getMessageList(); + } + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public int getRealTimeIconsListCount() { + if (realTimeIconsListBuilder_ == null) { + return realTimeIconsList_.size(); + } else { + return realTimeIconsListBuilder_.getCount(); + } + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getRealTimeIconsList(int index) { + if (realTimeIconsListBuilder_ == null) { + return realTimeIconsList_.get(index); + } else { + return realTimeIconsListBuilder_.getMessage(index); + } + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public Builder setRealTimeIconsList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (realTimeIconsListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRealTimeIconsListIsMutable(); + realTimeIconsList_.set(index, value); + onChanged(); + } else { + realTimeIconsListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public Builder setRealTimeIconsList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (realTimeIconsListBuilder_ == null) { + ensureRealTimeIconsListIsMutable(); + realTimeIconsList_.set(index, builderForValue.build()); + onChanged(); + } else { + realTimeIconsListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public Builder addRealTimeIconsList(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (realTimeIconsListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRealTimeIconsListIsMutable(); + realTimeIconsList_.add(value); + onChanged(); + } else { + realTimeIconsListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public Builder addRealTimeIconsList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (realTimeIconsListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRealTimeIconsListIsMutable(); + realTimeIconsList_.add(index, value); + onChanged(); + } else { + realTimeIconsListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public Builder addRealTimeIconsList( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (realTimeIconsListBuilder_ == null) { + ensureRealTimeIconsListIsMutable(); + realTimeIconsList_.add(builderForValue.build()); + onChanged(); + } else { + realTimeIconsListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public Builder addRealTimeIconsList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (realTimeIconsListBuilder_ == null) { + ensureRealTimeIconsListIsMutable(); + realTimeIconsList_.add(index, builderForValue.build()); + onChanged(); + } else { + realTimeIconsListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public Builder addAllRealTimeIconsList( + java.lang.Iterable values) { + if (realTimeIconsListBuilder_ == null) { + ensureRealTimeIconsListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, realTimeIconsList_); + onChanged(); + } else { + realTimeIconsListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public Builder clearRealTimeIconsList() { + if (realTimeIconsListBuilder_ == null) { + realTimeIconsList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x10000000); + onChanged(); + } else { + realTimeIconsListBuilder_.clear(); + } + return this; + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public Builder removeRealTimeIconsList(int index) { + if (realTimeIconsListBuilder_ == null) { + ensureRealTimeIconsListIsMutable(); + realTimeIconsList_.remove(index); + onChanged(); + } else { + realTimeIconsListBuilder_.remove(index); + } + return this; + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getRealTimeIconsListBuilder( + int index) { + return getRealTimeIconsListFieldBuilder().getBuilder(index); + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getRealTimeIconsListOrBuilder( + int index) { + if (realTimeIconsListBuilder_ == null) { + return realTimeIconsList_.get(index); } else { + return realTimeIconsListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public java.util.List + getRealTimeIconsListOrBuilderList() { + if (realTimeIconsListBuilder_ != null) { + return realTimeIconsListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(realTimeIconsList_); + } + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder addRealTimeIconsListBuilder() { + return getRealTimeIconsListFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()); + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder addRealTimeIconsListBuilder( + int index) { + return getRealTimeIconsListFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()); + } + /** + * repeated .Image realTimeIconsList = 29; + */ + public java.util.List + getRealTimeIconsListBuilderList() { + return getRealTimeIconsListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getRealTimeIconsListFieldBuilder() { + if (realTimeIconsListBuilder_ == null) { + realTimeIconsListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + realTimeIconsList_, + ((bitField0_ & 0x10000000) != 0), + getParentForChildren(), + isClean()); + realTimeIconsList_ = null; + } + return realTimeIconsListBuilder_; + } + + private java.util.List newRealTimeIconsList_ = + java.util.Collections.emptyList(); + private void ensureNewRealTimeIconsListIsMutable() { + if (!((bitField0_ & 0x20000000) != 0)) { + newRealTimeIconsList_ = new java.util.ArrayList(newRealTimeIconsList_); + bitField0_ |= 0x20000000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> newRealTimeIconsListBuilder_; + + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public java.util.List getNewRealTimeIconsListList() { + if (newRealTimeIconsListBuilder_ == null) { + return java.util.Collections.unmodifiableList(newRealTimeIconsList_); + } else { + return newRealTimeIconsListBuilder_.getMessageList(); + } + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public int getNewRealTimeIconsListCount() { + if (newRealTimeIconsListBuilder_ == null) { + return newRealTimeIconsList_.size(); + } else { + return newRealTimeIconsListBuilder_.getCount(); + } + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getNewRealTimeIconsList(int index) { + if (newRealTimeIconsListBuilder_ == null) { + return newRealTimeIconsList_.get(index); + } else { + return newRealTimeIconsListBuilder_.getMessage(index); + } + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public Builder setNewRealTimeIconsList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (newRealTimeIconsListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNewRealTimeIconsListIsMutable(); + newRealTimeIconsList_.set(index, value); + onChanged(); + } else { + newRealTimeIconsListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public Builder setNewRealTimeIconsList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (newRealTimeIconsListBuilder_ == null) { + ensureNewRealTimeIconsListIsMutable(); + newRealTimeIconsList_.set(index, builderForValue.build()); + onChanged(); + } else { + newRealTimeIconsListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public Builder addNewRealTimeIconsList(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (newRealTimeIconsListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNewRealTimeIconsListIsMutable(); + newRealTimeIconsList_.add(value); + onChanged(); + } else { + newRealTimeIconsListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public Builder addNewRealTimeIconsList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (newRealTimeIconsListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNewRealTimeIconsListIsMutable(); + newRealTimeIconsList_.add(index, value); + onChanged(); + } else { + newRealTimeIconsListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public Builder addNewRealTimeIconsList( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (newRealTimeIconsListBuilder_ == null) { + ensureNewRealTimeIconsListIsMutable(); + newRealTimeIconsList_.add(builderForValue.build()); + onChanged(); + } else { + newRealTimeIconsListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public Builder addNewRealTimeIconsList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (newRealTimeIconsListBuilder_ == null) { + ensureNewRealTimeIconsListIsMutable(); + newRealTimeIconsList_.add(index, builderForValue.build()); + onChanged(); + } else { + newRealTimeIconsListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public Builder addAllNewRealTimeIconsList( + java.lang.Iterable values) { + if (newRealTimeIconsListBuilder_ == null) { + ensureNewRealTimeIconsListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, newRealTimeIconsList_); + onChanged(); + } else { + newRealTimeIconsListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public Builder clearNewRealTimeIconsList() { + if (newRealTimeIconsListBuilder_ == null) { + newRealTimeIconsList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x20000000); + onChanged(); + } else { + newRealTimeIconsListBuilder_.clear(); + } + return this; + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public Builder removeNewRealTimeIconsList(int index) { + if (newRealTimeIconsListBuilder_ == null) { + ensureNewRealTimeIconsListIsMutable(); + newRealTimeIconsList_.remove(index); + onChanged(); + } else { + newRealTimeIconsListBuilder_.remove(index); + } + return this; + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getNewRealTimeIconsListBuilder( + int index) { + return getNewRealTimeIconsListFieldBuilder().getBuilder(index); + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getNewRealTimeIconsListOrBuilder( + int index) { + if (newRealTimeIconsListBuilder_ == null) { + return newRealTimeIconsList_.get(index); } else { + return newRealTimeIconsListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public java.util.List + getNewRealTimeIconsListOrBuilderList() { + if (newRealTimeIconsListBuilder_ != null) { + return newRealTimeIconsListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(newRealTimeIconsList_); + } + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder addNewRealTimeIconsListBuilder() { + return getNewRealTimeIconsListFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()); + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder addNewRealTimeIconsListBuilder( + int index) { + return getNewRealTimeIconsListFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()); + } + /** + * repeated .Image newRealTimeIconsList = 30; + */ + public java.util.List + getNewRealTimeIconsListBuilderList() { + return getNewRealTimeIconsListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getNewRealTimeIconsListFieldBuilder() { + if (newRealTimeIconsListBuilder_ == null) { + newRealTimeIconsListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + newRealTimeIconsList_, + ((bitField0_ & 0x20000000) != 0), + getParentForChildren(), + isClean()); + newRealTimeIconsList_ = null; + } + return newRealTimeIconsListBuilder_; + } + + private long topVipNo_ ; + /** + * int64 topVipNo = 31; + * @return The topVipNo. + */ + @java.lang.Override + public long getTopVipNo() { + return topVipNo_; + } + /** + * int64 topVipNo = 31; + * @param value The topVipNo to set. + * @return This builder for chaining. + */ + public Builder setTopVipNo(long value) { + + topVipNo_ = value; + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + /** + * int64 topVipNo = 31; + * @return This builder for chaining. + */ + public Builder clearTopVipNo() { + bitField0_ = (bitField0_ & ~0x40000000); + topVipNo_ = 0L; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr userAttr_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttrOrBuilder> userAttrBuilder_; + /** + * .User.UserAttr userAttr = 32; + * @return Whether the userAttr field is set. + */ + public boolean hasUserAttr() { + return ((bitField0_ & 0x80000000) != 0); + } + /** + * .User.UserAttr userAttr = 32; + * @return The userAttr. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr getUserAttr() { + if (userAttrBuilder_ == null) { + return userAttr_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.getDefaultInstance() : userAttr_; + } else { + return userAttrBuilder_.getMessage(); + } + } + /** + * .User.UserAttr userAttr = 32; + */ + public Builder setUserAttr(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr value) { + if (userAttrBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userAttr_ = value; + } else { + userAttrBuilder_.setMessage(value); + } + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + /** + * .User.UserAttr userAttr = 32; + */ + public Builder setUserAttr( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.Builder builderForValue) { + if (userAttrBuilder_ == null) { + userAttr_ = builderForValue.build(); + } else { + userAttrBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + /** + * .User.UserAttr userAttr = 32; + */ + public Builder mergeUserAttr(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr value) { + if (userAttrBuilder_ == null) { + if (((bitField0_ & 0x80000000) != 0) && + userAttr_ != null && + userAttr_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.getDefaultInstance()) { + getUserAttrBuilder().mergeFrom(value); + } else { + userAttr_ = value; + } + } else { + userAttrBuilder_.mergeFrom(value); + } + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + /** + * .User.UserAttr userAttr = 32; + */ + public Builder clearUserAttr() { + bitField0_ = (bitField0_ & ~0x80000000); + userAttr_ = null; + if (userAttrBuilder_ != null) { + userAttrBuilder_.dispose(); + userAttrBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.UserAttr userAttr = 32; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.Builder getUserAttrBuilder() { + bitField0_ |= 0x80000000; + onChanged(); + return getUserAttrFieldBuilder().getBuilder(); + } + /** + * .User.UserAttr userAttr = 32; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttrOrBuilder getUserAttrOrBuilder() { + if (userAttrBuilder_ != null) { + return userAttrBuilder_.getMessageOrBuilder(); + } else { + return userAttr_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.getDefaultInstance() : userAttr_; + } + } + /** + * .User.UserAttr userAttr = 32; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttrOrBuilder> + getUserAttrFieldBuilder() { + if (userAttrBuilder_ == null) { + userAttrBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttr.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserAttrOrBuilder>( + getUserAttr(), + getParentForChildren(), + isClean()); + userAttr_ = null; + } + return userAttrBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom ownRoom_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoomOrBuilder> ownRoomBuilder_; + /** + * .User.OwnRoom ownRoom = 33; + * @return Whether the ownRoom field is set. + */ + public boolean hasOwnRoom() { + return ((bitField1_ & 0x00000001) != 0); + } + /** + * .User.OwnRoom ownRoom = 33; + * @return The ownRoom. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom getOwnRoom() { + if (ownRoomBuilder_ == null) { + return ownRoom_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.getDefaultInstance() : ownRoom_; + } else { + return ownRoomBuilder_.getMessage(); + } + } + /** + * .User.OwnRoom ownRoom = 33; + */ + public Builder setOwnRoom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom value) { + if (ownRoomBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ownRoom_ = value; + } else { + ownRoomBuilder_.setMessage(value); + } + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .User.OwnRoom ownRoom = 33; + */ + public Builder setOwnRoom( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.Builder builderForValue) { + if (ownRoomBuilder_ == null) { + ownRoom_ = builderForValue.build(); + } else { + ownRoomBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .User.OwnRoom ownRoom = 33; + */ + public Builder mergeOwnRoom(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom value) { + if (ownRoomBuilder_ == null) { + if (((bitField1_ & 0x00000001) != 0) && + ownRoom_ != null && + ownRoom_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.getDefaultInstance()) { + getOwnRoomBuilder().mergeFrom(value); + } else { + ownRoom_ = value; + } + } else { + ownRoomBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .User.OwnRoom ownRoom = 33; + */ + public Builder clearOwnRoom() { + bitField1_ = (bitField1_ & ~0x00000001); + ownRoom_ = null; + if (ownRoomBuilder_ != null) { + ownRoomBuilder_.dispose(); + ownRoomBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.OwnRoom ownRoom = 33; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.Builder getOwnRoomBuilder() { + bitField1_ |= 0x00000001; + onChanged(); + return getOwnRoomFieldBuilder().getBuilder(); + } + /** + * .User.OwnRoom ownRoom = 33; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoomOrBuilder getOwnRoomOrBuilder() { + if (ownRoomBuilder_ != null) { + return ownRoomBuilder_.getMessageOrBuilder(); + } else { + return ownRoom_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.getDefaultInstance() : ownRoom_; + } + } + /** + * .User.OwnRoom ownRoom = 33; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoomOrBuilder> + getOwnRoomFieldBuilder() { + if (ownRoomBuilder_ == null) { + ownRoomBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoom.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.OwnRoomOrBuilder>( + getOwnRoom(), + getParentForChildren(), + isClean()); + ownRoom_ = null; + } + return ownRoomBuilder_; + } + + private long payScore_ ; + /** + * int64 payScore = 34; + * @return The payScore. + */ + @java.lang.Override + public long getPayScore() { + return payScore_; + } + /** + * int64 payScore = 34; + * @param value The payScore to set. + * @return This builder for chaining. + */ + public Builder setPayScore(long value) { + + payScore_ = value; + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int64 payScore = 34; + * @return This builder for chaining. + */ + public Builder clearPayScore() { + bitField1_ = (bitField1_ & ~0x00000002); + payScore_ = 0L; + onChanged(); + return this; + } + + private long ticketCount_ ; + /** + * int64 ticketCount = 35; + * @return The ticketCount. + */ + @java.lang.Override + public long getTicketCount() { + return ticketCount_; + } + /** + * int64 ticketCount = 35; + * @param value The ticketCount to set. + * @return This builder for chaining. + */ + public Builder setTicketCount(long value) { + + ticketCount_ = value; + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 ticketCount = 35; + * @return This builder for chaining. + */ + public Builder clearTicketCount() { + bitField1_ = (bitField1_ & ~0x00000004); + ticketCount_ = 0L; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo anchorInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfoOrBuilder> anchorInfoBuilder_; + /** + * .User.AnchorInfo anchorInfo = 36; + * @return Whether the anchorInfo field is set. + */ + public boolean hasAnchorInfo() { + return ((bitField1_ & 0x00000008) != 0); + } + /** + * .User.AnchorInfo anchorInfo = 36; + * @return The anchorInfo. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo getAnchorInfo() { + if (anchorInfoBuilder_ == null) { + return anchorInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.getDefaultInstance() : anchorInfo_; + } else { + return anchorInfoBuilder_.getMessage(); + } + } + /** + * .User.AnchorInfo anchorInfo = 36; + */ + public Builder setAnchorInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo value) { + if (anchorInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + anchorInfo_ = value; + } else { + anchorInfoBuilder_.setMessage(value); + } + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .User.AnchorInfo anchorInfo = 36; + */ + public Builder setAnchorInfo( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.Builder builderForValue) { + if (anchorInfoBuilder_ == null) { + anchorInfo_ = builderForValue.build(); + } else { + anchorInfoBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .User.AnchorInfo anchorInfo = 36; + */ + public Builder mergeAnchorInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo value) { + if (anchorInfoBuilder_ == null) { + if (((bitField1_ & 0x00000008) != 0) && + anchorInfo_ != null && + anchorInfo_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.getDefaultInstance()) { + getAnchorInfoBuilder().mergeFrom(value); + } else { + anchorInfo_ = value; + } + } else { + anchorInfoBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .User.AnchorInfo anchorInfo = 36; + */ + public Builder clearAnchorInfo() { + bitField1_ = (bitField1_ & ~0x00000008); + anchorInfo_ = null; + if (anchorInfoBuilder_ != null) { + anchorInfoBuilder_.dispose(); + anchorInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.AnchorInfo anchorInfo = 36; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.Builder getAnchorInfoBuilder() { + bitField1_ |= 0x00000008; + onChanged(); + return getAnchorInfoFieldBuilder().getBuilder(); + } + /** + * .User.AnchorInfo anchorInfo = 36; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfoOrBuilder getAnchorInfoOrBuilder() { + if (anchorInfoBuilder_ != null) { + return anchorInfoBuilder_.getMessageOrBuilder(); + } else { + return anchorInfo_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.getDefaultInstance() : anchorInfo_; + } + } + /** + * .User.AnchorInfo anchorInfo = 36; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfoOrBuilder> + getAnchorInfoFieldBuilder() { + if (anchorInfoBuilder_ == null) { + anchorInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorInfoOrBuilder>( + getAnchorInfo(), + getParentForChildren(), + isClean()); + anchorInfo_ = null; + } + return anchorInfoBuilder_; + } + + private int linkMicStats_ ; + /** + * int32 linkMicStats = 37; + * @return The linkMicStats. + */ + @java.lang.Override + public int getLinkMicStats() { + return linkMicStats_; + } + /** + * int32 linkMicStats = 37; + * @param value The linkMicStats to set. + * @return This builder for chaining. + */ + public Builder setLinkMicStats(int value) { + + linkMicStats_ = value; + bitField1_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int32 linkMicStats = 37; + * @return This builder for chaining. + */ + public Builder clearLinkMicStats() { + bitField1_ = (bitField1_ & ~0x00000010); + linkMicStats_ = 0; + onChanged(); + return this; + } + + private java.lang.Object displayId_ = ""; + /** + * string displayId = 38; + * @return The displayId. + */ + public java.lang.String getDisplayId() { + java.lang.Object ref = displayId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string displayId = 38; + * @return The bytes for displayId. + */ + public com.google.protobuf.ByteString + getDisplayIdBytes() { + java.lang.Object ref = displayId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string displayId = 38; + * @param value The displayId to set. + * @return This builder for chaining. + */ + public Builder setDisplayId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + displayId_ = value; + bitField1_ |= 0x00000020; + onChanged(); + return this; + } + /** + * string displayId = 38; + * @return This builder for chaining. + */ + public Builder clearDisplayId() { + displayId_ = getDefaultInstance().getDisplayId(); + bitField1_ = (bitField1_ & ~0x00000020); + onChanged(); + return this; + } + /** + * string displayId = 38; + * @param value The bytes for displayId to set. + * @return This builder for chaining. + */ + public Builder setDisplayIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + displayId_ = value; + bitField1_ |= 0x00000020; + onChanged(); + return this; + } + + private boolean withCommercePermission_ ; + /** + * bool withCommercePermission = 39; + * @return The withCommercePermission. + */ + @java.lang.Override + public boolean getWithCommercePermission() { + return withCommercePermission_; + } + /** + * bool withCommercePermission = 39; + * @param value The withCommercePermission to set. + * @return This builder for chaining. + */ + public Builder setWithCommercePermission(boolean value) { + + withCommercePermission_ = value; + bitField1_ |= 0x00000040; + onChanged(); + return this; + } + /** + * bool withCommercePermission = 39; + * @return This builder for chaining. + */ + public Builder clearWithCommercePermission() { + bitField1_ = (bitField1_ & ~0x00000040); + withCommercePermission_ = false; + onChanged(); + return this; + } + + private boolean withFusionShopEntry_ ; + /** + * bool withFusionShopEntry = 40; + * @return The withFusionShopEntry. + */ + @java.lang.Override + public boolean getWithFusionShopEntry() { + return withFusionShopEntry_; + } + /** + * bool withFusionShopEntry = 40; + * @param value The withFusionShopEntry to set. + * @return This builder for chaining. + */ + public Builder setWithFusionShopEntry(boolean value) { + + withFusionShopEntry_ = value; + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + /** + * bool withFusionShopEntry = 40; + * @return This builder for chaining. + */ + public Builder clearWithFusionShopEntry() { + bitField1_ = (bitField1_ & ~0x00000080); + withFusionShopEntry_ = false; + onChanged(); + return this; + } + + private long totalRechargeDiamondCount_ ; + /** + * int64 totalRechargeDiamondCount = 41; + * @return The totalRechargeDiamondCount. + */ + @java.lang.Override + public long getTotalRechargeDiamondCount() { + return totalRechargeDiamondCount_; + } + /** + * int64 totalRechargeDiamondCount = 41; + * @param value The totalRechargeDiamondCount to set. + * @return This builder for chaining. + */ + public Builder setTotalRechargeDiamondCount(long value) { + + totalRechargeDiamondCount_ = value; + bitField1_ |= 0x00000100; + onChanged(); + return this; + } + /** + * int64 totalRechargeDiamondCount = 41; + * @return This builder for chaining. + */ + public Builder clearTotalRechargeDiamondCount() { + bitField1_ = (bitField1_ & ~0x00000100); + totalRechargeDiamondCount_ = 0L; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel webcastAnchorLevel_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevelOrBuilder> webcastAnchorLevelBuilder_; + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + * @return Whether the webcastAnchorLevel field is set. + */ + public boolean hasWebcastAnchorLevel() { + return ((bitField1_ & 0x00000200) != 0); + } + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + * @return The webcastAnchorLevel. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel getWebcastAnchorLevel() { + if (webcastAnchorLevelBuilder_ == null) { + return webcastAnchorLevel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.getDefaultInstance() : webcastAnchorLevel_; + } else { + return webcastAnchorLevelBuilder_.getMessage(); + } + } + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + */ + public Builder setWebcastAnchorLevel(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel value) { + if (webcastAnchorLevelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + webcastAnchorLevel_ = value; + } else { + webcastAnchorLevelBuilder_.setMessage(value); + } + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + */ + public Builder setWebcastAnchorLevel( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.Builder builderForValue) { + if (webcastAnchorLevelBuilder_ == null) { + webcastAnchorLevel_ = builderForValue.build(); + } else { + webcastAnchorLevelBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + */ + public Builder mergeWebcastAnchorLevel(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel value) { + if (webcastAnchorLevelBuilder_ == null) { + if (((bitField1_ & 0x00000200) != 0) && + webcastAnchorLevel_ != null && + webcastAnchorLevel_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.getDefaultInstance()) { + getWebcastAnchorLevelBuilder().mergeFrom(value); + } else { + webcastAnchorLevel_ = value; + } + } else { + webcastAnchorLevelBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + */ + public Builder clearWebcastAnchorLevel() { + bitField1_ = (bitField1_ & ~0x00000200); + webcastAnchorLevel_ = null; + if (webcastAnchorLevelBuilder_ != null) { + webcastAnchorLevelBuilder_.dispose(); + webcastAnchorLevelBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.Builder getWebcastAnchorLevelBuilder() { + bitField1_ |= 0x00000200; + onChanged(); + return getWebcastAnchorLevelFieldBuilder().getBuilder(); + } + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevelOrBuilder getWebcastAnchorLevelOrBuilder() { + if (webcastAnchorLevelBuilder_ != null) { + return webcastAnchorLevelBuilder_.getMessageOrBuilder(); + } else { + return webcastAnchorLevel_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.getDefaultInstance() : webcastAnchorLevel_; + } + } + /** + * .User.AnchorLevel webcastAnchorLevel = 42; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevelOrBuilder> + getWebcastAnchorLevelFieldBuilder() { + if (webcastAnchorLevelBuilder_ == null) { + webcastAnchorLevelBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevelOrBuilder>( + getWebcastAnchorLevel(), + getParentForChildren(), + isClean()); + webcastAnchorLevel_ = null; + } + return webcastAnchorLevelBuilder_; + } + + private java.lang.Object verifiedContent_ = ""; + /** + * string verifiedContent = 43; + * @return The verifiedContent. + */ + public java.lang.String getVerifiedContent() { + java.lang.Object ref = verifiedContent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verifiedContent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string verifiedContent = 43; + * @return The bytes for verifiedContent. + */ + public com.google.protobuf.ByteString + getVerifiedContentBytes() { + java.lang.Object ref = verifiedContent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + verifiedContent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string verifiedContent = 43; + * @param value The verifiedContent to set. + * @return This builder for chaining. + */ + public Builder setVerifiedContent( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + verifiedContent_ = value; + bitField1_ |= 0x00000400; + onChanged(); + return this; + } + /** + * string verifiedContent = 43; + * @return This builder for chaining. + */ + public Builder clearVerifiedContent() { + verifiedContent_ = getDefaultInstance().getVerifiedContent(); + bitField1_ = (bitField1_ & ~0x00000400); + onChanged(); + return this; + } + /** + * string verifiedContent = 43; + * @param value The bytes for verifiedContent to set. + * @return This builder for chaining. + */ + public Builder setVerifiedContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + verifiedContent_ = value; + bitField1_ |= 0x00000400; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats authorStats_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStatsOrBuilder> authorStatsBuilder_; + /** + * .User.AuthorStats authorStats = 44; + * @return Whether the authorStats field is set. + */ + public boolean hasAuthorStats() { + return ((bitField1_ & 0x00000800) != 0); + } + /** + * .User.AuthorStats authorStats = 44; + * @return The authorStats. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats getAuthorStats() { + if (authorStatsBuilder_ == null) { + return authorStats_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.getDefaultInstance() : authorStats_; + } else { + return authorStatsBuilder_.getMessage(); + } + } + /** + * .User.AuthorStats authorStats = 44; + */ + public Builder setAuthorStats(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats value) { + if (authorStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authorStats_ = value; + } else { + authorStatsBuilder_.setMessage(value); + } + bitField1_ |= 0x00000800; + onChanged(); + return this; + } + /** + * .User.AuthorStats authorStats = 44; + */ + public Builder setAuthorStats( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.Builder builderForValue) { + if (authorStatsBuilder_ == null) { + authorStats_ = builderForValue.build(); + } else { + authorStatsBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000800; + onChanged(); + return this; + } + /** + * .User.AuthorStats authorStats = 44; + */ + public Builder mergeAuthorStats(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats value) { + if (authorStatsBuilder_ == null) { + if (((bitField1_ & 0x00000800) != 0) && + authorStats_ != null && + authorStats_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.getDefaultInstance()) { + getAuthorStatsBuilder().mergeFrom(value); + } else { + authorStats_ = value; + } + } else { + authorStatsBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00000800; + onChanged(); + return this; + } + /** + * .User.AuthorStats authorStats = 44; + */ + public Builder clearAuthorStats() { + bitField1_ = (bitField1_ & ~0x00000800); + authorStats_ = null; + if (authorStatsBuilder_ != null) { + authorStatsBuilder_.dispose(); + authorStatsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.AuthorStats authorStats = 44; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.Builder getAuthorStatsBuilder() { + bitField1_ |= 0x00000800; + onChanged(); + return getAuthorStatsFieldBuilder().getBuilder(); + } + /** + * .User.AuthorStats authorStats = 44; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStatsOrBuilder getAuthorStatsOrBuilder() { + if (authorStatsBuilder_ != null) { + return authorStatsBuilder_.getMessageOrBuilder(); + } else { + return authorStats_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.getDefaultInstance() : authorStats_; + } + } + /** + * .User.AuthorStats authorStats = 44; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStatsOrBuilder> + getAuthorStatsFieldBuilder() { + if (authorStatsBuilder_ == null) { + authorStatsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStats.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthorStatsOrBuilder>( + getAuthorStats(), + getParentForChildren(), + isClean()); + authorStats_ = null; + } + return authorStatsBuilder_; + } + + private java.util.List topFansList_ = + java.util.Collections.emptyList(); + private void ensureTopFansListIsMutable() { + if (!((bitField1_ & 0x00001000) != 0)) { + topFansList_ = new java.util.ArrayList(topFansList_); + bitField1_ |= 0x00001000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> topFansListBuilder_; + + /** + * repeated .User topFansList = 45; + */ + public java.util.List getTopFansListList() { + if (topFansListBuilder_ == null) { + return java.util.Collections.unmodifiableList(topFansList_); + } else { + return topFansListBuilder_.getMessageList(); + } + } + /** + * repeated .User topFansList = 45; + */ + public int getTopFansListCount() { + if (topFansListBuilder_ == null) { + return topFansList_.size(); + } else { + return topFansListBuilder_.getCount(); + } + } + /** + * repeated .User topFansList = 45; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getTopFansList(int index) { + if (topFansListBuilder_ == null) { + return topFansList_.get(index); + } else { + return topFansListBuilder_.getMessage(index); + } + } + /** + * repeated .User topFansList = 45; + */ + public Builder setTopFansList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (topFansListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopFansListIsMutable(); + topFansList_.set(index, value); + onChanged(); + } else { + topFansListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .User topFansList = 45; + */ + public Builder setTopFansList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder builderForValue) { + if (topFansListBuilder_ == null) { + ensureTopFansListIsMutable(); + topFansList_.set(index, builderForValue.build()); + onChanged(); + } else { + topFansListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .User topFansList = 45; + */ + public Builder addTopFansList(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (topFansListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopFansListIsMutable(); + topFansList_.add(value); + onChanged(); + } else { + topFansListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .User topFansList = 45; + */ + public Builder addTopFansList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User value) { + if (topFansListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopFansListIsMutable(); + topFansList_.add(index, value); + onChanged(); + } else { + topFansListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .User topFansList = 45; + */ + public Builder addTopFansList( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder builderForValue) { + if (topFansListBuilder_ == null) { + ensureTopFansListIsMutable(); + topFansList_.add(builderForValue.build()); + onChanged(); + } else { + topFansListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .User topFansList = 45; + */ + public Builder addTopFansList( + int index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder builderForValue) { + if (topFansListBuilder_ == null) { + ensureTopFansListIsMutable(); + topFansList_.add(index, builderForValue.build()); + onChanged(); + } else { + topFansListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .User topFansList = 45; + */ + public Builder addAllTopFansList( + java.lang.Iterable values) { + if (topFansListBuilder_ == null) { + ensureTopFansListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, topFansList_); + onChanged(); + } else { + topFansListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .User topFansList = 45; + */ + public Builder clearTopFansList() { + if (topFansListBuilder_ == null) { + topFansList_ = java.util.Collections.emptyList(); + bitField1_ = (bitField1_ & ~0x00001000); + onChanged(); + } else { + topFansListBuilder_.clear(); + } + return this; + } + /** + * repeated .User topFansList = 45; + */ + public Builder removeTopFansList(int index) { + if (topFansListBuilder_ == null) { + ensureTopFansListIsMutable(); + topFansList_.remove(index); + onChanged(); + } else { + topFansListBuilder_.remove(index); + } + return this; + } + /** + * repeated .User topFansList = 45; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder getTopFansListBuilder( + int index) { + return getTopFansListFieldBuilder().getBuilder(index); + } + /** + * repeated .User topFansList = 45; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder getTopFansListOrBuilder( + int index) { + if (topFansListBuilder_ == null) { + return topFansList_.get(index); } else { + return topFansListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .User topFansList = 45; + */ + public java.util.List + getTopFansListOrBuilderList() { + if (topFansListBuilder_ != null) { + return topFansListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(topFansList_); + } + } + /** + * repeated .User topFansList = 45; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder addTopFansListBuilder() { + return getTopFansListFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance()); + } + /** + * repeated .User topFansList = 45; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder addTopFansListBuilder( + int index) { + return getTopFansListFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.getDefaultInstance()); + } + /** + * repeated .User topFansList = 45; + */ + public java.util.List + getTopFansListBuilderList() { + return getTopFansListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder> + getTopFansListFieldBuilder() { + if (topFansListBuilder_ == null) { + topFansListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.UserOrBuilder>( + topFansList_, + ((bitField1_ & 0x00001000) != 0), + getParentForChildren(), + isClean()); + topFansList_ = null; + } + return topFansListBuilder_; + } + + private java.lang.Object secUid_ = ""; + /** + * string secUid = 46; + * @return The secUid. + */ + public java.lang.String getSecUid() { + java.lang.Object ref = secUid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secUid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string secUid = 46; + * @return The bytes for secUid. + */ + public com.google.protobuf.ByteString + getSecUidBytes() { + java.lang.Object ref = secUid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + secUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string secUid = 46; + * @param value The secUid to set. + * @return This builder for chaining. + */ + public Builder setSecUid( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + secUid_ = value; + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + /** + * string secUid = 46; + * @return This builder for chaining. + */ + public Builder clearSecUid() { + secUid_ = getDefaultInstance().getSecUid(); + bitField1_ = (bitField1_ & ~0x00002000); + onChanged(); + return this; + } + /** + * string secUid = 46; + * @param value The bytes for secUid to set. + * @return This builder for chaining. + */ + public Builder setSecUidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + secUid_ = value; + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + + private int userRole_ ; + /** + * int32 userRole = 47; + * @return The userRole. + */ + @java.lang.Override + public int getUserRole() { + return userRole_; + } + /** + * int32 userRole = 47; + * @param value The userRole to set. + * @return This builder for chaining. + */ + public Builder setUserRole(int value) { + + userRole_ = value; + bitField1_ |= 0x00004000; + onChanged(); + return this; + } + /** + * int32 userRole = 47; + * @return This builder for chaining. + */ + public Builder clearUserRole() { + bitField1_ = (bitField1_ & ~0x00004000); + userRole_ = 0; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams xiguaInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParamsOrBuilder> xiguaInfoBuilder_; + /** + * .User.XiguaParams xiguaInfo = 48; + * @return Whether the xiguaInfo field is set. + */ + public boolean hasXiguaInfo() { + return ((bitField1_ & 0x00008000) != 0); + } + /** + * .User.XiguaParams xiguaInfo = 48; + * @return The xiguaInfo. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams getXiguaInfo() { + if (xiguaInfoBuilder_ == null) { + return xiguaInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.getDefaultInstance() : xiguaInfo_; + } else { + return xiguaInfoBuilder_.getMessage(); + } + } + /** + * .User.XiguaParams xiguaInfo = 48; + */ + public Builder setXiguaInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams value) { + if (xiguaInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + xiguaInfo_ = value; + } else { + xiguaInfoBuilder_.setMessage(value); + } + bitField1_ |= 0x00008000; + onChanged(); + return this; + } + /** + * .User.XiguaParams xiguaInfo = 48; + */ + public Builder setXiguaInfo( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.Builder builderForValue) { + if (xiguaInfoBuilder_ == null) { + xiguaInfo_ = builderForValue.build(); + } else { + xiguaInfoBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00008000; + onChanged(); + return this; + } + /** + * .User.XiguaParams xiguaInfo = 48; + */ + public Builder mergeXiguaInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams value) { + if (xiguaInfoBuilder_ == null) { + if (((bitField1_ & 0x00008000) != 0) && + xiguaInfo_ != null && + xiguaInfo_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.getDefaultInstance()) { + getXiguaInfoBuilder().mergeFrom(value); + } else { + xiguaInfo_ = value; + } + } else { + xiguaInfoBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00008000; + onChanged(); + return this; + } + /** + * .User.XiguaParams xiguaInfo = 48; + */ + public Builder clearXiguaInfo() { + bitField1_ = (bitField1_ & ~0x00008000); + xiguaInfo_ = null; + if (xiguaInfoBuilder_ != null) { + xiguaInfoBuilder_.dispose(); + xiguaInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.XiguaParams xiguaInfo = 48; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.Builder getXiguaInfoBuilder() { + bitField1_ |= 0x00008000; + onChanged(); + return getXiguaInfoFieldBuilder().getBuilder(); + } + /** + * .User.XiguaParams xiguaInfo = 48; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParamsOrBuilder getXiguaInfoOrBuilder() { + if (xiguaInfoBuilder_ != null) { + return xiguaInfoBuilder_.getMessageOrBuilder(); + } else { + return xiguaInfo_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.getDefaultInstance() : xiguaInfo_; + } + } + /** + * .User.XiguaParams xiguaInfo = 48; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParamsOrBuilder> + getXiguaInfoFieldBuilder() { + if (xiguaInfoBuilder_ == null) { + xiguaInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParams.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.XiguaParamsOrBuilder>( + getXiguaInfo(), + getParentForChildren(), + isClean()); + xiguaInfo_ = null; + } + return xiguaInfoBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo activityReward_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfoOrBuilder> activityRewardBuilder_; + /** + * .User.ActivityInfo activityReward = 49; + * @return Whether the activityReward field is set. + */ + public boolean hasActivityReward() { + return ((bitField1_ & 0x00010000) != 0); + } + /** + * .User.ActivityInfo activityReward = 49; + * @return The activityReward. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo getActivityReward() { + if (activityRewardBuilder_ == null) { + return activityReward_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.getDefaultInstance() : activityReward_; + } else { + return activityRewardBuilder_.getMessage(); + } + } + /** + * .User.ActivityInfo activityReward = 49; + */ + public Builder setActivityReward(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo value) { + if (activityRewardBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + activityReward_ = value; + } else { + activityRewardBuilder_.setMessage(value); + } + bitField1_ |= 0x00010000; + onChanged(); + return this; + } + /** + * .User.ActivityInfo activityReward = 49; + */ + public Builder setActivityReward( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.Builder builderForValue) { + if (activityRewardBuilder_ == null) { + activityReward_ = builderForValue.build(); + } else { + activityRewardBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00010000; + onChanged(); + return this; + } + /** + * .User.ActivityInfo activityReward = 49; + */ + public Builder mergeActivityReward(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo value) { + if (activityRewardBuilder_ == null) { + if (((bitField1_ & 0x00010000) != 0) && + activityReward_ != null && + activityReward_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.getDefaultInstance()) { + getActivityRewardBuilder().mergeFrom(value); + } else { + activityReward_ = value; + } + } else { + activityRewardBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00010000; + onChanged(); + return this; + } + /** + * .User.ActivityInfo activityReward = 49; + */ + public Builder clearActivityReward() { + bitField1_ = (bitField1_ & ~0x00010000); + activityReward_ = null; + if (activityRewardBuilder_ != null) { + activityRewardBuilder_.dispose(); + activityRewardBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.ActivityInfo activityReward = 49; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.Builder getActivityRewardBuilder() { + bitField1_ |= 0x00010000; + onChanged(); + return getActivityRewardFieldBuilder().getBuilder(); + } + /** + * .User.ActivityInfo activityReward = 49; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfoOrBuilder getActivityRewardOrBuilder() { + if (activityRewardBuilder_ != null) { + return activityRewardBuilder_.getMessageOrBuilder(); + } else { + return activityReward_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.getDefaultInstance() : activityReward_; + } + } + /** + * .User.ActivityInfo activityReward = 49; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfoOrBuilder> + getActivityRewardFieldBuilder() { + if (activityRewardBuilder_ == null) { + activityRewardBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ActivityInfoOrBuilder>( + getActivityReward(), + getParentForChildren(), + isClean()); + activityReward_ = null; + } + return activityRewardBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo nobleInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfoOrBuilder> nobleInfoBuilder_; + /** + * .User.NobleLevelInfo nobleInfo = 50; + * @return Whether the nobleInfo field is set. + */ + public boolean hasNobleInfo() { + return ((bitField1_ & 0x00020000) != 0); + } + /** + * .User.NobleLevelInfo nobleInfo = 50; + * @return The nobleInfo. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo getNobleInfo() { + if (nobleInfoBuilder_ == null) { + return nobleInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.getDefaultInstance() : nobleInfo_; + } else { + return nobleInfoBuilder_.getMessage(); + } + } + /** + * .User.NobleLevelInfo nobleInfo = 50; + */ + public Builder setNobleInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo value) { + if (nobleInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + nobleInfo_ = value; + } else { + nobleInfoBuilder_.setMessage(value); + } + bitField1_ |= 0x00020000; + onChanged(); + return this; + } + /** + * .User.NobleLevelInfo nobleInfo = 50; + */ + public Builder setNobleInfo( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.Builder builderForValue) { + if (nobleInfoBuilder_ == null) { + nobleInfo_ = builderForValue.build(); + } else { + nobleInfoBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00020000; + onChanged(); + return this; + } + /** + * .User.NobleLevelInfo nobleInfo = 50; + */ + public Builder mergeNobleInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo value) { + if (nobleInfoBuilder_ == null) { + if (((bitField1_ & 0x00020000) != 0) && + nobleInfo_ != null && + nobleInfo_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.getDefaultInstance()) { + getNobleInfoBuilder().mergeFrom(value); + } else { + nobleInfo_ = value; + } + } else { + nobleInfoBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00020000; + onChanged(); + return this; + } + /** + * .User.NobleLevelInfo nobleInfo = 50; + */ + public Builder clearNobleInfo() { + bitField1_ = (bitField1_ & ~0x00020000); + nobleInfo_ = null; + if (nobleInfoBuilder_ != null) { + nobleInfoBuilder_.dispose(); + nobleInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.NobleLevelInfo nobleInfo = 50; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.Builder getNobleInfoBuilder() { + bitField1_ |= 0x00020000; + onChanged(); + return getNobleInfoFieldBuilder().getBuilder(); + } + /** + * .User.NobleLevelInfo nobleInfo = 50; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfoOrBuilder getNobleInfoOrBuilder() { + if (nobleInfoBuilder_ != null) { + return nobleInfoBuilder_.getMessageOrBuilder(); + } else { + return nobleInfo_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.getDefaultInstance() : nobleInfo_; + } + } + /** + * .User.NobleLevelInfo nobleInfo = 50; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfoOrBuilder> + getNobleInfoFieldBuilder() { + if (nobleInfoBuilder_ == null) { + nobleInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.NobleLevelInfoOrBuilder>( + getNobleInfo(), + getParentForChildren(), + isClean()); + nobleInfo_ = null; + } + return nobleInfoBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo brotherhoodInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfoOrBuilder> brotherhoodInfoBuilder_; + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + * @return Whether the brotherhoodInfo field is set. + */ + public boolean hasBrotherhoodInfo() { + return ((bitField1_ & 0x00040000) != 0); + } + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + * @return The brotherhoodInfo. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo getBrotherhoodInfo() { + if (brotherhoodInfoBuilder_ == null) { + return brotherhoodInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.getDefaultInstance() : brotherhoodInfo_; + } else { + return brotherhoodInfoBuilder_.getMessage(); + } + } + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + */ + public Builder setBrotherhoodInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo value) { + if (brotherhoodInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + brotherhoodInfo_ = value; + } else { + brotherhoodInfoBuilder_.setMessage(value); + } + bitField1_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + */ + public Builder setBrotherhoodInfo( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.Builder builderForValue) { + if (brotherhoodInfoBuilder_ == null) { + brotherhoodInfo_ = builderForValue.build(); + } else { + brotherhoodInfoBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + */ + public Builder mergeBrotherhoodInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo value) { + if (brotherhoodInfoBuilder_ == null) { + if (((bitField1_ & 0x00040000) != 0) && + brotherhoodInfo_ != null && + brotherhoodInfo_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.getDefaultInstance()) { + getBrotherhoodInfoBuilder().mergeFrom(value); + } else { + brotherhoodInfo_ = value; + } + } else { + brotherhoodInfoBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + */ + public Builder clearBrotherhoodInfo() { + bitField1_ = (bitField1_ & ~0x00040000); + brotherhoodInfo_ = null; + if (brotherhoodInfoBuilder_ != null) { + brotherhoodInfoBuilder_.dispose(); + brotherhoodInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.Builder getBrotherhoodInfoBuilder() { + bitField1_ |= 0x00040000; + onChanged(); + return getBrotherhoodInfoFieldBuilder().getBuilder(); + } + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfoOrBuilder getBrotherhoodInfoOrBuilder() { + if (brotherhoodInfoBuilder_ != null) { + return brotherhoodInfoBuilder_.getMessageOrBuilder(); + } else { + return brotherhoodInfo_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.getDefaultInstance() : brotherhoodInfo_; + } + } + /** + * .User.BrotherhoodInfo brotherhoodInfo = 51; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfoOrBuilder> + getBrotherhoodInfoFieldBuilder() { + if (brotherhoodInfoBuilder_ == null) { + brotherhoodInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.BrotherhoodInfoOrBuilder>( + getBrotherhoodInfo(), + getParentForChildren(), + isClean()); + brotherhoodInfo_ = null; + } + return brotherhoodInfoBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image personalCard_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> personalCardBuilder_; + /** + * .Image personalCard = 52; + * @return Whether the personalCard field is set. + */ + public boolean hasPersonalCard() { + return ((bitField1_ & 0x00080000) != 0); + } + /** + * .Image personalCard = 52; + * @return The personalCard. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getPersonalCard() { + if (personalCardBuilder_ == null) { + return personalCard_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : personalCard_; + } else { + return personalCardBuilder_.getMessage(); + } + } + /** + * .Image personalCard = 52; + */ + public Builder setPersonalCard(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (personalCardBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + personalCard_ = value; + } else { + personalCardBuilder_.setMessage(value); + } + bitField1_ |= 0x00080000; + onChanged(); + return this; + } + /** + * .Image personalCard = 52; + */ + public Builder setPersonalCard( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (personalCardBuilder_ == null) { + personalCard_ = builderForValue.build(); + } else { + personalCardBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00080000; + onChanged(); + return this; + } + /** + * .Image personalCard = 52; + */ + public Builder mergePersonalCard(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (personalCardBuilder_ == null) { + if (((bitField1_ & 0x00080000) != 0) && + personalCard_ != null && + personalCard_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getPersonalCardBuilder().mergeFrom(value); + } else { + personalCard_ = value; + } + } else { + personalCardBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00080000; + onChanged(); + return this; + } + /** + * .Image personalCard = 52; + */ + public Builder clearPersonalCard() { + bitField1_ = (bitField1_ & ~0x00080000); + personalCard_ = null; + if (personalCardBuilder_ != null) { + personalCardBuilder_.dispose(); + personalCardBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image personalCard = 52; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getPersonalCardBuilder() { + bitField1_ |= 0x00080000; + onChanged(); + return getPersonalCardFieldBuilder().getBuilder(); + } + /** + * .Image personalCard = 52; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getPersonalCardOrBuilder() { + if (personalCardBuilder_ != null) { + return personalCardBuilder_.getMessageOrBuilder(); + } else { + return personalCard_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : personalCard_; + } + } + /** + * .Image personalCard = 52; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getPersonalCardFieldBuilder() { + if (personalCardBuilder_ == null) { + personalCardBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getPersonalCard(), + getParentForChildren(), + isClean()); + personalCard_ = null; + } + return personalCardBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo authenticationInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfoOrBuilder> authenticationInfoBuilder_; + /** + * .User.AuthenticationInfo authenticationInfo = 53; + * @return Whether the authenticationInfo field is set. + */ + public boolean hasAuthenticationInfo() { + return ((bitField1_ & 0x00100000) != 0); + } + /** + * .User.AuthenticationInfo authenticationInfo = 53; + * @return The authenticationInfo. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo getAuthenticationInfo() { + if (authenticationInfoBuilder_ == null) { + return authenticationInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.getDefaultInstance() : authenticationInfo_; + } else { + return authenticationInfoBuilder_.getMessage(); + } + } + /** + * .User.AuthenticationInfo authenticationInfo = 53; + */ + public Builder setAuthenticationInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo value) { + if (authenticationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authenticationInfo_ = value; + } else { + authenticationInfoBuilder_.setMessage(value); + } + bitField1_ |= 0x00100000; + onChanged(); + return this; + } + /** + * .User.AuthenticationInfo authenticationInfo = 53; + */ + public Builder setAuthenticationInfo( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.Builder builderForValue) { + if (authenticationInfoBuilder_ == null) { + authenticationInfo_ = builderForValue.build(); + } else { + authenticationInfoBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00100000; + onChanged(); + return this; + } + /** + * .User.AuthenticationInfo authenticationInfo = 53; + */ + public Builder mergeAuthenticationInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo value) { + if (authenticationInfoBuilder_ == null) { + if (((bitField1_ & 0x00100000) != 0) && + authenticationInfo_ != null && + authenticationInfo_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.getDefaultInstance()) { + getAuthenticationInfoBuilder().mergeFrom(value); + } else { + authenticationInfo_ = value; + } + } else { + authenticationInfoBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00100000; + onChanged(); + return this; + } + /** + * .User.AuthenticationInfo authenticationInfo = 53; + */ + public Builder clearAuthenticationInfo() { + bitField1_ = (bitField1_ & ~0x00100000); + authenticationInfo_ = null; + if (authenticationInfoBuilder_ != null) { + authenticationInfoBuilder_.dispose(); + authenticationInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.AuthenticationInfo authenticationInfo = 53; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.Builder getAuthenticationInfoBuilder() { + bitField1_ |= 0x00100000; + onChanged(); + return getAuthenticationInfoFieldBuilder().getBuilder(); + } + /** + * .User.AuthenticationInfo authenticationInfo = 53; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfoOrBuilder getAuthenticationInfoOrBuilder() { + if (authenticationInfoBuilder_ != null) { + return authenticationInfoBuilder_.getMessageOrBuilder(); + } else { + return authenticationInfo_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.getDefaultInstance() : authenticationInfo_; + } + } + /** + * .User.AuthenticationInfo authenticationInfo = 53; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfoOrBuilder> + getAuthenticationInfoFieldBuilder() { + if (authenticationInfoBuilder_ == null) { + authenticationInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AuthenticationInfoOrBuilder>( + getAuthenticationInfo(), + getParentForChildren(), + isClean()); + authenticationInfo_ = null; + } + return authenticationInfoBuilder_; + } + + private int authorizationInfo_ ; + /** + * int32 authorizationInfo = 54; + * @return The authorizationInfo. + */ + @java.lang.Override + public int getAuthorizationInfo() { + return authorizationInfo_; + } + /** + * int32 authorizationInfo = 54; + * @param value The authorizationInfo to set. + * @return This builder for chaining. + */ + public Builder setAuthorizationInfo(int value) { + + authorizationInfo_ = value; + bitField1_ |= 0x00200000; + onChanged(); + return this; + } + /** + * int32 authorizationInfo = 54; + * @return This builder for chaining. + */ + public Builder clearAuthorizationInfo() { + bitField1_ = (bitField1_ & ~0x00200000); + authorizationInfo_ = 0; + onChanged(); + return this; + } + + private int adversaryAuthorizationInfo_ ; + /** + * int32 adversaryAuthorizationInfo = 55; + * @return The adversaryAuthorizationInfo. + */ + @java.lang.Override + public int getAdversaryAuthorizationInfo() { + return adversaryAuthorizationInfo_; + } + /** + * int32 adversaryAuthorizationInfo = 55; + * @param value The adversaryAuthorizationInfo to set. + * @return This builder for chaining. + */ + public Builder setAdversaryAuthorizationInfo(int value) { + + adversaryAuthorizationInfo_ = value; + bitField1_ |= 0x00400000; + onChanged(); + return this; + } + /** + * int32 adversaryAuthorizationInfo = 55; + * @return This builder for chaining. + */ + public Builder clearAdversaryAuthorizationInfo() { + bitField1_ = (bitField1_ & ~0x00400000); + adversaryAuthorizationInfo_ = 0; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo poiInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfoOrBuilder> poiInfoBuilder_; + /** + * .User.PoiInfo poiInfo = 56; + * @return Whether the poiInfo field is set. + */ + public boolean hasPoiInfo() { + return ((bitField1_ & 0x00800000) != 0); + } + /** + * .User.PoiInfo poiInfo = 56; + * @return The poiInfo. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo getPoiInfo() { + if (poiInfoBuilder_ == null) { + return poiInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.getDefaultInstance() : poiInfo_; + } else { + return poiInfoBuilder_.getMessage(); + } + } + /** + * .User.PoiInfo poiInfo = 56; + */ + public Builder setPoiInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo value) { + if (poiInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + poiInfo_ = value; + } else { + poiInfoBuilder_.setMessage(value); + } + bitField1_ |= 0x00800000; + onChanged(); + return this; + } + /** + * .User.PoiInfo poiInfo = 56; + */ + public Builder setPoiInfo( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.Builder builderForValue) { + if (poiInfoBuilder_ == null) { + poiInfo_ = builderForValue.build(); + } else { + poiInfoBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00800000; + onChanged(); + return this; + } + /** + * .User.PoiInfo poiInfo = 56; + */ + public Builder mergePoiInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo value) { + if (poiInfoBuilder_ == null) { + if (((bitField1_ & 0x00800000) != 0) && + poiInfo_ != null && + poiInfo_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.getDefaultInstance()) { + getPoiInfoBuilder().mergeFrom(value); + } else { + poiInfo_ = value; + } + } else { + poiInfoBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00800000; + onChanged(); + return this; + } + /** + * .User.PoiInfo poiInfo = 56; + */ + public Builder clearPoiInfo() { + bitField1_ = (bitField1_ & ~0x00800000); + poiInfo_ = null; + if (poiInfoBuilder_ != null) { + poiInfoBuilder_.dispose(); + poiInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.PoiInfo poiInfo = 56; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.Builder getPoiInfoBuilder() { + bitField1_ |= 0x00800000; + onChanged(); + return getPoiInfoFieldBuilder().getBuilder(); + } + /** + * .User.PoiInfo poiInfo = 56; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfoOrBuilder getPoiInfoOrBuilder() { + if (poiInfoBuilder_ != null) { + return poiInfoBuilder_.getMessageOrBuilder(); + } else { + return poiInfo_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.getDefaultInstance() : poiInfo_; + } + } + /** + * .User.PoiInfo poiInfo = 56; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfoOrBuilder> + getPoiInfoFieldBuilder() { + if (poiInfoBuilder_ == null) { + poiInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.PoiInfoOrBuilder>( + getPoiInfo(), + getParentForChildren(), + isClean()); + poiInfo_ = null; + } + return poiInfoBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image mediaBadgeImageListList_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> mediaBadgeImageListListBuilder_; + /** + * .Image mediaBadgeImageListList = 57; + * @return Whether the mediaBadgeImageListList field is set. + */ + public boolean hasMediaBadgeImageListList() { + return ((bitField1_ & 0x01000000) != 0); + } + /** + * .Image mediaBadgeImageListList = 57; + * @return The mediaBadgeImageListList. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getMediaBadgeImageListList() { + if (mediaBadgeImageListListBuilder_ == null) { + return mediaBadgeImageListList_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : mediaBadgeImageListList_; + } else { + return mediaBadgeImageListListBuilder_.getMessage(); + } + } + /** + * .Image mediaBadgeImageListList = 57; + */ + public Builder setMediaBadgeImageListList(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (mediaBadgeImageListListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mediaBadgeImageListList_ = value; + } else { + mediaBadgeImageListListBuilder_.setMessage(value); + } + bitField1_ |= 0x01000000; + onChanged(); + return this; + } + /** + * .Image mediaBadgeImageListList = 57; + */ + public Builder setMediaBadgeImageListList( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (mediaBadgeImageListListBuilder_ == null) { + mediaBadgeImageListList_ = builderForValue.build(); + } else { + mediaBadgeImageListListBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x01000000; + onChanged(); + return this; + } + /** + * .Image mediaBadgeImageListList = 57; + */ + public Builder mergeMediaBadgeImageListList(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (mediaBadgeImageListListBuilder_ == null) { + if (((bitField1_ & 0x01000000) != 0) && + mediaBadgeImageListList_ != null && + mediaBadgeImageListList_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getMediaBadgeImageListListBuilder().mergeFrom(value); + } else { + mediaBadgeImageListList_ = value; + } + } else { + mediaBadgeImageListListBuilder_.mergeFrom(value); + } + bitField1_ |= 0x01000000; + onChanged(); + return this; + } + /** + * .Image mediaBadgeImageListList = 57; + */ + public Builder clearMediaBadgeImageListList() { + bitField1_ = (bitField1_ & ~0x01000000); + mediaBadgeImageListList_ = null; + if (mediaBadgeImageListListBuilder_ != null) { + mediaBadgeImageListListBuilder_.dispose(); + mediaBadgeImageListListBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image mediaBadgeImageListList = 57; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getMediaBadgeImageListListBuilder() { + bitField1_ |= 0x01000000; + onChanged(); + return getMediaBadgeImageListListFieldBuilder().getBuilder(); + } + /** + * .Image mediaBadgeImageListList = 57; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getMediaBadgeImageListListOrBuilder() { + if (mediaBadgeImageListListBuilder_ != null) { + return mediaBadgeImageListListBuilder_.getMessageOrBuilder(); + } else { + return mediaBadgeImageListList_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : mediaBadgeImageListList_; + } + } + /** + * .Image mediaBadgeImageListList = 57; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getMediaBadgeImageListListFieldBuilder() { + if (mediaBadgeImageListListBuilder_ == null) { + mediaBadgeImageListListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getMediaBadgeImageListList(), + getParentForChildren(), + isClean()); + mediaBadgeImageListList_ = null; + } + return mediaBadgeImageListListBuilder_; + } + + private int adversaryUserStatus_ ; + /** + * int32 adversaryUserStatus = 58; + * @return The adversaryUserStatus. + */ + @java.lang.Override + public int getAdversaryUserStatus() { + return adversaryUserStatus_; + } + /** + * int32 adversaryUserStatus = 58; + * @param value The adversaryUserStatus to set. + * @return This builder for chaining. + */ + public Builder setAdversaryUserStatus(int value) { + + adversaryUserStatus_ = value; + bitField1_ |= 0x02000000; + onChanged(); + return this; + } + /** + * int32 adversaryUserStatus = 58; + * @return This builder for chaining. + */ + public Builder clearAdversaryUserStatus() { + bitField1_ = (bitField1_ & ~0x02000000); + adversaryUserStatus_ = 0; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo userVipInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfoOrBuilder> userVipInfoBuilder_; + /** + * .User.UserVIPInfo userVipInfo = 59; + * @return Whether the userVipInfo field is set. + */ + public boolean hasUserVipInfo() { + return ((bitField1_ & 0x04000000) != 0); + } + /** + * .User.UserVIPInfo userVipInfo = 59; + * @return The userVipInfo. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo getUserVipInfo() { + if (userVipInfoBuilder_ == null) { + return userVipInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.getDefaultInstance() : userVipInfo_; + } else { + return userVipInfoBuilder_.getMessage(); + } + } + /** + * .User.UserVIPInfo userVipInfo = 59; + */ + public Builder setUserVipInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo value) { + if (userVipInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userVipInfo_ = value; + } else { + userVipInfoBuilder_.setMessage(value); + } + bitField1_ |= 0x04000000; + onChanged(); + return this; + } + /** + * .User.UserVIPInfo userVipInfo = 59; + */ + public Builder setUserVipInfo( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.Builder builderForValue) { + if (userVipInfoBuilder_ == null) { + userVipInfo_ = builderForValue.build(); + } else { + userVipInfoBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x04000000; + onChanged(); + return this; + } + /** + * .User.UserVIPInfo userVipInfo = 59; + */ + public Builder mergeUserVipInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo value) { + if (userVipInfoBuilder_ == null) { + if (((bitField1_ & 0x04000000) != 0) && + userVipInfo_ != null && + userVipInfo_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.getDefaultInstance()) { + getUserVipInfoBuilder().mergeFrom(value); + } else { + userVipInfo_ = value; + } + } else { + userVipInfoBuilder_.mergeFrom(value); + } + bitField1_ |= 0x04000000; + onChanged(); + return this; + } + /** + * .User.UserVIPInfo userVipInfo = 59; + */ + public Builder clearUserVipInfo() { + bitField1_ = (bitField1_ & ~0x04000000); + userVipInfo_ = null; + if (userVipInfoBuilder_ != null) { + userVipInfoBuilder_.dispose(); + userVipInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.UserVIPInfo userVipInfo = 59; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.Builder getUserVipInfoBuilder() { + bitField1_ |= 0x04000000; + onChanged(); + return getUserVipInfoFieldBuilder().getBuilder(); + } + /** + * .User.UserVIPInfo userVipInfo = 59; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfoOrBuilder getUserVipInfoOrBuilder() { + if (userVipInfoBuilder_ != null) { + return userVipInfoBuilder_.getMessageOrBuilder(); + } else { + return userVipInfo_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.getDefaultInstance() : userVipInfo_; + } + } + /** + * .User.UserVIPInfo userVipInfo = 59; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfoOrBuilder> + getUserVipInfoFieldBuilder() { + if (userVipInfoBuilder_ == null) { + userVipInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserVIPInfoOrBuilder>( + getUserVipInfo(), + getParentForChildren(), + isClean()); + userVipInfo_ = null; + } + return userVipInfoBuilder_; + } + + private com.google.protobuf.Internal.LongList commerceWebcastConfigIdsList_ = emptyLongList(); + private void ensureCommerceWebcastConfigIdsListIsMutable() { + if (!((bitField1_ & 0x08000000) != 0)) { + commerceWebcastConfigIdsList_ = mutableCopy(commerceWebcastConfigIdsList_); + bitField1_ |= 0x08000000; + } + } + /** + * repeated int64 commerceWebcastConfigIdsList = 60; + * @return A list containing the commerceWebcastConfigIdsList. + */ + public java.util.List + getCommerceWebcastConfigIdsListList() { + return ((bitField1_ & 0x08000000) != 0) ? + java.util.Collections.unmodifiableList(commerceWebcastConfigIdsList_) : commerceWebcastConfigIdsList_; + } + /** + * repeated int64 commerceWebcastConfigIdsList = 60; + * @return The count of commerceWebcastConfigIdsList. + */ + public int getCommerceWebcastConfigIdsListCount() { + return commerceWebcastConfigIdsList_.size(); + } + /** + * repeated int64 commerceWebcastConfigIdsList = 60; + * @param index The index of the element to return. + * @return The commerceWebcastConfigIdsList at the given index. + */ + public long getCommerceWebcastConfigIdsList(int index) { + return commerceWebcastConfigIdsList_.getLong(index); + } + /** + * repeated int64 commerceWebcastConfigIdsList = 60; + * @param index The index to set the value at. + * @param value The commerceWebcastConfigIdsList to set. + * @return This builder for chaining. + */ + public Builder setCommerceWebcastConfigIdsList( + int index, long value) { + + ensureCommerceWebcastConfigIdsListIsMutable(); + commerceWebcastConfigIdsList_.setLong(index, value); + onChanged(); + return this; + } + /** + * repeated int64 commerceWebcastConfigIdsList = 60; + * @param value The commerceWebcastConfigIdsList to add. + * @return This builder for chaining. + */ + public Builder addCommerceWebcastConfigIdsList(long value) { + + ensureCommerceWebcastConfigIdsListIsMutable(); + commerceWebcastConfigIdsList_.addLong(value); + onChanged(); + return this; + } + /** + * repeated int64 commerceWebcastConfigIdsList = 60; + * @param values The commerceWebcastConfigIdsList to add. + * @return This builder for chaining. + */ + public Builder addAllCommerceWebcastConfigIdsList( + java.lang.Iterable values) { + ensureCommerceWebcastConfigIdsListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, commerceWebcastConfigIdsList_); + onChanged(); + return this; + } + /** + * repeated int64 commerceWebcastConfigIdsList = 60; + * @return This builder for chaining. + */ + public Builder clearCommerceWebcastConfigIdsList() { + commerceWebcastConfigIdsList_ = emptyLongList(); + bitField1_ = (bitField1_ & ~0x08000000); + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image badgeImageListV2List_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> badgeImageListV2ListBuilder_; + /** + * .Image badgeImageListV2List = 61; + * @return Whether the badgeImageListV2List field is set. + */ + public boolean hasBadgeImageListV2List() { + return ((bitField1_ & 0x10000000) != 0); + } + /** + * .Image badgeImageListV2List = 61; + * @return The badgeImageListV2List. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getBadgeImageListV2List() { + if (badgeImageListV2ListBuilder_ == null) { + return badgeImageListV2List_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : badgeImageListV2List_; + } else { + return badgeImageListV2ListBuilder_.getMessage(); + } + } + /** + * .Image badgeImageListV2List = 61; + */ + public Builder setBadgeImageListV2List(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (badgeImageListV2ListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + badgeImageListV2List_ = value; + } else { + badgeImageListV2ListBuilder_.setMessage(value); + } + bitField1_ |= 0x10000000; + onChanged(); + return this; + } + /** + * .Image badgeImageListV2List = 61; + */ + public Builder setBadgeImageListV2List( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (badgeImageListV2ListBuilder_ == null) { + badgeImageListV2List_ = builderForValue.build(); + } else { + badgeImageListV2ListBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x10000000; + onChanged(); + return this; + } + /** + * .Image badgeImageListV2List = 61; + */ + public Builder mergeBadgeImageListV2List(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (badgeImageListV2ListBuilder_ == null) { + if (((bitField1_ & 0x10000000) != 0) && + badgeImageListV2List_ != null && + badgeImageListV2List_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getBadgeImageListV2ListBuilder().mergeFrom(value); + } else { + badgeImageListV2List_ = value; + } + } else { + badgeImageListV2ListBuilder_.mergeFrom(value); + } + bitField1_ |= 0x10000000; + onChanged(); + return this; + } + /** + * .Image badgeImageListV2List = 61; + */ + public Builder clearBadgeImageListV2List() { + bitField1_ = (bitField1_ & ~0x10000000); + badgeImageListV2List_ = null; + if (badgeImageListV2ListBuilder_ != null) { + badgeImageListV2ListBuilder_.dispose(); + badgeImageListV2ListBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image badgeImageListV2List = 61; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getBadgeImageListV2ListBuilder() { + bitField1_ |= 0x10000000; + onChanged(); + return getBadgeImageListV2ListFieldBuilder().getBuilder(); + } + /** + * .Image badgeImageListV2List = 61; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getBadgeImageListV2ListOrBuilder() { + if (badgeImageListV2ListBuilder_ != null) { + return badgeImageListV2ListBuilder_.getMessageOrBuilder(); + } else { + return badgeImageListV2List_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : badgeImageListV2List_; + } + } + /** + * .Image badgeImageListV2List = 61; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getBadgeImageListV2ListFieldBuilder() { + if (badgeImageListV2ListBuilder_ == null) { + badgeImageListV2ListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getBadgeImageListV2List(), + getParentForChildren(), + isClean()); + badgeImageListV2List_ = null; + } + return badgeImageListV2ListBuilder_; + } + + private java.lang.Object locationCity_ = ""; + /** + *
+       * IndustryCertification  industryCertification = 62;
+       * 
+ * + * string locationCity = 63; + * @return The locationCity. + */ + public java.lang.String getLocationCity() { + java.lang.Object ref = locationCity_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationCity_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * IndustryCertification  industryCertification = 62;
+       * 
+ * + * string locationCity = 63; + * @return The bytes for locationCity. + */ + public com.google.protobuf.ByteString + getLocationCityBytes() { + java.lang.Object ref = locationCity_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + locationCity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * IndustryCertification  industryCertification = 62;
+       * 
+ * + * string locationCity = 63; + * @param value The locationCity to set. + * @return This builder for chaining. + */ + public Builder setLocationCity( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + locationCity_ = value; + bitField1_ |= 0x20000000; + onChanged(); + return this; + } + /** + *
+       * IndustryCertification  industryCertification = 62;
+       * 
+ * + * string locationCity = 63; + * @return This builder for chaining. + */ + public Builder clearLocationCity() { + locationCity_ = getDefaultInstance().getLocationCity(); + bitField1_ = (bitField1_ & ~0x20000000); + onChanged(); + return this; + } + /** + *
+       * IndustryCertification  industryCertification = 62;
+       * 
+ * + * string locationCity = 63; + * @param value The bytes for locationCity to set. + * @return This builder for chaining. + */ + public Builder setLocationCityBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + locationCity_ = value; + bitField1_ |= 0x20000000; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo fansGroupInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfoOrBuilder> fansGroupInfoBuilder_; + /** + * .User.FansGroupInfo fansGroupInfo = 64; + * @return Whether the fansGroupInfo field is set. + */ + public boolean hasFansGroupInfo() { + return ((bitField1_ & 0x40000000) != 0); + } + /** + * .User.FansGroupInfo fansGroupInfo = 64; + * @return The fansGroupInfo. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo getFansGroupInfo() { + if (fansGroupInfoBuilder_ == null) { + return fansGroupInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.getDefaultInstance() : fansGroupInfo_; + } else { + return fansGroupInfoBuilder_.getMessage(); + } + } + /** + * .User.FansGroupInfo fansGroupInfo = 64; + */ + public Builder setFansGroupInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo value) { + if (fansGroupInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fansGroupInfo_ = value; + } else { + fansGroupInfoBuilder_.setMessage(value); + } + bitField1_ |= 0x40000000; + onChanged(); + return this; + } + /** + * .User.FansGroupInfo fansGroupInfo = 64; + */ + public Builder setFansGroupInfo( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.Builder builderForValue) { + if (fansGroupInfoBuilder_ == null) { + fansGroupInfo_ = builderForValue.build(); + } else { + fansGroupInfoBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x40000000; + onChanged(); + return this; + } + /** + * .User.FansGroupInfo fansGroupInfo = 64; + */ + public Builder mergeFansGroupInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo value) { + if (fansGroupInfoBuilder_ == null) { + if (((bitField1_ & 0x40000000) != 0) && + fansGroupInfo_ != null && + fansGroupInfo_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.getDefaultInstance()) { + getFansGroupInfoBuilder().mergeFrom(value); + } else { + fansGroupInfo_ = value; + } + } else { + fansGroupInfoBuilder_.mergeFrom(value); + } + bitField1_ |= 0x40000000; + onChanged(); + return this; + } + /** + * .User.FansGroupInfo fansGroupInfo = 64; + */ + public Builder clearFansGroupInfo() { + bitField1_ = (bitField1_ & ~0x40000000); + fansGroupInfo_ = null; + if (fansGroupInfoBuilder_ != null) { + fansGroupInfoBuilder_.dispose(); + fansGroupInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.FansGroupInfo fansGroupInfo = 64; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.Builder getFansGroupInfoBuilder() { + bitField1_ |= 0x40000000; + onChanged(); + return getFansGroupInfoFieldBuilder().getBuilder(); + } + /** + * .User.FansGroupInfo fansGroupInfo = 64; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfoOrBuilder getFansGroupInfoOrBuilder() { + if (fansGroupInfoBuilder_ != null) { + return fansGroupInfoBuilder_.getMessageOrBuilder(); + } else { + return fansGroupInfo_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.getDefaultInstance() : fansGroupInfo_; + } + } + /** + * .User.FansGroupInfo fansGroupInfo = 64; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfoOrBuilder> + getFansGroupInfoFieldBuilder() { + if (fansGroupInfoBuilder_ == null) { + fansGroupInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.FansGroupInfoOrBuilder>( + getFansGroupInfo(), + getParentForChildren(), + isClean()); + fansGroupInfo_ = null; + } + return fansGroupInfoBuilder_; + } + + private java.lang.Object remarkName_ = ""; + /** + * string remarkName = 65; + * @return The remarkName. + */ + public java.lang.String getRemarkName() { + java.lang.Object ref = remarkName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remarkName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string remarkName = 65; + * @return The bytes for remarkName. + */ + public com.google.protobuf.ByteString + getRemarkNameBytes() { + java.lang.Object ref = remarkName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + remarkName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string remarkName = 65; + * @param value The remarkName to set. + * @return This builder for chaining. + */ + public Builder setRemarkName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + remarkName_ = value; + bitField1_ |= 0x80000000; + onChanged(); + return this; + } + /** + * string remarkName = 65; + * @return This builder for chaining. + */ + public Builder clearRemarkName() { + remarkName_ = getDefaultInstance().getRemarkName(); + bitField1_ = (bitField1_ & ~0x80000000); + onChanged(); + return this; + } + /** + * string remarkName = 65; + * @param value The bytes for remarkName to set. + * @return This builder for chaining. + */ + public Builder setRemarkNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + remarkName_ = value; + bitField1_ |= 0x80000000; + onChanged(); + return this; + } + + private int mysteryMan_ ; + /** + * int32 mysteryMan = 66; + * @return The mysteryMan. + */ + @java.lang.Override + public int getMysteryMan() { + return mysteryMan_; + } + /** + * int32 mysteryMan = 66; + * @param value The mysteryMan to set. + * @return This builder for chaining. + */ + public Builder setMysteryMan(int value) { + + mysteryMan_ = value; + bitField2_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 mysteryMan = 66; + * @return This builder for chaining. + */ + public Builder clearMysteryMan() { + bitField2_ = (bitField2_ & ~0x00000001); + mysteryMan_ = 0; + onChanged(); + return this; + } + + private java.lang.Object webRid_ = ""; + /** + * string webRid = 67; + * @return The webRid. + */ + public java.lang.String getWebRid() { + java.lang.Object ref = webRid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + webRid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string webRid = 67; + * @return The bytes for webRid. + */ + public com.google.protobuf.ByteString + getWebRidBytes() { + java.lang.Object ref = webRid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + webRid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string webRid = 67; + * @param value The webRid to set. + * @return This builder for chaining. + */ + public Builder setWebRid( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + webRid_ = value; + bitField2_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string webRid = 67; + * @return This builder for chaining. + */ + public Builder clearWebRid() { + webRid_ = getDefaultInstance().getWebRid(); + bitField2_ = (bitField2_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string webRid = 67; + * @param value The bytes for webRid to set. + * @return This builder for chaining. + */ + public Builder setWebRidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + webRid_ = value; + bitField2_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object desensitizedNickname_ = ""; + /** + * string desensitizedNickname = 68; + * @return The desensitizedNickname. + */ + public java.lang.String getDesensitizedNickname() { + java.lang.Object ref = desensitizedNickname_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + desensitizedNickname_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string desensitizedNickname = 68; + * @return The bytes for desensitizedNickname. + */ + public com.google.protobuf.ByteString + getDesensitizedNicknameBytes() { + java.lang.Object ref = desensitizedNickname_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + desensitizedNickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string desensitizedNickname = 68; + * @param value The desensitizedNickname to set. + * @return This builder for chaining. + */ + public Builder setDesensitizedNickname( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + desensitizedNickname_ = value; + bitField2_ |= 0x00000004; + onChanged(); + return this; + } + /** + * string desensitizedNickname = 68; + * @return This builder for chaining. + */ + public Builder clearDesensitizedNickname() { + desensitizedNickname_ = getDefaultInstance().getDesensitizedNickname(); + bitField2_ = (bitField2_ & ~0x00000004); + onChanged(); + return this; + } + /** + * string desensitizedNickname = 68; + * @param value The bytes for desensitizedNickname to set. + * @return This builder for chaining. + */ + public Builder setDesensitizedNicknameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + desensitizedNickname_ = value; + bitField2_ |= 0x00000004; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo jAccreditInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfoOrBuilder> jAccreditInfoBuilder_; + /** + * .User.JAccreditInfo jAccreditInfo = 69; + * @return Whether the jAccreditInfo field is set. + */ + public boolean hasJAccreditInfo() { + return ((bitField2_ & 0x00000008) != 0); + } + /** + * .User.JAccreditInfo jAccreditInfo = 69; + * @return The jAccreditInfo. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo getJAccreditInfo() { + if (jAccreditInfoBuilder_ == null) { + return jAccreditInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.getDefaultInstance() : jAccreditInfo_; + } else { + return jAccreditInfoBuilder_.getMessage(); + } + } + /** + * .User.JAccreditInfo jAccreditInfo = 69; + */ + public Builder setJAccreditInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo value) { + if (jAccreditInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + jAccreditInfo_ = value; + } else { + jAccreditInfoBuilder_.setMessage(value); + } + bitField2_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .User.JAccreditInfo jAccreditInfo = 69; + */ + public Builder setJAccreditInfo( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.Builder builderForValue) { + if (jAccreditInfoBuilder_ == null) { + jAccreditInfo_ = builderForValue.build(); + } else { + jAccreditInfoBuilder_.setMessage(builderForValue.build()); + } + bitField2_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .User.JAccreditInfo jAccreditInfo = 69; + */ + public Builder mergeJAccreditInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo value) { + if (jAccreditInfoBuilder_ == null) { + if (((bitField2_ & 0x00000008) != 0) && + jAccreditInfo_ != null && + jAccreditInfo_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.getDefaultInstance()) { + getJAccreditInfoBuilder().mergeFrom(value); + } else { + jAccreditInfo_ = value; + } + } else { + jAccreditInfoBuilder_.mergeFrom(value); + } + bitField2_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .User.JAccreditInfo jAccreditInfo = 69; + */ + public Builder clearJAccreditInfo() { + bitField2_ = (bitField2_ & ~0x00000008); + jAccreditInfo_ = null; + if (jAccreditInfoBuilder_ != null) { + jAccreditInfoBuilder_.dispose(); + jAccreditInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.JAccreditInfo jAccreditInfo = 69; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.Builder getJAccreditInfoBuilder() { + bitField2_ |= 0x00000008; + onChanged(); + return getJAccreditInfoFieldBuilder().getBuilder(); + } + /** + * .User.JAccreditInfo jAccreditInfo = 69; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfoOrBuilder getJAccreditInfoOrBuilder() { + if (jAccreditInfoBuilder_ != null) { + return jAccreditInfoBuilder_.getMessageOrBuilder(); + } else { + return jAccreditInfo_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.getDefaultInstance() : jAccreditInfo_; + } + } + /** + * .User.JAccreditInfo jAccreditInfo = 69; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfoOrBuilder> + getJAccreditInfoFieldBuilder() { + if (jAccreditInfoBuilder_ == null) { + jAccreditInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.JAccreditInfoOrBuilder>( + getJAccreditInfo(), + getParentForChildren(), + isClean()); + jAccreditInfo_ = null; + } + return jAccreditInfoBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe subscribe_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.SubscribeOrBuilder> subscribeBuilder_; + /** + * .User.Subscribe subscribe = 70; + * @return Whether the subscribe field is set. + */ + public boolean hasSubscribe() { + return ((bitField2_ & 0x00000010) != 0); + } + /** + * .User.Subscribe subscribe = 70; + * @return The subscribe. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe getSubscribe() { + if (subscribeBuilder_ == null) { + return subscribe_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.getDefaultInstance() : subscribe_; + } else { + return subscribeBuilder_.getMessage(); + } + } + /** + * .User.Subscribe subscribe = 70; + */ + public Builder setSubscribe(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe value) { + if (subscribeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + subscribe_ = value; + } else { + subscribeBuilder_.setMessage(value); + } + bitField2_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .User.Subscribe subscribe = 70; + */ + public Builder setSubscribe( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.Builder builderForValue) { + if (subscribeBuilder_ == null) { + subscribe_ = builderForValue.build(); + } else { + subscribeBuilder_.setMessage(builderForValue.build()); + } + bitField2_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .User.Subscribe subscribe = 70; + */ + public Builder mergeSubscribe(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe value) { + if (subscribeBuilder_ == null) { + if (((bitField2_ & 0x00000010) != 0) && + subscribe_ != null && + subscribe_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.getDefaultInstance()) { + getSubscribeBuilder().mergeFrom(value); + } else { + subscribe_ = value; + } + } else { + subscribeBuilder_.mergeFrom(value); + } + bitField2_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .User.Subscribe subscribe = 70; + */ + public Builder clearSubscribe() { + bitField2_ = (bitField2_ & ~0x00000010); + subscribe_ = null; + if (subscribeBuilder_ != null) { + subscribeBuilder_.dispose(); + subscribeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.Subscribe subscribe = 70; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.Builder getSubscribeBuilder() { + bitField2_ |= 0x00000010; + onChanged(); + return getSubscribeFieldBuilder().getBuilder(); + } + /** + * .User.Subscribe subscribe = 70; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.SubscribeOrBuilder getSubscribeOrBuilder() { + if (subscribeBuilder_ != null) { + return subscribeBuilder_.getMessageOrBuilder(); + } else { + return subscribe_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.getDefaultInstance() : subscribe_; + } + } + /** + * .User.Subscribe subscribe = 70; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.SubscribeOrBuilder> + getSubscribeFieldBuilder() { + if (subscribeBuilder_ == null) { + subscribeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.Subscribe.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.SubscribeOrBuilder>( + getSubscribe(), + getParentForChildren(), + isClean()); + subscribe_ = null; + } + return subscribeBuilder_; + } + + private boolean isAnonymous_ ; + /** + * bool isAnonymous = 71; + * @return The isAnonymous. + */ + @java.lang.Override + public boolean getIsAnonymous() { + return isAnonymous_; + } + /** + * bool isAnonymous = 71; + * @param value The isAnonymous to set. + * @return This builder for chaining. + */ + public Builder setIsAnonymous(boolean value) { + + isAnonymous_ = value; + bitField2_ |= 0x00000020; + onChanged(); + return this; + } + /** + * bool isAnonymous = 71; + * @return This builder for chaining. + */ + public Builder clearIsAnonymous() { + bitField2_ = (bitField2_ & ~0x00000020); + isAnonymous_ = false; + onChanged(); + return this; + } + + private int consumeDiamondLevel_ ; + /** + * int32 consumeDiamondLevel = 72; + * @return The consumeDiamondLevel. + */ + @java.lang.Override + public int getConsumeDiamondLevel() { + return consumeDiamondLevel_; + } + /** + * int32 consumeDiamondLevel = 72; + * @param value The consumeDiamondLevel to set. + * @return This builder for chaining. + */ + public Builder setConsumeDiamondLevel(int value) { + + consumeDiamondLevel_ = value; + bitField2_ |= 0x00000040; + onChanged(); + return this; + } + /** + * int32 consumeDiamondLevel = 72; + * @return This builder for chaining. + */ + public Builder clearConsumeDiamondLevel() { + bitField2_ = (bitField2_ & ~0x00000040); + consumeDiamondLevel_ = 0; + onChanged(); + return this; + } + + private java.lang.Object webcastUid_ = ""; + /** + * string webcastUid = 73; + * @return The webcastUid. + */ + public java.lang.String getWebcastUid() { + java.lang.Object ref = webcastUid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + webcastUid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string webcastUid = 73; + * @return The bytes for webcastUid. + */ + public com.google.protobuf.ByteString + getWebcastUidBytes() { + java.lang.Object ref = webcastUid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + webcastUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string webcastUid = 73; + * @param value The webcastUid to set. + * @return This builder for chaining. + */ + public Builder setWebcastUid( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + webcastUid_ = value; + bitField2_ |= 0x00000080; + onChanged(); + return this; + } + /** + * string webcastUid = 73; + * @return This builder for chaining. + */ + public Builder clearWebcastUid() { + webcastUid_ = getDefaultInstance().getWebcastUid(); + bitField2_ = (bitField2_ & ~0x00000080); + onChanged(); + return this; + } + /** + * string webcastUid = 73; + * @param value The bytes for webcastUid to set. + * @return This builder for chaining. + */ + public Builder setWebcastUidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + webcastUid_ = value; + bitField2_ |= 0x00000080; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams profileStyleParams_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParamsOrBuilder> profileStyleParamsBuilder_; + /** + * .User.ProfileStyleParams profileStyleParams = 74; + * @return Whether the profileStyleParams field is set. + */ + public boolean hasProfileStyleParams() { + return ((bitField2_ & 0x00000100) != 0); + } + /** + * .User.ProfileStyleParams profileStyleParams = 74; + * @return The profileStyleParams. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams getProfileStyleParams() { + if (profileStyleParamsBuilder_ == null) { + return profileStyleParams_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.getDefaultInstance() : profileStyleParams_; + } else { + return profileStyleParamsBuilder_.getMessage(); + } + } + /** + * .User.ProfileStyleParams profileStyleParams = 74; + */ + public Builder setProfileStyleParams(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams value) { + if (profileStyleParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + profileStyleParams_ = value; + } else { + profileStyleParamsBuilder_.setMessage(value); + } + bitField2_ |= 0x00000100; + onChanged(); + return this; + } + /** + * .User.ProfileStyleParams profileStyleParams = 74; + */ + public Builder setProfileStyleParams( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.Builder builderForValue) { + if (profileStyleParamsBuilder_ == null) { + profileStyleParams_ = builderForValue.build(); + } else { + profileStyleParamsBuilder_.setMessage(builderForValue.build()); + } + bitField2_ |= 0x00000100; + onChanged(); + return this; + } + /** + * .User.ProfileStyleParams profileStyleParams = 74; + */ + public Builder mergeProfileStyleParams(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams value) { + if (profileStyleParamsBuilder_ == null) { + if (((bitField2_ & 0x00000100) != 0) && + profileStyleParams_ != null && + profileStyleParams_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.getDefaultInstance()) { + getProfileStyleParamsBuilder().mergeFrom(value); + } else { + profileStyleParams_ = value; + } + } else { + profileStyleParamsBuilder_.mergeFrom(value); + } + bitField2_ |= 0x00000100; + onChanged(); + return this; + } + /** + * .User.ProfileStyleParams profileStyleParams = 74; + */ + public Builder clearProfileStyleParams() { + bitField2_ = (bitField2_ & ~0x00000100); + profileStyleParams_ = null; + if (profileStyleParamsBuilder_ != null) { + profileStyleParamsBuilder_.dispose(); + profileStyleParamsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.ProfileStyleParams profileStyleParams = 74; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.Builder getProfileStyleParamsBuilder() { + bitField2_ |= 0x00000100; + onChanged(); + return getProfileStyleParamsFieldBuilder().getBuilder(); + } + /** + * .User.ProfileStyleParams profileStyleParams = 74; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParamsOrBuilder getProfileStyleParamsOrBuilder() { + if (profileStyleParamsBuilder_ != null) { + return profileStyleParamsBuilder_.getMessageOrBuilder(); + } else { + return profileStyleParams_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.getDefaultInstance() : profileStyleParams_; + } + } + /** + * .User.ProfileStyleParams profileStyleParams = 74; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParamsOrBuilder> + getProfileStyleParamsFieldBuilder() { + if (profileStyleParamsBuilder_ == null) { + profileStyleParamsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParams.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.ProfileStyleParamsOrBuilder>( + getProfileStyleParams(), + getParentForChildren(), + isClean()); + profileStyleParams_ = null; + } + return profileStyleParamsBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo userDressInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfoOrBuilder> userDressInfoBuilder_; + /** + * .User.UserDressInfo userDressInfo = 75; + * @return Whether the userDressInfo field is set. + */ + public boolean hasUserDressInfo() { + return ((bitField2_ & 0x00000200) != 0); + } + /** + * .User.UserDressInfo userDressInfo = 75; + * @return The userDressInfo. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo getUserDressInfo() { + if (userDressInfoBuilder_ == null) { + return userDressInfo_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.getDefaultInstance() : userDressInfo_; + } else { + return userDressInfoBuilder_.getMessage(); + } + } + /** + * .User.UserDressInfo userDressInfo = 75; + */ + public Builder setUserDressInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo value) { + if (userDressInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userDressInfo_ = value; + } else { + userDressInfoBuilder_.setMessage(value); + } + bitField2_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .User.UserDressInfo userDressInfo = 75; + */ + public Builder setUserDressInfo( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.Builder builderForValue) { + if (userDressInfoBuilder_ == null) { + userDressInfo_ = builderForValue.build(); + } else { + userDressInfoBuilder_.setMessage(builderForValue.build()); + } + bitField2_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .User.UserDressInfo userDressInfo = 75; + */ + public Builder mergeUserDressInfo(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo value) { + if (userDressInfoBuilder_ == null) { + if (((bitField2_ & 0x00000200) != 0) && + userDressInfo_ != null && + userDressInfo_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.getDefaultInstance()) { + getUserDressInfoBuilder().mergeFrom(value); + } else { + userDressInfo_ = value; + } + } else { + userDressInfoBuilder_.mergeFrom(value); + } + bitField2_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .User.UserDressInfo userDressInfo = 75; + */ + public Builder clearUserDressInfo() { + bitField2_ = (bitField2_ & ~0x00000200); + userDressInfo_ = null; + if (userDressInfoBuilder_ != null) { + userDressInfoBuilder_.dispose(); + userDressInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.UserDressInfo userDressInfo = 75; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.Builder getUserDressInfoBuilder() { + bitField2_ |= 0x00000200; + onChanged(); + return getUserDressInfoFieldBuilder().getBuilder(); + } + /** + * .User.UserDressInfo userDressInfo = 75; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfoOrBuilder getUserDressInfoOrBuilder() { + if (userDressInfoBuilder_ != null) { + return userDressInfoBuilder_.getMessageOrBuilder(); + } else { + return userDressInfo_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.getDefaultInstance() : userDressInfo_; + } + } + /** + * .User.UserDressInfo userDressInfo = 75; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfoOrBuilder> + getUserDressInfoFieldBuilder() { + if (userDressInfoBuilder_ == null) { + userDressInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfo.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserDressInfoOrBuilder>( + getUserDressInfo(), + getParentForChildren(), + isClean()); + userDressInfo_ = null; + } + return userDressInfoBuilder_; + } + + private boolean allowBeLocated_ ; + /** + * bool allowBeLocated = 1001; + * @return The allowBeLocated. + */ + @java.lang.Override + public boolean getAllowBeLocated() { + return allowBeLocated_; + } + /** + * bool allowBeLocated = 1001; + * @param value The allowBeLocated to set. + * @return This builder for chaining. + */ + public Builder setAllowBeLocated(boolean value) { + + allowBeLocated_ = value; + bitField2_ |= 0x00000400; + onChanged(); + return this; + } + /** + * bool allowBeLocated = 1001; + * @return This builder for chaining. + */ + public Builder clearAllowBeLocated() { + bitField2_ = (bitField2_ & ~0x00000400); + allowBeLocated_ = false; + onChanged(); + return this; + } + + private boolean allowFindByContacts_ ; + /** + * bool allowFindByContacts = 1002; + * @return The allowFindByContacts. + */ + @java.lang.Override + public boolean getAllowFindByContacts() { + return allowFindByContacts_; + } + /** + * bool allowFindByContacts = 1002; + * @param value The allowFindByContacts to set. + * @return This builder for chaining. + */ + public Builder setAllowFindByContacts(boolean value) { + + allowFindByContacts_ = value; + bitField2_ |= 0x00000800; + onChanged(); + return this; + } + /** + * bool allowFindByContacts = 1002; + * @return This builder for chaining. + */ + public Builder clearAllowFindByContacts() { + bitField2_ = (bitField2_ & ~0x00000800); + allowFindByContacts_ = false; + onChanged(); + return this; + } + + private boolean allowOthersDownloadVideo_ ; + /** + * bool allowOthersDownloadVideo = 1003; + * @return The allowOthersDownloadVideo. + */ + @java.lang.Override + public boolean getAllowOthersDownloadVideo() { + return allowOthersDownloadVideo_; + } + /** + * bool allowOthersDownloadVideo = 1003; + * @param value The allowOthersDownloadVideo to set. + * @return This builder for chaining. + */ + public Builder setAllowOthersDownloadVideo(boolean value) { + + allowOthersDownloadVideo_ = value; + bitField2_ |= 0x00001000; + onChanged(); + return this; + } + /** + * bool allowOthersDownloadVideo = 1003; + * @return This builder for chaining. + */ + public Builder clearAllowOthersDownloadVideo() { + bitField2_ = (bitField2_ & ~0x00001000); + allowOthersDownloadVideo_ = false; + onChanged(); + return this; + } + + private boolean allowOthersDownloadWhenSharingVideo_ ; + /** + * bool allowOthersDownloadWhenSharingVideo = 1004; + * @return The allowOthersDownloadWhenSharingVideo. + */ + @java.lang.Override + public boolean getAllowOthersDownloadWhenSharingVideo() { + return allowOthersDownloadWhenSharingVideo_; + } + /** + * bool allowOthersDownloadWhenSharingVideo = 1004; + * @param value The allowOthersDownloadWhenSharingVideo to set. + * @return This builder for chaining. + */ + public Builder setAllowOthersDownloadWhenSharingVideo(boolean value) { + + allowOthersDownloadWhenSharingVideo_ = value; + bitField2_ |= 0x00002000; + onChanged(); + return this; + } + /** + * bool allowOthersDownloadWhenSharingVideo = 1004; + * @return This builder for chaining. + */ + public Builder clearAllowOthersDownloadWhenSharingVideo() { + bitField2_ = (bitField2_ & ~0x00002000); + allowOthersDownloadWhenSharingVideo_ = false; + onChanged(); + return this; + } + + private boolean allowShareShowProfile_ ; + /** + * bool allowShareShowProfile = 1005; + * @return The allowShareShowProfile. + */ + @java.lang.Override + public boolean getAllowShareShowProfile() { + return allowShareShowProfile_; + } + /** + * bool allowShareShowProfile = 1005; + * @param value The allowShareShowProfile to set. + * @return This builder for chaining. + */ + public Builder setAllowShareShowProfile(boolean value) { + + allowShareShowProfile_ = value; + bitField2_ |= 0x00004000; + onChanged(); + return this; + } + /** + * bool allowShareShowProfile = 1005; + * @return This builder for chaining. + */ + public Builder clearAllowShareShowProfile() { + bitField2_ = (bitField2_ & ~0x00004000); + allowShareShowProfile_ = false; + onChanged(); + return this; + } + + private boolean allowShowInGossip_ ; + /** + * bool allowShowInGossip = 1006; + * @return The allowShowInGossip. + */ + @java.lang.Override + public boolean getAllowShowInGossip() { + return allowShowInGossip_; + } + /** + * bool allowShowInGossip = 1006; + * @param value The allowShowInGossip to set. + * @return This builder for chaining. + */ + public Builder setAllowShowInGossip(boolean value) { + + allowShowInGossip_ = value; + bitField2_ |= 0x00008000; + onChanged(); + return this; + } + /** + * bool allowShowInGossip = 1006; + * @return This builder for chaining. + */ + public Builder clearAllowShowInGossip() { + bitField2_ = (bitField2_ & ~0x00008000); + allowShowInGossip_ = false; + onChanged(); + return this; + } + + private boolean allowShowMyAction_ ; + /** + * bool allowShowMyAction = 1007; + * @return The allowShowMyAction. + */ + @java.lang.Override + public boolean getAllowShowMyAction() { + return allowShowMyAction_; + } + /** + * bool allowShowMyAction = 1007; + * @param value The allowShowMyAction to set. + * @return This builder for chaining. + */ + public Builder setAllowShowMyAction(boolean value) { + + allowShowMyAction_ = value; + bitField2_ |= 0x00010000; + onChanged(); + return this; + } + /** + * bool allowShowMyAction = 1007; + * @return This builder for chaining. + */ + public Builder clearAllowShowMyAction() { + bitField2_ = (bitField2_ & ~0x00010000); + allowShowMyAction_ = false; + onChanged(); + return this; + } + + private boolean allowStrangeComment_ ; + /** + * bool allowStrangeComment = 1008; + * @return The allowStrangeComment. + */ + @java.lang.Override + public boolean getAllowStrangeComment() { + return allowStrangeComment_; + } + /** + * bool allowStrangeComment = 1008; + * @param value The allowStrangeComment to set. + * @return This builder for chaining. + */ + public Builder setAllowStrangeComment(boolean value) { + + allowStrangeComment_ = value; + bitField2_ |= 0x00020000; + onChanged(); + return this; + } + /** + * bool allowStrangeComment = 1008; + * @return This builder for chaining. + */ + public Builder clearAllowStrangeComment() { + bitField2_ = (bitField2_ & ~0x00020000); + allowStrangeComment_ = false; + onChanged(); + return this; + } + + private boolean allowUnfollowerComment_ ; + /** + * bool allowUnfollowerComment = 1009; + * @return The allowUnfollowerComment. + */ + @java.lang.Override + public boolean getAllowUnfollowerComment() { + return allowUnfollowerComment_; + } + /** + * bool allowUnfollowerComment = 1009; + * @param value The allowUnfollowerComment to set. + * @return This builder for chaining. + */ + public Builder setAllowUnfollowerComment(boolean value) { + + allowUnfollowerComment_ = value; + bitField2_ |= 0x00040000; + onChanged(); + return this; + } + /** + * bool allowUnfollowerComment = 1009; + * @return This builder for chaining. + */ + public Builder clearAllowUnfollowerComment() { + bitField2_ = (bitField2_ & ~0x00040000); + allowUnfollowerComment_ = false; + onChanged(); + return this; + } + + private boolean allowUseLinkmic_ ; + /** + * bool allowUseLinkmic = 1010; + * @return The allowUseLinkmic. + */ + @java.lang.Override + public boolean getAllowUseLinkmic() { + return allowUseLinkmic_; + } + /** + * bool allowUseLinkmic = 1010; + * @param value The allowUseLinkmic to set. + * @return This builder for chaining. + */ + public Builder setAllowUseLinkmic(boolean value) { + + allowUseLinkmic_ = value; + bitField2_ |= 0x00080000; + onChanged(); + return this; + } + /** + * bool allowUseLinkmic = 1010; + * @return This builder for chaining. + */ + public Builder clearAllowUseLinkmic() { + bitField2_ = (bitField2_ & ~0x00080000); + allowUseLinkmic_ = false; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel anchorLevel_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevelOrBuilder> anchorLevelBuilder_; + /** + * .User.AnchorLevel anchorLevel = 1011; + * @return Whether the anchorLevel field is set. + */ + public boolean hasAnchorLevel() { + return ((bitField2_ & 0x00100000) != 0); + } + /** + * .User.AnchorLevel anchorLevel = 1011; + * @return The anchorLevel. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel getAnchorLevel() { + if (anchorLevelBuilder_ == null) { + return anchorLevel_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.getDefaultInstance() : anchorLevel_; + } else { + return anchorLevelBuilder_.getMessage(); + } + } + /** + * .User.AnchorLevel anchorLevel = 1011; + */ + public Builder setAnchorLevel(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel value) { + if (anchorLevelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + anchorLevel_ = value; + } else { + anchorLevelBuilder_.setMessage(value); + } + bitField2_ |= 0x00100000; + onChanged(); + return this; + } + /** + * .User.AnchorLevel anchorLevel = 1011; + */ + public Builder setAnchorLevel( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.Builder builderForValue) { + if (anchorLevelBuilder_ == null) { + anchorLevel_ = builderForValue.build(); + } else { + anchorLevelBuilder_.setMessage(builderForValue.build()); + } + bitField2_ |= 0x00100000; + onChanged(); + return this; + } + /** + * .User.AnchorLevel anchorLevel = 1011; + */ + public Builder mergeAnchorLevel(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel value) { + if (anchorLevelBuilder_ == null) { + if (((bitField2_ & 0x00100000) != 0) && + anchorLevel_ != null && + anchorLevel_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.getDefaultInstance()) { + getAnchorLevelBuilder().mergeFrom(value); + } else { + anchorLevel_ = value; + } + } else { + anchorLevelBuilder_.mergeFrom(value); + } + bitField2_ |= 0x00100000; + onChanged(); + return this; + } + /** + * .User.AnchorLevel anchorLevel = 1011; + */ + public Builder clearAnchorLevel() { + bitField2_ = (bitField2_ & ~0x00100000); + anchorLevel_ = null; + if (anchorLevelBuilder_ != null) { + anchorLevelBuilder_.dispose(); + anchorLevelBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.AnchorLevel anchorLevel = 1011; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.Builder getAnchorLevelBuilder() { + bitField2_ |= 0x00100000; + onChanged(); + return getAnchorLevelFieldBuilder().getBuilder(); + } + /** + * .User.AnchorLevel anchorLevel = 1011; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevelOrBuilder getAnchorLevelOrBuilder() { + if (anchorLevelBuilder_ != null) { + return anchorLevelBuilder_.getMessageOrBuilder(); + } else { + return anchorLevel_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.getDefaultInstance() : anchorLevel_; + } + } + /** + * .User.AnchorLevel anchorLevel = 1011; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevelOrBuilder> + getAnchorLevelFieldBuilder() { + if (anchorLevelBuilder_ == null) { + anchorLevelBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevel.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.AnchorLevelOrBuilder>( + getAnchorLevel(), + getParentForChildren(), + isClean()); + anchorLevel_ = null; + } + return anchorLevelBuilder_; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image avatarJpg_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> avatarJpgBuilder_; + /** + * .Image avatarJpg = 1012; + * @return Whether the avatarJpg field is set. + */ + public boolean hasAvatarJpg() { + return ((bitField2_ & 0x00200000) != 0); + } + /** + * .Image avatarJpg = 1012; + * @return The avatarJpg. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image getAvatarJpg() { + if (avatarJpgBuilder_ == null) { + return avatarJpg_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarJpg_; + } else { + return avatarJpgBuilder_.getMessage(); + } + } + /** + * .Image avatarJpg = 1012; + */ + public Builder setAvatarJpg(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (avatarJpgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + avatarJpg_ = value; + } else { + avatarJpgBuilder_.setMessage(value); + } + bitField2_ |= 0x00200000; + onChanged(); + return this; + } + /** + * .Image avatarJpg = 1012; + */ + public Builder setAvatarJpg( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder builderForValue) { + if (avatarJpgBuilder_ == null) { + avatarJpg_ = builderForValue.build(); + } else { + avatarJpgBuilder_.setMessage(builderForValue.build()); + } + bitField2_ |= 0x00200000; + onChanged(); + return this; + } + /** + * .Image avatarJpg = 1012; + */ + public Builder mergeAvatarJpg(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image value) { + if (avatarJpgBuilder_ == null) { + if (((bitField2_ & 0x00200000) != 0) && + avatarJpg_ != null && + avatarJpg_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance()) { + getAvatarJpgBuilder().mergeFrom(value); + } else { + avatarJpg_ = value; + } + } else { + avatarJpgBuilder_.mergeFrom(value); + } + bitField2_ |= 0x00200000; + onChanged(); + return this; + } + /** + * .Image avatarJpg = 1012; + */ + public Builder clearAvatarJpg() { + bitField2_ = (bitField2_ & ~0x00200000); + avatarJpg_ = null; + if (avatarJpgBuilder_ != null) { + avatarJpgBuilder_.dispose(); + avatarJpgBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .Image avatarJpg = 1012; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder getAvatarJpgBuilder() { + bitField2_ |= 0x00200000; + onChanged(); + return getAvatarJpgFieldBuilder().getBuilder(); + } + /** + * .Image avatarJpg = 1012; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder getAvatarJpgOrBuilder() { + if (avatarJpgBuilder_ != null) { + return avatarJpgBuilder_.getMessageOrBuilder(); + } else { + return avatarJpg_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.getDefaultInstance() : avatarJpg_; + } + } + /** + * .Image avatarJpg = 1012; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder> + getAvatarJpgFieldBuilder() { + if (avatarJpgBuilder_ == null) { + avatarJpgBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.Image.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.ImageOrBuilder>( + getAvatarJpg(), + getParentForChildren(), + isClean()); + avatarJpg_ = null; + } + return avatarJpgBuilder_; + } + + private java.lang.Object bgImgUrl_ = ""; + /** + * string bgImgUrl = 1013; + * @return The bgImgUrl. + */ + public java.lang.String getBgImgUrl() { + java.lang.Object ref = bgImgUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bgImgUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string bgImgUrl = 1013; + * @return The bytes for bgImgUrl. + */ + public com.google.protobuf.ByteString + getBgImgUrlBytes() { + java.lang.Object ref = bgImgUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + bgImgUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string bgImgUrl = 1013; + * @param value The bgImgUrl to set. + * @return This builder for chaining. + */ + public Builder setBgImgUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + bgImgUrl_ = value; + bitField2_ |= 0x00400000; + onChanged(); + return this; + } + /** + * string bgImgUrl = 1013; + * @return This builder for chaining. + */ + public Builder clearBgImgUrl() { + bgImgUrl_ = getDefaultInstance().getBgImgUrl(); + bitField2_ = (bitField2_ & ~0x00400000); + onChanged(); + return this; + } + /** + * string bgImgUrl = 1013; + * @param value The bytes for bgImgUrl to set. + * @return This builder for chaining. + */ + public Builder setBgImgUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + bgImgUrl_ = value; + bitField2_ |= 0x00400000; + onChanged(); + return this; + } + + private java.lang.Object birthdayDescription_ = ""; + /** + * string birthdayDescription = 1014; + * @return The birthdayDescription. + */ + public java.lang.String getBirthdayDescription() { + java.lang.Object ref = birthdayDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + birthdayDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string birthdayDescription = 1014; + * @return The bytes for birthdayDescription. + */ + public com.google.protobuf.ByteString + getBirthdayDescriptionBytes() { + java.lang.Object ref = birthdayDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + birthdayDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string birthdayDescription = 1014; + * @param value The birthdayDescription to set. + * @return This builder for chaining. + */ + public Builder setBirthdayDescription( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + birthdayDescription_ = value; + bitField2_ |= 0x00800000; + onChanged(); + return this; + } + /** + * string birthdayDescription = 1014; + * @return This builder for chaining. + */ + public Builder clearBirthdayDescription() { + birthdayDescription_ = getDefaultInstance().getBirthdayDescription(); + bitField2_ = (bitField2_ & ~0x00800000); + onChanged(); + return this; + } + /** + * string birthdayDescription = 1014; + * @param value The bytes for birthdayDescription to set. + * @return This builder for chaining. + */ + public Builder setBirthdayDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + birthdayDescription_ = value; + bitField2_ |= 0x00800000; + onChanged(); + return this; + } + + private boolean birthdayValid_ ; + /** + * bool birthdayValid = 1015; + * @return The birthdayValid. + */ + @java.lang.Override + public boolean getBirthdayValid() { + return birthdayValid_; + } + /** + * bool birthdayValid = 1015; + * @param value The birthdayValid to set. + * @return This builder for chaining. + */ + public Builder setBirthdayValid(boolean value) { + + birthdayValid_ = value; + bitField2_ |= 0x01000000; + onChanged(); + return this; + } + /** + * bool birthdayValid = 1015; + * @return This builder for chaining. + */ + public Builder clearBirthdayValid() { + bitField2_ = (bitField2_ & ~0x01000000); + birthdayValid_ = false; + onChanged(); + return this; + } + + private int blockStatus_ ; + /** + * int32 blockStatus = 1016; + * @return The blockStatus. + */ + @java.lang.Override + public int getBlockStatus() { + return blockStatus_; + } + /** + * int32 blockStatus = 1016; + * @param value The blockStatus to set. + * @return This builder for chaining. + */ + public Builder setBlockStatus(int value) { + + blockStatus_ = value; + bitField2_ |= 0x02000000; + onChanged(); + return this; + } + /** + * int32 blockStatus = 1016; + * @return This builder for chaining. + */ + public Builder clearBlockStatus() { + bitField2_ = (bitField2_ & ~0x02000000); + blockStatus_ = 0; + onChanged(); + return this; + } + + private int commentRestrict_ ; + /** + * int32 commentRestrict = 1017; + * @return The commentRestrict. + */ + @java.lang.Override + public int getCommentRestrict() { + return commentRestrict_; + } + /** + * int32 commentRestrict = 1017; + * @param value The commentRestrict to set. + * @return This builder for chaining. + */ + public Builder setCommentRestrict(int value) { + + commentRestrict_ = value; + bitField2_ |= 0x04000000; + onChanged(); + return this; + } + /** + * int32 commentRestrict = 1017; + * @return This builder for chaining. + */ + public Builder clearCommentRestrict() { + bitField2_ = (bitField2_ & ~0x04000000); + commentRestrict_ = 0; + onChanged(); + return this; + } + + private java.lang.Object constellation_ = ""; + /** + * string constellation = 1018; + * @return The constellation. + */ + public java.lang.String getConstellation() { + java.lang.Object ref = constellation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + constellation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string constellation = 1018; + * @return The bytes for constellation. + */ + public com.google.protobuf.ByteString + getConstellationBytes() { + java.lang.Object ref = constellation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + constellation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string constellation = 1018; + * @param value The constellation to set. + * @return This builder for chaining. + */ + public Builder setConstellation( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + constellation_ = value; + bitField2_ |= 0x08000000; + onChanged(); + return this; + } + /** + * string constellation = 1018; + * @return This builder for chaining. + */ + public Builder clearConstellation() { + constellation_ = getDefaultInstance().getConstellation(); + bitField2_ = (bitField2_ & ~0x08000000); + onChanged(); + return this; + } + /** + * string constellation = 1018; + * @param value The bytes for constellation to set. + * @return This builder for chaining. + */ + public Builder setConstellationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + constellation_ = value; + bitField2_ |= 0x08000000; + onChanged(); + return this; + } + + private int disableIchat_ ; + /** + * int32 disableIchat = 1019; + * @return The disableIchat. + */ + @java.lang.Override + public int getDisableIchat() { + return disableIchat_; + } + /** + * int32 disableIchat = 1019; + * @param value The disableIchat to set. + * @return This builder for chaining. + */ + public Builder setDisableIchat(int value) { + + disableIchat_ = value; + bitField2_ |= 0x10000000; + onChanged(); + return this; + } + /** + * int32 disableIchat = 1019; + * @return This builder for chaining. + */ + public Builder clearDisableIchat() { + bitField2_ = (bitField2_ & ~0x10000000); + disableIchat_ = 0; + onChanged(); + return this; + } + + private long enableIchatImg_ ; + /** + * int64 enableIchatImg = 1020; + * @return The enableIchatImg. + */ + @java.lang.Override + public long getEnableIchatImg() { + return enableIchatImg_; + } + /** + * int64 enableIchatImg = 1020; + * @param value The enableIchatImg to set. + * @return This builder for chaining. + */ + public Builder setEnableIchatImg(long value) { + + enableIchatImg_ = value; + bitField2_ |= 0x20000000; + onChanged(); + return this; + } + /** + * int64 enableIchatImg = 1020; + * @return This builder for chaining. + */ + public Builder clearEnableIchatImg() { + bitField2_ = (bitField2_ & ~0x20000000); + enableIchatImg_ = 0L; + onChanged(); + return this; + } + + private int exp_ ; + /** + * int32 exp = 1021; + * @return The exp. + */ + @java.lang.Override + public int getExp() { + return exp_; + } + /** + * int32 exp = 1021; + * @param value The exp to set. + * @return This builder for chaining. + */ + public Builder setExp(int value) { + + exp_ = value; + bitField2_ |= 0x40000000; + onChanged(); + return this; + } + /** + * int32 exp = 1021; + * @return This builder for chaining. + */ + public Builder clearExp() { + bitField2_ = (bitField2_ & ~0x40000000); + exp_ = 0; + onChanged(); + return this; + } + + private long fanTicketCount_ ; + /** + * int64 fanTicketCount = 1022; + * @return The fanTicketCount. + */ + @java.lang.Override + public long getFanTicketCount() { + return fanTicketCount_; + } + /** + * int64 fanTicketCount = 1022; + * @param value The fanTicketCount to set. + * @return This builder for chaining. + */ + public Builder setFanTicketCount(long value) { + + fanTicketCount_ = value; + bitField2_ |= 0x80000000; + onChanged(); + return this; + } + /** + * int64 fanTicketCount = 1022; + * @return This builder for chaining. + */ + public Builder clearFanTicketCount() { + bitField2_ = (bitField2_ & ~0x80000000); + fanTicketCount_ = 0L; + onChanged(); + return this; + } + + private boolean foldStrangerChat_ ; + /** + * bool foldStrangerChat = 1023; + * @return The foldStrangerChat. + */ + @java.lang.Override + public boolean getFoldStrangerChat() { + return foldStrangerChat_; + } + /** + * bool foldStrangerChat = 1023; + * @param value The foldStrangerChat to set. + * @return This builder for chaining. + */ + public Builder setFoldStrangerChat(boolean value) { + + foldStrangerChat_ = value; + bitField3_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bool foldStrangerChat = 1023; + * @return This builder for chaining. + */ + public Builder clearFoldStrangerChat() { + bitField3_ = (bitField3_ & ~0x00000001); + foldStrangerChat_ = false; + onChanged(); + return this; + } + + private long followStatus_ ; + /** + * int64 followStatus = 1024; + * @return The followStatus. + */ + @java.lang.Override + public long getFollowStatus() { + return followStatus_; + } + /** + * int64 followStatus = 1024; + * @param value The followStatus to set. + * @return This builder for chaining. + */ + public Builder setFollowStatus(long value) { + + followStatus_ = value; + bitField3_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int64 followStatus = 1024; + * @return This builder for chaining. + */ + public Builder clearFollowStatus() { + bitField3_ = (bitField3_ & ~0x00000002); + followStatus_ = 0L; + onChanged(); + return this; + } + + private boolean hotsoonVerified_ ; + /** + * bool hotsoonVerified = 1025; + * @return The hotsoonVerified. + */ + @java.lang.Override + public boolean getHotsoonVerified() { + return hotsoonVerified_; + } + /** + * bool hotsoonVerified = 1025; + * @param value The hotsoonVerified to set. + * @return This builder for chaining. + */ + public Builder setHotsoonVerified(boolean value) { + + hotsoonVerified_ = value; + bitField3_ |= 0x00000004; + onChanged(); + return this; + } + /** + * bool hotsoonVerified = 1025; + * @return This builder for chaining. + */ + public Builder clearHotsoonVerified() { + bitField3_ = (bitField3_ & ~0x00000004); + hotsoonVerified_ = false; + onChanged(); + return this; + } + + private java.lang.Object hotsoonVerifiedReason_ = ""; + /** + * string hotsoonVerifiedReason = 1026; + * @return The hotsoonVerifiedReason. + */ + public java.lang.String getHotsoonVerifiedReason() { + java.lang.Object ref = hotsoonVerifiedReason_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hotsoonVerifiedReason_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string hotsoonVerifiedReason = 1026; + * @return The bytes for hotsoonVerifiedReason. + */ + public com.google.protobuf.ByteString + getHotsoonVerifiedReasonBytes() { + java.lang.Object ref = hotsoonVerifiedReason_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + hotsoonVerifiedReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string hotsoonVerifiedReason = 1026; + * @param value The hotsoonVerifiedReason to set. + * @return This builder for chaining. + */ + public Builder setHotsoonVerifiedReason( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + hotsoonVerifiedReason_ = value; + bitField3_ |= 0x00000008; + onChanged(); + return this; + } + /** + * string hotsoonVerifiedReason = 1026; + * @return This builder for chaining. + */ + public Builder clearHotsoonVerifiedReason() { + hotsoonVerifiedReason_ = getDefaultInstance().getHotsoonVerifiedReason(); + bitField3_ = (bitField3_ & ~0x00000008); + onChanged(); + return this; + } + /** + * string hotsoonVerifiedReason = 1026; + * @param value The bytes for hotsoonVerifiedReason to set. + * @return This builder for chaining. + */ + public Builder setHotsoonVerifiedReasonBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + hotsoonVerifiedReason_ = value; + bitField3_ |= 0x00000008; + onChanged(); + return this; + } + + private int ichatRestrictType_ ; + /** + * int32 ichatRestrictType = 1027; + * @return The ichatRestrictType. + */ + @java.lang.Override + public int getIchatRestrictType() { + return ichatRestrictType_; + } + /** + * int32 ichatRestrictType = 1027; + * @param value The ichatRestrictType to set. + * @return This builder for chaining. + */ + public Builder setIchatRestrictType(int value) { + + ichatRestrictType_ = value; + bitField3_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int32 ichatRestrictType = 1027; + * @return This builder for chaining. + */ + public Builder clearIchatRestrictType() { + bitField3_ = (bitField3_ & ~0x00000010); + ichatRestrictType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object idStr_ = ""; + /** + * string idStr = 1028; + * @return The idStr. + */ + public java.lang.String getIdStr() { + java.lang.Object ref = idStr_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + idStr_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string idStr = 1028; + * @return The bytes for idStr. + */ + public com.google.protobuf.ByteString + getIdStrBytes() { + java.lang.Object ref = idStr_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + idStr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string idStr = 1028; + * @param value The idStr to set. + * @return This builder for chaining. + */ + public Builder setIdStr( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + idStr_ = value; + bitField3_ |= 0x00000020; + onChanged(); + return this; + } + /** + * string idStr = 1028; + * @return This builder for chaining. + */ + public Builder clearIdStr() { + idStr_ = getDefaultInstance().getIdStr(); + bitField3_ = (bitField3_ & ~0x00000020); + onChanged(); + return this; + } + /** + * string idStr = 1028; + * @param value The bytes for idStr to set. + * @return This builder for chaining. + */ + public Builder setIdStrBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + idStr_ = value; + bitField3_ |= 0x00000020; + onChanged(); + return this; + } + + private boolean isFollower_ ; + /** + * bool isFollower = 1029; + * @return The isFollower. + */ + @java.lang.Override + public boolean getIsFollower() { + return isFollower_; + } + /** + * bool isFollower = 1029; + * @param value The isFollower to set. + * @return This builder for chaining. + */ + public Builder setIsFollower(boolean value) { + + isFollower_ = value; + bitField3_ |= 0x00000040; + onChanged(); + return this; + } + /** + * bool isFollower = 1029; + * @return This builder for chaining. + */ + public Builder clearIsFollower() { + bitField3_ = (bitField3_ & ~0x00000040); + isFollower_ = false; + onChanged(); + return this; + } + + private boolean isFollowing_ ; + /** + * bool isFollowing = 1030; + * @return The isFollowing. + */ + @java.lang.Override + public boolean getIsFollowing() { + return isFollowing_; + } + /** + * bool isFollowing = 1030; + * @param value The isFollowing to set. + * @return This builder for chaining. + */ + public Builder setIsFollowing(boolean value) { + + isFollowing_ = value; + bitField3_ |= 0x00000080; + onChanged(); + return this; + } + /** + * bool isFollowing = 1030; + * @return This builder for chaining. + */ + public Builder clearIsFollowing() { + bitField3_ = (bitField3_ & ~0x00000080); + isFollowing_ = false; + onChanged(); + return this; + } + + private boolean needProfileGuide_ ; + /** + * bool needProfileGuide = 1031; + * @return The needProfileGuide. + */ + @java.lang.Override + public boolean getNeedProfileGuide() { + return needProfileGuide_; + } + /** + * bool needProfileGuide = 1031; + * @param value The needProfileGuide to set. + * @return This builder for chaining. + */ + public Builder setNeedProfileGuide(boolean value) { + + needProfileGuide_ = value; + bitField3_ |= 0x00000100; + onChanged(); + return this; + } + /** + * bool needProfileGuide = 1031; + * @return This builder for chaining. + */ + public Builder clearNeedProfileGuide() { + bitField3_ = (bitField3_ & ~0x00000100); + needProfileGuide_ = false; + onChanged(); + return this; + } + + private long payScores_ ; + /** + * int64 payScores = 1032; + * @return The payScores. + */ + @java.lang.Override + public long getPayScores() { + return payScores_; + } + /** + * int64 payScores = 1032; + * @param value The payScores to set. + * @return This builder for chaining. + */ + public Builder setPayScores(long value) { + + payScores_ = value; + bitField3_ |= 0x00000200; + onChanged(); + return this; + } + /** + * int64 payScores = 1032; + * @return This builder for chaining. + */ + public Builder clearPayScores() { + bitField3_ = (bitField3_ & ~0x00000200); + payScores_ = 0L; + onChanged(); + return this; + } + + private boolean pushCommentStatus_ ; + /** + * bool pushCommentStatus = 1033; + * @return The pushCommentStatus. + */ + @java.lang.Override + public boolean getPushCommentStatus() { + return pushCommentStatus_; + } + /** + * bool pushCommentStatus = 1033; + * @param value The pushCommentStatus to set. + * @return This builder for chaining. + */ + public Builder setPushCommentStatus(boolean value) { + + pushCommentStatus_ = value; + bitField3_ |= 0x00000400; + onChanged(); + return this; + } + /** + * bool pushCommentStatus = 1033; + * @return This builder for chaining. + */ + public Builder clearPushCommentStatus() { + bitField3_ = (bitField3_ & ~0x00000400); + pushCommentStatus_ = false; + onChanged(); + return this; + } + + private boolean pushDigg_ ; + /** + * bool pushDigg = 1034; + * @return The pushDigg. + */ + @java.lang.Override + public boolean getPushDigg() { + return pushDigg_; + } + /** + * bool pushDigg = 1034; + * @param value The pushDigg to set. + * @return This builder for chaining. + */ + public Builder setPushDigg(boolean value) { + + pushDigg_ = value; + bitField3_ |= 0x00000800; + onChanged(); + return this; + } + /** + * bool pushDigg = 1034; + * @return This builder for chaining. + */ + public Builder clearPushDigg() { + bitField3_ = (bitField3_ & ~0x00000800); + pushDigg_ = false; + onChanged(); + return this; + } + + private boolean pushFollow_ ; + /** + * bool pushFollow = 1035; + * @return The pushFollow. + */ + @java.lang.Override + public boolean getPushFollow() { + return pushFollow_; + } + /** + * bool pushFollow = 1035; + * @param value The pushFollow to set. + * @return This builder for chaining. + */ + public Builder setPushFollow(boolean value) { + + pushFollow_ = value; + bitField3_ |= 0x00001000; + onChanged(); + return this; + } + /** + * bool pushFollow = 1035; + * @return This builder for chaining. + */ + public Builder clearPushFollow() { + bitField3_ = (bitField3_ & ~0x00001000); + pushFollow_ = false; + onChanged(); + return this; + } + + private boolean pushFriendAction_ ; + /** + * bool pushFriendAction = 1036; + * @return The pushFriendAction. + */ + @java.lang.Override + public boolean getPushFriendAction() { + return pushFriendAction_; + } + /** + * bool pushFriendAction = 1036; + * @param value The pushFriendAction to set. + * @return This builder for chaining. + */ + public Builder setPushFriendAction(boolean value) { + + pushFriendAction_ = value; + bitField3_ |= 0x00002000; + onChanged(); + return this; + } + /** + * bool pushFriendAction = 1036; + * @return This builder for chaining. + */ + public Builder clearPushFriendAction() { + bitField3_ = (bitField3_ & ~0x00002000); + pushFriendAction_ = false; + onChanged(); + return this; + } + + private boolean pushIchat_ ; + /** + * bool pushIchat = 1037; + * @return The pushIchat. + */ + @java.lang.Override + public boolean getPushIchat() { + return pushIchat_; + } + /** + * bool pushIchat = 1037; + * @param value The pushIchat to set. + * @return This builder for chaining. + */ + public Builder setPushIchat(boolean value) { + + pushIchat_ = value; + bitField3_ |= 0x00004000; + onChanged(); + return this; + } + /** + * bool pushIchat = 1037; + * @return This builder for chaining. + */ + public Builder clearPushIchat() { + bitField3_ = (bitField3_ & ~0x00004000); + pushIchat_ = false; + onChanged(); + return this; + } + + private boolean pushStatus_ ; + /** + * bool pushStatus = 1038; + * @return The pushStatus. + */ + @java.lang.Override + public boolean getPushStatus() { + return pushStatus_; + } + /** + * bool pushStatus = 1038; + * @param value The pushStatus to set. + * @return This builder for chaining. + */ + public Builder setPushStatus(boolean value) { + + pushStatus_ = value; + bitField3_ |= 0x00008000; + onChanged(); + return this; + } + /** + * bool pushStatus = 1038; + * @return This builder for chaining. + */ + public Builder clearPushStatus() { + bitField3_ = (bitField3_ & ~0x00008000); + pushStatus_ = false; + onChanged(); + return this; + } + + private boolean pushVideoPost_ ; + /** + * bool pushVideoPost = 1039; + * @return The pushVideoPost. + */ + @java.lang.Override + public boolean getPushVideoPost() { + return pushVideoPost_; + } + /** + * bool pushVideoPost = 1039; + * @param value The pushVideoPost to set. + * @return This builder for chaining. + */ + public Builder setPushVideoPost(boolean value) { + + pushVideoPost_ = value; + bitField3_ |= 0x00010000; + onChanged(); + return this; + } + /** + * bool pushVideoPost = 1039; + * @return This builder for chaining. + */ + public Builder clearPushVideoPost() { + bitField3_ = (bitField3_ & ~0x00010000); + pushVideoPost_ = false; + onChanged(); + return this; + } + + private boolean pushVideoRecommend_ ; + /** + * bool pushVideoRecommend = 1040; + * @return The pushVideoRecommend. + */ + @java.lang.Override + public boolean getPushVideoRecommend() { + return pushVideoRecommend_; + } + /** + * bool pushVideoRecommend = 1040; + * @param value The pushVideoRecommend to set. + * @return This builder for chaining. + */ + public Builder setPushVideoRecommend(boolean value) { + + pushVideoRecommend_ = value; + bitField3_ |= 0x00020000; + onChanged(); + return this; + } + /** + * bool pushVideoRecommend = 1040; + * @return This builder for chaining. + */ + public Builder clearPushVideoRecommend() { + bitField3_ = (bitField3_ & ~0x00020000); + pushVideoRecommend_ = false; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats stats_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStatsOrBuilder> statsBuilder_; + /** + * .User.UserStats stats = 1041; + * @return Whether the stats field is set. + */ + public boolean hasStats() { + return ((bitField3_ & 0x00040000) != 0); + } + /** + * .User.UserStats stats = 1041; + * @return The stats. + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats getStats() { + if (statsBuilder_ == null) { + return stats_ == null ? tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.getDefaultInstance() : stats_; + } else { + return statsBuilder_.getMessage(); + } + } + /** + * .User.UserStats stats = 1041; + */ + public Builder setStats(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stats_ = value; + } else { + statsBuilder_.setMessage(value); + } + bitField3_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .User.UserStats stats = 1041; + */ + public Builder setStats( + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.Builder builderForValue) { + if (statsBuilder_ == null) { + stats_ = builderForValue.build(); + } else { + statsBuilder_.setMessage(builderForValue.build()); + } + bitField3_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .User.UserStats stats = 1041; + */ + public Builder mergeStats(tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats value) { + if (statsBuilder_ == null) { + if (((bitField3_ & 0x00040000) != 0) && + stats_ != null && + stats_ != tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.getDefaultInstance()) { + getStatsBuilder().mergeFrom(value); + } else { + stats_ = value; + } + } else { + statsBuilder_.mergeFrom(value); + } + bitField3_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .User.UserStats stats = 1041; + */ + public Builder clearStats() { + bitField3_ = (bitField3_ & ~0x00040000); + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .User.UserStats stats = 1041; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.Builder getStatsBuilder() { + bitField3_ |= 0x00040000; + onChanged(); + return getStatsFieldBuilder().getBuilder(); + } + /** + * .User.UserStats stats = 1041; + */ + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStatsOrBuilder getStatsOrBuilder() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilder(); + } else { + return stats_ == null ? + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.getDefaultInstance() : stats_; + } + } + /** + * .User.UserStats stats = 1041; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStatsOrBuilder> + getStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStats.Builder, tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User.UserStatsOrBuilder>( + getStats(), + getParentForChildren(), + isClean()); + stats_ = null; + } + return statsBuilder_; + } + + private boolean verifiedMobile_ ; + /** + * bool verifiedMobile = 1042; + * @return The verifiedMobile. + */ + @java.lang.Override + public boolean getVerifiedMobile() { + return verifiedMobile_; + } + /** + * bool verifiedMobile = 1042; + * @param value The verifiedMobile to set. + * @return This builder for chaining. + */ + public Builder setVerifiedMobile(boolean value) { + + verifiedMobile_ = value; + bitField3_ |= 0x00080000; + onChanged(); + return this; + } + /** + * bool verifiedMobile = 1042; + * @return This builder for chaining. + */ + public Builder clearVerifiedMobile() { + bitField3_ = (bitField3_ & ~0x00080000); + verifiedMobile_ = false; + onChanged(); + return this; + } + + private java.lang.Object verifiedReason_ = ""; + /** + * string verifiedReason = 1043; + * @return The verifiedReason. + */ + public java.lang.String getVerifiedReason() { + java.lang.Object ref = verifiedReason_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verifiedReason_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string verifiedReason = 1043; + * @return The bytes for verifiedReason. + */ + public com.google.protobuf.ByteString + getVerifiedReasonBytes() { + java.lang.Object ref = verifiedReason_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + verifiedReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string verifiedReason = 1043; + * @param value The verifiedReason to set. + * @return This builder for chaining. + */ + public Builder setVerifiedReason( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + verifiedReason_ = value; + bitField3_ |= 0x00100000; + onChanged(); + return this; + } + /** + * string verifiedReason = 1043; + * @return This builder for chaining. + */ + public Builder clearVerifiedReason() { + verifiedReason_ = getDefaultInstance().getVerifiedReason(); + bitField3_ = (bitField3_ & ~0x00100000); + onChanged(); + return this; + } + /** + * string verifiedReason = 1043; + * @param value The bytes for verifiedReason to set. + * @return This builder for chaining. + */ + public Builder setVerifiedReasonBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + verifiedReason_ = value; + bitField3_ |= 0x00100000; + onChanged(); + return this; + } + + private boolean withCarManagementPermission_ ; + /** + * bool withCarManagementPermission = 1044; + * @return The withCarManagementPermission. + */ + @java.lang.Override + public boolean getWithCarManagementPermission() { + return withCarManagementPermission_; + } + /** + * bool withCarManagementPermission = 1044; + * @param value The withCarManagementPermission to set. + * @return This builder for chaining. + */ + public Builder setWithCarManagementPermission(boolean value) { + + withCarManagementPermission_ = value; + bitField3_ |= 0x00200000; + onChanged(); + return this; + } + /** + * bool withCarManagementPermission = 1044; + * @return This builder for chaining. + */ + public Builder clearWithCarManagementPermission() { + bitField3_ = (bitField3_ & ~0x00200000); + withCarManagementPermission_ = false; + onChanged(); + return this; + } + + private int ageRange_ ; + /** + * int32 ageRange = 1045; + * @return The ageRange. + */ + @java.lang.Override + public int getAgeRange() { + return ageRange_; + } + /** + * int32 ageRange = 1045; + * @param value The ageRange to set. + * @return This builder for chaining. + */ + public Builder setAgeRange(int value) { + + ageRange_ = value; + bitField3_ |= 0x00400000; + onChanged(); + return this; + } + /** + * int32 ageRange = 1045; + * @return This builder for chaining. + */ + public Builder clearAgeRange() { + bitField3_ = (bitField3_ & ~0x00400000); + ageRange_ = 0; + onChanged(); + return this; + } + + private long watchDurationMonth_ ; + /** + * int64 watchDurationMonth = 1046; + * @return The watchDurationMonth. + */ + @java.lang.Override + public long getWatchDurationMonth() { + return watchDurationMonth_; + } + /** + * int64 watchDurationMonth = 1046; + * @param value The watchDurationMonth to set. + * @return This builder for chaining. + */ + public Builder setWatchDurationMonth(long value) { + + watchDurationMonth_ = value; + bitField3_ |= 0x00800000; + onChanged(); + return this; + } + /** + * int64 watchDurationMonth = 1046; + * @return This builder for chaining. + */ + public Builder clearWatchDurationMonth() { + bitField3_ = (bitField3_ & ~0x00800000); + watchDurationMonth_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:User) + } + + // @@protoc_insertion_point(class_scope:User) + private static final tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User(); + } + + public static tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public User parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.UserOuterClass.User getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_ActivityInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_ActivityInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_AnchorInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_AnchorInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_AnchorLevel_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_AnchorLevel_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_AuthenticationInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_AuthenticationInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_AuthorStats_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_AuthorStats_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_Border_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_Border_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_BrotherhoodInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_BrotherhoodInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_FansClub_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_FansClub_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_FansClub_PreferDataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_FansClub_PreferDataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_FansClub_FansClubData_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_FansClub_FansClubData_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_FansClub_FansClubData_UserBadge_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_FansClub_FansClubData_UserBadge_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_FansClub_FansClubData_UserBadge_IconsEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_FansClub_FansClubData_UserBadge_IconsEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_FansGroupInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_FansGroupInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_FollowInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_FollowInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_JAccreditInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_JAccreditInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_NobleLevelInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_NobleLevelInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_OwnRoom_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_OwnRoom_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_PayGrade_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_PayGrade_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_PayGrade_GradeIcon_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_PayGrade_GradeIcon_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_PoiInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_PoiInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_ProfileStyleParams_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_ProfileStyleParams_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_Subscribe_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_Subscribe_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_UserAttr_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_UserAttr_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_UserDressInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_UserDressInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_UserVIPInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_UserVIPInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_UserStats_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_UserStats_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_User_XiguaParams_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_User_XiguaParams_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\nUser.proto\032\013Image.proto\"\366\'\n\004User\022\n\n\002id" + + "\030\001 \001(\004\022\017\n\007shortId\030\002 \001(\004\022\020\n\010nickname\030\003 \001(" + + "\t\022\016\n\006gender\030\004 \001(\r\022\021\n\tsignature\030\005 \001(\t\022\r\n\005" + + "level\030\006 \001(\r\022\020\n\010birthday\030\007 \001(\004\022\021\n\ttelepho" + + "ne\030\010 \001(\t\022\033\n\013avatarThumb\030\t \001(\0132\006.Image\022\034\n" + + "\014avatarMedium\030\n \001(\0132\006.Image\022\033\n\013avatarLar" + + "ge\030\013 \001(\0132\006.Image\022\020\n\010verified\030\014 \001(\010\022\022\n\nex" + + "perience\030\r \001(\005\022\014\n\004city\030\016 \001(\t\022\016\n\006status\030\017" + + " \001(\005\022\022\n\ncreateTime\030\020 \001(\003\022\022\n\nmodifyTime\030\021" + + " \001(\003\022\016\n\006secret\030\022 \001(\005\022\026\n\016shareQrcodeUri\030\023" + + " \001(\t\022\032\n\022incomeSharePercent\030\024 \001(\005\022\"\n\022badg" + + "eImageListList\030\025 \001(\0132\006.Image\022$\n\nfollowIn" + + "fo\030\026 \001(\0132\020.User.FollowInfo\022 \n\010payGrade\030\027" + + " \001(\0132\016.User.PayGrade\022 \n\010fansClub\030\030 \001(\0132\016" + + ".User.FansClub\022\034\n\006border\030\031 \001(\0132\014.User.Bo" + + "rder\022\021\n\tspecialId\030\032 \001(\t\022\034\n\014avatarBorder\030" + + "\033 \001(\0132\006.Image\022\025\n\005medal\030\034 \001(\0132\006.Image\022!\n\021" + + "realTimeIconsList\030\035 \003(\0132\006.Image\022$\n\024newRe" + + "alTimeIconsList\030\036 \003(\0132\006.Image\022\020\n\010topVipN" + + "o\030\037 \001(\003\022 \n\010userAttr\030 \001(\0132\016.User.UserAtt" + + "r\022\036\n\007ownRoom\030! \001(\0132\r.User.OwnRoom\022\020\n\010pay" + + "Score\030\" \001(\003\022\023\n\013ticketCount\030# \001(\003\022$\n\nanch" + + "orInfo\030$ \001(\0132\020.User.AnchorInfo\022\024\n\014linkMi" + + "cStats\030% \001(\005\022\021\n\tdisplayId\030& \001(\t\022\036\n\026withC" + + "ommercePermission\030\' \001(\010\022\033\n\023withFusionSho" + + "pEntry\030( \001(\010\022!\n\031totalRechargeDiamondCoun" + + "t\030) \001(\003\022-\n\022webcastAnchorLevel\030* \001(\0132\021.Us" + + "er.AnchorLevel\022\027\n\017verifiedContent\030+ \001(\t\022" + + "&\n\013authorStats\030, \001(\0132\021.User.AuthorStats\022" + + "\032\n\013topFansList\030- \003(\0132\005.User\022\016\n\006secUid\030. " + + "\001(\t\022\020\n\010userRole\030/ \001(\005\022$\n\txiguaInfo\0300 \001(\013" + + "2\021.User.XiguaParams\022*\n\016activityReward\0301 " + + "\001(\0132\022.User.ActivityInfo\022\'\n\tnobleInfo\0302 \001" + + "(\0132\024.User.NobleLevelInfo\022.\n\017brotherhoodI" + + "nfo\0303 \001(\0132\025.User.BrotherhoodInfo\022\034\n\014pers" + + "onalCard\0304 \001(\0132\006.Image\0224\n\022authentication" + + "Info\0305 \001(\0132\030.User.AuthenticationInfo\022\031\n\021" + + "authorizationInfo\0306 \001(\005\022\"\n\032adversaryAuth" + + "orizationInfo\0307 \001(\005\022\036\n\007poiInfo\0308 \001(\0132\r.U" + + "ser.PoiInfo\022\'\n\027mediaBadgeImageListList\0309" + + " \001(\0132\006.Image\022\033\n\023adversaryUserStatus\030: \001(" + + "\005\022&\n\013userVipInfo\030; \001(\0132\021.User.UserVIPInf" + + "o\022$\n\034commerceWebcastConfigIdsList\030< \003(\003\022" + + "$\n\024badgeImageListV2List\030= \001(\0132\006.Image\022\024\n" + + "\014locationCity\030? \001(\t\022*\n\rfansGroupInfo\030@ \001" + + "(\0132\023.User.FansGroupInfo\022\022\n\nremarkName\030A " + + "\001(\t\022\022\n\nmysteryMan\030B \001(\005\022\016\n\006webRid\030C \001(\t\022" + + "\034\n\024desensitizedNickname\030D \001(\t\022*\n\rjAccred" + + "itInfo\030E \001(\0132\023.User.JAccreditInfo\022\"\n\tsub" + + "scribe\030F \001(\0132\017.User.Subscribe\022\023\n\013isAnony" + + "mous\030G \001(\010\022\033\n\023consumeDiamondLevel\030H \001(\005\022" + + "\022\n\nwebcastUid\030I \001(\t\0224\n\022profileStyleParam" + + "s\030J \001(\0132\030.User.ProfileStyleParams\022*\n\ruse" + + "rDressInfo\030K \001(\0132\023.User.UserDressInfo\022\027\n" + + "\016allowBeLocated\030\351\007 \001(\010\022\034\n\023allowFindByCon" + + "tacts\030\352\007 \001(\010\022!\n\030allowOthersDownloadVideo" + + "\030\353\007 \001(\010\022,\n#allowOthersDownloadWhenSharin" + + "gVideo\030\354\007 \001(\010\022\036\n\025allowShareShowProfile\030\355" + + "\007 \001(\010\022\032\n\021allowShowInGossip\030\356\007 \001(\010\022\032\n\021all" + + "owShowMyAction\030\357\007 \001(\010\022\034\n\023allowStrangeCom" + + "ment\030\360\007 \001(\010\022\037\n\026allowUnfollowerComment\030\361\007" + + " \001(\010\022\030\n\017allowUseLinkmic\030\362\007 \001(\010\022\'\n\013anchor" + + "Level\030\363\007 \001(\0132\021.User.AnchorLevel\022\032\n\tavata" + + "rJpg\030\364\007 \001(\0132\006.Image\022\021\n\010bgImgUrl\030\365\007 \001(\t\022\034" + + "\n\023birthdayDescription\030\366\007 \001(\t\022\026\n\rbirthday" + + "Valid\030\367\007 \001(\010\022\024\n\013blockStatus\030\370\007 \001(\005\022\030\n\017co" + + "mmentRestrict\030\371\007 \001(\005\022\026\n\rconstellation\030\372\007" + + " \001(\t\022\025\n\014disableIchat\030\373\007 \001(\005\022\027\n\016enableIch" + + "atImg\030\374\007 \001(\003\022\014\n\003exp\030\375\007 \001(\005\022\027\n\016fanTicketC" + + "ount\030\376\007 \001(\003\022\031\n\020foldStrangerChat\030\377\007 \001(\010\022\025" + + "\n\014followStatus\030\200\010 \001(\003\022\030\n\017hotsoonVerified" + + "\030\201\010 \001(\010\022\036\n\025hotsoonVerifiedReason\030\202\010 \001(\t\022" + + "\032\n\021ichatRestrictType\030\203\010 \001(\005\022\016\n\005idStr\030\204\010 " + + "\001(\t\022\023\n\nisFollower\030\205\010 \001(\010\022\024\n\013isFollowing\030" + + "\206\010 \001(\010\022\031\n\020needProfileGuide\030\207\010 \001(\010\022\022\n\tpay" + + "Scores\030\210\010 \001(\003\022\032\n\021pushCommentStatus\030\211\010 \001(" + + "\010\022\021\n\010pushDigg\030\212\010 \001(\010\022\023\n\npushFollow\030\213\010 \001(" + + "\010\022\031\n\020pushFriendAction\030\214\010 \001(\010\022\022\n\tpushIcha" + + "t\030\215\010 \001(\010\022\023\n\npushStatus\030\216\010 \001(\010\022\026\n\rpushVid" + + "eoPost\030\217\010 \001(\010\022\033\n\022pushVideoRecommend\030\220\010 \001" + + "(\010\022\037\n\005stats\030\221\010 \001(\0132\017.User.UserStats\022\027\n\016v" + + "erifiedMobile\030\222\010 \001(\010\022\027\n\016verifiedReason\030\223" + + "\010 \001(\t\022$\n\033withCarManagementPermission\030\224\010 " + + "\001(\010\022\021\n\010ageRange\030\225\010 \001(\005\022\033\n\022watchDurationM" + + "onth\030\226\010 \001(\003\032\016\n\014ActivityInfo\032\014\n\nAnchorInf" + + "o\032\r\n\013AnchorLevel\032\024\n\022AuthenticationInfo\032\r" + + "\n\013AuthorStats\032\010\n\006Border\032\021\n\017BrotherhoodIn" + + "fo\032\375\003\n\010FansClub\022)\n\004data\030\001 \001(\0132\033.User.Fan" + + "sClub.FansClubData\0222\n\npreferData\030\002 \003(\0132\036" + + ".User.FansClub.PreferDataEntry\032N\n\017Prefer" + + "DataEntry\022\013\n\003key\030\001 \001(\005\022*\n\005value\030\002 \001(\0132\033." + + "User.FansClub.FansClubData:\0028\001\032\301\002\n\014FansC" + + "lubData\022\020\n\010clubName\030\001 \001(\t\022\r\n\005level\030\002 \001(\005" + + "\022\032\n\022userFansClubStatus\030\003 \001(\005\0224\n\005badge\030\004 " + + "\001(\0132%.User.FansClub.FansClubData.UserBad" + + "ge\022\030\n\020availableGiftIds\030\005 \003(\003\022\020\n\010anchorId" + + "\030\006 \001(\003\032\221\001\n\tUserBadge\022?\n\005icons\030\001 \003(\01320.Us" + + "er.FansClub.FansClubData.UserBadge.Icons" + + "Entry\022\r\n\005title\030\002 \001(\t\0324\n\nIconsEntry\022\013\n\003ke" + + "y\030\001 \001(\005\022\025\n\005value\030\002 \001(\0132\006.Image:\0028\001\032\017\n\rFa" + + "nsGroupInfo\032y\n\nFollowInfo\022\026\n\016followingCo" + + "unt\030\001 \001(\003\022\025\n\rfollowerCount\030\002 \001(\003\022\024\n\014foll" + + "owStatus\030\003 \001(\003\022\022\n\npushStatus\030\004 \001(\003\022\022\n\nre" + + "markName\030\005 \001(\t\032\017\n\rJAccreditInfo\032\020\n\016Noble" + + "LevelInfo\032\t\n\007OwnRoom\032\305\006\n\010PayGrade\022\031\n\021tot" + + "alDiamondCount\030\001 \001(\003\022\033\n\013diamondIcon\030\002 \001(" + + "\0132\006.Image\022\014\n\004name\030\003 \001(\t\022\024\n\004icon\030\004 \001(\0132\006." + + "Image\022\020\n\010nextName\030\005 \001(\t\022\r\n\005level\030\006 \001(\003\022\030" + + "\n\010nextIcon\030\007 \001(\0132\006.Image\022\023\n\013nextDiamond\030" + + "\010 \001(\003\022\022\n\nnowDiamond\030\t \001(\003\022\033\n\023thisGradeMi" + + "nDiamond\030\n \001(\003\022\033\n\023thisGradeMaxDiamond\030\013 " + + "\001(\003\022\025\n\rpayDiamondBak\030\014 \001(\003\022\025\n\rgradeDescr" + + "ibe\030\r \001(\t\022/\n\rgradeIconList\030\016 \003(\0132\030.User." + + "PayGrade.GradeIcon\022\026\n\016screenChatType\030\017 \001" + + "(\003\022\026\n\006imIcon\030\020 \001(\0132\006.Image\022\037\n\017imIconWith" + + "Level\030\021 \001(\0132\006.Image\022\030\n\010liveIcon\030\022 \001(\0132\006." + + "Image\022\"\n\022newImIconWithLevel\030\023 \001(\0132\006.Imag" + + "e\022\033\n\013newLiveIcon\030\024 \001(\0132\006.Image\022\032\n\022upgrad" + + "eNeedConsume\030\025 \001(\003\022\026\n\016nextPrivileges\030\026 \001" + + "(\t\022\032\n\nbackground\030\027 \001(\0132\006.Image\022\036\n\016backgr" + + "oundBack\030\030 \001(\0132\006.Image\022\r\n\005score\030\031 \001(\003\022\024\n" + + "\013gradeBanner\030\351\007 \001(\t\022 \n\017profileDialogBg\030\352" + + "\007 \001(\0132\006.Image\022$\n\023profileDialogBgBack\030\353\007 " + + "\001(\0132\006.Image\032W\n\tGradeIcon\022\024\n\004icon\030\001 \001(\0132\006" + + ".Image\022\023\n\013iconDiamond\030\002 \001(\003\022\r\n\005level\030\003 \001" + + "(\003\022\020\n\010levelStr\030\004 \001(\t\032\t\n\007PoiInfo\032\024\n\022Profi" + + "leStyleParams\032\013\n\tSubscribe\032\n\n\010UserAttr\032\017" + + "\n\rUserDressInfo\032\r\n\013UserVIPInfo\032\013\n\tUserSt" + + "ats\032\r\n\013XiguaParamsB8\n6tech.ordinaryroad." + + "live.chat.client.douyin.protobuf.dtob\006pr" + + "oto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.getDescriptor(), + }); + internal_static_User_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_User_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_descriptor, + new java.lang.String[] { "Id", "ShortId", "Nickname", "Gender", "Signature", "Level", "Birthday", "Telephone", "AvatarThumb", "AvatarMedium", "AvatarLarge", "Verified", "Experience", "City", "Status", "CreateTime", "ModifyTime", "Secret", "ShareQrcodeUri", "IncomeSharePercent", "BadgeImageListList", "FollowInfo", "PayGrade", "FansClub", "Border", "SpecialId", "AvatarBorder", "Medal", "RealTimeIconsList", "NewRealTimeIconsList", "TopVipNo", "UserAttr", "OwnRoom", "PayScore", "TicketCount", "AnchorInfo", "LinkMicStats", "DisplayId", "WithCommercePermission", "WithFusionShopEntry", "TotalRechargeDiamondCount", "WebcastAnchorLevel", "VerifiedContent", "AuthorStats", "TopFansList", "SecUid", "UserRole", "XiguaInfo", "ActivityReward", "NobleInfo", "BrotherhoodInfo", "PersonalCard", "AuthenticationInfo", "AuthorizationInfo", "AdversaryAuthorizationInfo", "PoiInfo", "MediaBadgeImageListList", "AdversaryUserStatus", "UserVipInfo", "CommerceWebcastConfigIdsList", "BadgeImageListV2List", "LocationCity", "FansGroupInfo", "RemarkName", "MysteryMan", "WebRid", "DesensitizedNickname", "JAccreditInfo", "Subscribe", "IsAnonymous", "ConsumeDiamondLevel", "WebcastUid", "ProfileStyleParams", "UserDressInfo", "AllowBeLocated", "AllowFindByContacts", "AllowOthersDownloadVideo", "AllowOthersDownloadWhenSharingVideo", "AllowShareShowProfile", "AllowShowInGossip", "AllowShowMyAction", "AllowStrangeComment", "AllowUnfollowerComment", "AllowUseLinkmic", "AnchorLevel", "AvatarJpg", "BgImgUrl", "BirthdayDescription", "BirthdayValid", "BlockStatus", "CommentRestrict", "Constellation", "DisableIchat", "EnableIchatImg", "Exp", "FanTicketCount", "FoldStrangerChat", "FollowStatus", "HotsoonVerified", "HotsoonVerifiedReason", "IchatRestrictType", "IdStr", "IsFollower", "IsFollowing", "NeedProfileGuide", "PayScores", "PushCommentStatus", "PushDigg", "PushFollow", "PushFriendAction", "PushIchat", "PushStatus", "PushVideoPost", "PushVideoRecommend", "Stats", "VerifiedMobile", "VerifiedReason", "WithCarManagementPermission", "AgeRange", "WatchDurationMonth", }); + internal_static_User_ActivityInfo_descriptor = + internal_static_User_descriptor.getNestedTypes().get(0); + internal_static_User_ActivityInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_ActivityInfo_descriptor, + new java.lang.String[] { }); + internal_static_User_AnchorInfo_descriptor = + internal_static_User_descriptor.getNestedTypes().get(1); + internal_static_User_AnchorInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_AnchorInfo_descriptor, + new java.lang.String[] { }); + internal_static_User_AnchorLevel_descriptor = + internal_static_User_descriptor.getNestedTypes().get(2); + internal_static_User_AnchorLevel_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_AnchorLevel_descriptor, + new java.lang.String[] { }); + internal_static_User_AuthenticationInfo_descriptor = + internal_static_User_descriptor.getNestedTypes().get(3); + internal_static_User_AuthenticationInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_AuthenticationInfo_descriptor, + new java.lang.String[] { }); + internal_static_User_AuthorStats_descriptor = + internal_static_User_descriptor.getNestedTypes().get(4); + internal_static_User_AuthorStats_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_AuthorStats_descriptor, + new java.lang.String[] { }); + internal_static_User_Border_descriptor = + internal_static_User_descriptor.getNestedTypes().get(5); + internal_static_User_Border_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_Border_descriptor, + new java.lang.String[] { }); + internal_static_User_BrotherhoodInfo_descriptor = + internal_static_User_descriptor.getNestedTypes().get(6); + internal_static_User_BrotherhoodInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_BrotherhoodInfo_descriptor, + new java.lang.String[] { }); + internal_static_User_FansClub_descriptor = + internal_static_User_descriptor.getNestedTypes().get(7); + internal_static_User_FansClub_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_FansClub_descriptor, + new java.lang.String[] { "Data", "PreferData", }); + internal_static_User_FansClub_PreferDataEntry_descriptor = + internal_static_User_FansClub_descriptor.getNestedTypes().get(0); + internal_static_User_FansClub_PreferDataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_FansClub_PreferDataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_User_FansClub_FansClubData_descriptor = + internal_static_User_FansClub_descriptor.getNestedTypes().get(1); + internal_static_User_FansClub_FansClubData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_FansClub_FansClubData_descriptor, + new java.lang.String[] { "ClubName", "Level", "UserFansClubStatus", "Badge", "AvailableGiftIds", "AnchorId", }); + internal_static_User_FansClub_FansClubData_UserBadge_descriptor = + internal_static_User_FansClub_FansClubData_descriptor.getNestedTypes().get(0); + internal_static_User_FansClub_FansClubData_UserBadge_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_FansClub_FansClubData_UserBadge_descriptor, + new java.lang.String[] { "Icons", "Title", }); + internal_static_User_FansClub_FansClubData_UserBadge_IconsEntry_descriptor = + internal_static_User_FansClub_FansClubData_UserBadge_descriptor.getNestedTypes().get(0); + internal_static_User_FansClub_FansClubData_UserBadge_IconsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_FansClub_FansClubData_UserBadge_IconsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_User_FansGroupInfo_descriptor = + internal_static_User_descriptor.getNestedTypes().get(8); + internal_static_User_FansGroupInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_FansGroupInfo_descriptor, + new java.lang.String[] { }); + internal_static_User_FollowInfo_descriptor = + internal_static_User_descriptor.getNestedTypes().get(9); + internal_static_User_FollowInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_FollowInfo_descriptor, + new java.lang.String[] { "FollowingCount", "FollowerCount", "FollowStatus", "PushStatus", "RemarkName", }); + internal_static_User_JAccreditInfo_descriptor = + internal_static_User_descriptor.getNestedTypes().get(10); + internal_static_User_JAccreditInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_JAccreditInfo_descriptor, + new java.lang.String[] { }); + internal_static_User_NobleLevelInfo_descriptor = + internal_static_User_descriptor.getNestedTypes().get(11); + internal_static_User_NobleLevelInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_NobleLevelInfo_descriptor, + new java.lang.String[] { }); + internal_static_User_OwnRoom_descriptor = + internal_static_User_descriptor.getNestedTypes().get(12); + internal_static_User_OwnRoom_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_OwnRoom_descriptor, + new java.lang.String[] { }); + internal_static_User_PayGrade_descriptor = + internal_static_User_descriptor.getNestedTypes().get(13); + internal_static_User_PayGrade_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_PayGrade_descriptor, + new java.lang.String[] { "TotalDiamondCount", "DiamondIcon", "Name", "Icon", "NextName", "Level", "NextIcon", "NextDiamond", "NowDiamond", "ThisGradeMinDiamond", "ThisGradeMaxDiamond", "PayDiamondBak", "GradeDescribe", "GradeIconList", "ScreenChatType", "ImIcon", "ImIconWithLevel", "LiveIcon", "NewImIconWithLevel", "NewLiveIcon", "UpgradeNeedConsume", "NextPrivileges", "Background", "BackgroundBack", "Score", "GradeBanner", "ProfileDialogBg", "ProfileDialogBgBack", }); + internal_static_User_PayGrade_GradeIcon_descriptor = + internal_static_User_PayGrade_descriptor.getNestedTypes().get(0); + internal_static_User_PayGrade_GradeIcon_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_PayGrade_GradeIcon_descriptor, + new java.lang.String[] { "Icon", "IconDiamond", "Level", "LevelStr", }); + internal_static_User_PoiInfo_descriptor = + internal_static_User_descriptor.getNestedTypes().get(14); + internal_static_User_PoiInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_PoiInfo_descriptor, + new java.lang.String[] { }); + internal_static_User_ProfileStyleParams_descriptor = + internal_static_User_descriptor.getNestedTypes().get(15); + internal_static_User_ProfileStyleParams_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_ProfileStyleParams_descriptor, + new java.lang.String[] { }); + internal_static_User_Subscribe_descriptor = + internal_static_User_descriptor.getNestedTypes().get(16); + internal_static_User_Subscribe_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_Subscribe_descriptor, + new java.lang.String[] { }); + internal_static_User_UserAttr_descriptor = + internal_static_User_descriptor.getNestedTypes().get(17); + internal_static_User_UserAttr_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_UserAttr_descriptor, + new java.lang.String[] { }); + internal_static_User_UserDressInfo_descriptor = + internal_static_User_descriptor.getNestedTypes().get(18); + internal_static_User_UserDressInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_UserDressInfo_descriptor, + new java.lang.String[] { }); + internal_static_User_UserVIPInfo_descriptor = + internal_static_User_descriptor.getNestedTypes().get(19); + internal_static_User_UserVIPInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_UserVIPInfo_descriptor, + new java.lang.String[] { }); + internal_static_User_UserStats_descriptor = + internal_static_User_descriptor.getNestedTypes().get(20); + internal_static_User_UserStats_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_UserStats_descriptor, + new java.lang.String[] { }); + internal_static_User_XiguaParams_descriptor = + internal_static_User_descriptor.getNestedTypes().get(21); + internal_static_User_XiguaParams_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_User_XiguaParams_descriptor, + new java.lang.String[] { }); + tech.ordinaryroad.live.chat.client.douyin.protobuf.dto.ImageOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Common.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Common.proto new file mode 100644 index 0000000..a09a395 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Common.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +import "User.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message Common { + string method = 1; + uint64 msgId = 2; + uint64 roomId = 3; + uint64 createTime = 4; + uint32 monitor = 5; + bool isShowMsg = 6; + string describe = 7; + // DisplayText displayText = 8; + uint64 foldType = 9; + uint64 anchorFoldType = 10; + uint64 priorityScore = 11; + string logId = 12; + string msgProcessFilterK = 13; + string msgProcessFilterV = 14; + User user = 15; + // Room room = 16; + uint64 anchorFoldTypeV2 = 17; + uint64 processAtSeiTimeMs = 18; + uint64 randomDispatchMs = 19; + bool isDispatch = 20; + uint32 channelId = 21; + uint64 diffSei2absSecond = 22; + uint64 anchorFoldDuration = 23; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/DoubleLikeDetail.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/DoubleLikeDetail.proto new file mode 100644 index 0000000..de0b28a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/DoubleLikeDetail.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message DoubleLikeDetail { + bool doubleFlag = 1; + uint32 seqId = 2; + uint32 renewalsNum = 3; + uint32 triggersNum = 4; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/GiftIMPriority.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/GiftIMPriority.proto new file mode 100644 index 0000000..3b8db33 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/GiftIMPriority.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message GiftIMPriority { + repeated uint64 queue_sizes_list = 1; + uint64 self_queue_priority = 2; + uint64 priority = 3; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/GiftStruct.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/GiftStruct.proto new file mode 100644 index 0000000..3031acc --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/GiftStruct.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; +import "Image.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message GiftStruct { + Image image = 1; + string describe = 2; + bool notify = 3; + uint64 duration = 4; + uint64 id = 5; + // GiftStructFansClubInfo fansclubInfo = 6; + bool for_linkmic = 7; + bool doodle = 8; + bool for_fansclub = 9; + bool combo = 10; + uint32 type = 11; + uint32 diamond_count = 12; + bool is_displayed_on_panel = 13; + uint64 primary_effect_id = 14; + Image gift_label_icon = 15; + string name = 16; + string region = 17; + string manual = 18; + bool for_custom = 19; + map specialEffectsMap = 20; + Image icon = 21; + uint32 action_type = 22; + int32 watermelonSeeds = 23; + string goldEffect = 24; + // repeated LuckyMoneyGiftMeta subs = 25; + int64 goldenBeans = 26; + int64 honorLevel = 27; + int32 itemType = 28; + string schemeUrl = 29; + // GiftPanelOperation giftOperation = 30; + string eventName = 31; + int64 nobleLevel = 32; + string guideUrl = 33; + bool punishMedicine = 34; + bool forPortal = 35; + string businessText = 36; + bool cnyGift = 37; + int64 appId = 38; + int64 vipLevel = 39; + bool isGray = 40; + string graySchemeUrl = 41; + int64 giftScene = 42; + // GiftBanner giftBanner = 43; + repeated string triggerWords = 44; + // repeated GiftBuffInfo giftBuffInfos = 45; + bool forFirstRecharge = 46; + Image dynamicImgForSelected = 47; + int32 afterSendAction = 48; + int64 giftOfflineTime = 49; + string topBarText = 50; + Image topRightAvatar = 51; + string bannerSchemeUrl = 52; + bool isLocked = 53; + int64 reqExtraType = 54; + repeated int64 assetIds = 55; + // GiftPreviewInfo giftPreviewInfo = 56; + // GiftTip giftTip = 57; + int32 needSweepLightCount = 58; + // repeated GiftGroupInfo groupInfo = 59; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Image.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Image.proto new file mode 100644 index 0000000..1f48729 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Image.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message Image { + repeated string urlListList = 1; + string uri = 2; + int64 height = 3; + int64 width = 4; + string avgColor = 5; + int32 imageType = 6; + string openWebUrl = 7; + Content content = 8; + bool isAnimated = 9; + repeated NinePatchSetting flexSettingListList = 10; + repeated NinePatchSetting textSettingListList = 11; + + message Content { + string name = 1; + string fontColor = 2; + int64 level = 3; + string alternativeText = 4; + } + + message NinePatchSetting{ + + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/PatternRef.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/PatternRef.proto new file mode 100644 index 0000000..5caa0e4 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/PatternRef.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message PatternRef { + string key = 1; + string default_pattern = 2; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/PublicAreaCommon.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/PublicAreaCommon.proto new file mode 100644 index 0000000..01358fd --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/PublicAreaCommon.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +import "Image.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message PublicAreaCommon { + Image user_label = 1; + uint64 user_consume_in_room = 2; + uint64 user_send_gift_cnt_in_room = 3; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Text.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Text.proto new file mode 100644 index 0000000..60f985c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/Text.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +import "TextFormat.proto"; +import "TextPiece.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message Text { + string key = 1; + string default_patter = 2; + TextFormat default_format = 3; + TextPiece pieces_list = 4; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextEffect.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextEffect.proto new file mode 100644 index 0000000..662e168 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextEffect.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +import "TextEffectDetail.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message TextEffect { + TextEffectDetail portrait = 1; + TextEffectDetail landscape = 2; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextEffectDetail.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextEffectDetail.proto new file mode 100644 index 0000000..6d1146a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextEffectDetail.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +import "Image.proto"; +import "Text.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message TextEffectDetail { + Text text = 1; + uint32 text_font_size = 2; + Image background = 3; + uint32 start = 4; + uint32 duration = 5; + uint32 x = 6; + uint32 y = 7; + uint32 width = 8; + uint32 height = 9; + uint32 shadow_dx = 10; + uint32 shadow_dy = 11; + uint32 shadow_radius = 12; + string shadow_color = 13; + string stroke_color = 14; + uint32 stroke_width = 15; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextFormat.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextFormat.proto new file mode 100644 index 0000000..8ca8ab5 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextFormat.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message TextFormat { + string color = 1; + bool bold = 2; + bool italic = 3; + uint32 weight = 4; + uint32 italic_angle = 5; + uint32 font_size = 6; + bool use_heigh_light_color = 7; + bool use_remote_clor = 8; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPiece.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPiece.proto new file mode 100644 index 0000000..e76d1ce --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPiece.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +import "TextFormat.proto"; +import "TextPieceImage.proto"; +import "TextPiecePatternRef.proto"; +import "TextPieceHeart.proto"; +import "TextPieceGift.proto"; +import "TextPieceUser.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message TextPiece { + bool type = 1; + TextFormat format = 2; + string string_value = 3; + TextPieceUser user_value = 4; + TextPieceGift gift_value = 5; + TextPieceHeart heart_value = 6; + TextPiecePatternRef pattern_ref_value = 7; + TextPieceImage image_value = 8; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceGift.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceGift.proto new file mode 100644 index 0000000..5ed59e2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceGift.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +import "PatternRef.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message TextPieceGift { + uint64 gift_id = 1; + PatternRef name_ref = 2; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceHeart.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceHeart.proto new file mode 100644 index 0000000..6528fd1 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceHeart.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message TextPieceHeart { + string color = 1; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceImage.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceImage.proto new file mode 100644 index 0000000..6f50714 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceImage.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +import "Image.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message TextPieceImage { + Image image = 1; + float scaling_rate = 2; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPiecePatternRef.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPiecePatternRef.proto new file mode 100644 index 0000000..c3a51aa --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPiecePatternRef.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message TextPiecePatternRef { + string key = 1; + string default_pattern = 2; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceUser.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceUser.proto new file mode 100644 index 0000000..c46ae9a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/TextPieceUser.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +import "User.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message TextPieceUser { + User user = 1; + bool with_colon = 2; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/User.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/User.proto new file mode 100644 index 0000000..4a29684 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/User.proto @@ -0,0 +1,272 @@ +syntax = "proto3"; +import "Image.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf.dto"; + +message User { + uint64 id = 1; + uint64 shortId = 2; + string nickname = 3; + uint32 gender = 4; + string signature = 5; + uint32 level = 6; + uint64 birthday = 7; + string telephone = 8; + Image avatarThumb = 9; + Image avatarMedium = 10; + Image avatarLarge = 11; + bool verified = 12; + int32 experience = 13; + string city = 14; + int32 status = 15; + int64 createTime = 16; + int64 modifyTime = 17; + int32 secret = 18; + string shareQrcodeUri = 19; + int32 incomeSharePercent = 20; + Image badgeImageListList = 21; + FollowInfo followInfo = 22; + PayGrade payGrade = 23; + FansClub fansClub = 24; + Border border = 25; + string specialId = 26; + Image avatarBorder = 27; + Image medal = 28; + repeated Image realTimeIconsList = 29; + repeated Image newRealTimeIconsList = 30; + int64 topVipNo = 31; + UserAttr userAttr = 32; + OwnRoom ownRoom = 33; + int64 payScore = 34; + int64 ticketCount = 35; + AnchorInfo anchorInfo = 36; + int32 linkMicStats = 37; + string displayId = 38; + bool withCommercePermission = 39; + bool withFusionShopEntry = 40; + int64 totalRechargeDiamondCount = 41; + AnchorLevel webcastAnchorLevel = 42; + string verifiedContent = 43; + AuthorStats authorStats = 44; + repeated User topFansList = 45; + string secUid = 46; + int32 userRole = 47; + XiguaParams xiguaInfo = 48; + ActivityInfo activityReward = 49; + NobleLevelInfo nobleInfo = 50; + BrotherhoodInfo brotherhoodInfo = 51; + Image personalCard = 52; + AuthenticationInfo authenticationInfo = 53; + int32 authorizationInfo = 54; + int32 adversaryAuthorizationInfo = 55; + PoiInfo poiInfo = 56; + Image mediaBadgeImageListList = 57; + int32 adversaryUserStatus = 58; + UserVIPInfo userVipInfo = 59; + repeated int64 commerceWebcastConfigIdsList = 60; + Image badgeImageListV2List = 61; + // IndustryCertification industryCertification = 62; + string locationCity = 63; + FansGroupInfo fansGroupInfo = 64; + string remarkName = 65; + int32 mysteryMan = 66; + string webRid = 67; + string desensitizedNickname = 68; + JAccreditInfo jAccreditInfo = 69; + Subscribe subscribe = 70; + bool isAnonymous = 71; + int32 consumeDiamondLevel = 72; + string webcastUid = 73; + ProfileStyleParams profileStyleParams = 74; + UserDressInfo userDressInfo = 75; + bool allowBeLocated = 1001; + bool allowFindByContacts = 1002; + bool allowOthersDownloadVideo = 1003; + bool allowOthersDownloadWhenSharingVideo = 1004; + bool allowShareShowProfile = 1005; + bool allowShowInGossip = 1006; + bool allowShowMyAction = 1007; + bool allowStrangeComment = 1008; + bool allowUnfollowerComment = 1009; + bool allowUseLinkmic = 1010; + AnchorLevel anchorLevel = 1011; + Image avatarJpg = 1012; + string bgImgUrl = 1013; + string birthdayDescription = 1014; + bool birthdayValid = 1015; + int32 blockStatus = 1016; + int32 commentRestrict = 1017; + string constellation = 1018; + int32 disableIchat = 1019; + int64 enableIchatImg = 1020; + int32 exp = 1021; + int64 fanTicketCount = 1022; + bool foldStrangerChat = 1023; + int64 followStatus = 1024; + bool hotsoonVerified = 1025; + string hotsoonVerifiedReason = 1026; + int32 ichatRestrictType = 1027; + string idStr = 1028; + bool isFollower = 1029; + bool isFollowing = 1030; + bool needProfileGuide = 1031; + int64 payScores = 1032; + bool pushCommentStatus = 1033; + bool pushDigg = 1034; + bool pushFollow = 1035; + bool pushFriendAction = 1036; + bool pushIchat = 1037; + bool pushStatus = 1038; + bool pushVideoPost = 1039; + bool pushVideoRecommend = 1040; + UserStats stats = 1041; + bool verifiedMobile = 1042; + string verifiedReason = 1043; + bool withCarManagementPermission = 1044; + int32 ageRange = 1045; + int64 watchDurationMonth = 1046; + + message ActivityInfo{ + + } + + message AnchorInfo { + + } + + message AnchorLevel{ + + } + + message AuthenticationInfo{ + + } + + message AuthorStats{ + + } + + message Border{ + + } + + message BrotherhoodInfo{ + + } + + message FansClub { + FansClubData data = 1; + map preferData = 2; + + message FansClubData { + string clubName = 1; + int32 level = 2; + int32 userFansClubStatus = 3; + UserBadge badge = 4; + repeated int64 availableGiftIds = 5; + int64 anchorId = 6; + + message UserBadge { + map icons = 1; + string title = 2; + } + + } + } + + message FansGroupInfo{ + + } + + message FollowInfo { + int64 followingCount = 1; + int64 followerCount = 2; + int64 followStatus = 3; + int64 pushStatus = 4; + string remarkName = 5; + } + + message JAccreditInfo{ + + } + + message NobleLevelInfo{ + + } + + message OwnRoom { + + } + + message PayGrade { + int64 totalDiamondCount = 1; + Image diamondIcon = 2; + string name = 3; + Image icon = 4; + string nextName = 5; + int64 level = 6; + Image nextIcon = 7; + int64 nextDiamond = 8; + int64 nowDiamond = 9; + int64 thisGradeMinDiamond = 10; + int64 thisGradeMaxDiamond = 11; + int64 payDiamondBak = 12; + string gradeDescribe = 13; + repeated GradeIcon gradeIconList = 14; + int64 screenChatType = 15; + Image imIcon = 16; + Image imIconWithLevel = 17; + Image liveIcon = 18; + Image newImIconWithLevel = 19; + Image newLiveIcon = 20; + int64 upgradeNeedConsume = 21; + string nextPrivileges = 22; + Image background = 23; + Image backgroundBack = 24; + int64 score = 25; + // GradeBuffInfo buffInfo = 26; + string gradeBanner = 1001; + Image profileDialogBg = 1002; + Image profileDialogBgBack = 1003; + + message GradeIcon{ + Image icon = 1; + int64 iconDiamond = 2; + int64 level = 3; + string levelStr = 4; + } + + } + + message PoiInfo{ + + } + + message ProfileStyleParams{ + + } + + message Subscribe{ + + } + + message UserAttr{ + + } + + message UserDressInfo{ + + } + + message UserVIPInfo { + + } + + message UserStats{ + + } + + message XiguaParams{ + + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_cmd_msg.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_cmd_msg.proto new file mode 100644 index 0000000..41a71eb --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_cmd_msg.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf"; +option java_outer_classname = "Douyin_cmd_msgProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +message douyin_cmd_msg { + string method = 1; + bytes payload = 2; + int64 msg_id = 3; + int32 msg_type = 4; + int64 offset = 5; + bool need_wrds_store = 6; + int64 wrds_version = 7; + string wrds_sub_key = 8; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_chat_message_msg.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_chat_message_msg.proto new file mode 100644 index 0000000..4866a3b --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_chat_message_msg.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +import "Common.proto"; +import "User.proto"; +import "Image.proto"; + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf"; +option java_outer_classname = "Douyin_webcast_chat_message_msgProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +message douyin_webcast_chat_message_msg { + Common common = 1; + User user = 2; + string content = 3; + bool visible_to_sender = 4; + Image background_image = 5; + string full_screen_text_color = 6; + Image background_image_v2 = 7; + // PublicAreaCommon public_area_common = 9; + Image gift_image = 10; + uint64 agree_msg_id = 11; + uint32 priority_level = 12; + // LandscapeAreaCommon landscape_area_common = 13; + uint64 event_time = 15; + bool send_review = 16; + bool from_intercom = 17; + bool intercom_hide_user_card = 18; + // repeated string chatTagsList = 19; + string chat_by = 20; + uint32 individual_chat_priority = 21; + // Text rtf_content = 22 ; +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_gift_message_msg.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_gift_message_msg.proto new file mode 100644 index 0000000..fcd1d78 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_gift_message_msg.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +import "Common.proto"; +import "User.proto"; +import "TextEffect.proto"; +import "Text.proto"; +import "GiftIMPriority.proto"; +import "GiftStruct.proto"; +import "PublicAreaCommon.proto"; + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf"; +option java_outer_classname = "Douyin_webcast_gift_message_msgProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +message douyin_webcast_gift_message_msg { + Common common = 1; + uint64 long_gift_id = 2; + uint64 fan_ticket_count = 3; + uint64 group_count = 4; + uint64 repeat_count = 5; + uint64 combo_count = 6; + User user = 7; + User to_user = 8 ; + uint32 repeat_end = 9 ; + TextEffect text_effect = 10 ; + uint64 group_id = 11 ; + uint64 income_taskgifts = 12 ; + uint64 room_fan_ticket_count = 13 ; + GiftIMPriority priority = 14 ; + GiftStruct gift = 15 ; + string log_id = 16 ; + uint64 send_type = 17 ; + PublicAreaCommon public_area_common = 18 ; + Text tray_display_text = 19 ; + uint64 banned_display_effects = 20 ; + // GiftTrayInfo trayInfo = 21; + // AssetEffectMixInfo assetEffectMixInfo = 22; + bool display_for_self = 25; + string interact_gift_info = 26; + string diy_item_info = 27; + repeated uint64 min_asset_set_list = 28; + uint64 total_count = 29; + uint32 client_gift_source = 30; + // AnchorGiftData anchorGift = 31; + repeated uint64 to_user_ids_list = 32; + uint64 send_timet = 33; + uint64 force_display_effectst = 34; + string trace_id = 35; + uint64 effect_display_ts = 36; +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_like_message_msg.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_like_message_msg.proto new file mode 100644 index 0000000..2a61739 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_like_message_msg.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +import "Common.proto"; +import "User.proto"; +import "DoubleLikeDetail.proto"; + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf"; +option java_outer_classname = "douyin_webcast_like_message_msgProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +message douyin_webcast_like_message_msg { + Common common = 1; + uint64 count = 2; + uint64 total = 3; + uint64 color = 4; + User user = 5; + string icon = 6; + DoubleLikeDetail doubleLikeDetail = 7; + // DisplayControlInfo displayControlInfo = 8; + uint64 linkmicGuestUid = 9; + string scene = 10; + // PicoDisplayInfo picoDisplayInfo = 11; + // = 12; +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_member_message_msg.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_member_message_msg.proto new file mode 100644 index 0000000..f892a74 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_webcast_member_message_msg.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +import "Common.proto"; +import "User.proto"; +import "Image.proto"; +import "Text.proto"; + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf"; +option java_outer_classname = "Douyin_webcast_member_message_msgProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +message douyin_webcast_member_message_msg { + Common common = 1; + User user = 2; + uint64 memberCount = 3; + User operator = 4; + bool isSetToAdmin = 5; + bool isTopUser = 6; + int64 rankScore = 7; + int64 topUserNo = 8; + int64 enterType = 9; + int64 action = 10; + string actionDescription = 11; + int64 userId = 12; + // EffectConfig effectConfig = 13; + string popStr = 14; + // EffectConfig enterEffectConfig = 15; + Image backgroundImage = 16; + Image backgroundImageV2 = 17; + Text anchorDisplayText = 18; + // PublicAreaCommon publicAreaCommon = 19; + int64 userEnterTipType = 20; + int64 anchorEnterTipType = 21; + map buriedPointMap = 22; +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_websocket_frame.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_websocket_frame.proto new file mode 100644 index 0000000..fe01e9a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_websocket_frame.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf"; +option java_outer_classname = "Douyin_websocket_frameProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +message douyin_websocket_frame { + uint64 seq_id = 1; + uint64 log_id = 2; + uint64 service = 3; + uint64 method = 4; + map headers_list = 5; + string payload_encoding = 6; + string payload_type = 7; + bytes payload = 8; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_websocket_frame_msg.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_websocket_frame_msg.proto new file mode 100644 index 0000000..808bb2f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/main/resources/proto/douyin_websocket_frame_msg.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package tech.ordinaryroad.live.chat.client.douyin.protobuf; + +option java_package = "tech.ordinaryroad.live.chat.client.douyin.protobuf"; +option java_outer_classname = "douyin_websocket_frame_msgProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +import "douyin_cmd_msg.proto"; + +message douyin_websocket_frame_msg { + repeated douyin_cmd_msg messages_list = 1; + string cursor = 2; + uint64 fetch_interval = 3; + uint64 now = 4; + string internal_ext = 5; + uint32 fetch_type = 6; + map route_params = 7; + uint64 heartbeat_duration = 8; + bool need_ack = 9; + string push_server = 10; + string live_cursor = 11; + bool history_no_more = 12; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/test/java/tech/ordinaryroad/live/chat/client/douyin/api/DouyinApisTest.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/test/java/tech/ordinaryroad/live/chat/client/douyin/api/DouyinApisTest.java new file mode 100644 index 0000000..fe217bc --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/test/java/tech/ordinaryroad/live/chat/client/douyin/api/DouyinApisTest.java @@ -0,0 +1,15 @@ +package tech.ordinaryroad.live.chat.client.douyin.api; + +import org.junit.jupiter.api.Test; + +/** + * @author mjz + * @date 2024/1/3 + */ +class DouyinApisTest { + + @Test + void roomInit() { + DouyinApis.roomInit("886419461662"); + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/test/java/tech/ordinaryroad/live/chat/client/douyin/client/DouyinLiveChatClientTest.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/test/java/tech/ordinaryroad/live/chat/client/douyin/client/DouyinLiveChatClientTest.java new file mode 100644 index 0000000..a80ec93 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyin/src/test/java/tech/ordinaryroad/live/chat/client/douyin/client/DouyinLiveChatClientTest.java @@ -0,0 +1,93 @@ +package tech.ordinaryroad.live.chat.client.douyin.client; + +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Test; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; +import tech.ordinaryroad.live.chat.client.douyin.config.DouyinLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.douyin.constant.DouyinCmdEnum; +import tech.ordinaryroad.live.chat.client.douyin.listener.IDouyinMsgListener; +import tech.ordinaryroad.live.chat.client.douyin.msg.DouyinDanmuMsg; +import tech.ordinaryroad.live.chat.client.douyin.msg.DouyinEnterRoomMsg; +import tech.ordinaryroad.live.chat.client.douyin.msg.DouyinGiftMsg; +import tech.ordinaryroad.live.chat.client.douyin.msg.DouyinLikeMsg; +import tech.ordinaryroad.live.chat.client.douyin.netty.handler.DouyinBinaryFrameHandler; + +/** + * @author mjz + * @date 2024/1/2 + */ +@Slf4j +class DouyinLiveChatClientTest { + + static Object lock = new Object(); + DouyinLiveChatClient client; + + @Test + void example() throws InterruptedException { + String cookie = System.getenv("cookie"); + log.error("cookie: {}", cookie); + DouyinLiveChatClientConfig config = DouyinLiveChatClientConfig.builder() + // TODO 浏览器Cookie + .cookie(cookie) + .roomId("renyixu1989") + .roomId("567789235524") + .roomId("166163409118") + .roomId("722266687616") + .roomId("o333") + .roomId("qilongmusic") + .roomId("yimei20210922") + .build(); + + client = new DouyinLiveChatClient(config, new IDouyinMsgListener() { + @Override + public void onMsg(IMsg msg) { + // log.debug("收到{}消息 {}", msg.getClass(), msg); + } + + @Override + public void onCmdMsg(DouyinCmdEnum cmd, ICmdMsg cmdMsg) { + // log.debug("收到CMD消息{} {}", cmd, cmdMsg); + } + + @Override + public void onOtherCmdMsg(DouyinCmdEnum cmd, ICmdMsg cmdMsg) { + log.debug("收到其他CMD消息 {}", cmd); + } + + @Override + public void onUnknownCmd(String cmdString, IMsg msg) { + log.debug("收到未知CMD消息 {}", cmdString); + } + + @Override + public void onDanmuMsg(DouyinBinaryFrameHandler binaryFrameHandler, DouyinDanmuMsg msg) { + log.info("{} 收到弹幕 {} {}({}):{}", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), msg.getContent()); + } + + @Override + public void onGiftMsg(DouyinBinaryFrameHandler binaryFrameHandler, DouyinGiftMsg msg) { + log.info("{} 收到礼物 {} {}({}) {} {}({})x{}({})", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), "赠送", msg.getGiftName(), msg.getGiftId(), msg.getGiftCount(), msg.getGiftPrice()); + } + + @Override + public void onLikeMsg(DouyinBinaryFrameHandler binaryFrameHandler, DouyinLikeMsg msg) { + log.info("{} 收到点赞 [{}] {}({})", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid()); + } + + @Override + public void onEnterRoomMsg(DouyinBinaryFrameHandler binaryFrameHandler, DouyinEnterRoomMsg msg) { + log.info("{} {}({}) 进入直播间", msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid()); + } + }); + client.connect(); + + // 防止测试时直接退出 + while (true) { + synchronized (lock) { + lock.wait(); + } + } + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/README.md b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/README.md new file mode 100644 index 0000000..0b71bda --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/README.md @@ -0,0 +1,52 @@ +### 序列化 + +#### 序列化基本数据类型 + +1. escape(key) +2. escape(value) +3. key@=value/ + +#### 序列化Map + +1. escape(key) +2. value for each + 1. escape(key) + 2. escape(value) + 3. escape(key@=value/) +3. escape(value) +4. key@=value/ + +### 反序列化 + +#### 反序列化基本数据类型 + +1. spilt("/"): + type@=chatmsg + +2. split("@="): + 1. key: unescape(key) = el + 2. unescape(value).endsWith("/") = false + 2.1 value = chatmsg + +#### 反序列化Map + +1. spilt("/"): + el@=eid@AA=1@ASetp@AA=1@ASsc@AA=1@AS + +2. split("@="): + 1. key: unescape = el + 2. unescape(value).endsWith("/") = true + eid@A=1/etp@A=1/sc@A=1/ + 1. split("/") + eid@A=1 + etp@A=1 + sc@A=1 + 2. unescape: + eid@=1 + etp@=1 + sc@=1 + 3. for each + 1. split("@=") + 2. unescape(key) + 3. unescape(value) + 4. value: map \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/pom.xml b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/pom.xml new file mode 100644 index 0000000..d051f93 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/pom.xml @@ -0,0 +1,61 @@ + + + + 4.0.0 + + org.ruoyi + live-chat-clients + ${revision} + ../pom.xml + + jar + + live-chat-client-douyu + live-chat-client-douyu + + + UTF-8 + + + + + org.ruoyi + live-chat-client-servers-netty-client + + + + ch.qos.logback + logback-classic + + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/api/DouyuApis.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/api/DouyuApis.java new file mode 100644 index 0000000..32c5366 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/api/DouyuApis.java @@ -0,0 +1,196 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.api; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.ReUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.crypto.digest.MD5; +import cn.hutool.http.*; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.Cleanup; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg; +import tech.ordinaryroad.live.chat.client.commons.util.OrLocalDateTimeUtil; +import tech.ordinaryroad.live.chat.client.douyu.msg.dto.GiftPropSingle; + +import java.util.List; +import java.util.Map; + +/** + * API简易版 + * + * @author mjz + * @date 2023/5/5 + */ +@Slf4j +public class DouyuApis { + + public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + public static final String PATTERN_BODY_ROOM_ID = "\\$ROOM\\.room_id\\D+(\\d+)"; + public static final String KEY_REDIRECT_LOCATION_RID = "rid"; + public static final String KEY_COOKIE_DY_DID = "dy_did"; + public static final String KEY_COOKIE_ACF_UID = "acf_uid"; + public static final String KEY_COOKIE_ACF_STK = "acf_stk"; + public static final String KEY_COOKIE_ACF_LTKID = "acf_ltkid"; + public static final String API_AVATAR = "https://apic.douyucdn.cn/upload/"; + // https://webconf.douyucdn.cn/resource/common/gift/flash/gift_effect.json + // https://webconf.douyucdn.cn/resource/common/gift/common_config_v2.json + // https://webconf.douyucdn.cn/resource/common/prop_gift_list/prop_gift_config.json + // 用PID查询礼物信息:https://gift.douyucdn.cn/api/prop/v1/web/single?pid= + // 查询房间礼物列表:https://gift.douyucdn.cn/api/gift/v3/web/list?rid= + public static final String API_GIFT_LIST = "https://gift.douyucdn.cn/api/gift/v3/web/list?rid="; + public static final String API_PROP_SINGLE = "https://gift.douyucdn.cn/api/prop/v1/web/single?pid="; + public static final String API_AVATAR_PREFIX_SMALL = "_small.jpg"; + public static final String API_AVATAR_PREFIX_MIDDLE = "_middle.jpg"; + public static final String API_AVATAR_PREFIX_BIG = "_big.jpg"; + + public static String getAvatarUrl(List list, String prefix) { + if (CollUtil.isEmpty(list) || list.size() < 3) { + return StrUtil.EMPTY; + } + return API_AVATAR + CollUtil.join(list, "/") + prefix; + } + + public static String getSmallAvatarUrl(List list) { + return getAvatarUrl(list, API_AVATAR_PREFIX_SMALL); + } + + public static long getRealRoomId(long roomId, String cookie) { + String realRoomIdString = null; + @Cleanup + HttpResponse execute = createGetRequest("https://www.douyu.com/" + roomId, cookie).execute(); + if (execute.getStatus() == HttpStatus.HTTP_NOT_FOUND) { + throw new BaseException("获取" + roomId + "真实房间ID失败"); + } + if (HttpStatus.isRedirected(execute.getStatus())) { + String location = execute.header(Header.LOCATION); + Map paramMap = HttpUtil.decodeParamMap(location, null); + if (paramMap.containsKey(KEY_REDIRECT_LOCATION_RID)) { + realRoomIdString = paramMap.get(KEY_REDIRECT_LOCATION_RID); + } + } + if (StrUtil.isBlank(realRoomIdString)) { + String body = execute.body(); + String matchString = ReUtil.get(PATTERN_BODY_ROOM_ID, body, 1); + if (StrUtil.isNotBlank(matchString)) { + realRoomIdString = matchString; + } + } + long realRoomId = roomId; + if (!StrUtil.isBlank(realRoomIdString)) { + try { + realRoomId = NumberUtil.parseLong(realRoomIdString); + } catch (Exception e) { + throw new BaseException("获取" + roomId + "真实房间ID失败"); + } + } + return realRoomId; + } + + public static long getRealRoomId(long roomId) { + return getRealRoomId(roomId, null); + } + + public static JsonNode getServerInfo(long roomId, String cookie) { + @Cleanup + HttpResponse execute = createPostRequest("https://www.douyu.com/lapi/live/gateway/web/" + roomId + "?isH5=1", cookie).execute(); + return responseInterceptor(execute.body()); + } + + public static JsonNode getServerInfo(long roomId) { + return getServerInfo(roomId, null); + } + + public static String getRandomWssUri(long roomId) { + JsonNode serverInfo = getServerInfo(roomId); + JsonNode wss = serverInfo.get("wss"); + JsonNode jsonNode = wss.get(RandomUtil.randomInt(0, wss.size())); + return "wss://" + jsonNode.get("domain").asText() + ":" + jsonNode.get("port").asInt(); + } + + public static JsonNode getGiftList(long roomId) { + @Cleanup + HttpResponse execute = createGetRequest(API_GIFT_LIST + roomId, null).execute(); + return responseInterceptor(execute.body()); + } + + @SneakyThrows + public static GiftPropSingle getGiftPropSingleByPid(String pid) { + @Cleanup + HttpResponse execute = createGetRequest(API_PROP_SINGLE + pid, null).execute(); + JsonNode jsonNode = responseInterceptor(execute.body()); + return BaseMsg.OBJECT_MAPPER.readValue(jsonNode.toString(), GiftPropSingle.class); + } + + public static final String vk_secret = "r5*^5;}2#${XF[h+;'./.Q'1;,-]f'p["; + + /** + * 参考: 斗鱼关注人数爬取 ── 字体反爬的攻与防 + * + * @param currentTimeSecs + * @param did + * @return + */ + public static String generateVk(long currentTimeSecs, String did) { + return MD5.create().digestHex(currentTimeSecs + vk_secret + did); + } + + public static String generateVk(String did) { + return generateVk(OrLocalDateTimeUtil.zonedCurrentTimeSecs(), did); + } + + public static HttpRequest createGetRequest(String url, String cookie) { + return HttpUtil.createGet(url) + .cookie(cookie); + } + + public static HttpRequest createPostRequest(String url, String cookie) { + return HttpUtil.createPost(url) + .cookie(cookie); + } + + private static JsonNode responseInterceptor(String responseString) { + try { + JsonNode jsonNode = OBJECT_MAPPER.readTree(responseString); + int code = jsonNode.get("error").asInt(); + if (code == 0) { + // 成功 + return jsonNode.get("data"); + } else { + throw new BaseException(jsonNode.get("msg").asText()); + } + } catch (JsonProcessingException e) { + throw new BaseException(e); + } + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuDanmuLiveChatClient.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuDanmuLiveChatClient.java new file mode 100644 index 0000000..a780aca --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuDanmuLiveChatClient.java @@ -0,0 +1,117 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.client; + +import io.netty.channel.EventLoopGroup; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.handler.codec.http.DefaultHttpHeaders; +import io.netty.handler.codec.http.websocketx.WebSocketClientHandshakerFactory; +import io.netty.handler.codec.http.websocketx.WebSocketVersion; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; +import tech.ordinaryroad.live.chat.client.douyu.client.base.BaseDouyuLiveChatClient; +import tech.ordinaryroad.live.chat.client.douyu.config.DouyuLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuClientModeEnum; +import tech.ordinaryroad.live.chat.client.douyu.listener.IDouyuConnectionListener; +import tech.ordinaryroad.live.chat.client.douyu.listener.IDouyuMsgListener; +import tech.ordinaryroad.live.chat.client.douyu.msg.LoginresMsg; +import tech.ordinaryroad.live.chat.client.douyu.netty.handler.DouyuBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.douyu.netty.handler.DouyuConnectionHandler; + +import java.util.List; + +/** + * 直播间弹幕客户端{@link DouyuClientModeEnum#DANMU} + * + * @author mjz + * @date 2023/8/20 + */ +@Slf4j +public class DouyuDanmuLiveChatClient extends BaseDouyuLiveChatClient implements IDouyuMsgListener { + + public DouyuDanmuLiveChatClient(DouyuLiveChatClientConfig config, List msgListeners, IDouyuConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(DouyuClientModeEnum.DANMU, config, msgListeners, connectionListener, workerGroup); + addMsgListener(DouyuDanmuLiveChatClient.this); + } + + public DouyuDanmuLiveChatClient(DouyuLiveChatClientConfig config, IDouyuMsgListener msgListener, IDouyuConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(DouyuClientModeEnum.DANMU, config, msgListener, connectionListener, workerGroup); + addMsgListener(DouyuDanmuLiveChatClient.this); + } + + public DouyuDanmuLiveChatClient(DouyuLiveChatClientConfig config, IDouyuMsgListener msgListener, IDouyuConnectionListener connectionListener) { + this(config, msgListener, connectionListener, new NioEventLoopGroup()); + } + + public DouyuDanmuLiveChatClient(DouyuLiveChatClientConfig config, IDouyuMsgListener msgListener) { + this(config, msgListener, null); + } + + public DouyuDanmuLiveChatClient(DouyuLiveChatClientConfig config) { + this(config, null); + } + + @Override + public DouyuConnectionHandler initConnectionHandler(IBaseConnectionListener clientConnectionListener) { + return new DouyuConnectionHandler(DouyuClientModeEnum.DANMU, + WebSocketClientHandshakerFactory.newHandshaker(getWebsocketUri(), WebSocketVersion.V13, null, true, new DefaultHttpHeaders(), getConfig().getMaxFramePayloadLength()), + DouyuDanmuLiveChatClient.this, clientConnectionListener + ); + } + + @Override + public DouyuBinaryFrameHandler initBinaryFrameHandler() { + return new DouyuBinaryFrameHandler(msgListeners, DouyuDanmuLiveChatClient.this); + } + + @Override + public void onMsg(DouyuBinaryFrameHandler binaryFrameHandler, IMsg msg) { + if (msg instanceof LoginresMsg) { + // 1 type@=joingroup/rid@=4615502/gid@=1/ + send(getWebSocketFrameFactory(getConfig().getRoomId()).createJoingroup(), () -> { + // 2 type@=mrkl/ + send(getWebSocketFrameFactory(getConfig().getRoomId()).createHeartbeat(), () -> { + // 3 type@=sub/mt@=dayrk/ + send(getWebSocketFrameFactory(getConfig().getRoomId()).createSub()); + }); + }); + } + } + + @Override + public boolean removeMsgListener(IDouyuMsgListener msgListener) { + if (msgListener == DouyuDanmuLiveChatClient.this) { + return false; + } + return super.removeMsgListener(msgListener); + } + + @Override + public void removeAllMsgListeners() { + super.removeAllMsgListeners(); + addMsgListener(DouyuDanmuLiveChatClient.this); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuLiveChatClient.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuLiveChatClient.java new file mode 100644 index 0000000..4e183a1 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuLiveChatClient.java @@ -0,0 +1,268 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.client; + +import cn.hutool.cache.impl.TimedCache; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import cn.hutool.core.util.RandomUtil; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.nio.NioEventLoopGroup; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseCmdMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; +import tech.ordinaryroad.live.chat.client.commons.client.enums.ClientStatusEnums; +import tech.ordinaryroad.live.chat.client.douyu.api.DouyuApis; +import tech.ordinaryroad.live.chat.client.douyu.config.DouyuLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.listener.IDouyuConnectionListener; +import tech.ordinaryroad.live.chat.client.douyu.listener.IDouyuMsgListener; +import tech.ordinaryroad.live.chat.client.douyu.msg.ChatmsgMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.DgbMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.MsgrepeaterproxylistMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.UenterMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.dto.GiftListInfo; +import tech.ordinaryroad.live.chat.client.douyu.msg.dto.GiftPropSingle; +import tech.ordinaryroad.live.chat.client.douyu.netty.handler.DouyuBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.douyu.netty.handler.DouyuConnectionHandler; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +/** + * 直播间弹幕客户端 + * + * @author mjz + * @date 2023/8/20 + */ +@Slf4j +public class DouyuLiveChatClient extends DouyuWsLiveChatClient implements IDouyuMsgListener { + + /** + * 通用礼物缓存,过期时间1天 + * pid,Info + */ + public static final TimedCache giftMap = new TimedCache<>(TimeUnit.DAYS.toMillis(1)); + /** + * 房间礼物缓存,过期时间1天 + * realRoomId,(giftId,Info) + */ + public static final TimedCache> roomGiftMap = new TimedCache<>(TimeUnit.DAYS.toMillis(1), new HashMap<>()); + private final DouyuWsLiveChatClient proxyClient = this; + private DouyuDanmuLiveChatClient danmuClient = null; + private DouyuConnectionHandler connectionHandler; + /** + * 统一管理Ws、Danmu的连接状态 + */ + private final IDouyuConnectionListener connectionListener; + + public DouyuLiveChatClient(DouyuLiveChatClientConfig config, List msgListeners, IDouyuConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(config, msgListeners, null, workerGroup); + this.connectionListener = connectionListener; + } + + public DouyuLiveChatClient(DouyuLiveChatClientConfig config, IDouyuMsgListener msgListener, IDouyuConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(config, msgListener, null, workerGroup); + this.connectionListener = connectionListener; + } + + public DouyuLiveChatClient(DouyuLiveChatClientConfig config, IDouyuMsgListener msgListener, IDouyuConnectionListener connectionListener) { + this(config, msgListener, connectionListener, new NioEventLoopGroup()); + } + + public DouyuLiveChatClient(DouyuLiveChatClientConfig config, IDouyuMsgListener msgListener) { + this(config, msgListener, null); + } + + public DouyuLiveChatClient(DouyuLiveChatClientConfig config) { + this(config, null); + } + + @Override + public void init() { + super.init(); + + // 初始化房间礼物列表 + Map map = new HashMap<>(); + DouyuApis.getGiftList(getConfig().getRoomId()) + .get("giftList") + .forEach(jsonNode -> { + try { + GiftListInfo giftListInfo = BaseMsg.OBJECT_MAPPER.readValue(jsonNode.toString(), GiftListInfo.class); + map.put(String.valueOf(giftListInfo.getId()), giftListInfo); + } catch (Exception e) { + if (log.isDebugEnabled()) { + log.debug("获取房间礼物列表异常", e); + } + // ignore + } + }); + roomGiftMap.put(String.valueOf(DouyuApis.getRealRoomId(getConfig().getRoomId())), map); + } + + @Override + public DouyuConnectionHandler initConnectionHandler(IBaseConnectionListener clientConnectionListener) { + this.connectionHandler = super.initConnectionHandler(super.clientConnectionListener); + return connectionHandler; + } + + @Override + public void onMsg(DouyuBinaryFrameHandler binaryFrameHandler, IMsg msg) { + super.onMsg(binaryFrameHandler, msg); + if (msg instanceof MsgrepeaterproxylistMsg) { + MsgrepeaterproxylistMsg msgrepeaterproxylistMsg = (MsgrepeaterproxylistMsg) msg; + List> list = msgrepeaterproxylistMsg.getList(); + if (list.isEmpty()) { + log.error("弹幕服务器列表为空"); + if (connectionListener != null) { + connectionListener.onConnectFailed(connectionHandler); + } + disconnect(); + } else { + // 初始化danmuClient + int randomIndex = RandomUtil.randomInt(0, list.size()); + Map randomMap = list.get(randomIndex); + DouyuLiveChatClientConfig danmuClientConfig = BeanUtil.toBean(getConfig(), DouyuLiveChatClientConfig.class, CopyOptions.create().ignoreNullValue()); + danmuClientConfig.setWebsocketUri(String.format("wss://%s:%s/", randomMap.get("ip"), randomMap.get("port"))); + destroyDanmuClient(); + this.danmuClient = new DouyuDanmuLiveChatClient(danmuClientConfig, new IDouyuMsgListener() { + @Override + public void onMsg(DouyuBinaryFrameHandler binaryFrameHandler, IMsg msg) { + proxyClient.iteratorMsgListeners(msgListener -> msgListener.onMsg(binaryFrameHandler, msg)); + } + + @Override + public void onDanmuMsg(DouyuBinaryFrameHandler binaryFrameHandler, ChatmsgMsg msg) { + proxyClient.iteratorMsgListeners(msgListener -> msgListener.onDanmuMsg(binaryFrameHandler, msg)); + } + + @Override + public void onGiftMsg(DouyuBinaryFrameHandler binaryFrameHandler, DgbMsg msg) { + proxyClient.iteratorMsgListeners(msgListener -> msgListener.onGiftMsg(binaryFrameHandler, msg)); + } + + @Override + public void onEnterRoomMsg(DouyuBinaryFrameHandler binaryFrameHandler, UenterMsg uenterMsg) { + proxyClient.iteratorMsgListeners(msgListener -> msgListener.onEnterRoomMsg(binaryFrameHandler, uenterMsg)); + } + + @Override + public void onCmdMsg(DouyuBinaryFrameHandler binaryFrameHandler, DouyuCmdEnum cmd, ICmdMsg cmdMsg) { + proxyClient.iteratorMsgListeners(msgListener -> msgListener.onCmdMsg(binaryFrameHandler, cmd, cmdMsg)); + } + + @Override + public void onOtherCmdMsg(DouyuBinaryFrameHandler binaryFrameHandler, DouyuCmdEnum cmd, ICmdMsg cmdMsg) { + proxyClient.iteratorMsgListeners(msgListener -> msgListener.onOtherCmdMsg(binaryFrameHandler, cmd, cmdMsg)); + } + + @Override + public void onUnknownCmd(DouyuBinaryFrameHandler binaryFrameHandler, String cmdString, IMsg msg) { + proxyClient.iteratorMsgListeners(msgListener -> msgListener.onUnknownCmd(binaryFrameHandler, cmdString, msg)); + } + + @Override + public void onCmdMsg(DouyuBinaryFrameHandler binaryFrameHandler, DouyuCmdEnum cmd, BaseCmdMsg cmdMsg) { + proxyClient.iteratorMsgListeners(msgListener -> msgListener.onCmdMsg(binaryFrameHandler, cmd, cmdMsg)); + } + + @Override + public void onOtherCmdMsg(DouyuBinaryFrameHandler binaryFrameHandler, DouyuCmdEnum cmd, BaseCmdMsg cmdMsg) { + proxyClient.iteratorMsgListeners(msgListener -> msgListener.onOtherCmdMsg(binaryFrameHandler, cmd, cmdMsg)); + } + + @Override + public void onUnknownCmd(DouyuBinaryFrameHandler binaryFrameHandler, String cmdString, BaseMsg msg) { + proxyClient.iteratorMsgListeners(msgListener -> msgListener.onUnknownCmd(binaryFrameHandler, cmdString, msg)); + } + }, new IDouyuConnectionListener() { + @Override + public void onConnected(DouyuConnectionHandler connectionHandler) { + if (connectionListener != null) { + connectionListener.onConnected(connectionHandler); + } + } + + @Override + public void onConnectFailed(DouyuConnectionHandler connectionHandler) { + if (connectionListener != null) { + connectionListener.onConnectFailed(connectionHandler); + } + } + + @Override + public void onDisconnected(DouyuConnectionHandler connectionHandler) { + if (connectionListener != null) { + connectionListener.onDisconnected(connectionHandler); + } + } + }); + this.danmuClient.addStatusChangeListener(evt -> { + ClientStatusEnums newStatus = (ClientStatusEnums) evt.getNewValue(); + switch (newStatus) { + case CONNECTED: + case RECONNECTING: + case CONNECT_FAILED: + case DISCONNECTED: + case CONNECTING: { + super.setStatus(newStatus); + break; + } + default: { + // ignore + } + } + + }); + this.danmuClient.connect(); + } + } + } + + @Override + protected void setStatus(ClientStatusEnums status) { + if (status == ClientStatusEnums.CONNECTED) { + return; + } + super.setStatus(status); + } + + @Override + public void destroy() { + destroyDanmuClient(); + super.destroy(); + } + + private void destroyDanmuClient() { + if (danmuClient != null) { + danmuClient.destroy(); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuWsLiveChatClient.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuWsLiveChatClient.java new file mode 100644 index 0000000..e6d5062 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuWsLiveChatClient.java @@ -0,0 +1,116 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.client; + +import io.netty.channel.EventLoopGroup; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.handler.codec.http.DefaultHttpHeaders; +import io.netty.handler.codec.http.websocketx.WebSocketClientHandshakerFactory; +import io.netty.handler.codec.http.websocketx.WebSocketVersion; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; +import tech.ordinaryroad.live.chat.client.douyu.api.DouyuApis; +import tech.ordinaryroad.live.chat.client.douyu.client.base.BaseDouyuLiveChatClient; +import tech.ordinaryroad.live.chat.client.douyu.config.DouyuLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuClientModeEnum; +import tech.ordinaryroad.live.chat.client.douyu.listener.IDouyuConnectionListener; +import tech.ordinaryroad.live.chat.client.douyu.listener.IDouyuMsgListener; +import tech.ordinaryroad.live.chat.client.douyu.msg.LoginresMsg; +import tech.ordinaryroad.live.chat.client.douyu.netty.handler.DouyuBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.douyu.netty.handler.DouyuConnectionHandler; + +import java.util.List; + +/** + * 直播间弹幕客户端{@link DouyuClientModeEnum#WS} + * + * @author mjz + * @date 2023/8/20 + */ +@Slf4j +public class DouyuWsLiveChatClient extends BaseDouyuLiveChatClient implements IDouyuMsgListener { + + public DouyuWsLiveChatClient(DouyuLiveChatClientConfig config, List msgListeners, IDouyuConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(DouyuClientModeEnum.WS, config, msgListeners, connectionListener, workerGroup); + addMsgListener(DouyuWsLiveChatClient.this); + } + + public DouyuWsLiveChatClient(DouyuLiveChatClientConfig config, IDouyuMsgListener msgListener, IDouyuConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(DouyuClientModeEnum.WS, config, msgListener, connectionListener, workerGroup); + addMsgListener(DouyuWsLiveChatClient.this); + } + + public DouyuWsLiveChatClient(DouyuLiveChatClientConfig config, IDouyuMsgListener msgListener, IDouyuConnectionListener connectionListener) { + this(config, msgListener, connectionListener, new NioEventLoopGroup()); + } + + public DouyuWsLiveChatClient(DouyuLiveChatClientConfig config, IDouyuMsgListener msgListener) { + this(config, msgListener, null); + } + + public DouyuWsLiveChatClient(DouyuLiveChatClientConfig config) { + this(config, null); + } + + @Override + protected String getWebSocketUriString() { + return DouyuApis.getRandomWssUri(getConfig().getRoomId()); + } + + @Override + public DouyuConnectionHandler initConnectionHandler(IBaseConnectionListener clientConnectionListener) { + return new DouyuConnectionHandler(DouyuClientModeEnum.WS, + WebSocketClientHandshakerFactory.newHandshaker(getWebsocketUri(), WebSocketVersion.V13, null, true, new DefaultHttpHeaders(), getConfig().getMaxFramePayloadLength()), + DouyuWsLiveChatClient.this, clientConnectionListener + ); + } + + @Override + public DouyuBinaryFrameHandler initBinaryFrameHandler() { + return new DouyuBinaryFrameHandler(msgListeners, DouyuWsLiveChatClient.this); + } + + @Override + public void onMsg(DouyuBinaryFrameHandler binaryFrameHandler, IMsg msg) { + if (msg instanceof LoginresMsg) { + send(getWebSocketFrameFactory(getConfig().getRoomId()).createKeeplive(getConfig().getCookie())); + } + } + + @Override + public boolean removeMsgListener(IDouyuMsgListener msgListener) { + if (msgListener == DouyuWsLiveChatClient.this) { + return false; + } + return super.removeMsgListener(msgListener); + } + + @Override + public void removeAllMsgListeners() { + super.removeAllMsgListeners(); + addMsgListener(DouyuWsLiveChatClient.this); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/base/BaseDouyuLiveChatClient.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/base/BaseDouyuLiveChatClient.java new file mode 100644 index 0000000..799eab2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/client/base/BaseDouyuLiveChatClient.java @@ -0,0 +1,139 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.client.base; + +import cn.hutool.core.collection.CollUtil; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.handler.codec.http.websocketx.WebSocketFrame; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.douyu.config.DouyuLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuClientModeEnum; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.listener.IDouyuConnectionListener; +import tech.ordinaryroad.live.chat.client.douyu.listener.IDouyuMsgListener; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.IDouyuMsg; +import tech.ordinaryroad.live.chat.client.douyu.netty.frame.factory.DouyuWebSocketFrameFactory; +import tech.ordinaryroad.live.chat.client.douyu.netty.handler.DouyuBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.douyu.netty.handler.DouyuConnectionHandler; +import tech.ordinaryroad.live.chat.client.servers.netty.client.base.BaseNettyClient; + +import java.util.List; +import java.util.function.Consumer; + +/** + * @author mjz + * @date 2023/9/15 + */ +@Slf4j +public abstract class BaseDouyuLiveChatClient extends BaseNettyClient< + DouyuLiveChatClientConfig, + DouyuCmdEnum, + IDouyuMsg, + IDouyuMsgListener, + DouyuConnectionHandler, + DouyuBinaryFrameHandler + > { + + private final DouyuClientModeEnum mode; + + public BaseDouyuLiveChatClient(DouyuClientModeEnum mode, DouyuLiveChatClientConfig config, List msgListeners, IDouyuConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(config, workerGroup, connectionListener); + this.mode = mode; + addMsgListeners(msgListeners); + + // 初始化 + this.init(); + } + + public BaseDouyuLiveChatClient(DouyuClientModeEnum mode, DouyuLiveChatClientConfig config, IDouyuMsgListener msgListener, IDouyuConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(config, workerGroup, connectionListener); + this.mode = mode; + addMsgListener(msgListener); + + // 初始化 + this.init(); + } + + public BaseDouyuLiveChatClient(DouyuClientModeEnum mode, DouyuLiveChatClientConfig config, IDouyuMsgListener msgListener, IDouyuConnectionListener connectionListener) { + this(mode, config, msgListener, connectionListener, new NioEventLoopGroup()); + } + + public BaseDouyuLiveChatClient(DouyuClientModeEnum mode, DouyuLiveChatClientConfig config, IDouyuMsgListener msgListener) { + this(mode, config, msgListener, null, new NioEventLoopGroup()); + } + + public BaseDouyuLiveChatClient(DouyuClientModeEnum mode, DouyuLiveChatClientConfig config) { + this(mode, config, CollUtil.newArrayList(), null, new NioEventLoopGroup()); + } + + @Override + public void sendDanmu(Object danmu, Runnable success, Consumer failed) { + if (!checkCanSendDanmu()) { + return; + } + if (mode == DouyuClientModeEnum.WS && danmu instanceof String) { + String msg = (String) danmu; + if (log.isDebugEnabled()) { + log.debug("{} douyu发送弹幕 {}", getConfig().getRoomId(), danmu); + } + + WebSocketFrame webSocketFrame = null; + try { + webSocketFrame = getWebSocketFrameFactory(getConfig().getRoomId()).createDanmu(msg, getConfig().getCookie()); + } catch (Exception e) { + log.error("douyu弹幕包创建失败", e); + if (failed != null) { + failed.accept(e); + } + } + if (webSocketFrame == null) { + return; + } + + send(webSocketFrame, () -> { + if (log.isDebugEnabled()) { + log.debug("douyu弹幕发送成功 {}", danmu); + } + if (success != null) { + success.run(); + } + finishSendDanmu(); + }, throwable -> { + log.error("douyu弹幕发送失败", throwable); + if (failed != null) { + failed.accept(throwable); + } + }); + } else { + super.sendDanmu(danmu); + } + } + + protected static DouyuWebSocketFrameFactory getWebSocketFrameFactory(long roomId) { + return DouyuWebSocketFrameFactory.getInstance(roomId); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/config/DouyuLiveChatClientConfig.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/config/DouyuLiveChatClientConfig.java new file mode 100644 index 0000000..685cd8d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/config/DouyuLiveChatClientConfig.java @@ -0,0 +1,69 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.config; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import tech.ordinaryroad.live.chat.client.commons.util.OrLiveChatNumberUtil; +import tech.ordinaryroad.live.chat.client.servers.netty.client.config.BaseNettyClientConfig; + +/** + * Douyu直播间弹幕客户端配置 + * + * @author mjz + * @date 2023/8/21 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@SuperBuilder(toBuilder = true) +public class DouyuLiveChatClientConfig extends BaseNettyClientConfig { + + @Builder.Default + private String ver = "20220825"; + + @Builder.Default + private String aver = "218101901"; + + @Override + public Long getRoomId() { + return OrLiveChatNumberUtil.parseLong(super.getRoomId()); + } + + public void setVer(String ver) { + String oldValue = this.ver; + this.ver = ver; + super.propertyChangeSupport.firePropertyChange("ver", oldValue, ver); + } + + public void setAver(String aver) { + String oldValue = this.aver; + this.aver = aver; + super.propertyChangeSupport.firePropertyChange("aver", oldValue, aver); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/constant/DouyuClientModeEnum.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/constant/DouyuClientModeEnum.java new file mode 100644 index 0000000..dbdc8b2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/constant/DouyuClientModeEnum.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.constant; + +/** + * @author mjz + * @date 2023/9/15 + */ +public enum DouyuClientModeEnum { + /** + * 发送弹幕,获取可用的Danmu服务器链接 + */ + WS, + /** + * 接收直播间弹幕 + */ + DANMU, +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/constant/DouyuCmdEnum.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/constant/DouyuCmdEnum.java new file mode 100644 index 0000000..9078fcd --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/constant/DouyuCmdEnum.java @@ -0,0 +1,199 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.constant; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import tech.ordinaryroad.live.chat.client.douyu.msg.*; + +/** + * 文档 + * + * @author mjz + * @date 2023/1/6 + */ +@Getter +@AllArgsConstructor +@RequiredArgsConstructor +public enum DouyuCmdEnum { + /** + * 登录请求消息 + *
{@code
+     * type@=loginreq/roomid@=7750753/dfl@=/username@=visitor10424697/uid@=1168052601/ver@=20220825/aver@=218101901/ct@=0/
+     * type@=loginreq/roomid@=58839/aid@=yihanTest/token@=4c8421535f9639d8c1ad35d1fa421f36/time@=1574850339/auth@=45619bb990e6b76db06a66d5a8a446d7/
+     * }
+ */ + loginreq(LoginreqMsg.class), + /** + * 登录响应消息 + *
{@code
+     * type@=loginres/userid@=1168052601/roomgroup@=0/pg@=0/sessionid@=0/username@=/nickname@=/live_stat@=0/is_illegal@=0/ill_ct@=/ill_ts@=0/now@=0/ps@=0/es@=0/it@=0/its@=0/npv@=0/best_dlev@=0/cur_lev@=0/nrc@=964715377/ih@=0/sid@=76494/sahf@=0/sceneid@=0/newrg@=0/regts@=0/ip@=112.43.93.229/rn@=0/rct@=0/
+     * type@=loginresp/msg@=ok/rid@=77614265/
+     * }
+ */ + loginres(LoginresMsg.class), + /** + * 入组 + * type@=joingroup/rid@=59872/aid@=yourapplicaitonID/token@=4c8421535f9639d8c1ad35d1fa421f36/time@=1574850339/auth@=xxxxxxxxxxxx/ + * Auth 生成方式为 md5({secret}_{aid}_{time}_{token}), secret为aid对应的秘钥 + */ + joingroup(JoingroupMsg.class), + /** + * 客户端旧版心跳、心跳回复 + *
{@code
+     * type@=keeplive/tick@=1439802131/
+     * }
+ */ + keeplive(KeepliveMsg.class), + /** + * 客户端新版心跳、心跳回复 + *
{@code
+     * type@=mrkl/
+     * }
+ */ + mrkl, + /** + * 订阅贵族排行变动 + * type@=sub/mt@=online_vip_list/ + */ + sub(SubMsg.class), + subres, + noble_num_info, + oni, + postLogin, + /** + * 弹幕 + * type@=chatmsg/rid@=7750753/uid@=549977/nn@=一闪一闪亮品品/txt@=冷门歌手哎,声音独特哎/cid@=044c3bf3074b483275a44e0000000000/ic@=avatar@Sdefault@S08/level@=29/sahf@=0/nl@=7/cst@=1693107871294/bnn@=/bl@=0/brid@=0/hc@=/lk@=/dms@=8/pdg@=26/pdk@=86/ext@=/ + * type@=chatmsg/rid@=58839/ct@=8/hashid@=9LA18ePx4dqW/nn@=test/txt@=666/cid@=1111/ic@=icon/sahf@=0/level@=1/nl@=0/nc@=0/cmt@=0/gt@=0/col@=0/rg@=0/pg@=0/dlv@=0/dc@=0/bdlv@=0/gatin@=0/ chtin@=0/repin@=0/bnn@=test/bl@=0/brid@=58839/hc@=0/ol@=0/rev@=0/hl@=0/ifs@=0/p2p@=0/el@=eid@AA=1@ASetp@AA=1@ASsc@AA=1@AS/ + */ + chatmsg(ChatmsgMsg.class), + pingreq, + /** + * 登出 + * type@=logout/ + */ + logout, + /** + * 登录响应 + * type@=loginresp/msg@=ok/rid@=77614265/ + */ + loginresp, + /** + * 礼物 + * type@=dgb/gfid@=1/gs@=59872/gfcnt@=1/hashid@=1/rid@=1/nn@=someone/level@=1/dw@=1/ + */ + dgb(DgbMsg.class), + /** + * 用户进房通知消息 + * type@=uenter/rid@=1/ uid@=1/nn@=someone/str@=1/level@=1/el@=eid@AA=1@ASetp@AA=1@ASsc@AA=1@AS@S/ + */ + uenter(UenterMsg.class), + /** + * 房间开关播提醒 + * type@=rss/rid@=1/ss@=1/code@=1/rt@=0/notify@=1/endtime@=1/ + */ + rss, + /** + * 超级弹幕消息 + * type@=ssd/rid@=1/trid@=1/content@=test/cli tp@=1/url@=test_url/jmptp@=1/ + */ + ssd, + /** + * 房间内礼物广播 + * type@=spbc/rid@=1/gfid@=1/sn@=name/dn@=name/gn@=1/gc@=1/gb@=1/es@=1/ eid@=1/ + */ + spbc, + /** + * 房间宝箱消息 + * type@=tsgs/rid@=1/gid@=1/gfid@=1/sn@=name/dn@=name/gn@=1/gc@=1/gb@=1/es@=1/gfid@=1/eid@=1/ + */ + tsgs, + /** + * 房间内 top10 变化消息 + * type@=rankup/uid@=1/rn@=3/rid@=1/rkt@=1/gid@=-9999/rt@=0/ nk@=test/sz@=3/drid@=1/bt@=1/ + */ + rankup, + /** + * 主播离开提醒 + * type@=al/rid@=10111/aid@=3044114/ + */ + al, + /** + * 主播回来继续直播提醒 + * type@=ab/rid@=10111/gid@=-9999/aid@=3044114/ + */ + ab, + /** + * 用户等级提升消息 + * type@=upgrade/rid@=1/gid@=-9999/uid@=12001/nn@=test/level@=3/ic@=icon/ + */ + upgrade, + /** + * 主播等级提升广播 + * type@=upbc/rid@=1/gid@=-9999/lev@=20/pu@=0/ + */ + upbc, + /** + * 禁言操作结果 + * type@=newblackres/rid@=1/gid@=-9999/ret@=0/otype@=2/sid@=10002/did@=10003/snic@=stest/dnic@=dtest/endtime@=1501920157/ + */ + newblackres, + /** + * 徽章等级提升通知 + * type@=blab/rid@=1/gid@=-9999/uid@=10002/nn@=test/lbl@=2/bl@=3/ba@=1/bnn@=ttt/ + */ + blab, + /** + * 用户分享了直播间通知 + * type@=srres/rid@=1/gid@=-9999/uid@=12001/nickname@=test/exp@=3/ + */ + srres, + /** + * 栏目排行榜变更通知 + * type@=rri/rid@=1/rn@=cate_rank/cate_id@=5/uid@=10005/sc@=100 00/idx@=10/bcr@=1/ibc@=1/an@=test/rktype@=1/tag_id@=1200/gif t_id@=100/ + */ + rri, + mapkb(MapkbMsg.class), + /** + * 发送弹幕 + */ + chatmessage(ChatmessageMsg.class), + h5ckreq(H5ckreqMsg.class), + h5gkcreq(H5gkcreqMsg.class), + h5cs(H5csMsg.class), + msgrepeaterproxylist(MsgrepeaterproxylistMsg.class), + ; + + private Class tClass; + + public static DouyuCmdEnum getByString(String cmd) { + try { + return DouyuCmdEnum.valueOf(cmd); + } catch (Exception e) { + return null; + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/listener/IDouyuConnectionListener.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/listener/IDouyuConnectionListener.java new file mode 100644 index 0000000..cc3d33d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/listener/IDouyuConnectionListener.java @@ -0,0 +1,38 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.listener; + + +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.douyu.netty.handler.DouyuConnectionHandler; + +/** + * 连接回调 + * + * @author mjz + * @date 2023/8/21 + */ +public interface IDouyuConnectionListener extends IBaseConnectionListener { +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/listener/IDouyuMsgListener.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/listener/IDouyuMsgListener.java new file mode 100644 index 0000000..782c884 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/listener/IDouyuMsgListener.java @@ -0,0 +1,45 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.listener; + +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseMsgListener; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IDanmuMsgListener; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IEnterRoomMsgListener; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IGiftMsgListener; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.ChatmsgMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.DgbMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.UenterMsg; +import tech.ordinaryroad.live.chat.client.douyu.netty.handler.DouyuBinaryFrameHandler; + +/** + * @author mjz + * @date 2023/1/7 + */ +public interface IDouyuMsgListener extends IBaseMsgListener, + IDanmuMsgListener, + IGiftMsgListener, + IEnterRoomMsgListener { +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/ChatmessageMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/ChatmessageMsg.java new file mode 100644 index 0000000..1e801ce --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/ChatmessageMsg.java @@ -0,0 +1,86 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import cn.hutool.core.util.RandomUtil; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.util.OrLocalDateTimeUtil; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +/** + * @author mjz + * @date 2023/9/7 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class ChatmessageMsg extends BaseDouyuCmdMsg { + + private String pe = "0"; + /** + * 弹幕内容 + */ + private String content; + private String col = "0"; + /** + * Cookie中的dy_did + */ + private String dy; + /** + * Cookie中的acf_uid + */ + private String sender; + private String ifs = "0"; + private String nc = "0"; + private String dat = "0"; + private String rev = "0"; + /** + * 当前时间戳(秒) + */ + private String tts; + private String admzq = "0"; + /** + * tts往后加几秒的时间戳(毫秒) + */ + private String cst; + + public ChatmessageMsg(String content, String dy, String sender) { + this.content = content; + this.dy = dy; + this.sender = sender; + this.tts = String.valueOf(OrLocalDateTimeUtil.zonedCurrentTimeSecs()); + this.cst = String.valueOf(OrLocalDateTimeUtil.zonedCurrentTimeMillis() + RandomUtil.randomLong(8000, 10000)); + } + + @Override + public String getType() { + return DouyuCmdEnum.chatmessage.name(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/ChatmsgMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/ChatmsgMsg.java new file mode 100644 index 0000000..052954e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/ChatmsgMsg.java @@ -0,0 +1,125 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import com.fasterxml.jackson.databind.JsonNode; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IDanmuMsg; +import tech.ordinaryroad.live.chat.client.douyu.api.DouyuApis; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +import java.util.List; + +/** + *
{@code
+ * {
+ * 	"type": "chatmsg",
+ * 	"cmdEnum": "chatmsg",
+ * 	"cmd": "chatmsg",
+ * 	"nn": "宋老二929",
+ * 	"ext": null,
+ * 	"bnn": null,
+ * 	"level": "1",
+ * 	"cst": "1693213418102",
+ * 	"brid": "0",
+ * 	"bl": "0",
+ * 	"dms": "5",
+ * 	"rid": "3168536",
+ * 	"uid": "396023456",
+ * 	"txt": "666",
+ * 	"pdg": "47",
+ * 	"pdk": "89",
+ * 	"sahf": "0",
+ * 	"ic": ["avatar_v3", "202101", "45daf5ceb475414293e3da4559552655"],
+ * 	"hb": ["2719"],
+ * 	"hc": null,
+ * 	"cid": "0b37e26cccd54f7c4d73590000000000",
+ * 	"lk": null
+ * }
+ * }
+ * + * @author mjz + * @date 2023/8/28 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class ChatmsgMsg extends BaseDouyuCmdMsg implements IDanmuMsg { + + private String nn; + private String ext; + private String bnn; + private String level; + private String cst; + private String brid; + private byte bl; + private String dms; + private long rid; + private String uid; + private String txt; + private String pdg; + private String pdk; + private String sahf; + private List ic; + private List hb; + private String hc; + private String cid; + private JsonNode lk; + + @Override + public String getType() { + return DouyuCmdEnum.chatmsg.name(); + } + + @Override + public String getBadgeName() { + return this.bnn; + } + + @Override + public byte getBadgeLevel() { + return this.bl; + } + + @Override + public String getUsername() { + return this.nn; + } + + @Override + public String getUserAvatar() { + return DouyuApis.getSmallAvatarUrl(ic); + } + + @Override + public String getContent() { + return this.txt; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/DgbMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/DgbMsg.java new file mode 100644 index 0000000..a8c5416 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/DgbMsg.java @@ -0,0 +1,233 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IGiftMsg; +import tech.ordinaryroad.live.chat.client.douyu.api.DouyuApis; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.dto.GiftListInfo; +import tech.ordinaryroad.live.chat.client.douyu.msg.dto.GiftPropSingle; + +import java.util.List; + +/** + * 收到礼物消息 + *
{@code
+ * {
+ * 	"type": "dgb",
+ * 	"nn": "用户名",
+ * 	"eid": "0",
+ * 	"bst": "32",
+ * 	"brid": "0",
+ * 	"pma": "186963537",
+ * 	"bnid": "1",
+ * 	"gfid": "824",
+ * 	"bl": "0",
+ * 	"pid": "268",
+ * 	"rid": "290935",
+ * 	"mss": "186963457",
+ * 	"bcst": "2",
+ * 	"uid": "用户id",
+ * 	"receive_uid": "接受用户id",
+ * 	"ic": ["avatar_v3", "201912", "d031765fbe764a49887083bcf200da0b"],
+ * 	"from": "2",
+ * 	"gpf": "1",
+ * 	"bnl": "1",
+ * 	"ce": "1",
+ * 	"bnn": null,
+ * 	"receive_nn": "接受用户用户名",
+ * 	"level": "43",
+ * 	"bcnt": "1",
+ * 	"gs": "0",
+ * 	"hits": "249",
+ * 	"gfcnt": "249",
+ * 	"ct": "0",
+ * 	"pfm": "27585",
+ * 	"sahf": "0",
+ * 	"hc": null,
+ * 	"fc": "0",
+ * 	"eic": "0"
+ * }
+ * }
+ * + * @author mjz + * @date 2023/9/8 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class DgbMsg extends BaseDouyuCmdMsg implements IGiftMsg { + + /** + * 用户名 + */ + private String nn; + private String eid; + private String bst; + private String brid; + private String pma; + private String bnid; + private long gfid; + private byte bl; + private String pid; + private String rid; + private String mss; + private String bcst; + /** + * 用户id + */ + private String uid; + /** + * 收礼物用户id + */ + private long receive_uid; + private List ic; + private String from; + private String gpf; + private String bnl; + private String ce; + private String bnn; + /** + * 收礼物用户名 + */ + private String receive_nn; + private String level; + private String bcnt; + private String gs; + /** + * 连击 + */ + private String hits; + /** + * 礼物个数 + */ + private int gfcnt; + private String ct; + private String pfm; + private String sahf; + private String hc; + private String fc; + private String eic; + private String bsfl; + private String skinid; + + // region 额外属性 + private GiftPropSingle giftInfo = GiftPropSingle.DEFAULT_GIFT; + private GiftListInfo roomGiftInfo = GiftListInfo.DEFAULT_GIFT; + // endregion + + @Override + public String getType() { + return DouyuCmdEnum.dgb.name(); + } + + @Override + public String getBadgeName() { + return this.bnn; + } + + @Override + public byte getBadgeLevel() { + return this.bl; + } + + @Override + public String getUsername() { + return this.nn; + } + + @Override + public String getUserAvatar() { + return DouyuApis.getSmallAvatarUrl(ic); + } + + @Override + public String getGiftName() { + if (this.roomGiftInfo != null && this.roomGiftInfo != GiftListInfo.DEFAULT_GIFT) { + return this.roomGiftInfo.getName(); + } + + if (this.giftInfo == null) { + return "未知礼物"; + } + + return this.giftInfo.getName(); + } + + @Override + public String getGiftImg() { + if (this.roomGiftInfo != null && this.roomGiftInfo != GiftListInfo.DEFAULT_GIFT && this.roomGiftInfo.getBasicInfo() != null) { + return this.roomGiftInfo.getPicUrlPrefix() + this.roomGiftInfo.getBasicInfo().getChatPic(); + } + + if (this.giftInfo == null) { + return ""; + } + + return this.giftInfo.getPicUrlPrefix() + this.giftInfo.getChatPic(); + } + + @Override + public String getGiftId() { + return Long.toString(this.gfid); + } + + @Override + public int getGiftCount() { + return this.gfcnt; + } + + /** + * 100 => 1鱼翅 + */ + @Override + public int getGiftPrice() { + if (this.roomGiftInfo != null && this.roomGiftInfo != GiftListInfo.DEFAULT_GIFT && this.roomGiftInfo.getPriceInfo() != null) { + return this.roomGiftInfo.getPriceInfo().getPrice(); + } + + if (this.giftInfo == null) { + return -1; + } + + return this.giftInfo.getPrice(); + } + + @Override + public String getReceiveUid() { + return Long.toString(this.receive_uid); + } + + @Override + public String getReceiveUsername() { + return this.receive_nn; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/DouyuCmdMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/DouyuCmdMsg.java new file mode 100644 index 0000000..dcef880 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/DouyuCmdMsg.java @@ -0,0 +1,51 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +/** + * type@=chatmsg/rid@=7750753/uid@=549977/nn@=一闪一闪亮品品/txt@=冷门歌手哎,声音独特哎/cid@=044c3bf3074b483275a44e0000000000/ic@=avatar@Sdefault@S08/level@=29/sahf@=0/nl@=7/cst@=1693107871294/bnn@=/bl@=0/brid@=0/hc@=/lk@=/dms@=8/pdg@=26/pdk@=86/ext@=/ + * + * @see tech.ordinaryroad.live.chat.client.douyu.util.DouyuCodecUtil#getDouyuMsgClassByType(DouyuCmdEnum, short) + * @author mjz + * @date 2023/1/6 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class DouyuCmdMsg extends BaseDouyuCmdMsg { + + private String tick; + + private String res; + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/H5ckreqMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/H5ckreqMsg.java new file mode 100644 index 0000000..3736591 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/H5ckreqMsg.java @@ -0,0 +1,51 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +/** + * @author mjz + * @date 2023/9/8 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class H5ckreqMsg extends BaseDouyuCmdMsg { + + private String rid; + private String ti; + + @Override + public String getType() { + return DouyuCmdEnum.h5ckreq.name(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/H5csMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/H5csMsg.java new file mode 100644 index 0000000..29b0957 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/H5csMsg.java @@ -0,0 +1,50 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +/** + * @author mjz + * @date 2023/9/8 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class H5csMsg extends BaseDouyuCmdMsg { + + private String result; + + @Override + public String getType() { + return DouyuCmdEnum.h5cs.name(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/H5gkcreqMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/H5gkcreqMsg.java new file mode 100644 index 0000000..7e5a8b9 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/H5gkcreqMsg.java @@ -0,0 +1,51 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +/** + * @author mjz + * @date 2023/9/8 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class H5gkcreqMsg extends BaseDouyuCmdMsg { + + private String rid; + private String ti; + + @Override + public String getType() { + return DouyuCmdEnum.h5gkcreq.name(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/HeartbeatMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/HeartbeatMsg.java new file mode 100644 index 0000000..934e953 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/HeartbeatMsg.java @@ -0,0 +1,45 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +/** + * @author mjz + * @date 2023/1/6 + */ +public class HeartbeatMsg extends BaseDouyuCmdMsg { + + @Override + public String getType() { + return DouyuCmdEnum.mrkl.name(); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/HeartbeatReplyMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/HeartbeatReplyMsg.java new file mode 100644 index 0000000..37eaa90 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/HeartbeatReplyMsg.java @@ -0,0 +1,45 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +/** + * @author mjz + * @date 2023/1/6 + */ +public class HeartbeatReplyMsg extends BaseDouyuCmdMsg { + + @Override + public String getType() { + return DouyuCmdEnum.mrkl.name(); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/JoingroupMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/JoingroupMsg.java new file mode 100644 index 0000000..9d2694f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/JoingroupMsg.java @@ -0,0 +1,52 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +/** + * @author mjz + * @date 2023/8/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class JoingroupMsg extends BaseDouyuCmdMsg { + + private long rid; + private long gid = -9999; + + @Override + public String getType() { + return DouyuCmdEnum.joingroup.name(); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/KeepliveMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/KeepliveMsg.java new file mode 100644 index 0000000..e7a0ff3 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/KeepliveMsg.java @@ -0,0 +1,62 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.util.OrLocalDateTimeUtil; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +/** + *
{@code
+ * type@=keeplive/vbw@=0/cdn@=hs-h5/tick@=1694099389/kd@=da9c384371b4552ac94e1237d2596262/
+ * }
+ * + * @author mjz + * @date 2023/9/7 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class KeepliveMsg extends BaseDouyuCmdMsg { + + private String vbw = "0"; + private String cnd; + private long tick = OrLocalDateTimeUtil.zonedCurrentTimeSecs(); + private String kd = ""; + + public KeepliveMsg(String cnd) { + this.cnd = cnd; + } + + @Override + public String getType() { + return DouyuCmdEnum.keeplive.name(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/LoginreqMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/LoginreqMsg.java new file mode 100644 index 0000000..f180e8c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/LoginreqMsg.java @@ -0,0 +1,107 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.util.OrLocalDateTimeUtil; +import tech.ordinaryroad.live.chat.client.douyu.api.DouyuApis; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +import java.util.Arrays; +import java.util.List; + +/** + * @author mjz + * @date 2023/8/27 + */ +@Getter +@Setter +@RequiredArgsConstructor +public class LoginreqMsg extends BaseDouyuCmdMsg { + + public static List SHOULD_IGNORE_NEW_LOGIN_PROPERTIES = Arrays.asList("roomid", "dfl", "username", "uid", "ver", "aver", "ct", "type"); + public static List SHOULD_IGNORE_OLD_LOGIN_PROPERTIES = Arrays.asList("type", "roomid", "dfl", "username", "password", "ltkid", "biz", "stk", "devid", "ct", "pt", "cvr", "tvr", "apd", "rt", "vk", "ver", "aver", "dmbt", "dmbv"); + + private long roomid; + private String dfl; + private String username; + private long uid; + private String ver; + private String aver; + private int ct = 0; + + private String password; + /** + * Cookie中的acf_ltkid + */ + private String ltkid; + private String biz; + /** + * Cookie中的acf_stk + */ + private String stk; + /** + * Cookie中的dy_did + */ + private String devid; + private String pt = "2"; + private String cvr = "0"; + private String tvr = "7"; + private String apd = ""; + private long rt = OrLocalDateTimeUtil.zonedCurrentTimeSecs(); + private String vk; + private String dmbt = "chrome"; + private String dmbv = "116"; + + public LoginreqMsg(long roomid, String dfl, String username, long uid, String ver, String aver) { + this.roomid = roomid; + this.dfl = dfl; + this.username = username; + this.uid = uid; + this.ver = ver; + this.aver = aver; + } + + public LoginreqMsg(long roomid, String dfl, String username, String ver, String aver, String ltkid, String biz, String stk, String devid) { + this.roomid = roomid; + this.dfl = dfl; + this.username = username; + this.ver = ver; + this.aver = aver; + this.ltkid = ltkid; + this.biz = biz; + this.stk = stk; + this.devid = devid; + this.vk = DouyuApis.generateVk(devid); + } + + @Override + public String getType() { + return DouyuCmdEnum.loginreq.name(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/LoginresMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/LoginresMsg.java new file mode 100644 index 0000000..8db0f3c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/LoginresMsg.java @@ -0,0 +1,77 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +/** + * @author mjz + * @date 2023/8/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class LoginresMsg extends BaseDouyuCmdMsg { + + private long userid; + private int roomgroup; + private int pg; + private long sessionid; + private String username; + private String nickname; + private int live_stat; + private boolean is_illegal; + private String ill_ct; + private String ill_ts; + private String now; + private String ps; + private String es; + private String it; + private String its; + private String npv; + private String best_dlev; + private String cur_lev; + private String nrc; + private String ih; + private String sid; + private String sahf; + private String sceneid; + private String newrg; + private String regts; + private String ip; + private String rn; + private String rct; + + @Override + public String getType() { + return DouyuCmdEnum.loginres.name(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/MapkbMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/MapkbMsg.java new file mode 100644 index 0000000..e81b764 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/MapkbMsg.java @@ -0,0 +1,53 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +import java.util.List; + +/** + * @author mjz + * @date 2023/8/28 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class MapkbMsg extends BaseDouyuCmdMsg { + + private long pk_time; + private List teams; + + @Override + public String getType() { + return DouyuCmdEnum.mapkb.name(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/MsgrepeaterproxylistMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/MsgrepeaterproxylistMsg.java new file mode 100644 index 0000000..0bfdb5f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/MsgrepeaterproxylistMsg.java @@ -0,0 +1,96 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +import java.util.List; +import java.util.Map; + +/** + * @author mjz + * @date 2023/9/8 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class MsgrepeaterproxylistMsg extends BaseDouyuCmdMsg { + + private String rid; + + /** + *
{@code
+     * [{
+     * 	"nr": "0",
+     * 	"port": "8501",
+     * 	"ip": "danmuproxy.douyu.com",
+     * 	"id": "0",
+     * 	"ml": "10000"
+     * }, {
+     * 	"nr": "0",
+     * 	"port": "8502",
+     * 	"ip": "danmuproxy.douyu.com",
+     * 	"id": "0",
+     * 	"ml": "10000"
+     * }, {
+     * 	"nr": "0",
+     * 	"port": "8503",
+     * 	"ip": "danmuproxy.douyu.com",
+     * 	"id": "0",
+     * 	"ml": "10000"
+     * }, {
+     * 	"nr": "0",
+     * 	"port": "8504",
+     * 	"ip": "danmuproxy.douyu.com",
+     * 	"id": "0",
+     * 	"ml": "10000"
+     * }, {
+     * 	"nr": "0",
+     * 	"port": "8505",
+     * 	"ip": "danmuproxy.douyu.com",
+     * 	"id": "0",
+     * 	"ml": "10000"
+     * }, {
+     * 	"nr": "0",
+     * 	"port": "8506",
+     * 	"ip": "danmuproxy.douyu.com",
+     * 	"id": "0",
+     * 	"ml": "10000"
+     * }]
+     * }
+ */ + private List> list; + + @Override + public String getType() { + return DouyuCmdEnum.msgrepeaterproxylist.name(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/SubMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/SubMsg.java new file mode 100644 index 0000000..c642c28 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/SubMsg.java @@ -0,0 +1,51 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +/** + * @author mjz + * @date 2023/8/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class SubMsg extends BaseDouyuCmdMsg { + + private String mt = "dayrk"; + + @Override + public String getType() { + return DouyuCmdEnum.sub.name(); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/UenterMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/UenterMsg.java new file mode 100644 index 0000000..91b6b2e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/UenterMsg.java @@ -0,0 +1,78 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IEnterRoomMsg; +import tech.ordinaryroad.live.chat.client.douyu.api.DouyuApis; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; + +import java.util.List; + +/** + * @author mjz + * @date 2023/12/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class UenterMsg extends BaseDouyuCmdMsg implements IEnterRoomMsg { + + private String nn; + private long uid; + private int level; + private String sahf; + private List ic; + private String rid; + + @Override + public String getBadgeName() { + return null; + } + + @Override + public byte getBadgeLevel() { + return 0; + } + + @Override + public String getUid() { + return Long.toString(uid); + } + + @Override + public String getUsername() { + return nn; + } + + @Override + public String getUserAvatar() { + return DouyuApis.getSmallAvatarUrl(ic); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/base/BaseDouyuCmdMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/base/BaseDouyuCmdMsg.java new file mode 100644 index 0000000..90e7478 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/base/BaseDouyuCmdMsg.java @@ -0,0 +1,62 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg.base; + + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseCmdMsg; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; + +/** + * @author mjz + * @date 2023/1/6 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public abstract class BaseDouyuCmdMsg extends BaseCmdMsg implements IDouyuMsg { + + private String type; + + @Override + public String getCmd() { + return type; + } + + @Override + public void setCmd(String cmd) { + type = cmd; + } + + @Override + public DouyuCmdEnum getCmdEnum() { + return DouyuCmdEnum.getByString(type); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/base/IDouyuMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/base/IDouyuMsg.java new file mode 100644 index 0000000..dac7d08 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/base/IDouyuMsg.java @@ -0,0 +1,36 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.msg.base; + +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; + +/** + * @author mjz + * @date 2023/8/26 + */ +public interface IDouyuMsg extends IMsg { + + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/dto/GiftListInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/dto/GiftListInfo.java new file mode 100644 index 0000000..03f2ee3 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/dto/GiftListInfo.java @@ -0,0 +1,136 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package tech.ordinaryroad.live.chat.client.douyu.msg.dto; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class GiftListInfo { + + public static final GiftListInfo DEFAULT_GIFT = new GiftListInfo(); + + private BasicInfo basicInfo; + private JsonNode batchInfo; + private int batchInfoFlag; + private int countLimit; + private int defaultSkinId; + private int donateStatus; + private JsonNode effectInfo; + private int effectStatus; + private int endTime; + private JsonNode growthInfo; + private long hitInterval; + private int id; + private int isBatchLimited; + private int isFace; + private String name = "未知礼物"; + private String picUrlPrefix; + private PriceInfo priceInfo = new PriceInfo(); + private int showStatus; + private List skinIds; + private int startTime; + private List tabIds; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + + @Data + public static class BasicInfo { + private String bizTag; + private String borderColor; + private String chatPic; + private String culture; + private String desc1; + private String desc2; + private String focusPic; + private String giftPic; + private int giftType; + private int guardLevel; + private String sendPic; + private String subscriptColor; + private String subscriptText; + private String webSubscriptBigPic; + private String webSubscriptSmallPic; + private String webSubscriptText; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } + + @Data + public static class PriceInfo { + private int price = -1; + private String priceType; + private int returnNum; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/dto/GiftPropInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/dto/GiftPropInfo.java new file mode 100644 index 0000000..64e3e28 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/dto/GiftPropInfo.java @@ -0,0 +1,99 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package tech.ordinaryroad.live.chat.client.douyu.msg.dto; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class GiftPropInfo { + + public static final GiftPropInfo DEFAULT_GIFT = new GiftPropInfo(); + + private String name = "未知礼物"; + private String bimg; + private String himg; + private String cimg; + private int stay_time; + private int show_combo; + private String batch_preset; + private List hit; + private int type; + private int style; + private int pc; + private int ry; + private int ef; + private int effect; + private int is_syn_fs; + private int is_stay; + private String drgb; + private String urgb; + private String grgb; + private String brgb; + private String small_effect_icon; + private String big_effect_icon; + private String effect_icon; + private String gift_icon; + private String gift_open_icon; + private int bonus; + private String web_flash; + private String hit_interval; + private int devote; + private int attack; + private int exp; + private int active_type; + private String pc_full_icon; + private String pc_full_bg_icon; + private int pc_show_combo; + private String pc_urgb; + private String pc_grgb; + private int index; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/dto/GiftPropSingle.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/dto/GiftPropSingle.java new file mode 100644 index 0000000..de9ebe6 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/msg/dto/GiftPropSingle.java @@ -0,0 +1,97 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package tech.ordinaryroad.live.chat.client.douyu.msg.dto; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.HashMap; +import java.util.Map; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class GiftPropSingle { + + public static final GiftPropSingle DEFAULT_GIFT = new GiftPropSingle(); + + // key,value + private JsonNode batchInfo; + private String bizTag; + private String borderColor; + private String chatPic; + private int count; + private String description; + private String description2; + private int devote; + // key,value + private JsonNode effectInfo; + private int exp; + private int expiry; + private String focusPic; + private int hitInterval; + private long id; + private int intimate; + private String intro; + private int isClick; + private int isFace; + private int isValuable; + private int level; + private int levelTime; + private int met; + private String name = "未知礼物"; + private String picUrlPrefix; + private int price = -1; + private int priceType; + private String propPic; + private int propType; + private int returnNum; + private String sendPic; + private String subscriptColor; + private String subscriptText; + private String webSubscriptBigPic; + private String webSubscriptSmallPic; + private String webSubscriptText; + + /** + * 未知属性都放在这 + */ + private final Map unknownProperties = new HashMap<>(); + + @JsonAnyGetter + public Map getUnknownProperties() { + return unknownProperties; + } + + @JsonAnySetter + public void setOther(String key, JsonNode value) { + this.unknownProperties.put(key, value); + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/AuthWebSocketFrame.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/AuthWebSocketFrame.java new file mode 100644 index 0000000..6293b94 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/AuthWebSocketFrame.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.netty.frame; + +import io.netty.buffer.ByteBuf; +import tech.ordinaryroad.live.chat.client.douyu.netty.frame.base.BaseDouyuWebSocketFrame; + +/** + * @author mjz + * @date 2023/1/5 + */ +public class AuthWebSocketFrame extends BaseDouyuWebSocketFrame { + + public AuthWebSocketFrame(ByteBuf byteBuf) { + super(byteBuf); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/HeartbeatWebSocketFrame.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/HeartbeatWebSocketFrame.java new file mode 100644 index 0000000..1dd882e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/HeartbeatWebSocketFrame.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.netty.frame; + +import io.netty.buffer.ByteBuf; +import tech.ordinaryroad.live.chat.client.douyu.netty.frame.base.BaseDouyuWebSocketFrame; + +/** + * @author mjz + * @date 2023/1/5 + */ +public class HeartbeatWebSocketFrame extends BaseDouyuWebSocketFrame { + + public HeartbeatWebSocketFrame(ByteBuf byteBuf) { + super(byteBuf); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/KeepliveWebSocketFrame.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/KeepliveWebSocketFrame.java new file mode 100644 index 0000000..43e88af --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/KeepliveWebSocketFrame.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.netty.frame; + +import io.netty.buffer.ByteBuf; +import tech.ordinaryroad.live.chat.client.douyu.netty.frame.base.BaseDouyuWebSocketFrame; + +/** + * @author mjz + * @date 2023/9/8 + */ +public class KeepliveWebSocketFrame extends BaseDouyuWebSocketFrame { + + public KeepliveWebSocketFrame(ByteBuf byteBuf) { + super(byteBuf); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/base/BaseDouyuWebSocketFrame.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/base/BaseDouyuWebSocketFrame.java new file mode 100644 index 0000000..da484fe --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/base/BaseDouyuWebSocketFrame.java @@ -0,0 +1,39 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.netty.frame.base; + +import io.netty.buffer.ByteBuf; +import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame; + +/** + * @author mjz + * @date 2023/8/27 + */ +public abstract class BaseDouyuWebSocketFrame extends BinaryWebSocketFrame { + + public BaseDouyuWebSocketFrame(ByteBuf byteBuf) { + super(byteBuf); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/factory/DouyuWebSocketFrameFactory.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/factory/DouyuWebSocketFrameFactory.java new file mode 100644 index 0000000..64bf90b --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/frame/factory/DouyuWebSocketFrameFactory.java @@ -0,0 +1,181 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.netty.frame.factory; + +import cn.hutool.core.lang.UUID; +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.StrUtil; +import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame; +import io.netty.handler.codec.http.websocketx.WebSocketFrame; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.util.OrLiveChatCookieUtil; +import tech.ordinaryroad.live.chat.client.douyu.api.DouyuApis; +import tech.ordinaryroad.live.chat.client.douyu.config.DouyuLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuClientModeEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.*; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; +import tech.ordinaryroad.live.chat.client.douyu.netty.frame.AuthWebSocketFrame; +import tech.ordinaryroad.live.chat.client.douyu.netty.frame.HeartbeatWebSocketFrame; +import tech.ordinaryroad.live.chat.client.douyu.netty.frame.KeepliveWebSocketFrame; +import tech.ordinaryroad.live.chat.client.douyu.util.DouyuCodecUtil; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author mjz + * @date 2023/1/5 + */ +public class DouyuWebSocketFrameFactory { + + private static final ConcurrentHashMap CACHE = new ConcurrentHashMap<>(); + /** + * 浏览器地址中的房间id,暂不支持短id + */ + private final long roomId; + private volatile static HeartbeatMsg heartbeatMsg; + + public DouyuWebSocketFrameFactory(long roomId) { + this.roomId = roomId; + } + + public synchronized static DouyuWebSocketFrameFactory getInstance(long roomId) { + return CACHE.computeIfAbsent(roomId, aLong -> new DouyuWebSocketFrameFactory(roomId)); + } + + /** + * 创建认证包 + * + * @param mode {@link DouyuClientModeEnum#DANMU}, {@link DouyuClientModeEnum#WS} + * @param ver {@link DouyuLiveChatClientConfig#getVer()} + * @param aver {@link DouyuLiveChatClientConfig#getAver()} + * @param cookie 浏览器Cookie,发送弹幕时必传 + * @return AuthWebSocketFrame + */ + public AuthWebSocketFrame createAuth(DouyuClientModeEnum mode, String ver, String aver, String cookie) { + try { + // type@=loginreq/roomid@=7750753/dfl@=/username@=visitor10424697/uid@=1168052601/ver@=20220825/aver@=218101901/ct@=0/ + LoginreqMsg loginreqMsg; + long realRoomId = DouyuApis.getRealRoomId(roomId); + long uid; + String username; + Map cookieMap = OrLiveChatCookieUtil.parseCookieString(cookie); + + if (cookieMap.isEmpty()) { + // 视为未登录 + if (mode == DouyuClientModeEnum.DANMU) { + uid = RandomUtil.randomLong(10000000, 19999999); + username = "visitor" + RandomUtil.randomLong(10000000, 19999999); + loginreqMsg = new LoginreqMsg(realRoomId, "", username, uid, ver, aver); + return new AuthWebSocketFrame(DouyuCodecUtil.encode(loginreqMsg, LoginreqMsg.SHOULD_IGNORE_NEW_LOGIN_PROPERTIES)); + } else { + loginreqMsg = new LoginreqMsg(realRoomId, "", "", ver, aver, "", "", "", UUID.fastUUID().toString(true)); + return new AuthWebSocketFrame(DouyuCodecUtil.encode(loginreqMsg, LoginreqMsg.SHOULD_IGNORE_OLD_LOGIN_PROPERTIES)); + } + } + // 视为登录 + else { + String acfUid = OrLiveChatCookieUtil.getCookieByName(cookieMap, DouyuApis.KEY_COOKIE_ACF_UID, () -> { + throw new BaseException("Cookie中缺少字段" + DouyuApis.KEY_COOKIE_ACF_UID); + }); + uid = NumberUtil.parseLong(acfUid); + username = acfUid; + String dfl = "sn@A=105@Sss@A=1"; + if (mode == DouyuClientModeEnum.DANMU) { + loginreqMsg = new LoginreqMsg(realRoomId, dfl, username, uid, ver, aver); + return new AuthWebSocketFrame(DouyuCodecUtil.encode(loginreqMsg, LoginreqMsg.SHOULD_IGNORE_NEW_LOGIN_PROPERTIES)); + } else { + String acfLtkid = OrLiveChatCookieUtil.getCookieByName(cookieMap, DouyuApis.KEY_COOKIE_ACF_LTKID, () -> { + throw new BaseException("Cookie中缺少字段" + DouyuApis.KEY_COOKIE_ACF_LTKID); + }); + String acfStk = OrLiveChatCookieUtil.getCookieByName(cookieMap, DouyuApis.KEY_COOKIE_ACF_STK, () -> { + throw new BaseException("Cookie中缺少字段" + DouyuApis.KEY_COOKIE_ACF_STK); + }); + String dyDid = OrLiveChatCookieUtil.getCookieByName(cookieMap, DouyuApis.KEY_COOKIE_DY_DID, () -> { + throw new BaseException("Cookie中缺少字段" + DouyuApis.KEY_COOKIE_DY_DID); + }); + loginreqMsg = new LoginreqMsg(realRoomId, dfl, username, ver, aver, acfLtkid, "1", acfStk, dyDid); + return new AuthWebSocketFrame(DouyuCodecUtil.encode(loginreqMsg, LoginreqMsg.SHOULD_IGNORE_OLD_LOGIN_PROPERTIES)); + } + } + } catch (Exception e) { + throw new BaseException(String.format("认证包创建失败,请检查房间号是否正确。roomId: %d, msg: %s", roomId, e.getMessage())); + } + } + + public AuthWebSocketFrame createAuth(DouyuClientModeEnum mode, String ver, String aver) { + return this.createAuth(mode, ver, aver, null); + } + + public HeartbeatWebSocketFrame createHeartbeat() { + return new HeartbeatWebSocketFrame(DouyuCodecUtil.encode(this.getHeartbeatMsg())); + } + + public KeepliveWebSocketFrame createKeeplive(String cookie) { + return new KeepliveWebSocketFrame(DouyuCodecUtil.encode(this.getKeepliveMsg(StrUtil.isNotBlank(cookie) ? "hs-h5" : ""))); + } + + /** + * 心跳包单例模式 + * + * @return HeartbeatWebSocketFrame + */ + public HeartbeatMsg getHeartbeatMsg() { + if (heartbeatMsg == null) { + synchronized (DouyuWebSocketFrameFactory.this) { + if (heartbeatMsg == null) { + heartbeatMsg = new HeartbeatMsg(); + } + } + } + return heartbeatMsg; + } + + private BaseDouyuCmdMsg getKeepliveMsg(String cnd) { + return new KeepliveMsg(cnd); + } + + public WebSocketFrame createJoingroup() { + JoingroupMsg joingroupMsg = new JoingroupMsg(); + joingroupMsg.setRid(roomId); + return new BinaryWebSocketFrame(DouyuCodecUtil.encode(joingroupMsg)); + } + + public WebSocketFrame createSub() { + return new BinaryWebSocketFrame(DouyuCodecUtil.encode(new SubMsg())); + } + + public WebSocketFrame createDanmu(String msg, String cookie) { + String dyDid = OrLiveChatCookieUtil.getCookieByName(cookie, DouyuApis.KEY_COOKIE_DY_DID, () -> { + throw new BaseException("cookie中缺少参数" + DouyuApis.KEY_COOKIE_DY_DID); + }); + String acfUid = OrLiveChatCookieUtil.getCookieByName(cookie, DouyuApis.KEY_COOKIE_ACF_UID, () -> { + throw new BaseException("cookie中缺少参数" + DouyuApis.KEY_COOKIE_ACF_UID); + }); + ChatmessageMsg chatmessageMsg = new ChatmessageMsg(msg, dyDid, acfUid); + return new BinaryWebSocketFrame(DouyuCodecUtil.encode(chatmessageMsg)); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/handler/DouyuBinaryFrameHandler.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/handler/DouyuBinaryFrameHandler.java new file mode 100644 index 0000000..f7d3e55 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/handler/DouyuBinaryFrameHandler.java @@ -0,0 +1,98 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.netty.handler; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandler; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.douyu.client.base.BaseDouyuLiveChatClient; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.listener.IDouyuMsgListener; +import tech.ordinaryroad.live.chat.client.douyu.msg.ChatmsgMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.DgbMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.DouyuCmdMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.UenterMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.IDouyuMsg; +import tech.ordinaryroad.live.chat.client.douyu.util.DouyuCodecUtil; +import tech.ordinaryroad.live.chat.client.servers.netty.client.handler.BaseNettyClientBinaryFrameHandler; + +import java.util.List; + + +/** + * 消息处理器 + * + * @author mjz + * @date 2023/1/4 + */ +@Slf4j +@ChannelHandler.Sharable +public class DouyuBinaryFrameHandler extends BaseNettyClientBinaryFrameHandler { + + public DouyuBinaryFrameHandler(List msgListeners, BaseDouyuLiveChatClient client) { + super(msgListeners, client); + } + + public DouyuBinaryFrameHandler(List msgListeners, long roomId) { + super(msgListeners, roomId); + } + + @Override + public void onCmdMsg(DouyuCmdEnum cmd, ICmdMsg cmdMsg) { + if (super.msgListeners.isEmpty()) { + return; + } + + switch (cmd) { + case chatmsg: { + iteratorMsgListeners(msgListener -> msgListener.onDanmuMsg(DouyuBinaryFrameHandler.this, (ChatmsgMsg) cmdMsg)); + break; + } + case dgb: { + iteratorMsgListeners(msgListener -> msgListener.onGiftMsg(DouyuBinaryFrameHandler.this, (DgbMsg) cmdMsg)); + break; + } + case uenter: { + iteratorMsgListeners(msgListener -> msgListener.onEnterRoomMsg(DouyuBinaryFrameHandler.this, (UenterMsg) cmdMsg)); + break; + } + default: { + if (!(cmdMsg instanceof DouyuCmdMsg)) { + if (log.isDebugEnabled()) { + log.debug("非DouyuCmdMsg {}", cmdMsg.getClass()); + } + return; + } + iteratorMsgListeners(msgListener -> msgListener.onOtherCmdMsg(DouyuBinaryFrameHandler.this, cmd, cmdMsg)); + } + } + } + + @Override + protected List decode(ByteBuf byteBuf) { + return DouyuCodecUtil.decode(byteBuf); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/handler/DouyuConnectionHandler.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/handler/DouyuConnectionHandler.java new file mode 100644 index 0000000..e878c2b --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/netty/handler/DouyuConnectionHandler.java @@ -0,0 +1,173 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.netty.handler; + +import io.netty.channel.Channel; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker; +import io.netty.handler.codec.http.websocketx.WebSocketFrame; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.douyu.client.base.BaseDouyuLiveChatClient; +import tech.ordinaryroad.live.chat.client.douyu.config.DouyuLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuClientModeEnum; +import tech.ordinaryroad.live.chat.client.douyu.netty.frame.factory.DouyuWebSocketFrameFactory; +import tech.ordinaryroad.live.chat.client.servers.netty.client.handler.BaseNettyClientConnectionHandler; + + +/** + * 连接处理器 + * + * @author mjz + * @date 2023/8/21 + */ +@Slf4j +@ChannelHandler.Sharable +public class DouyuConnectionHandler extends BaseNettyClientConnectionHandler { + + @Getter + private final DouyuClientModeEnum mode; + /** + * 以ClientConfig为主 + */ + private final long roomId; + /** + * 以ClientConfig为主 + */ + private final String ver; + /** + * 以ClientConfig为主 + */ + private final String aver; + /** + * 以ClientConfig为主 + */ + private String cookie; + + public DouyuConnectionHandler(DouyuClientModeEnum mode, WebSocketClientHandshaker handshaker, BaseDouyuLiveChatClient client, IBaseConnectionListener listener) { + super(handshaker, client, listener); + this.mode = mode; + this.roomId = client.getConfig().getRoomId(); + this.ver = client.getConfig().getVer(); + this.aver = client.getConfig().getAver(); + this.cookie = client.getConfig().getCookie(); + } + + public DouyuConnectionHandler(DouyuClientModeEnum mode, WebSocketClientHandshaker handshaker, BaseDouyuLiveChatClient client) { + this(mode, handshaker, client, null); + } + + public DouyuConnectionHandler(DouyuClientModeEnum mode, WebSocketClientHandshaker handshaker, long roomId, String ver, String aver, IBaseConnectionListener listener, String cookie) { + super(handshaker, listener); + this.mode = mode; + this.roomId = roomId; + this.ver = ver; + this.aver = aver; + this.cookie = cookie; + } + + public DouyuConnectionHandler(DouyuClientModeEnum mode, WebSocketClientHandshaker handshaker, long roomId, String ver, String aver, IBaseConnectionListener listener) { + this(mode, handshaker, roomId, ver, aver, listener, null); + } + + public DouyuConnectionHandler(DouyuClientModeEnum mode, WebSocketClientHandshaker handshaker, long roomId, String ver, String aver, String cookie) { + this(mode, handshaker, roomId, ver, aver, null, cookie); + } + + public DouyuConnectionHandler(DouyuClientModeEnum mode, WebSocketClientHandshaker handshaker, long roomId, String ver, String aver) { + this(mode, handshaker, roomId, ver, aver, null, null); + } + + @Override + protected void sendHeartbeat(ChannelHandlerContext ctx) { + if (log.isDebugEnabled()) { + log.debug("发送心跳包"); + } + WebSocketFrame webSocketFrame; + if (mode == DouyuClientModeEnum.DANMU) { + webSocketFrame = getWebSocketFrameFactory(getRoomId()).createHeartbeat(); + } else { + webSocketFrame = getWebSocketFrameFactory(getRoomId()).createKeeplive(getCookie()); + } + ctx.writeAndFlush(webSocketFrame).addListener((ChannelFutureListener) future -> { + if (future.isSuccess()) { + if (log.isDebugEnabled()) { + log.debug("心跳包发送完成"); + } + } else { + log.error("心跳包发送失败", future.cause()); + } + }); + } + + @Override + public void sendAuthRequest(Channel channel) { + if (log.isDebugEnabled()) { + log.debug("发送认证包"); + } + channel.writeAndFlush(getWebSocketFrameFactory(getRoomId()).createAuth(mode, getVer(), getAver(), getCookie())); + } + + private DouyuWebSocketFrameFactory getWebSocketFrameFactory(long roomId) { + return DouyuWebSocketFrameFactory.getInstance(roomId); + } + + public long getRoomId() { + return client != null ? client.getConfig().getRoomId() : roomId; + } + + private String getVer() { + return client != null ? client.getConfig().getVer() : ver; + } + + private String getAver() { + return client != null ? client.getConfig().getAver() : aver; + } + + private String getCookie() { + return client != null ? client.getConfig().getCookie() : cookie; + } + + @Override + protected long getHeartbeatPeriod() { + if (client == null) { + return DouyuLiveChatClientConfig.DEFAULT_HEARTBEAT_PERIOD; + } else { + return client.getConfig().getHeartbeatPeriod(); + } + } + + @Override + protected long getHeartbeatInitialDelay() { + if (client == null) { + return DouyuLiveChatClientConfig.DEFAULT_HEARTBEAT_INITIAL_DELAY; + } else { + return client.getConfig().getHeartbeatInitialDelay(); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/util/DouyuCodecUtil.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/util/DouyuCodecUtil.java new file mode 100644 index 0000000..dad8a58 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/main/java/tech/ordinaryroad/live/chat/client/douyu/util/DouyuCodecUtil.java @@ -0,0 +1,329 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.util; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ReflectUtil; +import cn.hutool.core.util.StrUtil; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.util.OrLiveChatReflectUtil; +import tech.ordinaryroad.live.chat.client.douyu.api.DouyuApis; +import tech.ordinaryroad.live.chat.client.douyu.client.DouyuLiveChatClient; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.msg.DgbMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.DouyuCmdMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.HeartbeatMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.HeartbeatReplyMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.IDouyuMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.dto.GiftListInfo; +import tech.ordinaryroad.live.chat.client.douyu.msg.dto.GiftPropSingle; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.nio.charset.StandardCharsets; +import java.util.*; + +/** + * 参考:https://open.douyu.com/source/api/63 + * + * @author mjz + * @date 2023/1/6 + */ +@Slf4j +public class DouyuCodecUtil { + + public static final String[] IGNORE_PROPERTIES = {"OBJECT_MAPPER", "unknownProperties"}; + /** + * 以SHOULD_IGNORE开头的成员变量将不会序列化 + */ + public static final String SHOULD_IGNORE_PROPERTIES_PREFIX = "SHOULD_IGNORE"; + + public static final short MSG_TYPE_SEND = 689; + public static final short MSG_TYPE_RECEIVE = 690; + public static final short FRAME_HEADER_LENGTH = 8; + + public static ByteBuf encode(BaseDouyuCmdMsg msg, List containProperties) { + ByteBuf out = Unpooled.buffer(FRAME_HEADER_LENGTH); + String bodyDouyuSttString = StrUtil.nullToEmpty(toDouyuSttString(msg, containProperties)) + SUFFIX; + byte[] bodyBytes = bodyDouyuSttString.getBytes(StandardCharsets.UTF_8); + int length = bodyBytes.length + FRAME_HEADER_LENGTH; + out.writeIntLE(length); + out.writeIntLE(length); + out.writeShortLE(MSG_TYPE_SEND); + out.writeByte(0); + out.writeByte(0); + out.writeBytes(bodyBytes); + return out; + } + + public static ByteBuf encode(BaseDouyuCmdMsg msg) { + return encode(msg, null); + } + + public static List decode(ByteBuf in) { + List msgList = new ArrayList<>(); + Queue pendingByteBuf = new LinkedList<>(); + + do { + Optional msg = doDecode(in, pendingByteBuf); + msg.ifPresent(msgList::add); + in = pendingByteBuf.poll(); + } while (in != null); + + return msgList; + } + + /** + * 执行解码操作 + * + * @param in handler收到的一条消息 + * @param pendingByteBuf 用于存放未读取完的ByteBuf + * @return Optional 何时为空值:不支持的{@link DouyuCmdEnum},{@link #parseDouyuSttString(String, short)}反序列化失败 + */ + private static Optional doDecode(ByteBuf in, Queue pendingByteBuf) { + int length = in.readIntLE(); + in.readIntLE(); + // MSG_TYPE_RECEIVE + short msgType = in.readShortLE(); + if (msgType != MSG_TYPE_RECEIVE) { + log.error("decode消息类型 非 收到的消息"); + } + in.readByte(); + in.readByte(); + int contentLength = length - FRAME_HEADER_LENGTH; + byte[] inputBytes = new byte[contentLength]; + in.readBytes(inputBytes); + if (in.readableBytes() != 0) { + // log.error("in.readableBytes() {}", in.readableBytes()); + pendingByteBuf.offer(in); + } + + String bodyDouyuSttString = new String(inputBytes, 0, inputBytes.length - 1); + return Optional.ofNullable(parseDouyuSttString(bodyDouyuSttString, msgType)); + } + + public static final String SPLITTER = "@="; + public static final String END = "/"; + public static final String SUFFIX = "\0"; + + /** + *
{@code @S/ -> @AS@S}
+ * + * @param string + * @return + */ + public static String escape(String string) { +// return string == null ? StrUtil.EMPTY : (string.replaceAll("/", "@S").replaceAll("@", "@A")); + return string == null ? StrUtil.EMPTY : (string.replaceAll("@", "@A").replaceAll("/", "@S")); + } + + /** + *
{@code @AS@S -> @S/}
+ * + * @param string + * @return + */ + public static String unescape(String string) { + return string == null ? StrUtil.EMPTY : (string.replaceAll("@S", "/").replaceAll("@A", "@")); + } + + public static String toDouyuSttString(Object object, List containProperties) { + StringBuffer sb = new StringBuffer(); + if (object instanceof IDouyuMsg) { + Class objectClass = object.getClass(); + Field[] fields = ReflectUtil.getFields(objectClass, field -> { + String name = field.getName(); + if (CollUtil.isNotEmpty(containProperties)) { + return containProperties.contains(name); + } else { + return !name.startsWith(SHOULD_IGNORE_PROPERTIES_PREFIX) && !ArrayUtil.contains(IGNORE_PROPERTIES, name); + } + }); + for (Field field : fields) { + String key = field.getName(); + Method method = OrLiveChatReflectUtil.getGetterMethod(objectClass, key); + Object value = ReflectUtil.invoke(object, method); + String douyuSttString = toDouyuSttString(value, containProperties); + String escape = escape(douyuSttString); + sb.append(escape(key)) + .append(SPLITTER) + .append(escape) + .append(END); + } + } else { + if (object instanceof Iterable) { + Iterable iterable = (Iterable) object; + StringBuffer iterableStringBuffer = new StringBuffer(); + for (Object o : iterable) { + String douyuSttString = toDouyuSttString(o, containProperties); + String escape = escape(douyuSttString); + iterableStringBuffer.append(escape) + .append(END); + } + sb.append((iterableStringBuffer.toString())); + } else if (object instanceof Map) { + Map map = (Map) object; + StringBuffer mapStringBuffer = new StringBuffer(); + map.forEach((mapKey, mapValue) -> { + mapStringBuffer.append(escape(StrUtil.toStringOrNull(mapKey))) + .append(SPLITTER) + .append(escape(toDouyuSttString(mapValue, containProperties))) + .append(END); + }); + sb.append((mapStringBuffer.toString())); + } else { + sb.append((StrUtil.nullToEmpty(StrUtil.toStringOrNull(object)))); + } + } + return sb.toString(); + } + + public static String toDouyuSttString(Object object) { + return toDouyuSttString(object, null); + } + + public static IDouyuMsg parseDouyuSttString(String string, short msgType) { + Map stringObjectMap = parseDouyuSttStringToMap(string); + String type = (String) stringObjectMap.get("type"); + DouyuCmdEnum cmdEnum = DouyuCmdEnum.getByString(type); + + Class msgClass = getDouyuMsgClassByType(cmdEnum, msgType); + if (msgClass == null) { + // TODO 不支持的cmdEnum + if (log.isWarnEnabled()) { + log.warn("暂不支持 cmdEnum {}, msgType {}", cmdEnum, msgType); + } + return null; + } + + IDouyuMsg t = ReflectUtil.newInstance(msgClass); + stringObjectMap.forEach((key, value) -> { + Field field = ReflectUtil.getField(t.getClass(), key); + // 未知key + if (field == null) { + // Object -> JsonNode + ((BaseDouyuCmdMsg) t).getUnknownProperties().put(key, BaseDouyuCmdMsg.OBJECT_MAPPER.valueToTree(value)); + // log.debug("未知key {} {},已存放于unknownProperties中", msgClass, key); + } else { + ReflectUtil.setFieldValue(t, field, value); + } + }); + + // 礼物消息设置礼物信息字段 + if (t instanceof DgbMsg) { + DgbMsg msg = (DgbMsg) t; + String pid = msg.getPid(); + // 通用礼物 + if (StrUtil.isNotBlank(pid)) { + GiftPropSingle giftSingle = DouyuLiveChatClient.giftMap.get(pid, () -> { + GiftPropSingle gift = GiftPropSingle.DEFAULT_GIFT; + try { + gift = DouyuApis.getGiftPropSingleByPid(pid); + } catch (Exception e) { + log.error("礼物信息获取失败, pid=" + pid, e); + } + return gift; + }); + msg.setGiftInfo(giftSingle); + } + // 房间礼物 + else { + String realRoomId = msg.getRid(); + if (DouyuLiveChatClient.roomGiftMap.containsKey(realRoomId)) { + Map stringGiftListInfoMap = DouyuLiveChatClient.roomGiftMap.get(realRoomId); + msg.setRoomGiftInfo(stringGiftListInfoMap.getOrDefault(String.valueOf(msg.getGfid()), GiftListInfo.DEFAULT_GIFT)); + } + } + } + + return t; + } + + public static Object parseDouyuSttStringToObject(String value) { + Object valueObject; + if (StrUtil.isBlank(value)) { + return null; + } + if (value.contains(SPLITTER) && value.contains(END)) { + // log.debug("map valueObject {}", value); + valueObject = parseDouyuSttStringToMap(value); + } + // List + else if (!value.contains(SPLITTER) && value.contains(END)) { + // log.debug("list valueObject {}", value); + List list = new ArrayList<>(); + for (String s : value.split(END)) { + list.add(parseDouyuSttStringToObject(unescape(s))); + } + valueObject = list; + } + // String + else { + valueObject = value; + } + return valueObject; + } + + public static Map parseDouyuSttStringToMap(String string) { + Map stringObjectMap = new HashMap<>(); + for (String s : string.split(END)) { + String[] entry = s.split(SPLITTER); + String key = unescape(entry[0]); + String value = unescape(ArrayUtil.get(entry, 1)); + Object valueObject = parseDouyuSttStringToObject(value); + stringObjectMap.put(key, valueObject); + } + return stringObjectMap; + } + + public static Class getDouyuMsgClassByType(DouyuCmdEnum douyuCmdEnum, short msgType) { + if (douyuCmdEnum == null) { + return (Class) DouyuCmdMsg.class; + } + + Class msgClass; + Class tClass = douyuCmdEnum.getTClass(); + if (tClass == null) { + if (douyuCmdEnum == DouyuCmdEnum.mrkl) { + if (msgType == MSG_TYPE_RECEIVE) { + msgClass = HeartbeatReplyMsg.class; + } else if (msgType == MSG_TYPE_SEND) { + msgClass = HeartbeatMsg.class; + } else { + msgClass = null; + } + } else { + msgClass = DouyuCmdMsg.class; + } + } else { + msgClass = tClass; + } + return (Class) msgClass; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/api/DouyuApisTest.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/api/DouyuApisTest.java new file mode 100644 index 0000000..cf82840 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/api/DouyuApisTest.java @@ -0,0 +1,30 @@ +package tech.ordinaryroad.live.chat.client.douyu.api; + +import org.junit.jupiter.api.Test; +import tech.ordinaryroad.live.chat.client.douyu.msg.dto.GiftPropSingle; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +/** + * @author mjz + * @date 2023/8/30 + */ +class DouyuApisTest { + + @Test + void getRealRoomId() { + assertEquals(2947432, DouyuApis.getRealRoomId(92000)); + assertEquals(3168536, DouyuApis.getRealRoomId(3168536)); + assertEquals(290935, DouyuApis.getRealRoomId(22222)); + assertEquals(290935, DouyuApis.getRealRoomId(290935)); + assertEquals(520, DouyuApis.getRealRoomId(520)); + assertThrows(RuntimeException.class, () -> DouyuApis.getRealRoomId(-1)); + } + + @Test + void getGiftInfo() { + GiftPropSingle giftByPid = DouyuApis.getGiftPropSingleByPid("4"); + assertEquals("赞", giftByPid.getName()); + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/ChatChoice.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/ChatChoice.java new file mode 100644 index 0000000..7919ad1 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/ChatChoice.java @@ -0,0 +1,31 @@ +package tech.ordinaryroad.live.chat.client.douyu.client; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @since 2023-03-02 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class ChatChoice implements Serializable { + private long index; + /** + * 请求参数stream为true返回是delta + */ + @JsonProperty("delta") + private Message delta; + /** + * 请求参数stream为false返回是message + */ + @JsonProperty("message") + private Message message; + @JsonProperty("finish_reason") + private String finishReason; +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/ChatCompletionResponse.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/ChatCompletionResponse.java new file mode 100644 index 0000000..3134d4e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/ChatCompletionResponse.java @@ -0,0 +1,24 @@ +package tech.ordinaryroad.live.chat.client.douyu.client; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述: chat答案类 + * + * @author https:www.unfbx.com + * 2023-03-02 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class ChatCompletionResponse implements Serializable { + private String id; + private String object; + private long created; + private String model; + private List choices; + private Usage usage; +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuLiveChatClientTest.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuLiveChatClientTest.java new file mode 100644 index 0000000..56cc6d0 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/DouyuLiveChatClientTest.java @@ -0,0 +1,410 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.douyu.client; + +import com.fasterxml.jackson.databind.ObjectMapper; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.util.internal.StringUtil; +import lombok.extern.slf4j.Slf4j; +import okhttp3.*; +import org.junit.jupiter.api.Test; +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseCmdMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; +import tech.ordinaryroad.live.chat.client.douyu.config.DouyuLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.douyu.constant.DouyuCmdEnum; +import tech.ordinaryroad.live.chat.client.douyu.listener.IDouyuConnectionListener; +import tech.ordinaryroad.live.chat.client.douyu.listener.IDouyuMsgListener; +import tech.ordinaryroad.live.chat.client.douyu.msg.ChatmsgMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.DgbMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.UenterMsg; +import tech.ordinaryroad.live.chat.client.douyu.netty.handler.DouyuBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.douyu.netty.handler.DouyuConnectionHandler; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.IOException; +import java.util.Objects; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +/** + * @author mjz + * @date 2023/8/26 + */ +@Slf4j +class DouyuLiveChatClientTest implements IDouyuConnectionListener, IDouyuMsgListener { + + static Object lock = new Object(); + DouyuLiveChatClient client; + + private final OkHttpClient okClient = new OkHttpClient(); + private static final String API_KEY = "sk-xxxxxx"; + private static final String URL = "https://api.pandarobot.chat/v1/chat/completions"; + + private final Lock reentrantLock = new ReentrantLock(); + private boolean isProcessing = false; + + + public String getChatGptResponse(String prompt){ + if (!reentrantLock.tryLock()) { + // 如果无法立即获得锁,直接返回空字符串 + log.info("自动回复:我还没准备好"); + return ""; + } + try { + if (isProcessing) { + log.info("自动回复:我还没准备好"); + // 如果已经在处理中,直接返回 + return ""; + } + isProcessing = true; + // 你的原始代码逻辑 + RequestBody body = RequestBody.create(MediaType.get("application/json; charset=utf-8"), + "{\"model\": \"gpt-4-0125-preview\", \"messages\": [{\"role\": \"system\", \"content\": \"扮演一个充满机智和幽默感的斗鱼直播弹幕助手,你的任务是用不超过30字的诙谐小段子来回复直播间用户的评论。你的回复应该机智幽默,不夸张能引发笑声,同时也要和谐适应直播间的气氛。当你收到用户的评论时,迅速给出一个既幽默又贴切的回复。例如:评论: 今天的直播怎么样?回复: 好看得让人忘记摸鱼,专心变成鱼粉!\"}, {\"role\": \"user\", \"content\": \"" + prompt + "\"}]}"); + Request request = new Request.Builder() + .url(URL) + .post(body) + .addHeader("Authorization", "Bearer " + API_KEY) + .build(); + + long startTime = System.currentTimeMillis(); // 获取开始时间的毫秒数 + System.out.println("执行前......."); + Thread.sleep(3000); + System.out.println("执行后......."); + long endTime = System.currentTimeMillis(); // 获取结束时间的毫秒数 + long timeDiff = endTime - startTime; // 计算时间差 + System.out.println("执行时间 " + timeDiff / 1000 + " 秒。"); + + try (Response response = okClient.newCall(request).execute()) { + if (response.body() != null) { + ObjectMapper mapper = new ObjectMapper(); + ChatCompletionResponse completionResponse = mapper.readValue(response.body().string(), ChatCompletionResponse.class); + return completionResponse.getChoices().get(0).getMessage().getContent(); + } + } catch (Exception e) { + log.info("调用出错了{}",e.getMessage()); + } + return ""; + } catch (InterruptedException e) { + throw new RuntimeException(e); + } finally { + isProcessing = false; + reentrantLock.unlock(); + } + } + + @Test + void example() throws InterruptedException { + String cookie = "dy_did=621fbe7a636002f6e6cc42eb00091701; acf_did=621fbe7a636002f6e6cc42eb00091701; dy_teen_mode=%7B%22uid%22%3A%22145703733%22%2C%22status%22%3A0%2C%22birthday%22%3A%22%22%2C%22password%22%3A%22%22%7D; dy_did=621fbe7a636002f6e6cc42eb00091701; Hm_lvt_e99aee90ec1b2106afe7ec3b199020a7=1706978160,1707033428,1707109487; PHPSESSID=1orrfq0m0gfrbd58slgh6shqc7; acf_auth=c22dT%2BYJG1xQ3ZuNrfxYNS06lnIjzNl%2F58xziUwyAsNedpJWvbEtIBh%2Bq%2F%2FYxo%2FFYAp9aQr4i4iYqTp2kYdb7n2JNUFBwGEBgZ8GiGS6O%2FR0CNLy8kQ2iVw; dy_auth=d0d0Ps%2FEOPWjXoPGMenITKuiBIC7wTua3heP19LVKzOZ8qibQpmTA9Hpyx%2FdxtDei1Db6KUWkzq1fEC0BLSZVSUbDkuv%2FX%2F%2B0pMu1kgXnk%2FUzQ%2BhV3EiRf8; wan_auth37wan=f0a9656c2e00K9uFDlpgnTfrv3m8aZoYB0WQTWxGSrSccCMd9LUiEUD2oYpJ%2F5Oe5uD2tVpaUA69sGzlTAtl9p3uLSSqgrvH%2F8sy1gWyyrS4fxotQSU; acf_uid=145703733; acf_username=145703733; acf_nickname=%E5%9B%BE%E5%85%94%E5%85%94%E7%9A%84%E5%85%94%E5%85%94%E5%9B%BE; acf_own_room=0; acf_groupid=1; acf_phonestatus=1; acf_avatar=https%3A%2F%2Fapic.douyucdn.cn%2Fupload%2Favanew%2Fface%2F201706%2F25%2F21%2F82973545fd6b770fe03175783ffbc3d5_; acf_ct=0; acf_ltkid=28814433; acf_biz=1; acf_stk=1213d18dc8e6b5b1; Hm_lpvt_e99aee90ec1b2106afe7ec3b199020a7=1707141953"; + DouyuLiveChatClientConfig config = DouyuLiveChatClientConfig.builder() + // TODO 修改房间id(支持短id) + .roomId(7828414) + .cookie(cookie) + .build(); + + client = new DouyuLiveChatClient(config, new IDouyuMsgListener() { + @Override + public void onMsg(DouyuBinaryFrameHandler binaryFrameHandler, IMsg msg) { + IDouyuMsgListener.super.onMsg(binaryFrameHandler, msg); + // log.debug("{} 收到{}消息 {}", binaryFrameHandler.getRoomId(), msg.getClass(), msg); + } + + @Override + public void onDanmuMsg(DouyuBinaryFrameHandler binaryFrameHandler, ChatmsgMsg msg) { + if(Integer.parseInt(msg.getLevel())>5){ + String chatGptResponse = getChatGptResponse(msg.getContent()); + log.info("自动回复:"+ "@"+msg.getUsername()+": "+chatGptResponse); + if(!Objects.equals(chatGptResponse, "")){ + client.sendDanmu("@"+msg.getUsername()+": "+chatGptResponse); + } + } + log.info("{} 收到弹幕 {} {}({}):{}", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), msg.getContent()); + } + + @Override + public void onGiftMsg(DouyuBinaryFrameHandler binaryFrameHandler, DgbMsg msg) { + IDouyuMsgListener.super.onGiftMsg(binaryFrameHandler, msg); + // log.info("{} 收到礼物 {} {}({}) {} {}({})x{}({})", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), "赠送", msg.getGiftName(), msg.getGiftId(), msg.getGiftCount(), msg.getGiftPrice()); + } + + @Override + public void onEnterRoomMsg(UenterMsg msg) { +// if(msg.getLevel()>20){ +// String chatGptResponse = getChatGptResponse(msg.getUsername()+"加入了直播间,请你帮忙编写简短有创意的欢迎语"); +// if(!Objects.equals(chatGptResponse, "")){ +// client.sendDanmu(chatGptResponse); +// } +// } + log.info("{} {}({}) 进入直播间", msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid()); + } + + @Override + public void onCmdMsg(DouyuBinaryFrameHandler binaryFrameHandler, DouyuCmdEnum cmd, BaseCmdMsg cmdMsg) { + IDouyuMsgListener.super.onCmdMsg(binaryFrameHandler, cmd, cmdMsg); + //log.info("{} 收到CMD消息{} {}", binaryFrameHandler.getRoomId(), cmd, cmdMsg); + } + + @Override + public void onOtherCmdMsg(DouyuBinaryFrameHandler binaryFrameHandler, DouyuCmdEnum cmd, BaseCmdMsg cmdMsg) { + IDouyuMsgListener.super.onOtherCmdMsg(binaryFrameHandler, cmd, cmdMsg); + + // log.debug("{} 收到其他CMD消息 {}", binaryFrameHandler.getRoomId(), cmd); + } + + @Override + public void onUnknownCmd(DouyuBinaryFrameHandler binaryFrameHandler, String cmdString, BaseMsg msg) { + IDouyuMsgListener.super.onUnknownCmd(binaryFrameHandler, cmdString, msg); + + // log.debug("{} 收到未知CMD消息 {}", binaryFrameHandler.getRoomId(), cmdString); + } + }, new IDouyuConnectionListener() { + @Override + public void onConnected(DouyuConnectionHandler connectionHandler) { + log.info("{} onConnected", connectionHandler.getRoomId()); + } + + @Override + public void onConnectFailed(DouyuConnectionHandler connectionHandler) { + log.info("{} onConnectFailed", connectionHandler.getRoomId()); + } + + @Override + public void onDisconnected(DouyuConnectionHandler connectionHandler) { + log.info("{} onDisconnected", connectionHandler.getRoomId()); + } + }); + client.connect(); + + // 防止测试时直接退出 + while (true) { + synchronized (lock) { + lock.wait(); + } + } + } + + @Test + void multipyListeners() throws InterruptedException { + DouyuLiveChatClientConfig config = DouyuLiveChatClientConfig.builder() + // TODO 修改房间id(支持短id) + .roomId(74751) + .build(); + + client = new DouyuLiveChatClient(config, null, this); + client.addMsgListener(new IDouyuMsgListener() { + @Override + public void onMsg(DouyuBinaryFrameHandler binaryFrameHandler, IMsg msg) { + log.info("listener 1 onMsg {}", msg); + } + }); + IDouyuMsgListener msgListener2 = new IDouyuMsgListener() { + @Override + public void onMsg(DouyuBinaryFrameHandler binaryFrameHandler, IMsg msg) { + log.info("listener 2 onMsg {}", msg); + } + }; + client.addMsgListener(msgListener2); + AtomicBoolean removed = new AtomicBoolean(false); + client.addMsgListener(new IDouyuMsgListener() { + @Override + public void onMsg(DouyuBinaryFrameHandler binaryFrameHandler, IMsg msg) { + log.info("listener 3 onMsg {}", msg); + if (!removed.get()) { + log.warn("remove listener 2 by listener 3"); + removed.set(client.removeMsgListener(msgListener2)); + } + } + }); + client.connect(); + + // 防止测试时直接退出 + while (true) { + synchronized (lock) { + lock.wait(); + } + } + } + + @Test + void multiplyClient() throws InterruptedException { + DouyuLiveChatClientConfig config1 = DouyuLiveChatClientConfig.builder().roomId(890074).build(); + DouyuLiveChatClient client1 = new DouyuLiveChatClient(config1, DouyuLiveChatClientTest.this, DouyuLiveChatClientTest.this); + + DouyuLiveChatClientConfig config2 = DouyuLiveChatClientConfig.builder().roomId(718133).build(); + DouyuLiveChatClient client2 = new DouyuLiveChatClient(config2, DouyuLiveChatClientTest.this, DouyuLiveChatClientTest.this); + + client1.connect(() -> { + log.warn("client1 connect successfully, start connecting client2"); + client2.connect(() -> { + log.warn("client2 connect successfully"); + }); + }); + + // 防止测试时直接退出 + while (true) { + synchronized (lock) { + lock.wait(); + } + } + } + + @Test + void sendDanmu() throws InterruptedException { + String cookie = "dy_did=621fbe7a636002f6e6cc42eb00091701; acf_did=621fbe7a636002f6e6cc42eb00091701; Hm_lvt_e99aee90ec1b2106afe7ec3b199020a7=1706978160; PHPSESSID=5mg98bkoens5bsg7da6ooj74b7; acf_auth=2a246MCoU1hPn940VxZrs0wQVc8tY96s6rHocobTmUJF8XKjoxWmv51PLf1V4T5g8QiEAyy6u%2BHQfC%2FTNkJudUVdEowNqAF81eaUzHvo5i1MIXBRbDXYXwY; dy_auth=d066mz7%2BE83QjmEJfujfi%2FyOuib9Y2qfBcK7pINX6Gde4HGRaiWZxhNXkqdbLU1aV%2FXaQ0wbkyxV0DddiF9jBc4tMpCMjvi4a1C6EJTfpLHvMmaGBKlI%2FlQ; wan_auth37wan=b747c445309bcOqiaMF72xt346irN4v%2Fhi%2BgabHCNxe812jm9rR8kGws8cdJlsn0C6jxsVKY6We5xWlrjHKesoD2%2B0Av52%2FWzIxaZKT0f30GASOJz58; acf_uid=145703733; acf_username=145703733; acf_nickname=%E5%9B%BE%E5%85%94%E5%85%94%E7%9A%84%E5%85%94%E5%85%94%E5%9B%BE; acf_own_room=0; acf_groupid=1; acf_phonestatus=1; acf_avatar=https%3A%2F%2Fapic.douyucdn.cn%2Fupload%2Favanew%2Fface%2F201706%2F25%2F21%2F82973545fd6b770fe03175783ffbc3d5_; acf_ct=0; acf_ltkid=28814429; acf_biz=1; acf_stk=0fad5f2454193f86; dy_teen_mode=%7B%22uid%22%3A%22145703733%22%2C%22status%22%3A0%2C%22birthday%22%3A%22%22%2C%22password%22%3A%22%22%7D; dy_did=621fbe7a636002f6e6cc42eb00091701; acf_ccn=5ba506efe2d8a939cf09f8597c7d8030; Hm_lpvt_e99aee90ec1b2106afe7ec3b199020a7=1706978671"; + // log.error("cookie: {}", cookie); + DouyuLiveChatClientConfig config = DouyuLiveChatClientConfig.builder() + .cookie(cookie) + // TODO 修改弹幕发送最短时间间隔,默认3s + .minSendDanmuPeriod(10 * 1000) + // TODO 修改房间id(支持短id) + .roomId(4624967) + .build(); + DouyuWsLiveChatClient client = new DouyuWsLiveChatClient(config, new IDouyuMsgListener() { + @Override + public void onMsg(IMsg msg) { + IDouyuMsgListener.super.onMsg(msg); + +// log.debug("收到消息 {}", msg.getClass()); + } + + @Override + public void onCmdMsg(DouyuCmdEnum cmd, BaseCmdMsg cmdMsg) { + log.debug("收到CMD消息 {} {}", cmd, cmdMsg); + } + + @Override + public void onEnterRoomMsg(UenterMsg msg) { + log.info("{} {}({}) 进入直播间", msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid()); + } + @Override + public void onUnknownCmd(String cmdString, BaseMsg msg) { + IDouyuMsgListener.super.onUnknownCmd(cmdString, msg); + + log.debug("收到未知CMD消息 {} {}", cmdString, msg); + } + }, new IDouyuConnectionListener() { + @Override + public void onConnected(DouyuConnectionHandler connectionHandler) { + log.error("{} onConnected", connectionHandler.getRoomId()); + } + + @Override + public void onConnectFailed(DouyuConnectionHandler connectionHandler) { + log.error("{} onConnectFailed", connectionHandler.getRoomId()); + } + + @Override + public void onDisconnected(DouyuConnectionHandler connectionHandler) { + log.error("{} onDisconnected", connectionHandler.getRoomId()); + } + }, new NioEventLoopGroup()); + client.connect(() -> { + client.sendDanmu("主播真好看"); + }); + + // 防止测试时直接退出 + while (true) { + synchronized (lock) { + lock.wait(); + } + } + } + + @Test + void createAuthFrameFailedAndDisconnect() throws InterruptedException { + DouyuLiveChatClientConfig config = DouyuLiveChatClientConfig.builder() + // TODO 修改房间id(支持短id) + .autoReconnect(false) + .cookie("12323232'123'213'2'13'2") + .roomId(22222) + .build(); + + client = new DouyuLiveChatClient(config, this, this); + client.connect(); + + // 防止测试时直接退出 + while (true) { + synchronized (lock) { + lock.wait(); + } + } + } + + @Test + void autoReconnect() throws InterruptedException { + DouyuLiveChatClientConfig config = DouyuLiveChatClientConfig.builder() + // TODO 修改房间id(支持短id) + .autoReconnect(true) + .cookie("12323232'123'213'2'13'2") +// .websocketUri("wss://sa.asd.asd:12") + .roomId(22222) + .build(); + + client = new DouyuLiveChatClient(config, this, this); + client.addStatusChangeListener(new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + Object oldStatus = evt.getOldValue(); + Object newStatus = evt.getNewValue(); + log.error("{} => {}", oldStatus, newStatus); + } + }); + client.connect(); + + // 防止测试时直接退出 + while (true) { + synchronized (lock) { + lock.wait(); + } + } + } + + @Override + public void onConnected(DouyuConnectionHandler connectionHandler) { + log.info("{} onConnected", connectionHandler.getRoomId()); + } + + @Override + public void onConnectFailed(DouyuConnectionHandler connectionHandler) { + log.info("{} onConnectFailed", connectionHandler.getRoomId()); + } + + @Override + public void onDisconnected(DouyuConnectionHandler connectionHandler) { + log.info("{} onDisconnected", connectionHandler.getRoomId()); + } + + @Override + public void onDanmuMsg(DouyuBinaryFrameHandler binaryFrameHandler, ChatmsgMsg msg) { + IDouyuMsgListener.super.onDanmuMsg(binaryFrameHandler, msg); + + log.info("{} 收到弹幕 {}({}):{}", binaryFrameHandler.getRoomId(), msg.getNn(), msg.getUid(), msg.getTxt()); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/Message.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/Message.java new file mode 100644 index 0000000..7ab7d80 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/Message.java @@ -0,0 +1,104 @@ +package tech.ordinaryroad.live.chat.client.douyu.client; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.Getter; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @since 2023-03-02 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public class Message implements Serializable { + + /** + * 目前支持四个中角色参考官网,进行情景输入: + * https://platform.openai.com/docs/guides/chat/introduction + */ + private String role; + + private String content; + + private String name; + + public static Builder builder() { + return new Builder(); + } + + /** + * 构造函数 + * + * @param role 角色 + * @param content 描述主题信息 + * @param name name + */ + public Message(String role, String content, String name) { + this.role = role; + this.content = content; + this.name = name; + } + + public Message() { + } + + private Message(Builder builder) { + setRole(builder.role); + setContent(builder.content); + setName(builder.name); + } + + + @Getter + @AllArgsConstructor + public enum Role { + + SYSTEM("system"), + USER("user"), + ASSISTANT("assistant"), + FUNCTION("function"), + ; + private String name; + } + + public static final class Builder { + private String role; + private String content; + private String name; + + public Builder() { + } + + public Builder role(Role role) { + this.role = role.getName(); + return this; + } + + public Builder role(String role) { + this.role = role; + return this; + } + + public Builder content(String content) { + this.content = content; + return this; + } + + public Builder name(String name) { + this.name = name; + return this; + } + + + public Message build() { + return new Message(this); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/Usage.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/Usage.java new file mode 100644 index 0000000..5595bc0 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/client/Usage.java @@ -0,0 +1,24 @@ +package tech.ordinaryroad.live.chat.client.douyu.client; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述: + * + * @author https:www.unfbx.com + * 2023-02-15 + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class Usage implements Serializable { + @JsonProperty("prompt_tokens") + private long promptTokens; + @JsonProperty("completion_tokens") + private long completionTokens; + @JsonProperty("total_tokens") + private long totalTokens; +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/util/DouyuCodecUtilTest.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/util/DouyuCodecUtilTest.java new file mode 100644 index 0000000..b4d7260 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-douyu/src/test/java/tech/ordinaryroad/live/chat/client/douyu/util/DouyuCodecUtilTest.java @@ -0,0 +1,102 @@ +package tech.ordinaryroad.live.chat.client.douyu.util; + +import org.junit.jupiter.api.Test; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.BaseDouyuCmdMsg; +import tech.ordinaryroad.live.chat.client.douyu.msg.base.IDouyuMsg; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +/** + * @author mjz + * @date 2023/8/27 + */ +class DouyuCodecUtilTest { + + @Test + void test() { + String loginres = "type@=loginres/userid@=1235403446/roomgroup@=0/pg@=0/sessionid@=0/username@=/nickname@=/live_stat@=0/is_illegal@=0/ill_ct@=/ill_ts@=0/now@=0/ps@=0/es@=0/it@=0/its@=0/npv@=0/best_dlev@=0/cur_lev@=0/nrc@=2785047409/ih@=0/sid@=72256/sahf@=0/sceneid@=0/newrg@=0/regts@=0/ip@=112.43.93.229/rn@=0/rct@=0/"; + String pingreq = "type@=pingreq/tick@=1693128084471/"; + String mrkl = "type@=mrkl/"; + String subres = "type@=subres/res@=0/"; + String mapkb = "type@=mapkb/cmd@=3/rid@=5515841/pk_time@=600/lt@=156/teams@=team@AA=5@ASres@AA=1@ASsc@AA=660000@ASbf@AA=0@AS@Steam@AA=6@ASres@AA=2@ASsc@AA=600000@ASbf@AA=0@AS@Steam@AA=4@ASres@AA=3@ASsc@AA=456000@ASbf@AA=0@AS@Steam@AA=2@ASres@AA=4@ASsc@AA=302000@ASbf@AA=0@AS@Steam@AA=3@ASres@AA=5@ASsc@AA=100000@ASbf@AA=0@AS@Steam@AA=1@ASres@AA=6@ASsc@AA=200@ASbf@AA=0@AS@S/members@=rid@AA=5515841@ASuid@AA=219585944@ASnick@AA=喵小莎@ASicon@AA=avatar_v3@AAS202303@AAS4cab38d935004acfab53f77a730c9d42@ASstatus@AA=0@ASsc@AA=100000@AStime@AA=1693127363@ASteam@AA=3@ASgroup_no@AA=0@ASmd@AA=0@AShvsc@AA=0@ASct@AA=0@AS@Srid@AA=8733064@ASuid@AA=364378905@ASnick@AA=阿允唱情歌@ASicon@AA=avatar_v3@AAS202008@AAS31b239d8af174462b5e0a2990c70b818@ASstatus@AA=0@ASsc@AA=600000@AStime@AA=1693127527@ASteam@AA=6@ASgroup_no@AA=0@ASmd@AA=0@AShvsc@AA=0@ASct@AA=0@AS@Srid@AA=10673032@ASuid@AA=442218984@ASnick@AA=果酱Broly@ASicon@AA=avatar_v3@AAS202306@AASf7d61a0ea3bb4c179af7b5e24f94953e@ASstatus@AA=0@ASsc@AA=200@AStime@AA=1693127347@ASteam@AA=1@ASgroup_no@AA=0@ASmd@AA=0@AShvsc@AA=0@ASct@AA=0@AS@Srid@AA=533813@ASuid@AA=36922190@ASnick@AA=正直博@ASicon@AA=avatar_v3@AAS202212@AAS4e340983996f43b991ffa50af7b956f6@ASstatus@AA=0@ASsc@AA=302000@AStime@AA=1693127348@ASteam@AA=2@ASgroup_no@AA=0@ASmd@AA=0@AShvsc@AA=0@ASct@AA=0@AS@Srid@AA=8031896@ASuid@AA=243111494@ASnick@AA=青榎@ASicon@AA=avatar_v3@AAS202305@AAS8bd800d3bb8d4e16884dcb3e3f77b038@ASstatus@AA=0@ASsc@AA=456000@AStime@AA=1693127393@ASteam@AA=4@ASgroup_no@AA=0@ASmd@AA=0@AShvsc@AA=0@ASct@AA=0@AS@Srid@AA=7009686@ASuid@AA=299482114@ASnick@AA=紫薇同学@ASicon@AA=avatar_v3@AAS202302@AASb67044b78b494b0896fd6738bc2d5b7b@ASstatus@AA=0@ASsc@AA=660000@AStime@AA=1693127424@ASteam@AA=5@ASgroup_no@AA=0@ASmd@AA=0@AShvsc@AA=0@ASct@AA=0@AS@S/subcmd@=0/pkm@=0/rlt@=0/"; + String pdrinfo = "giftId@=23518/total@=total@A=3@Snum@A=0@Sfin@A=0@S/actStatus@=1/time@=1693158017596/type@=pdrinfo/dayFin@=0/list@=1@A=total@AAA=6@AASnum@AAA=6@AASpid@AAA=2682@AASfin@AAA=1@AAS@AStotal@AAA=600@AASnum@AAA=336@AASpid@AAA=2680@AASfin@AAA=0@AAS@AS@S100@A=total@AAA=2@AASnum@AAA=0@AASpid@AAA=2685@AASfin@AAA=0@AAS@AStotal@AAA=100@AASnum@AAA=5@AASpid@AAA=2682@AASfin@AAA=0@AAS@AS@S10@A=total@AAA=2@AASnum@AAA=0@AASpid@AAA=2683@AASfin@AAA=0@AAS@AStotal@AAA=80@AASnum@AAA=35@AASpid@AAA=2681@AASfin@AAA=0@AAS@AS@S/"; + + Map map = new HashMap<>(); + map.put("loginres", loginres); + map.put("pingreq", pingreq); + map.put("mrkl", mrkl); + map.put("subres", subres); + map.put("mapkb", mapkb); + map.put("pdrinfo", pdrinfo); + + map.forEach((string, string2) -> { + BaseDouyuCmdMsg baseDouyuCmdMsg = (BaseDouyuCmdMsg) DouyuCodecUtil.parseDouyuSttString(string2, DouyuCodecUtil.MSG_TYPE_RECEIVE); + assertNotNull(baseDouyuCmdMsg); + String cmd = baseDouyuCmdMsg.getCmd(); + assertEquals(string, cmd); + }); + } + + @Test + void decodeTest() { + String mapkb = "type@=mapkb/cmd@=3/rid@=5515841/pk_time@=600/lt@=156/teams@=team@AA=5@ASres@AA=1@ASsc@AA=660000@ASbf@AA=0@AS@Steam@AA=6@ASres@AA=2@ASsc@AA=600000@ASbf@AA=0@AS@Steam@AA=4@ASres@AA=3@ASsc@AA=456000@ASbf@AA=0@AS@Steam@AA=2@ASres@AA=4@ASsc@AA=302000@ASbf@AA=0@AS@Steam@AA=3@ASres@AA=5@ASsc@AA=100000@ASbf@AA=0@AS@Steam@AA=1@ASres@AA=6@ASsc@AA=200@ASbf@AA=0@AS@S/members@=rid@AA=5515841@ASuid@AA=219585944@ASnick@AA=喵小莎@ASicon@AA=avatar_v3@AAS202303@AAS4cab38d935004acfab53f77a730c9d42@ASstatus@AA=0@ASsc@AA=100000@AStime@AA=1693127363@ASteam@AA=3@ASgroup_no@AA=0@ASmd@AA=0@AShvsc@AA=0@ASct@AA=0@AS@Srid@AA=8733064@ASuid@AA=364378905@ASnick@AA=阿允唱情歌@ASicon@AA=avatar_v3@AAS202008@AAS31b239d8af174462b5e0a2990c70b818@ASstatus@AA=0@ASsc@AA=600000@AStime@AA=1693127527@ASteam@AA=6@ASgroup_no@AA=0@ASmd@AA=0@AShvsc@AA=0@ASct@AA=0@AS@Srid@AA=10673032@ASuid@AA=442218984@ASnick@AA=果酱Broly@ASicon@AA=avatar_v3@AAS202306@AASf7d61a0ea3bb4c179af7b5e24f94953e@ASstatus@AA=0@ASsc@AA=200@AStime@AA=1693127347@ASteam@AA=1@ASgroup_no@AA=0@ASmd@AA=0@AShvsc@AA=0@ASct@AA=0@AS@Srid@AA=533813@ASuid@AA=36922190@ASnick@AA=正直博@ASicon@AA=avatar_v3@AAS202212@AAS4e340983996f43b991ffa50af7b956f6@ASstatus@AA=0@ASsc@AA=302000@AStime@AA=1693127348@ASteam@AA=2@ASgroup_no@AA=0@ASmd@AA=0@AShvsc@AA=0@ASct@AA=0@AS@Srid@AA=8031896@ASuid@AA=243111494@ASnick@AA=青榎@ASicon@AA=avatar_v3@AAS202305@AAS8bd800d3bb8d4e16884dcb3e3f77b038@ASstatus@AA=0@ASsc@AA=456000@AStime@AA=1693127393@ASteam@AA=4@ASgroup_no@AA=0@ASmd@AA=0@AShvsc@AA=0@ASct@AA=0@AS@Srid@AA=7009686@ASuid@AA=299482114@ASnick@AA=紫薇同学@ASicon@AA=avatar_v3@AAS202302@AASb67044b78b494b0896fd6738bc2d5b7b@ASstatus@AA=0@ASsc@AA=660000@AStime@AA=1693127424@ASteam@AA=5@ASgroup_no@AA=0@ASmd@AA=0@AShvsc@AA=0@ASct@AA=0@AS@S/subcmd@=0/pkm@=0/rlt@=0/"; + Map stringObjectMap = DouyuCodecUtil.parseDouyuSttStringToMap(mapkb); + assertNotNull(stringObjectMap); + stringObjectMap.forEach((string, o) -> { + System.out.println(string); + }); + } + + @Test + void decodeTest2() { + String pdrinfo = "giftId@=23518/total@=total@A=3@Snum@A=0@Sfin@A=0@S/actStatus@=1/time@=1693158017596/type@=pdrinfo/dayFin@=0/list@=1@A=total@AAA=6@AASnum@AAA=6@AASpid@AAA=2682@AASfin@AAA=1@AAS@AStotal@AAA=600@AASnum@AAA=336@AASpid@AAA=2680@AASfin@AAA=0@AAS@AS@S100@A=total@AAA=2@AASnum@AAA=0@AASpid@AAA=2685@AASfin@AAA=0@AAS@AStotal@AAA=100@AASnum@AAA=5@AASpid@AAA=2682@AASfin@AAA=0@AAS@AS@S10@A=total@AAA=2@AASnum@AAA=0@AASpid@AAA=2683@AASfin@AAA=0@AAS@AStotal@AAA=80@AASnum@AAA=35@AASpid@AAA=2681@AASfin@AAA=0@AAS@AS@S/"; + Map stringObjectMap = DouyuCodecUtil.parseDouyuSttStringToMap(pdrinfo); + assertNotNull(stringObjectMap); + stringObjectMap.forEach((string, o) -> { + System.out.println(string); + }); + } + + @Test + void toDouyuSttStringTest() { + String douyuSttString = DouyuCodecUtil.toDouyuSttString(new HashMap() {{ + put("key1", "value1"); + put("key2", 2); + put("key3", new ArrayList>() {{ + add(new HashMap() {{ + put("11", 11); + put("12", 12); + }}); + add(new HashMap() {{ + put("21", 21); + put("22", 22); + }}); + }}); + }}); + System.out.println(douyuSttString); + assertEquals("key1@=value1/key2@=2/key3@=11@AA=11@AS12@AA=12@AS@S22@AA=22@AS21@AA=21@AS@S/".length(), douyuSttString.length()); + } + + @Test + void codecTest() { + String mapkb = "type@=mapkb/pk_time@=600/teams@=team@AA=5@ASres@AA=1@ASsc@AA=660000@ASbf@AA=0@AS@Steam@AA=6@ASres@AA=2@ASsc@AA=600000@ASbf@AA=0@AS@Steam@AA=4@ASres@AA=3@ASsc@AA=456000@ASbf@AA=0@AS@Steam@AA=2@ASres@AA=4@ASsc@AA=302000@ASbf@AA=0@AS@Steam@AA=3@ASres@AA=5@ASsc@AA=100000@ASbf@AA=0@AS@Steam@AA=1@ASres@AA=6@ASsc@AA=200@ASbf@AA=0@AS@S/"; + IDouyuMsg iDouyuMsg = DouyuCodecUtil.parseDouyuSttString(mapkb, DouyuCodecUtil.MSG_TYPE_RECEIVE); + String douyuSttString = DouyuCodecUtil.toDouyuSttString(iDouyuMsg); + System.out.println(mapkb); + System.out.println(douyuSttString); + assertEquals(mapkb.length(), douyuSttString.length()); + IDouyuMsg douyuSttStringMsg = DouyuCodecUtil.parseDouyuSttString(douyuSttString, DouyuCodecUtil.MSG_TYPE_RECEIVE); + assertNotNull(douyuSttStringMsg); + } + + @Test + void unescape() { + String unescape = DouyuCodecUtil.unescape("team@AA=5@ASres@AA=1@ASsc@AA=660000@ASbf@AA=0@AS@Steam@AA=6@ASres@AA=2@ASsc@AA=600000@ASbf@AA=0@AS@Steam@AA=4@ASres@AA=3@ASsc@AA=456000@ASbf@AA=0@AS@Steam@AA=2@ASres@AA=4@ASsc@AA=302000@ASbf@AA=0@AS@Steam@AA=3@ASres@AA=5@ASsc@AA=100000@ASbf@AA=0@AS@Steam@AA=1@ASres@AA=6@ASsc@AA=200@ASbf@AA=0@AS@S"); + System.out.println(unescape); + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/pom.xml b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/pom.xml new file mode 100644 index 0000000..ff7529a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/pom.xml @@ -0,0 +1,66 @@ + + + + 4.0.0 + + org.ruoyi + live-chat-clients + ${revision} + ../pom.xml + + jar + + live-chat-client-huya + live-chat-client-huya + + + UTF-8 + + + + + org.ruoyi + live-chat-client-servers-netty-client + + + + com.tencent.tars + tars-core + + + + ch.qos.logback + logback-classic + + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/api/HuyaApis.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/api/HuyaApis.java new file mode 100644 index 0000000..bd89130 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/api/HuyaApis.java @@ -0,0 +1,83 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.api; + +import cn.hutool.core.util.ReUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpStatus; +import cn.hutool.http.HttpUtil; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.PropsItem; + +import java.util.HashMap; +import java.util.Map; + +import static tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg.OBJECT_MAPPER; + +/** + * API简易版 + *
+ * vplayerUI.js + *
+ * taf-signal.global.0.0.4.prod.js + * + * @author mjz + * @date 2023/9/5 + */ +@Slf4j +public class HuyaApis { + + // TODO TimedCache + public static final Map GIFT_ITEMS = new HashMap<>(); + + public static JsonNode roomInit(Object roomId) { + @Cleanup + HttpResponse response = createGetRequest("https://www.huya.com/" + roomId, null).execute(); + if (response.getStatus() != HttpStatus.HTTP_OK) { + throw new BaseException("获取" + roomId + "真实房间ID失败"); + } + String body = response.body(); + String lSubChannelId = ReUtil.getGroup1("\"lp\"\\D+(\\d+)", body); + String lChannelId = ReUtil.getGroup1("\"lp\"\\D+(\\d+)", body); + String lYyid = ReUtil.getGroup1("\"yyid\"\\D+(\\d+)", body); + ObjectNode objectNode = OBJECT_MAPPER.createObjectNode(); + objectNode.put("lSubChannelId", StrUtil.emptyToDefault(lSubChannelId, "0")); + objectNode.put("lChannelId", StrUtil.emptyToDefault(lChannelId, "0")); + objectNode.put("lYyid", lYyid); + return objectNode; + } + + public static HttpRequest createGetRequest(String url, String cookies) { + return HttpUtil.createGet(url) + .cookie(cookies); + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/client/HuyaLiveChatClient.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/client/HuyaLiveChatClient.java new file mode 100644 index 0000000..ecad0b3 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/client/HuyaLiveChatClient.java @@ -0,0 +1,148 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.client; + +import io.netty.channel.EventLoopGroup; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.handler.codec.http.DefaultHttpHeaders; +import io.netty.handler.codec.http.websocketx.WebSocketClientHandshakerFactory; +import io.netty.handler.codec.http.websocketx.WebSocketFrame; +import io.netty.handler.codec.http.websocketx.WebSocketVersion; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.huya.config.HuyaLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaCmdEnum; +import tech.ordinaryroad.live.chat.client.huya.listener.IHuyaConnectionListener; +import tech.ordinaryroad.live.chat.client.huya.listener.IHuyaMsgListener; +import tech.ordinaryroad.live.chat.client.huya.msg.base.IHuyaMsg; +import tech.ordinaryroad.live.chat.client.huya.netty.frame.factory.HuyaWebSocketFrameFactory; +import tech.ordinaryroad.live.chat.client.huya.netty.handler.HuyaBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.huya.netty.handler.HuyaConnectionHandler; +import tech.ordinaryroad.live.chat.client.servers.netty.client.base.BaseNettyClient; + +import java.util.List; +import java.util.function.Consumer; + +/** + * 虎牙直播间弹幕客户端 + * + * @author mjz + * @date 2023/8/20 + */ +@Slf4j +public class HuyaLiveChatClient extends BaseNettyClient< + HuyaLiveChatClientConfig, + HuyaCmdEnum, + IHuyaMsg, + IHuyaMsgListener, + HuyaConnectionHandler, + HuyaBinaryFrameHandler> { + + public HuyaLiveChatClient(HuyaLiveChatClientConfig config, List msgListeners, IHuyaConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(config, workerGroup, connectionListener); + addMsgListeners(msgListeners); + + // 初始化 + this.init(); + } + + public HuyaLiveChatClient(HuyaLiveChatClientConfig config, IHuyaMsgListener msgListener, IHuyaConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(config, workerGroup, connectionListener); + addMsgListener(msgListener); + + // 初始化 + this.init(); + } + + public HuyaLiveChatClient(HuyaLiveChatClientConfig config, IHuyaMsgListener msgListener, IHuyaConnectionListener connectionListener) { + this(config, msgListener, connectionListener, new NioEventLoopGroup()); + } + + public HuyaLiveChatClient(HuyaLiveChatClientConfig config, IHuyaMsgListener msgListener) { + this(config, msgListener, null, new NioEventLoopGroup()); + } + + public HuyaLiveChatClient(HuyaLiveChatClientConfig config) { + this(config, null); + } + + + @Override + public HuyaConnectionHandler initConnectionHandler(IBaseConnectionListener clientConnectionListener) { + return new HuyaConnectionHandler( + WebSocketClientHandshakerFactory.newHandshaker(getWebsocketUri(), WebSocketVersion.V13, null, true, new DefaultHttpHeaders(), getConfig().getMaxFramePayloadLength()), + HuyaLiveChatClient.this, clientConnectionListener + ); + } + + @Override + public HuyaBinaryFrameHandler initBinaryFrameHandler() { + return new HuyaBinaryFrameHandler(super.msgListeners, HuyaLiveChatClient.this); + } + + @Override + public void sendDanmu(Object danmu, Runnable success, Consumer failed) { + if (!checkCanSendDanmu()) { + return; + } + + if (danmu instanceof String) { + String msg = (String) danmu; + if (log.isDebugEnabled()) { + log.debug("{} huya发送弹幕 {}", getConfig().getRoomId(), danmu); + } + + WebSocketFrame webSocketFrame = null; + try { + webSocketFrame = HuyaWebSocketFrameFactory.getInstance(getConfig().getRoomId()).createSendMessageReq(msg, getConfig().getVer(), getConfig().getCookie()); + } catch (Exception e) { + log.error("huya弹幕包创建失败", e); + if (failed != null) { + failed.accept(e); + } + } + if (webSocketFrame == null) { + return; + } + + send(webSocketFrame, () -> { + if (log.isDebugEnabled()) { + log.debug("huya弹幕发送成功 {}", danmu); + } + if (success != null) { + success.run(); + } + finishSendDanmu(); + }, throwable -> { + log.error("huya弹幕发送失败", throwable); + if (failed != null) { + failed.accept(throwable); + } + }); + } else { + super.sendDanmu(danmu); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/config/HuyaLiveChatClientConfig.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/config/HuyaLiveChatClientConfig.java new file mode 100644 index 0000000..176bc74 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/config/HuyaLiveChatClientConfig.java @@ -0,0 +1,84 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.config; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import tech.ordinaryroad.live.chat.client.servers.netty.client.config.BaseNettyClientConfig; + +/** + * 直播间弹幕客户端配置 + * + * @author mjz + * @date 2023/9/5 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@SuperBuilder(toBuilder = true) +public class HuyaLiveChatClientConfig extends BaseNettyClientConfig { + + public static final String VER = "2309271152"; + + @Builder.Default +// private String websocketUri = "wss://wsapi.huya.com:443"; + private String websocketUri = "wss://cdnws.api.huya.com:443"; + + @Builder.Default + private int aggregatorMaxContentLength = 64 * 1024 * 1024; + + @Builder.Default + private int maxFramePayloadLength = 64 * 1024 * 1024; + + @Builder.Default + private String ver = VER; + + @Builder.Default + private String exp = "15547.23738,16582.25335,32083.50834"; + + @Builder.Default + private String appSrc = "HUYA&ZH&2052"; + + public void setVer(String ver) { + String oldValue = this.ver; + this.ver = ver; + super.propertyChangeSupport.firePropertyChange("ver", oldValue, ver); + } + + public void setExp(String exp) { + String oldValue = this.exp; + this.exp = exp; + super.propertyChangeSupport.firePropertyChange("exp", oldValue, exp); + } + + public void setAppSrc(String appSrc) { + String oldValue = this.appSrc; + this.appSrc = appSrc; + super.propertyChangeSupport.firePropertyChange("appSrc", oldValue, appSrc); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaClientTemplateTypeEnum.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaClientTemplateTypeEnum.java new file mode 100644 index 0000000..48ddedf --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaClientTemplateTypeEnum.java @@ -0,0 +1,58 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.constant; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@RequiredArgsConstructor +public enum HuyaClientTemplateTypeEnum { + + TPL_PC(64), + TPL_WEB(32), + TPL_JIEDAI(16), + TPL_TEXAS(8), + TPL_MATCH(4), + TPL_HUYAAPP(2), + TPL_MIRROR(1), + ; + + private final int code; + + public static HuyaClientTemplateTypeEnum getByCode(int code) { + for (HuyaClientTemplateTypeEnum value : values()) { + if (value.getCode() == code) { + return value; + } + } + return null; + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaCmdEnum.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaCmdEnum.java new file mode 100644 index 0000000..e47b2c2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaCmdEnum.java @@ -0,0 +1,206 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.constant; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@RequiredArgsConstructor +public enum HuyaCmdEnum { + + NobleNotice(1001), + // NobleEnterNotice(1002), + NobleEnterNotice(1005), + NobleLevelNotice(1006), + MessageNotice(1400), + // ExpressionEmoticonNotice(1420), + ExpressionEmoticonNotice(1422), + OpenEmojiTrialNotice(1441), + SubscribeInfoNotify(3104), + PublicMessageAreaGuideWindow(6074), + // WeekStarPropsIds(6100), + WeekStarPropsIdsTab(6102), + /** + * https://dev.huya.com/docs/miniapp/dev/scenario/vip-event/ + */ + VipEnterBanner(6110), + VipBarListStatInfo(6211), + EnterPushInfo(6200), + GameAdvertisement(6201), + ViewerListRsp(6203), + VipBarListRsp(6210), + UserWeekRankScoreInfo(6219), + WeekRankListRsp(6220), + WeekRankEnterBanner(6221), + FansSupportListRsp(6223), + FansRankListRsp(6230), + BadgeInfo(6231), + BadgeScoreChanged(6232), + FansInfoNotice(6233), + UserGiftNotice(6234), + WeekStarPropsIds(6235), + SuperFansExtendInfo(6245), + TrialFansBadgeScoreChanged(6246), + GuardianCountChangedNotice(6249), + GiftBarRsp(6250), + GrandCeremonyChampionPresenter(6260), + LotteryAnnounce(6289), + NewsTicker(6290), + SendItemSubBroadcastPacket(6501), + SendItemNoticeWordBroadcastPacket(6502), + ShowScreenSkinNotify(6640), + HideScreenSkinNotify(6641), + ActivetyBarrageNotice(6650), + BannerNotice(6291), + // OnTVPanel(6294), + OnTVPanel(6295), + OnTVData(6296), + OnTVEndNotice(6297), + OnTVBarrageNotice(6298), + CheckRoomStatus(6340), + SendItemNoticeGameBroadcastPacket(6507), + SendItemActivityNoticeBroadcastPacket(6508), + SendItemOtherBroadcastPacket(6514), + GiftStatusNotify(6515), + ActivitySpecialNoticeBroadcastPacket(6540), + UserDIYMountsChanged(6575), + ObtainDecoNotify(6590), + TreasureResultBroadcastPacket(6602), + TreasureUpdateNotice(6604), + TreasureLotteryResultNoticePacket(6605), + TreasureBoxPanel(6606), + TreasureBoxBigAwardNotice(6607), + ItemLotterySubNotice(6616), + ItemLotteryGameNotice(6617), + FansBadgeLevelUpNotice(6710), + FansPromoteNotice(6711), + ActCommPanelChangeNotify(6647), + MatchRaffleResultNotice(7055), + BatchGameInfoNotice(7500), + GameInfoChangeNotice(7501), + EndHistoryGameNotice(7502), + GameSettlementNotice(7503), + PresenterEndGameNotice(7504), + // PresenterLevelNotice(7708), + PresenterLevelNotice(7709), + EffectsConfChangeNoticeMsg(7772), + BeginLiveNotice(8000), + EndLiveNotice(8001), + StreamSettingNotice(8002), + LiveInfoChangedNotice(8004), + AttendeeCountNotice(8006), + ReplayPresenterInLiveNotify(9010), + RoomAuditWarningNotice(10039), + AuditorEnterLiveNotice(10040), + AuditorRoleChangeNotice(10041), + GetRoomAuditConfRsp(10042), + UserConsumePrivilegeChangeNotice(10047), + LinkMicStatusChangeNotice(42008), + InterveneCountRsp(44000), + UserLevelUpgradeNotice(1000106), + PushUserLevelTaskCompleteNotice(1130055), + GuardianPresenterInfoNotice(1020001), + SupportCampInfoRsp(1025300), + UserSupportCampRsp(1025301), + UserSupportEffectRsp(1025302), + WSRedirect(1025305), + HuYaUdbNotify(10220051), + infoBody(10220053), + UnionAuthPushMsg(10220054), + RMessageNotify(1025000), + PushPresenterAdNotice(1025493), + RoomAdInfo(1025504), + // PushAdInfo(1025562), +// PushAdInfo(1025564), + PushAdInfo(1025566), + // AdExtServer.PushOfflineInfo(1025569), + WSP2POpenNotify(1025307), + WSP2PCloseNotify(1025308), + LiveMeetingSyncNotice(1025601), + MakeFriendsPKInfo(1025604), + LiveRoomTransferNotice(1025605), + GetPugcVipListRsp(1025800), + PugcVipInfo(1025801), + StreamChangeNotice(100000), + PayLiveRoomNotice(1033001), + MatchEndNotice(1034001), + LiveRoomProfileChangedNotice(1035400), + ACOrderInfo(1060003), + // WEBACT.Message(108e4), + MultiPKNotice(1090007), + MultiPKPanelInfo(1090009), + AiBarrageDetectNotify(1100003), + FloatMomentNotice(1130050), + FloatBallNotice(1130052), + VoiceMuteJsonInfo(1200000), + PixelateInfo(1200001), + // MpsDeliverData(1210000), + MpsDeliverData(1220000), + ActivityMsgRsp(1010003), + // Message(1040000), + Message(1040002), + LiveEventMessage(1040003), + LiveViewLimitChangeNotice(1035100), + PrivilegeRenewalNotice(1035101), + MatchRecLiveInfo(1029001), + GetBattleTeamInfoRsp(1029002), + // MatchGuess.MatchCmdColorNotify(1025312), + GameStatusInfo(1130003), + MatchPlaybackPointNotice(1150001), + PushFaceDirectorCurrentProgram(1130070), + JoinSplitScreenNotice(1500001), + LeaveSplitScreenNotice(1500002), + GameLivePromoteNotify(1800009), + MotorcadeGatherBeginNotice(2000001), + MotorcadeGatherEndNotice(2000002), + MotorcadeGatherResponseNotice(2000003), + MotorcadeActivityPanel(2000041), + MessageRichTextNotice(2001231), + MultiVideoSyncNotice(2400001), + PassParcelChangeNotify(2400002), + MatchLiveCommentorChangeNotify(2400020), + MessageEasterEggNotice(2001203), + MessageEasterEggToastNotice(2001202), + UserFollowStrollIconNotice(2410001), + UserFollowStrollBarrageNotice(2410002), +// LiveMatch.MatchLiveRoomRecMsg(2500406), + ; + + private final long code; + + public static HuyaCmdEnum getByCode(long code) { + for (HuyaCmdEnum value : HuyaCmdEnum.values()) { + if (value.code == code) { + return value; + } + } + return null; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaDecorationAppTypeEnum.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaDecorationAppTypeEnum.java new file mode 100644 index 0000000..834af67 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaDecorationAppTypeEnum.java @@ -0,0 +1,88 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.constant; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * @author mjz + * @date 2023/10/10 + */ +@Getter +@RequiredArgsConstructor +public enum HuyaDecorationAppTypeEnum { + + kDecorationAppTypeCommon(100), + kDecorationAppTypeContentBubble(5000), + kDecorationAppTypeContentBubbleNew(5001), + kDecorationAppTypeEffectsMessenger(5002), + kDecorationAppTypeMsgInterConnect(5010), + kDecorationAppTypeMsgLocation(5011), + kDecorationAppTypeChannel(10000), + kDecorationAppTypeGuildAdmin(10090), + kDecorationAppTypeAdmin(10100), + kDecorationAppTypeDaiyanClub(10150), + kDecorationAppTypeNoble(10200), + KDecorationAppTypeGuildVip(10210), + kDecorationAppTypeGuard(10300), + kDecorationAppTypeDiamondUser_V2(10310), + kDecorationAppTypeTeamMedalV2(10350), + kDecorationAppTypeTrialFans(10399), + kDecorationAppTypeFans(10400), + kDecorationAppTypeWatchTogetherVip(10425), + kDecorationAppTypeTeamMedal(10450), + kDecorationAppTypeVIP(10500), + kDecorationAppTypeUserProfile(10560), + kDecorationAppTyperPurpleDiamond(10600), + kDecorationAppTypeStamp(10700), + KDecorationAppTypeNobleEmoticon(10800), + KDecorationAppTypeAnotherAi(10801), + KDecorationAppTypePresenter(10900), + KDecorationAppTypeFirstRecharge(11000), + kDecorationAppTypeCheckRoom(11100), + kDecorationAppTypeTWatch(11101), + kDecorationAppTypeEasterEgg(11102), + kDecorationAppTypeRepeatMessengeFilter(11103), + kDecorationAppTypeEasterEggCounter(11104), + kDecorationAppTypeACOrderIntimacy(12001), + kDecorationAppTypeSuperWord(13000), + kDecorationAppTypeDiamondUser(14000), + kDecorationAppTypeRedBag(15000), + kDecorationAppTypeUsrAvatarDeco(100009), + kDecorationAppTypeUsrBeautyId(100100), + ; + + private final int code; + + public static HuyaDecorationAppTypeEnum getByCode(int code) { + for (HuyaDecorationAppTypeEnum value : values()) { + if (value.getCode() == code) { + return value; + } + } + return null; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaDecorationViewTypeEnum.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaDecorationViewTypeEnum.java new file mode 100644 index 0000000..3e1318b --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaDecorationViewTypeEnum.java @@ -0,0 +1,54 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.constant; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * @author mjz + * @date 2023/10/10 + */ +@Getter +@RequiredArgsConstructor +public enum HuyaDecorationViewTypeEnum { + + kDecorationViewTypeCustomized(0), + kDecorationViewTypeText(1), + kDecorationViewTypeIcon(2), + kDecorationViewTypeSuperWord(4), + ; + + private final int code; + + public static HuyaDecorationViewTypeEnum getByCode(int code) { + for (HuyaDecorationViewTypeEnum value : values()) { + if (value.getCode() == code) { + return value; + } + } + return null; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaGenderEnum.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaGenderEnum.java new file mode 100644 index 0000000..830c6f4 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaGenderEnum.java @@ -0,0 +1,51 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.constant; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@RequiredArgsConstructor +public enum HuyaGenderEnum { + + MALE(0), + FEMALE(1), + ; + private final int code; + + public static HuyaGenderEnum getByCode(int code) { + for (HuyaGenderEnum value : values()) { + if (value.getCode() == code) { + return value; + } + } + return null; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaLiveSource.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaLiveSource.java new file mode 100644 index 0000000..ce93ab6 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaLiveSource.java @@ -0,0 +1,54 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.constant; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@RequiredArgsConstructor +public enum HuyaLiveSource { + + PC_YY(0), + PC_HUYA(1), + MOBILE_HUYA(2), + WEB_HUYA(3), + ; + + private final int code; + + public static HuyaLiveSource getByCode(int code){ + for (HuyaLiveSource value : values()) { + if (value.getCode()==code) { + return value; + } + } + return null; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaOperationEnum.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaOperationEnum.java new file mode 100644 index 0000000..dca5979 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaOperationEnum.java @@ -0,0 +1,97 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.constant; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@RequiredArgsConstructor +public enum HuyaOperationEnum { + EWSCmd_NULL(0), + EWSCmd_RegisterReq(1), + EWSCmd_RegisterRsp(2), + EWSCmd_WupReq(3), + EWSCmd_WupRsp(4), + EWSCmdC2S_HeartBeat(5), + EWSCmdS2C_HeartBeatAck(6), + EWSCmdS2C_MsgPushReq(7), + EWSCmdC2S_DeregisterReq(8), + EWSCmdS2C_DeRegisterRsp(9), + EWSCmdC2S_VerifyCookieReq(10), + EWSCmdS2C_VerifyCookieRsp(11), + EWSCmdC2S_VerifyHuyaTokenReq(12), + EWSCmdS2C_VerifyHuyaTokenRsp(13), + EWSCmdC2S_UNVerifyReq(14), + EWSCmdS2C_UNVerifyRsp(15), + EWSCmdC2S_RegisterGroupReq(16), + EWSCmdS2C_RegisterGroupRsp(17), + EWSCmdC2S_UnRegisterGroupReq(18), + EWSCmdS2C_UnRegisterGroupRsp(19), + EWSCmdC2S_HeartBeatReq(20), + EWSCmdS2C_HeartBeatRsp(21), + EWSCmdS2C_MsgPushReq_V2(22), + EWSCmdC2S_UpdateUserExpsReq(23), + EWSCmdS2C_UpdateUserExpsRsp(24), + EWSCmdC2S_WSHistoryMsgReq(25), + EWSCmdS2C_WSHistoryMsgRsp(26), + EWSCmdS2C_EnterP2P(27), + EWSCmdS2C_EnterP2PAck(28), + EWSCmdS2C_ExitP2P(29), + EWSCmdS2C_ExitP2PAck(30), + EWSCmdC2S_SyncGroupReq(31), + EWSCmdS2C_SyncGroupRsp(32), + EWSCmdC2S_UpdateUserInfoReq(33), + EWSCmdS2C_UpdateUserInfoRsp(34), + EWSCmdC2S_MsgAckReq(35), + EWSCmdS2C_MsgAckRsp(36), + EWSCmdC2S_CloudGameReq(37), + EWSCmdS2C_CloudGamePush(38), + EWSCmdS2C_CloudGameRsp(39), + EWSCmdS2C_RpcReq(40), + EWSCmdC2S_RpcRsp(41), + EWSCmdS2C_RpcRspRsp(42), + EWSCmdC2S_GetStunPortReq(101), + EWSCmdS2C_GetStunPortRsp(102), + EWSCmdC2S_WebRTCOfferReq(103), + EWSCmdS2C_WebRTCOfferRsp(104), + EWSCmdC2S_SignalUpgradeReq(105), + EWSCmdS2C_SignalUpgradeRsp(106), + ; + private final int code; + + public static HuyaOperationEnum getByCode(int code) { + for (HuyaOperationEnum value : HuyaOperationEnum.values()) { + if (value.code == code) { + return value; + } + } + return null; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaStreamLineTypeEnum.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaStreamLineTypeEnum.java new file mode 100644 index 0000000..3696532 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaStreamLineTypeEnum.java @@ -0,0 +1,62 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.constant; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@RequiredArgsConstructor +public enum HuyaStreamLineTypeEnum { + + STREAM_LINE_OLD_YY(0), + STREAM_LINE_WS(1), + STREAM_LINE_NEW_YY(2), + STREAM_LINE_AL(3), + STREAM_LINE_HUYA(4), + STREAM_LINE_TX(5), + STREAM_LINE_CDN(8), + STREAM_LINE_HW(6), + STREAM_LINE_BD(7), + STREAM_LINE_GG(9), + STREAM_LINE_CF(10), + STREAM_LINE_QUICK_HUYA(99), + ; + + private final int code; + + public static HuyaStreamLineTypeEnum getByCode(int code) { + for (HuyaStreamLineTypeEnum value : values()) { + if (value.getCode() == code) { + return value; + } + } + return null; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaWupFunctionEnum.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaWupFunctionEnum.java new file mode 100644 index 0000000..c7e9906 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/constant/HuyaWupFunctionEnum.java @@ -0,0 +1,59 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.constant; + +import cn.hutool.core.util.StrUtil; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * @author mjz + * @date 2023/10/3 + */ +@Getter +@RequiredArgsConstructor +public enum HuyaWupFunctionEnum { + + doLaunch, + speak, + getPropsList, + OnUserHeartBeat, + getLivingInfo, + sendMessage, + ; + + public static HuyaWupFunctionEnum getByName(String name) { + if (StrUtil.isBlank(name)) { + return null; + } + + for (HuyaWupFunctionEnum value : values()) { + if (value.name().equals(name)) { + return value; + } + } + return null; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/listener/IHuyaConnectionListener.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/listener/IHuyaConnectionListener.java new file mode 100644 index 0000000..caa4674 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/listener/IHuyaConnectionListener.java @@ -0,0 +1,38 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.listener; + + +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.huya.netty.handler.HuyaConnectionHandler; + +/** + * 连接回调 + * + * @author mjz + * @date 2023/9/5 + */ +public interface IHuyaConnectionListener extends IBaseConnectionListener { +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/listener/IHuyaMsgListener.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/listener/IHuyaMsgListener.java new file mode 100644 index 0000000..48e656d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/listener/IHuyaMsgListener.java @@ -0,0 +1,45 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.listener; + +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseMsgListener; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IDanmuMsgListener; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IEnterRoomMsgListener; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IGiftMsgListener; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaCmdEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.MessageNoticeMsg; +import tech.ordinaryroad.live.chat.client.huya.msg.SendItemSubBroadcastPacketMsg; +import tech.ordinaryroad.live.chat.client.huya.msg.VipEnterBannerMsg; +import tech.ordinaryroad.live.chat.client.huya.netty.handler.HuyaBinaryFrameHandler; + +/** + * @author mjz + * @date 2023/9/5 + */ +public interface IHuyaMsgListener extends IBaseMsgListener, + IDanmuMsgListener, + IGiftMsgListener, + IEnterRoomMsgListener { +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/BaseWup.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/BaseWup.java new file mode 100644 index 0000000..9a924f3 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/BaseWup.java @@ -0,0 +1,138 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.support.TarsMethodInfo; +import com.qq.tars.protocol.util.TarsHelper; +import com.qq.tars.rpc.protocol.tars.TarsServantRequest; +import com.qq.tars.rpc.protocol.tup.UniAttribute; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufUtil; +import io.netty.buffer.Unpooled; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg; +import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg; +import tech.ordinaryroad.live.chat.client.huya.util.HuyaCodecUtil; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public abstract class BaseWup extends BaseHuyaMsg { + + private TarsServantRequest tarsServantRequest = new TarsServantRequest(null) {{ + setMethodInfo(new TarsMethodInfo()); + }}; + private UniAttribute uniAttribute = new UniAttribute(); + + public BaseWup(TarsInputStream is) { + this.readFrom(is); + } + + @Override + public void writeTo(TarsOutputStream os) { +// os.write(this.tarsServantRequest.getVersion(), 1); + os.write(TarsHelper.VERSION3, 1); + os.write(this.tarsServantRequest.getPacketType(), 2); + os.write(this.tarsServantRequest.getMessageType(), 3); + os.write(this.tarsServantRequest.getRequestId(), 4); + os.write(this.tarsServantRequest.getServantName(), 5); + os.write(this.tarsServantRequest.getFunctionName(), 6); + os.write(this.uniAttribute.encode(), 7); + os.write(this.tarsServantRequest.getTimeout(), 8); + os.write(this.tarsServantRequest.getContext(), 9); + os.write(this.tarsServantRequest.getStatus(), 10); + } + + @Override + public void readFrom(TarsInputStream is) { + this.tarsServantRequest.setVersion(is.read(this.tarsServantRequest.getVersion(), 1, false)); + this.tarsServantRequest.setPacketType(is.read(this.tarsServantRequest.getPacketType(), 2, false)); + this.tarsServantRequest.setMessageType(is.read(this.tarsServantRequest.getMessageType(), 3, false)); + this.tarsServantRequest.setRequestId(is.read(this.tarsServantRequest.getRequestId(), 4, false)); + this.tarsServantRequest.setServantName(is.read(this.tarsServantRequest.getServantName(), 5, false)); + this.tarsServantRequest.setFunctionName(is.read(this.tarsServantRequest.getFunctionName(), 6, false)); + this.uniAttribute.decode(is.read(new byte[]{}, 7, false)); + this.tarsServantRequest.setTimeout(is.read(this.tarsServantRequest.getTimeout(), 8, false)); + this.tarsServantRequest.setContext(is.readMap(this.tarsServantRequest.getContext(), 9, false)); + this.tarsServantRequest.setStatus(is.readMap(this.tarsServantRequest.getStatus(), 10, false)); + } + + public byte[] encode() { + TarsOutputStream wupTarsOutputStream = new TarsOutputStream(); + this.writeTo(wupTarsOutputStream); + + ByteBuf buffer = Unpooled.buffer(); + buffer.writeInt(4 + wupTarsOutputStream.getByteBuffer().position()); + buffer.writeBytes(wupTarsOutputStream.toByteArray()); + + return ByteBufUtil.getBytes(buffer); + } + + public void decode(byte[] bytes) { + ByteBuf byteBuf = Unpooled.wrappedBuffer(bytes); + int size = byteBuf.readInt(); + if (size < 4) { + return; + } + + bytes = new byte[byteBuf.readableBytes()]; + byteBuf.readBytes(bytes); + this.readFrom(HuyaCodecUtil.newUtf8TarsInputStream(bytes)); + } + + @Override + public String toString() { + Map map = new HashMap<>(); + map.put("version", this.tarsServantRequest.getVersion()); + map.put("packetType", this.tarsServantRequest.getPacketType()); + map.put("messageType", this.tarsServantRequest.getMessageType()); + map.put("requestId", this.tarsServantRequest.getRequestId()); + map.put("servantName", this.tarsServantRequest.getServantName()); + map.put("functionName", this.tarsServantRequest.getFunctionName()); + map.put("timeout", this.tarsServantRequest.getTimeout()); + map.put("context", this.tarsServantRequest.getContext()); + map.put("status", this.tarsServantRequest.getStatus()); + try { + return BaseMsg.OBJECT_MAPPER.writeValueAsString(map); + } catch (JsonProcessingException e) { + throw new BaseException(e); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/ConnectParaInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/ConnectParaInfo.java new file mode 100644 index 0000000..75e55e6 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/ConnectParaInfo.java @@ -0,0 +1,105 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author mjz + * @date 2023/9/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class ConnectParaInfo extends TarsStructBase { + + private long lUid = 0; + private String sGuid = ""; + private String sUA = ""; + private String sAppSrc = ""; + private String sMid = ""; + private String sExp = ""; + private int iTokenType = 0; + private String sToken = ""; + private String sCookie = ""; + private String sTraceId = ""; + private Map mCustomHeaders = new HashMap() {{ + put("", ""); + }}; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lUid, 0); + os.write(this.sGuid, 1); + os.write(this.sUA, 2); + os.write(this.sAppSrc, 3); + os.write(this.sMid, 4); + os.write(this.sExp, 5); + os.write(this.iTokenType, 6); + os.write(this.sToken, 7); + os.write(this.sCookie, 8); + os.write(this.sTraceId, 9); + os.write(this.mCustomHeaders, 10); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lUid = is.read(this.lUid, 0, false); + this.sGuid = is.read(this.sGuid, 1, false); + this.sUA = is.read(this.sUA, 2, false); + this.sAppSrc = is.read(this.sAppSrc, 3, false); + this.sMid = is.read(this.sMid, 4, false); + this.sExp = is.read(this.sExp, 5, false); + this.iTokenType = is.read(this.iTokenType, 6, false); + this.sToken = is.read(this.sToken, 7, false); + this.sCookie = is.read(this.sCookie, 8, false); + this.sTraceId = is.read(this.sTraceId, 9, false); + this.mCustomHeaders = is.readMap(this.mCustomHeaders, 10, false); + } + + public static ConnectParaInfo newWSConnectParaInfo(String ver, String sExp, String appSrc) { + ConnectParaInfo wsConnectParaInfo = new ConnectParaInfo(); +// wsConnectParaInfo.sGuid = UUID.fastUUID().toString(true); + + wsConnectParaInfo.sUA = String.format("webh5&%s&websocket", ver); + wsConnectParaInfo.sAppSrc = appSrc; + wsConnectParaInfo.sExp = sExp; + wsConnectParaInfo.mCustomHeaders = new HashMap() {{ + put("HUYA_NET", "0"); + put("HUYA_VSDKUA", wsConnectParaInfo.sUA); + }}; + return wsConnectParaInfo; + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/LiveLaunchRsp.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/LiveLaunchRsp.java new file mode 100644 index 0000000..71ed2cc --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/LiveLaunchRsp.java @@ -0,0 +1,78 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg; + +import cn.hutool.core.collection.CollUtil; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.LiveProxyValue; + +import java.util.List; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class LiveLaunchRsp extends BaseHuyaMsg { + + private String sGuid = ""; + private int iTime; + private List vProxyList = CollUtil.newArrayList(new LiveProxyValue()); + private int eAccess; + private String sClientIp = ""; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.sGuid, 0); + os.write(this.iTime, 1); + os.write(this.vProxyList, 2); + os.write(this.eAccess, 3); + os.write(this.sClientIp, 4); + } + + @Override + public void readFrom(TarsInputStream is) { + this.sGuid = is.read(this.sGuid, 0, false); + this.iTime = is.read(this.iTime, 1, false); + this.vProxyList = is.readArray(this.vProxyList, 2, false); + this.eAccess = is.read(this.eAccess, 3, false); + this.sClientIp = is.read(this.sClientIp, 4, false); + } + + @Override + public HuyaOperationEnum getOperationEnum() { + return HuyaOperationEnum.EWSCmd_WupRsp; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/MessageNoticeMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/MessageNoticeMsg.java new file mode 100644 index 0000000..a0178e5 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/MessageNoticeMsg.java @@ -0,0 +1,197 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg; + +import cn.hutool.core.collection.CollUtil; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IDanmuMsg; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.*; +import tech.ordinaryroad.live.chat.client.huya.util.HuyaCodecUtil; + +import java.util.List; +import java.util.Optional; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class MessageNoticeMsg extends BaseHuyaMsg implements IDanmuMsg { + + private SenderInfo tUserInfo = new SenderInfo(); + private long lTid; + private long lSid; + private String sContent = ""; + private int iShowMode; + private ContentFormat tFormat = new ContentFormat(); + private BulletFormat tBulletFormat = new BulletFormat(); + private int iTermType; + private List vDecorationPrefix = CollUtil.newArrayList(new DecorationInfo()); + private List vDecorationSuffix = CollUtil.newArrayList(new DecorationInfo()); + private List vAtSomeone = CollUtil.newArrayList(new UidNickName()); + private long lPid; + private List vBulletPrefix = CollUtil.newArrayList(new DecorationInfo()); + private String sIconUrl = ""; + private int iType; + private List vBulletSuffix = CollUtil.newArrayList(new DecorationInfo()); + private List vTagInfo = CollUtil.newArrayList(new MessageTagInfo()); + private SendMessageFormat tSenceFormat = new SendMessageFormat(); + private MessageContentExpand tContentExpand = new MessageContentExpand(); + private int iMessageMode; + + // region 额外属性 + private BadgeInfo badgeInfo; + // endregion + + public MessageNoticeMsg(TarsInputStream is) { + this.readFrom(is); + } + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.tUserInfo, 0); + os.write(this.lTid, 1); + os.write(this.lSid, 2); + os.write(this.sContent, 3); + os.write(this.iShowMode, 4); + os.write(this.tFormat, 5); + os.write(this.tBulletFormat, 6); + os.write(this.iTermType, 7); + os.write(this.vDecorationPrefix, 8); + os.write(this.vDecorationSuffix, 9); + os.write(this.vAtSomeone, 10); + os.write(this.lPid, 11); + os.write(this.vBulletPrefix, 12); + os.write(this.sIconUrl, 13); + os.write(this.iType, 14); + os.write(this.vBulletSuffix, 15); + os.write(this.vTagInfo, 16); + os.write(this.tSenceFormat, 17); + os.write(this.tContentExpand, 18); + os.write(this.iMessageMode, 19); + } + + @Override + public void readFrom(TarsInputStream is) { + this.tUserInfo = (SenderInfo) is.directRead(this.tUserInfo, 0, true); + this.lTid = is.read(this.lTid, 1, true); + this.lSid = is.read(this.lSid, 2, true); + this.sContent = is.readString(3, true); + this.iShowMode = is.read(this.iShowMode, 4, true); + this.tFormat = (ContentFormat) is.directRead(this.tFormat, 5, true); + this.tBulletFormat = (BulletFormat) is.directRead(this.tBulletFormat, 6, true); + this.iTermType = is.read(this.iTermType, 7, true); + this.vDecorationPrefix = is.readArray(this.vDecorationPrefix, 8, true); + this.vDecorationSuffix = is.readArray(this.vDecorationSuffix, 9, true); + this.vAtSomeone = is.readArray(this.vAtSomeone, 10, true); + this.lPid = is.read(this.lPid, 11, true); + this.vBulletPrefix = is.readArray(this.vBulletPrefix, 12, false); + this.sIconUrl = is.read(this.sIconUrl, 13, false); + this.iType = is.read(this.iType, 14, false); + this.vBulletSuffix = is.readArray(this.vBulletSuffix, 15, false); + this.vTagInfo = is.readArray(this.vTagInfo, 16, false); + this.tSenceFormat = (SendMessageFormat) is.directRead(this.tSenceFormat, 17, false); + this.tContentExpand = (MessageContentExpand) is.directRead(this.tContentExpand, 18, false); + this.iMessageMode = is.read(this.iMessageMode, 19, false); + + // 解析额外属性 + for (DecorationInfo decorationPrefix : vDecorationPrefix) { + Optional optional = HuyaCodecUtil.decodeDecorationInfo(decorationPrefix); + if (optional.isPresent()) { + TarsStructBase tarsStructBase = optional.get(); + if (tarsStructBase instanceof BadgeInfo) { + this.badgeInfo = (BadgeInfo) tarsStructBase; + break; + } + } + } + } + + @Override + public HuyaOperationEnum getOperationEnum() { + return HuyaOperationEnum.EWSCmdS2C_MsgPushReq; + } + + @Override + public String getBadgeName() { + if (this.badgeInfo == null) { + return ""; + } + + return this.badgeInfo.getSBadgeName(); + } + + @Override + public byte getBadgeLevel() { + if (this.badgeInfo == null) { + return 0; + } + + return (byte) this.badgeInfo.getIBadgeLevel(); + } + + @Override + public String getUid() { + if (this.tUserInfo == null) { + return null; + } + + return Long.toString(this.tUserInfo.getLUid()); + } + + @Override + public String getUsername() { + if (this.tUserInfo == null) { + return ""; + } + + return this.tUserInfo.getSNickName(); + } + + @Override + public String getUserAvatar() { + if (this.tUserInfo == null) { + return ""; + } + + return this.tUserInfo.getSAvatarUrl(); + } + + @Override + public String getContent() { + return this.sContent; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/PushMessage.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/PushMessage.java new file mode 100644 index 0000000..9008d88 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/PushMessage.java @@ -0,0 +1,84 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaCmdMsg; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class PushMessage extends BaseHuyaCmdMsg { + + private int ePushType; + private byte[] dataBytes; + private int iProtocolType; + private String sGroupId = ""; + private long lMsgId; + private int iMsgTag; + + public PushMessage(TarsInputStream is) { + this.readFrom(is); + } + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.ePushType, 0); + os.write(super.getLUri(), 1); + os.write(this.dataBytes, 2); + os.write(this.iProtocolType, 3); + os.write(this.sGroupId, 4); + os.write(this.lMsgId, 5); + os.write(this.iMsgTag, 6); + + } + + @Override + public void readFrom(TarsInputStream is) { + this.ePushType = is.read(this.ePushType, 0, true); + super.setLUri(is.read(super.getLUri(), 1, true)); + this.dataBytes = is.read(this.dataBytes, 2, true); + this.iProtocolType = is.read(this.iProtocolType, 3, true); + this.sGroupId = is.read(this.sGroupId, 4, true); + this.lMsgId = is.read(this.lMsgId, 5, true); + this.iMsgTag = is.read(this.iMsgTag, 6, true); + } + + @Override + public HuyaOperationEnum getOperationEnum() { + return HuyaOperationEnum.EWSCmdS2C_MsgPushReq_V2; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/PushMessage_V2.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/PushMessage_V2.java new file mode 100644 index 0000000..a9aa3b1 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/PushMessage_V2.java @@ -0,0 +1,73 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg; + +import cn.hutool.core.collection.CollUtil; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.MsgItem; + +import java.util.List; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class PushMessage_V2 extends BaseHuyaMsg { + + private String sGroupId; + private List vMsgItem = CollUtil.newArrayList(new MsgItem()); + + public PushMessage_V2(TarsInputStream is) { + this.readFrom(is); + } + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.sGroupId, 0); + os.write(this.vMsgItem, 1); + } + + @Override + public void readFrom(TarsInputStream is) { + this.sGroupId = is.read(this.sGroupId, 0, true); + this.vMsgItem = is.readArray(this.vMsgItem, 1, true); + } + + @Override + public HuyaOperationEnum getOperationEnum() { + return HuyaOperationEnum.EWSCmdS2C_MsgPushReq_V2; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/RegisterGroupRsp.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/RegisterGroupRsp.java new file mode 100644 index 0000000..1060ae5 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/RegisterGroupRsp.java @@ -0,0 +1,72 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg; + +import cn.hutool.core.collection.CollUtil; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg; + +import java.util.List; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class RegisterGroupRsp extends BaseHuyaMsg { + + private int iResCode; + private List vSupportP2PGroupId = CollUtil.newArrayList(""); + + public RegisterGroupRsp(TarsInputStream is) { + this.readFrom(is); + } + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iResCode, 0); + os.write(this.vSupportP2PGroupId, 1); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iResCode = is.read(this.iResCode, 0, true); + this.vSupportP2PGroupId = is.readArray(this.vSupportP2PGroupId, 1, true); + } + + @Override + public HuyaOperationEnum getOperationEnum() { + return HuyaOperationEnum.EWSCmdS2C_RegisterGroupRsp; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/RegisterRsp.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/RegisterRsp.java new file mode 100644 index 0000000..20ab1b0 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/RegisterRsp.java @@ -0,0 +1,75 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class RegisterRsp extends BaseHuyaMsg { + + private int iResCode; + private long lRequestId; + private String sMessage = ""; + private String sBCConnHost = ""; + + public RegisterRsp(TarsInputStream is) { + this.readFrom(is); + } + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iResCode, 0); + os.write(this.lRequestId, 1); + os.write(this.sMessage, 2); + os.write(this.sBCConnHost, 3); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iResCode = is.read(this.iResCode, 0, true); + this.lRequestId = is.read(this.lRequestId, 1, true); + this.sMessage = is.read(this.sMessage, 2, true); + this.sBCConnHost = is.read(this.sBCConnHost, 3, true); + } + + @Override + public HuyaOperationEnum getOperationEnum() { + return HuyaOperationEnum.EWSCmd_RegisterRsp; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/SendItemSubBroadcastPacketMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/SendItemSubBroadcastPacketMsg.java new file mode 100644 index 0000000..0fd0375 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/SendItemSubBroadcastPacketMsg.java @@ -0,0 +1,283 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IGiftMsg; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.*; +import tech.ordinaryroad.live.chat.client.huya.util.HuyaCodecUtil; + +import java.util.List; +import java.util.Optional; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class SendItemSubBroadcastPacketMsg extends BaseHuyaMsg implements IGiftMsg { + + private int iItemType; + private String strPayId = ""; + private int iItemCount; + private long lPresenterUid; + private long lSenderUid; + private String sPresenterNick = ""; + private String sSenderNick = ""; + private String sSendContent = ""; + private int iItemCountByGroup; + private int iItemGroup; + private int iSuperPupleLevel; + private int iComboScore; + private int iDisplayInfo; + private int iEffectType; + private String iSenderIcon = ""; + private String iPresenterIcon = ""; + private int iTemplateType; + private String sExpand = ""; + private boolean bBusi; + private int iColorEffectType; + private String sPropsName = ""; + private short iAccpet = 0; + private short iEventType = 0; + private UserIdentityInfo userInfo = new UserIdentityInfo(); + private long lRoomId = 0; + private long lHomeOwnerUid = 0; + // private int streamerInfo = new D.StreamerNode; + private int iPayType = -1; + private int iNobleLevel = 0; + private NobleLevelInfo tNobleLevel = new NobleLevelInfo(); + private ItemEffectInfo tEffectInfo = new ItemEffectInfo(); + private List vExUid = CollUtil.newArrayList(-1L); + private int iComboStatus = 0; + private int iPidColorType = 0; + private int iMultiSend = 0; + private int iVFanLevel = 0; + private int iUpgradeLevel = 0; + private String sCustomText = ""; + private DIYBigGiftEffect tDIYEffect = new DIYBigGiftEffect(); + private long lComboSeqId = 0; + private long lPayTotal = 0; +// private int vBizData = new V.Vector(new D.ItemEffectBizData); + + // region 额外属性 + private BadgeInfo badgeInfo; + private PropsItem propsItem = PropsItem.DEFAULT; + // endregion + + public SendItemSubBroadcastPacketMsg(TarsInputStream is) { + this.readFrom(is); + } + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iItemType, 0); + os.write(this.strPayId, 1); + os.write(this.iItemCount, 2); + os.write(this.lPresenterUid, 3); + os.write(this.lSenderUid, 4); + os.write(this.sPresenterNick, 5); + os.write(this.sSenderNick, 6); + os.write(this.sSendContent, 7); + os.write(this.iItemCountByGroup, 8); + os.write(this.iItemGroup, 9); + os.write(this.iSuperPupleLevel, 10); + os.write(this.iComboScore, 11); + os.write(this.iDisplayInfo, 12); + os.write(this.iEffectType, 13); + os.write(this.iSenderIcon, 14); + os.write(this.iPresenterIcon, 15); + os.write(this.iTemplateType, 16); + os.write(this.sExpand, 17); + os.write(this.bBusi, 18); + os.write(this.iColorEffectType, 19); + os.write(this.sPropsName, 20); + os.write(this.iAccpet, 21); + os.write(this.iEventType, 22); + os.write(this.userInfo, 23); + os.write(this.lRoomId, 24); + os.write(this.lHomeOwnerUid, 25); +// os.write(this.streamerInfo, 26); + os.write(this.iPayType, 27); + os.write(this.iNobleLevel, 28); + os.write(this.tNobleLevel, 29); + os.write(this.tEffectInfo, 30); + os.write(this.vExUid, 31); + os.write(this.iComboStatus, 32); + os.write(this.iPidColorType, 33); + os.write(this.iMultiSend, 34); + os.write(this.iVFanLevel, 35); + os.write(this.iUpgradeLevel, 36); + os.write(this.sCustomText, 37); + os.write(this.tDIYEffect, 38); + os.write(this.lComboSeqId, 39); + os.write(this.lPayTotal, 41); +// os.write(this.vBizData, 42); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iItemType = is.read(this.iItemType, 0, true); + this.strPayId = is.read(this.strPayId, 1, true); + this.iItemCount = is.read(this.iItemCount, 2, true); + this.lPresenterUid = is.read(this.lPresenterUid, 3, true); + this.lSenderUid = is.read(this.lSenderUid, 4, true); + this.sPresenterNick = is.read(this.sPresenterNick, 5, true); + this.sSenderNick = is.read(this.sSenderNick, 6, true); + this.sSendContent = is.read(this.sSendContent, 7, true); + this.iItemCountByGroup = is.read(this.iItemCountByGroup, 8, true); + this.iItemGroup = is.read(this.iItemGroup, 9, true); + this.iSuperPupleLevel = is.read(this.iSuperPupleLevel, 10, true); + this.iComboScore = is.read(this.iComboScore, 11, true); + this.iDisplayInfo = is.read(this.iDisplayInfo, 12, true); + this.iEffectType = is.read(this.iEffectType, 13, true); + this.iSenderIcon = is.read(this.iSenderIcon, 14, true); + this.iPresenterIcon = is.read(this.iPresenterIcon, 15, true); + this.iTemplateType = is.read(this.iTemplateType, 16, true); + this.sExpand = is.read(this.sExpand, 17, true); + this.bBusi = is.read(this.bBusi, 18, true); + this.iColorEffectType = is.read(this.iColorEffectType, 19, true); + this.sPropsName = is.read(this.sPropsName, 20, true); + this.iAccpet = is.read(this.iAccpet, 21, true); + this.iEventType = is.read(this.iEventType, 22, true); + this.userInfo = (UserIdentityInfo) is.directRead(this.userInfo, 23, true); + this.lRoomId = is.read(this.lRoomId, 24, true); + this.lHomeOwnerUid = is.read(this.lHomeOwnerUid, 25, true); +// this.streamerInfo = is.read(this.streamerInfo, 26, true); + this.iPayType = is.read(this.iPayType, 27, true); + this.iNobleLevel = is.read(this.iNobleLevel, 28, true); + this.tNobleLevel = (NobleLevelInfo) is.directRead(this.tNobleLevel, 29, true); + this.tEffectInfo = (ItemEffectInfo) is.directRead(this.tEffectInfo, 30, true); + this.vExUid = is.readArray(this.vExUid, 31, true); + this.iComboStatus = is.read(this.iComboStatus, 32, true); + this.iPidColorType = is.read(this.iPidColorType, 33, true); + this.iMultiSend = is.read(this.iMultiSend, 34, true); + this.iVFanLevel = is.read(this.iVFanLevel, 35, true); + this.iUpgradeLevel = is.read(this.iUpgradeLevel, 36, true); + this.sCustomText = is.read(this.sCustomText, 37, true); + this.tDIYEffect = (DIYBigGiftEffect) is.directRead(this.tDIYEffect, 38, true); + this.lComboSeqId = is.read(this.lComboSeqId, 39, true); + this.lPayTotal = is.read(this.lPayTotal, 41, true); +// this.vBizData = is.read(this.vBizData, 42, true); + + // 解析额外属性 + for (DecorationInfo decorationPrefix : userInfo.getVDecorationPrefix()) { + Optional optional = HuyaCodecUtil.decodeDecorationInfo(decorationPrefix); + if (optional.isPresent()) { + TarsStructBase tarsStructBase = optional.get(); + if (tarsStructBase instanceof BadgeInfo) { + this.badgeInfo = (BadgeInfo) tarsStructBase; + break; + } + } + } + } + + @Override + public String getUid() { + return Long.toString(this.lSenderUid); + } + + @Override + public String getUsername() { + return this.sSenderNick; + } + + @Override + public String getUserAvatar() { + return this.iSenderIcon; + } + + @Override + public String getGiftName() { + return this.sPropsName; + } + + @Override + public String getGiftImg() { + if (this.propsItem == null) { + return ""; + } + + List vPropsIdentity = this.propsItem.getVPropsIdentity(); + if (vPropsIdentity.isEmpty()) { + return ""; + } + + PropsIdentity propsIdentity = vPropsIdentity.get(0); + String sPropsWeb = propsIdentity.getSPropsWeb(); + if (StrUtil.isBlank(sPropsWeb)) { + return ""; + } + + return sPropsWeb.substring(0, sPropsWeb.indexOf("&")); + } + + @Override + public String getGiftId() { + return Long.toString(this.iItemType); + } + + @Override + public int getGiftCount() { + return this.iItemCount; + } + + /** + * 100 对应 1虎牙币 + */ + @Override + public int getGiftPrice() { + return (int) (this.lPayTotal / this.iItemCount); + } + + @Override + public String getReceiveUid() { + return Long.toString(this.lPresenterUid); + } + + @Override + public String getReceiveUsername() { + return this.sPresenterNick; + } + + @Override + public HuyaOperationEnum getOperationEnum() { + return HuyaOperationEnum.EWSCmdS2C_MsgPushReq; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/UserInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/UserInfo.java new file mode 100644 index 0000000..b8ef2ab --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/UserInfo.java @@ -0,0 +1,88 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/3 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class UserInfo extends TarsStructBase { + + private long lUid = 0; + private boolean bAnonymous = true; + private String sGuid = ""; + private String sToken = ""; + private long lTid = 0; + private long lSid = 0; + private long lGroupId = 0; + private long lGroupType = 0; + private String sAppId = ""; + private String sUA = ""; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lUid, 0); + os.write(this.bAnonymous, 1); + os.write(this.sGuid, 2); + os.write(this.sToken, 3); + os.write(this.lTid, 4); + os.write(this.lSid, 5); + os.write(this.lGroupId, 6); + os.write(this.lGroupType, 7); + os.write(this.sAppId, 8); + os.write(this.sUA, 9); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lUid = is.read(this.lUid, 0, true); + this.bAnonymous = is.read(this.bAnonymous, 1, true); + this.sGuid = is.read(this.sGuid, 2, true); + this.sToken = is.read(this.sToken, 3, true); + this.lTid = is.read(this.lTid, 4, true); + this.lSid = is.read(this.lSid, 5, true); + this.lGroupId = is.read(this.lGroupId, 6, true); + this.lGroupType = is.read(this.lGroupType, 7, true); + this.sAppId = is.read(this.sAppId, 8, true); + this.sUA = is.read(this.sUA, 9, true); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/VerifyCookieRsp.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/VerifyCookieRsp.java new file mode 100644 index 0000000..c080d6e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/VerifyCookieRsp.java @@ -0,0 +1,66 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class VerifyCookieRsp extends BaseHuyaMsg { + + private int iValidate; + + public VerifyCookieRsp(TarsInputStream is) { + this.readFrom(is); + } + + @Override + public void writeTo(TarsOutputStream os) { + os.write(0, this.iValidate); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iValidate = is.read(this.iValidate, 0, true); + } + + @Override + public HuyaOperationEnum getOperationEnum() { + return HuyaOperationEnum.EWSCmdS2C_VerifyCookieRsp; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/VipEnterBannerMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/VipEnterBannerMsg.java new file mode 100644 index 0000000..7fbfe94 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/VipEnterBannerMsg.java @@ -0,0 +1,144 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg; + +import cn.hutool.core.collection.CollUtil; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IEnterRoomMsg; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.*; + +import java.util.List; + +/** + * @author mjz + * @date 2023/12/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class VipEnterBannerMsg extends BaseHuyaMsg implements IEnterRoomMsg { + + private long lUid; + private String sNickName = ""; + private long lPid; + private NobleInfo tNobleInfo = new NobleInfo(); + private GuardInfo tGuardInfo = new GuardInfo(); + private WeekRankInfo tWeekRankInfo = new WeekRankInfo(); + private String sLogoURL = ""; + private boolean bFromNearby; + private String sLocation = ""; + private DecorationInfoRsp tDecorationInfo = new DecorationInfoRsp(); + private WeekRankInfo tWeekHeartStirRankInfo = new WeekRankInfo(); + private WeekRankInfo tWeekHeartBlockRankInfo = new WeekRankInfo(); + private int iMasterRank; + private ACEnterBanner tACInfo = new ACEnterBanner(); + private List vCommEnterBanner = CollUtil.newArrayList(new CommEnterBanner()); + private UserRidePetInfo tRidePetInfo = new UserRidePetInfo(); + + public VipEnterBannerMsg(TarsInputStream is) { + this.readFrom(is); + } + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lUid, 0); + os.write(this.sNickName, 1); + os.write(this.lPid, 2); + os.write(this.tNobleInfo, 3); + os.write(this.tGuardInfo, 4); + os.write(this.tWeekRankInfo, 5); + os.write(this.sLogoURL, 6); + os.write(this.bFromNearby, 7); + os.write(this.sLocation, 8); + os.write(this.tDecorationInfo, 9); + os.write(this.tWeekHeartStirRankInfo, 10); + os.write(this.tWeekHeartBlockRankInfo, 11); + os.write(this.iMasterRank, 12); + os.write(this.tACInfo, 13); + os.write(this.vCommEnterBanner, 14); + os.write(this.tRidePetInfo, 15); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lUid = is.read(this.lUid, 0, false); + this.sNickName = is.read(this.sNickName, 1, false); + this.lPid = is.read(this.lPid, 2, false); + this.tNobleInfo = (NobleInfo) is.directRead(this.tNobleInfo, 3, false); + this.tGuardInfo = (GuardInfo) is.directRead(this.tGuardInfo, 4, false); + this.tWeekRankInfo = (WeekRankInfo) is.directRead(this.tWeekRankInfo, 5, false); + this.sLogoURL = is.read(this.sLogoURL, 6, false); + this.bFromNearby = is.read(this.bFromNearby, 7, false); + this.sLocation = is.read(this.sLocation, 8, false); + this.tDecorationInfo = (DecorationInfoRsp) is.directRead(this.tDecorationInfo, 9, false); + this.tWeekHeartStirRankInfo = (WeekRankInfo) is.directRead(this.tWeekHeartStirRankInfo, 10, false); + this.tWeekHeartBlockRankInfo = (WeekRankInfo) is.directRead(this.tWeekHeartBlockRankInfo, 11, false); + this.iMasterRank = is.read(this.iMasterRank, 12, false); + this.tACInfo = (ACEnterBanner) is.directRead(this.tACInfo, 13, false); + this.vCommEnterBanner = is.readArray(this.vCommEnterBanner, 14, false); + this.tRidePetInfo = (UserRidePetInfo) is.directRead(this.tRidePetInfo, 15, false); + } + + @Override + public String getBadgeName() { + // TODO + return null; + } + + @Override + public byte getBadgeLevel() { + // TODO + return 0; + } + + @Override + public String getUid() { + return Long.toString(lUid); + } + + @Override + public String getUsername() { + return sNickName; + } + + @Override + public String getUserAvatar() { + // TODO + return IEnterRoomMsg.super.getUserAvatar(); + } + + @Override + public HuyaOperationEnum getOperationEnum() { + return HuyaOperationEnum.EWSCmdS2C_MsgPushReq; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/WebSocketCommand.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/WebSocketCommand.java new file mode 100644 index 0000000..6c71ae5 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/WebSocketCommand.java @@ -0,0 +1,84 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaMsg; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class WebSocketCommand extends BaseHuyaMsg { + + private int operation; + private byte[] vData; + private long lRequestId; + private String traceId = ""; + private int iEncryptType; + private long lTime; + private String sMD5 = ""; + + public WebSocketCommand(TarsInputStream is) { + this.readFrom(is); + } + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.operation, 0); + os.write(this.vData, 1); + os.write(this.lRequestId, 2); + os.write(this.traceId, 3); + os.write(this.iEncryptType, 4); + os.write(this.lTime, 5); + os.write(this.sMD5, 6); + } + + @Override + public void readFrom(TarsInputStream is) { + this.operation = is.read(this.operation, 0, true); + this.vData = is.read(this.vData, 1, true); + this.lRequestId = is.read(this.lRequestId, 2, true); + this.traceId = is.read(this.traceId, 3, true); + this.iEncryptType = is.read(this.iEncryptType, 4, true); + this.lTime = is.read(this.lTime, 5, true); + this.sMD5 = is.read(this.sMD5, 6, true); + } + + @Override + public HuyaOperationEnum getOperationEnum() { + return HuyaOperationEnum.getByCode(operation); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/WupRsp.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/WupRsp.java new file mode 100644 index 0000000..443866c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/WupRsp.java @@ -0,0 +1,45 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg; + +import lombok.NoArgsConstructor; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; + +/** + * @author mjz + * @date 2023/10/3 + */ +@NoArgsConstructor +public class WupRsp extends BaseWup { + + public WupRsp(byte[] vData) { + super.decode(vData); + } + + @Override + public HuyaOperationEnum getOperationEnum() { + return HuyaOperationEnum.EWSCmd_WupRsp; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/BaseHuyaCmdMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/BaseHuyaCmdMsg.java new file mode 100644 index 0000000..2b5c1cf --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/BaseHuyaCmdMsg.java @@ -0,0 +1,79 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.base; + +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.StrUtil; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaCmdEnum; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public abstract class BaseHuyaCmdMsg extends TarsStructBase implements IHuyaCmdMsg { + + private long lUri; + + @Override + public String getCmd() { + return StrUtil.nullToEmpty(StrUtil.toStringOrNull(this.lUri)); + } + + @Override + public void setCmd(String cmd) { + this.lUri = NumberUtil.parseLong(cmd); + } + + @Override + public HuyaCmdEnum getCmdEnum() { + return HuyaCmdEnum.getByCode(this.lUri); + } + + @Override + public TarsStructBase newInit() { + return this; + } + + @Override + public String toString() { + try { + return BaseMsg.OBJECT_MAPPER.writeValueAsString(this); + } catch (JsonProcessingException e) { + throw new BaseException(e); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/BaseHuyaMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/BaseHuyaMsg.java new file mode 100644 index 0000000..b0dd169 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/BaseHuyaMsg.java @@ -0,0 +1,51 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.base; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.qq.tars.protocol.tars.TarsStructBase; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg; + +/** + * @author mjz + * @date 2023/10/2 + */ +public abstract class BaseHuyaMsg extends TarsStructBase implements IHuyaMsg { + + @Override + public TarsStructBase newInit() { + return this; + } + + @Override + public String toString() { + try { + return BaseMsg.OBJECT_MAPPER.writeValueAsString(this); + } catch (JsonProcessingException e) { + throw new BaseException(e); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/IHuyaCmdMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/IHuyaCmdMsg.java new file mode 100644 index 0000000..41ab6e2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/IHuyaCmdMsg.java @@ -0,0 +1,35 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.base; + +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaCmdEnum; + +/** + * @author mjz + * @date 2023/10/2 + */ +public interface IHuyaCmdMsg extends IHuyaMsg, ICmdMsg { +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/IHuyaMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/IHuyaMsg.java new file mode 100644 index 0000000..0fc8aa0 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/base/IHuyaMsg.java @@ -0,0 +1,38 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.base; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; + +/** + * @author mjz + * @date 2023/8/26 + */ +public interface IHuyaMsg extends IMsg { + @JsonIgnore + HuyaOperationEnum getOperationEnum(); +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ACEnterBanner.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ACEnterBanner.java new file mode 100644 index 0000000..e907675 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ACEnterBanner.java @@ -0,0 +1,70 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/12/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class ACEnterBanner extends TarsStructBase { + + private int iWeekHeartStirRank; + private int iWeekHeartBlockRank; + private int iMasterRank; + private int iACWeekRank; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iWeekHeartStirRank, 0); + os.write(this.iWeekHeartBlockRank, 1); + os.write(this.iMasterRank, 2); + os.write(this.iACWeekRank, 3); + } + + @Override + public void readFrom(TarsInputStream is) { + is.read(this.iWeekHeartStirRank, 0, false); + is.read(this.iWeekHeartBlockRank, 1, false); + is.read(this.iMasterRank, 2, false); + is.read(this.iACWeekRank, 3, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/BadgeInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/BadgeInfo.java new file mode 100644 index 0000000..e9233b0 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/BadgeInfo.java @@ -0,0 +1,119 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/10 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class BadgeInfo extends TarsStructBase { + + private long lUid; + private long lBadgeId; + private String sPresenterNickName = ""; + private String sBadgeName = ""; + private int iBadgeLevel; + private int iRank; + private int iScore; + private int iNextScore; + private int iQuotaUsed; + private int iQuota; + private long lQuotaTS; + private long lOpenTS; + private int iVFlag; + private String sVLogo = ""; + private PresenterChannelInfo tChannelInfo = new PresenterChannelInfo(); + private String sPresenterLogo = ""; + private long lVExpiredTS; + private int iBadgeType; + private FaithInfo tFaithInfo = new FaithInfo(); + private SuperFansInfo tSuperFansInfo = new SuperFansInfo(); + private int iBaseQuota; + private long lVConsumRank; + private int iCustomBadgeFlag; + private int iAgingDays; + private int iDayScore; + private CustomBadgeDynamicExternal tExternal = new CustomBadgeDynamicExternal(); + private int iExtinguished; + private int iExtinguishDays; + private int iBadgeCate; + private int iLiveFlag; + + @Override + public void writeTo(TarsOutputStream os) { + + } + + @Override + public void readFrom(TarsInputStream is) { + this.lUid = is.read(this.lUid, 0, false); + this.lBadgeId = is.read(this.lBadgeId, 1, false); + this.sPresenterNickName = is.read(this.sPresenterNickName, 2, false); + this.sBadgeName = is.read(this.sBadgeName, 3, false); + this.iBadgeLevel = is.read(this.iBadgeLevel, 4, false); + this.iRank = is.read(this.iRank, 5, false); + this.iScore = is.read(this.iScore, 6, false); + this.iNextScore = is.read(this.iNextScore, 7, false); + this.iQuotaUsed = is.read(this.iQuotaUsed, 8, false); + this.iQuota = is.read(this.iQuota, 9, false); + this.lQuotaTS = is.read(this.lQuotaTS, 10, false); + this.lOpenTS = is.read(this.lOpenTS, 11, false); + this.iVFlag = is.read(this.iVFlag, 12, false); + this.sVLogo = is.read(this.sVLogo, 13, false); + this.tChannelInfo = (PresenterChannelInfo) is.directRead(this.tChannelInfo, 14, false); + this.sPresenterLogo = is.read(this.sPresenterLogo, 15, false); + this.lVExpiredTS = is.read(this.lVExpiredTS, 16, false); + this.iBadgeType = is.read(this.iBadgeType, 17, false); + this.tFaithInfo = (FaithInfo) is.directRead(this.tFaithInfo, 18, false); + this.tSuperFansInfo = (SuperFansInfo) is.directRead(this.tSuperFansInfo, 19, false); + this.iBaseQuota = is.read(this.iBaseQuota, 20, false); + this.lVConsumRank = is.read(this.lVConsumRank, 21, false); + this.iCustomBadgeFlag = is.read(this.iCustomBadgeFlag, 22, false); + this.iAgingDays = is.read(this.iAgingDays, 23, false); + this.iDayScore = is.read(this.iDayScore, 24, false); + this.tExternal = (CustomBadgeDynamicExternal) is.directRead(this.tExternal, 25, false); + this.iExtinguished = is.read(this.iExtinguished, 26, false); + this.iExtinguishDays = is.read(this.iExtinguishDays, 27, false); + this.iBadgeCate = is.read(this.iBadgeCate, 28, false); + this.iLiveFlag = is.read(this.iLiveFlag, 29, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/BulletBorderGroundFormat.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/BulletBorderGroundFormat.java new file mode 100644 index 0000000..61fabb2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/BulletBorderGroundFormat.java @@ -0,0 +1,85 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class BulletBorderGroundFormat extends TarsStructBase { + + private int iEnableUse; + private int iBorderThickness; + private int iBorderColour = -1; + private int iBorderDiaphaneity = 100; + private int iGroundColour = -1; + private int iGroundColourDiaphaneity = 100; + private String sAvatarDecorationUrl = ""; + private int iFontColor = -1; + private int iTerminalFlag = -1; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iEnableUse, 0); + os.write(this.iBorderThickness, 1); + os.write(this.iBorderColour, 2); + os.write(this.iBorderDiaphaneity, 3); + os.write(this.iGroundColour, 4); + os.write(this.iGroundColourDiaphaneity, 5); + os.write(this.sAvatarDecorationUrl, 6); + os.write(this.iFontColor, 7); + os.write(this.iTerminalFlag, 8); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iEnableUse = is.read(this.iEnableUse, 0, false); + this.iBorderThickness = is.read(this.iBorderThickness, 1, false); + this.iBorderColour = is.read(this.iBorderColour, 2, false); + this.iBorderDiaphaneity = is.read(this.iBorderDiaphaneity, 3, false); + this.iGroundColour = is.read(this.iGroundColour, 4, false); + this.iGroundColourDiaphaneity = is.read(this.iGroundColourDiaphaneity, 5, false); + this.sAvatarDecorationUrl = is.read(this.sAvatarDecorationUrl, 6, false); + this.iFontColor = is.read(this.iFontColor, 7, false); + this.iTerminalFlag = is.read(this.iTerminalFlag, 8, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/BulletFormat.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/BulletFormat.java new file mode 100644 index 0000000..5f81da9 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/BulletFormat.java @@ -0,0 +1,89 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import cn.hutool.core.collection.CollUtil; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.List; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class BulletFormat extends TarsStructBase { + + private int iFontColor = -1; + private int iFontSize = 4; + private int iTextSpeed = 0; + private int iTransitionType = 1; + private int iPopupStyle = 0; + private BulletBorderGroundFormat tBorderGroundFormat = new BulletBorderGroundFormat(); + private List vGraduatedColor = CollUtil.newArrayList(0); + private int iAvatarFlag = 0; + private int iAvatarTerminalFlag = -1; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iFontColor, 0); + os.write(this.iFontSize, 1); + os.write(this.iTextSpeed, 2); + os.write(this.iTransitionType, 3); + os.write(this.iPopupStyle, 4); + os.write(this.tBorderGroundFormat, 5); + os.write(this.vGraduatedColor, 6); + os.write(this.iAvatarFlag, 7); + os.write(this.iAvatarTerminalFlag, 8); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iFontColor = is.read(this.iFontColor, 0, false); + this.iFontSize = is.read(this.iFontSize, 1, false); + this.iTextSpeed = is.read(this.iTextSpeed, 2, false); + this.iTransitionType = is.read(this.iTransitionType, 3, false); + this.iPopupStyle = is.read(this.iPopupStyle, 4, false); + this.tBorderGroundFormat = (BulletBorderGroundFormat) is.directRead(this.tBorderGroundFormat, 5, false); + this.vGraduatedColor = is.readArray(this.vGraduatedColor, 6, false); + this.iAvatarFlag = is.read(this.iAvatarFlag, 7, false); + this.iAvatarTerminalFlag = is.read(this.iAvatarTerminalFlag, 8, false); + + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ChannelPair.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ChannelPair.java new file mode 100644 index 0000000..4bb796a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ChannelPair.java @@ -0,0 +1,67 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/12/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class ChannelPair extends TarsStructBase { + + private long lTid; + private long lSid; + private long lPid; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lTid, 0); + os.write(this.lSid, 1); + os.write(this.lPid, 2); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lTid = is.read(this.lTid, 0, false); + this.lSid = is.read(this.lSid, 1, false); + this.lPid = is.read(this.lPid, 2, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/CommEnterBanner.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/CommEnterBanner.java new file mode 100644 index 0000000..900178d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/CommEnterBanner.java @@ -0,0 +1,67 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/12/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class CommEnterBanner extends TarsStructBase { + + private int iBannerUri; + private int iViewType; + private byte[] vData; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iBannerUri, 0); + os.write(this.iViewType, 1); + os.write(this.vData, 2); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iBannerUri = is.read(this.iBannerUri, 0, false); + this.iViewType = is.read(this.iViewType, 1, false); + this.vData = is.read(this.vData, 2, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ContentFormat.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ContentFormat.java new file mode 100644 index 0000000..594baf1 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ContentFormat.java @@ -0,0 +1,76 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class ContentFormat extends TarsStructBase { + + private int iFontColor = -1; + private int iFontSize = 4; + private int iPopupStyle = 0; + private int iNickNameFontColor = -1; + private int iDarkFontColor = -1; + private int iDarkNickNameFontColor = -1; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iFontColor, 0); + os.write(this.iFontSize, 1); + os.write(this.iPopupStyle, 2); + os.write(this.iNickNameFontColor, 3); + os.write(this.iDarkFontColor, 4); + os.write(this.iDarkNickNameFontColor, 5); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iFontColor = is.read(this.iFontColor, 0, false); + this.iFontSize = is.read(this.iFontSize, 1, false); + this.iPopupStyle = is.read(this.iPopupStyle, 2, false); + this.iNickNameFontColor = is.read(this.iNickNameFontColor, 3, false); + this.iDarkFontColor = is.read(this.iDarkFontColor, 4, false); + this.iDarkNickNameFontColor = is.read(this.iDarkNickNameFontColor, 5, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/CustomBadgeDynamicExternal.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/CustomBadgeDynamicExternal.java new file mode 100644 index 0000000..bb8d5aa --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/CustomBadgeDynamicExternal.java @@ -0,0 +1,64 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/10 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class CustomBadgeDynamicExternal extends TarsStructBase { + + private String sFloorExter = ""; + private int iFansIdentity; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.sFloorExter, 0); + os.write(this.iFansIdentity, 1); + } + + @Override + public void readFrom(TarsInputStream is) { + this.sFloorExter = is.read(this.sFloorExter, 0, false); + this.iFansIdentity = is.read(this.iFansIdentity, 1, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DIYBigGiftEffect.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DIYBigGiftEffect.java new file mode 100644 index 0000000..b93da5a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DIYBigGiftEffect.java @@ -0,0 +1,70 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/10 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class DIYBigGiftEffect extends TarsStructBase { + + private String sResourceUrl = ""; + private String sResourceAttr = ""; + private String sWebResourceUrl = ""; + private String sPCResourceUrl = ""; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.sResourceUrl, 0); + os.write(this.sResourceAttr, 1); + os.write(this.sWebResourceUrl, 2); + os.write(this.sPCResourceUrl, 3); + } + + @Override + public void readFrom(TarsInputStream is) { + this.sResourceUrl = is.read(this.sResourceUrl, 0, false); + this.sResourceAttr = is.read(this.sResourceAttr, 1, false); + this.sWebResourceUrl = is.read(this.sWebResourceUrl, 2, false); + this.sPCResourceUrl = is.read(this.sPCResourceUrl, 3, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DecorationInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DecorationInfo.java new file mode 100644 index 0000000..747518d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DecorationInfo.java @@ -0,0 +1,67 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/3 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class DecorationInfo extends TarsStructBase { + + private int iAppId = 0; + private int iViewType = 0; + private byte[] vData; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iAppId, 0); + os.write(this.iViewType, 1); + os.write(this.vData, 2); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iAppId = is.read(this.iAppId, 0, true); + this.iViewType = is.read(this.iViewType, 1, true); + this.vData = is.read(this.vData, 2, true); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DecorationInfoRsp.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DecorationInfoRsp.java new file mode 100644 index 0000000..9c93cc4 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DecorationInfoRsp.java @@ -0,0 +1,88 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import cn.hutool.core.collection.CollUtil; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.List; + +/** + * @author mjz + * @date 2023/12/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class DecorationInfoRsp extends TarsStructBase { + + private List vDecorationPrefix = CollUtil.newArrayList(new DecorationInfo()); + private List vDecorationSuffix = CollUtil.newArrayList(new DecorationInfo()); + private ContentFormat tFormat = new ContentFormat(); + private BulletFormat tBulletFormat = new BulletFormat(); + private List vForwardChannels = CollUtil.newArrayList(new ChannelPair()); + private int iModifyMask; + private List vBulletPrefix = CollUtil.newArrayList(new DecorationInfo()); + private SenderInfo tUserInfo = new SenderInfo(); + private List vBulletSuffix = CollUtil.newArrayList(new DecorationInfo()); + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.vDecorationPrefix, 0); + os.write(this.vDecorationSuffix, 1); + os.write(this.tFormat, 2); + os.write(this.tBulletFormat, 3); + os.write(this.vForwardChannels, 4); + os.write(this.iModifyMask, 5); + os.write(this.vBulletPrefix, 6); + os.write(this.tUserInfo, 7); + os.write(this.vBulletSuffix, 8); + } + + @Override + public void readFrom(TarsInputStream is) { + this.vDecorationPrefix = is.readArray(this.vDecorationPrefix, 0, false); + this.vDecorationSuffix = is.readArray(this.vDecorationSuffix, 1, false); + this.tFormat = (ContentFormat) is.directRead(this.tFormat, 2, false); + this.tBulletFormat = (BulletFormat) is.directRead(this.tBulletFormat, 3, false); + this.vForwardChannels = is.readArray(this.vForwardChannels, 4, false); + this.iModifyMask = is.read(this.iModifyMask, 5, false); + this.vBulletPrefix = is.readArray(this.vBulletPrefix, 6, false); + this.tUserInfo = (SenderInfo) is.directRead(this.tUserInfo, 7, false); + this.vBulletSuffix = is.readArray(this.vBulletSuffix, 8, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DeviceInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DeviceInfo.java new file mode 100644 index 0000000..8e8d93b --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DeviceInfo.java @@ -0,0 +1,73 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class DeviceInfo extends TarsStructBase { + + private String sIMEI = ""; + private String sAPN = ""; + private String sNetType = ""; + private String sDeviceId = ""; + private String sMId = ""; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.sIMEI, 0); + os.write(this.sAPN, 1); + os.write(this.sNetType, 2); + os.write(this.sDeviceId, 3); + os.write(this.sMId, 4); + } + + @Override + public void readFrom(TarsInputStream is) { + this.sIMEI = is.read(this.sIMEI, 0, false); + this.sAPN = is.read(this.sAPN, 1, false); + this.sNetType = is.read(this.sNetType, 2, false); + this.sDeviceId = is.read(this.sDeviceId, 3, false); + this.sMId = is.read(this.sMId, 4, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DisplayInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DisplayInfo.java new file mode 100644 index 0000000..1a23b3f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/DisplayInfo.java @@ -0,0 +1,91 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/3 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class DisplayInfo extends TarsStructBase { + + private int iMarqueeScopeMin = 0; + private int iMarqueeScopeMax = 0; + private int iCurrentVideoNum = 0; + private int iCurrentVideoMin = 0; + private int iCurrentVideoMax = 0; + private int iAllVideoNum = 0; + private int iAllVideoMin = 0; + private int iAllVideoMax = 0; + private int iCurrentScreenNum = 0; + private int iCurrentScreenMin = 0; + private int iCurrentScreenMax = 0; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iMarqueeScopeMin, 1); + os.write(this.iMarqueeScopeMax, 2); + os.write(this.iCurrentVideoNum, 3); + os.write(this.iCurrentVideoMin, 4); + os.write(this.iCurrentVideoMax, 5); + os.write(this.iAllVideoNum, 6); + os.write(this.iAllVideoMin, 7); + os.write(this.iAllVideoMax, 8); + os.write(this.iCurrentScreenNum, 9); + os.write(this.iCurrentScreenMin, 10); + os.write(this.iCurrentScreenMax, 11); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iMarqueeScopeMin = is.read(this.iMarqueeScopeMin, 1, true); + this.iMarqueeScopeMax = is.read(this.iMarqueeScopeMax, 2, true); + this.iCurrentVideoNum = is.read(this.iCurrentVideoNum, 3, true); + this.iCurrentVideoMin = is.read(this.iCurrentVideoMin, 4, true); + this.iCurrentVideoMax = is.read(this.iCurrentVideoMax, 5, true); + this.iAllVideoNum = is.read(this.iAllVideoNum, 6, true); + this.iAllVideoMin = is.read(this.iAllVideoMin, 7, true); + this.iAllVideoMax = is.read(this.iAllVideoMax, 8, true); + this.iCurrentScreenNum = is.read(this.iCurrentScreenNum, 9, true); + this.iCurrentScreenMin = is.read(this.iCurrentScreenMin, 10, true); + this.iCurrentScreenMax = is.read(this.iCurrentScreenMax, 11, true); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/FaithInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/FaithInfo.java new file mode 100644 index 0000000..1faa752 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/FaithInfo.java @@ -0,0 +1,67 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import cn.hutool.core.collection.CollUtil; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.List; + +/** + * @author mjz + * @date 2023/10/10 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class FaithInfo extends TarsStructBase { + + private String sFaithName = ""; + private List vPresenter = CollUtil.newArrayList(new FaithPresenter()); + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.sFaithName, 0); + os.write(this.vPresenter, 1); + } + + @Override + public void readFrom(TarsInputStream is) { + this.sFaithName = is.read(this.sFaithName, 0, false); + this.vPresenter = is.readArray(this.vPresenter, 1, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/FaithPresenter.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/FaithPresenter.java new file mode 100644 index 0000000..ad78b3d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/FaithPresenter.java @@ -0,0 +1,64 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/10 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class FaithPresenter extends TarsStructBase { + + private long lPid; + private String sLogo = ""; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lPid, 0); + os.write(this.sLogo, 1); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lPid = is.read(this.lPid, 0, false); + this.sLogo = is.read(this.sLogo, 1, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/GuardInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/GuardInfo.java new file mode 100644 index 0000000..badff46 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/GuardInfo.java @@ -0,0 +1,94 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/12/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class GuardInfo extends TarsStructBase { + + private long lUid; + private long lPid; + private int iGuardLevel; + private long lEndTime; + private String sAttr = ""; + private String sIcon = ""; + private int iGuardType; + private long lStartTime; + private long lCommemorateDay; + private int iAccompanyDay; + private String sNewAttr = ""; + private String sEnterText = ""; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lUid, 0); + os.write(this.lPid, 1); + os.write(this.iGuardLevel, 2); + os.write(this.lEndTime, 3); + os.write(this.sAttr, 4); + os.write(this.sIcon, 5); + os.write(this.iGuardType, 6); + os.write(this.lStartTime, 7); + os.write(this.lCommemorateDay, 8); + os.write(this.iAccompanyDay, 9); + os.write(this.sNewAttr, 10); + os.write(this.sEnterText, 11); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lUid = is.read(this.lUid, 0, false); + this.lPid = is.read(this.lPid, 1, false); + this.iGuardLevel = is.read(this.iGuardLevel, 2, false); + this.lEndTime = is.read(this.lEndTime, 3, false); + this.sAttr = is.read(this.sAttr, 4, false); + this.sIcon = is.read(this.sIcon, 5, false); + this.iGuardType = is.read(this.iGuardType, 6, false); + this.lStartTime = is.read(this.lStartTime, 7, false); + this.lCommemorateDay = is.read(this.lCommemorateDay, 8, false); + this.iAccompanyDay = is.read(this.iAccompanyDay, 9, false); + this.sNewAttr = is.read(this.sNewAttr, 10, false); + this.sEnterText = is.read(this.sEnterText, 11, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ItemEffectInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ItemEffectInfo.java new file mode 100644 index 0000000..4a4478f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/ItemEffectInfo.java @@ -0,0 +1,70 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/10 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class ItemEffectInfo extends TarsStructBase { + + private int iPriceLevel; + private int iStreamDuration; + private int iShowType; + private int iStreamId; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iPriceLevel, 0); + os.write(this.iStreamDuration, 1); + os.write(this.iShowType, 2); + os.write(this.iStreamId, 3); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iPriceLevel = is.read(this.iPriceLevel, 0, false); + this.iStreamDuration = is.read(this.iStreamDuration, 1, false); + this.iShowType = is.read(this.iShowType, 2, false); + this.iStreamId = is.read(this.iStreamId, 3, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/LiveAppUAEx.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/LiveAppUAEx.java new file mode 100644 index 0000000..b7b9b83 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/LiveAppUAEx.java @@ -0,0 +1,73 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class LiveAppUAEx extends TarsStructBase { + + private String sIMEI = ""; + private String sAPN = ""; + private String sNetType = ""; + private String sDeviceId = ""; + private String sMId = ""; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.sIMEI, 1); + os.write(this.sAPN, 2); + os.write(this.sNetType, 3); + os.write(this.sDeviceId, 4); + os.write(this.sMId, 5); + } + + @Override + public void readFrom(TarsInputStream is) { + this.sIMEI = is.read(this.sIMEI, 1, false); + this.sAPN = is.read(this.sAPN, 2, false); + this.sNetType = is.read(this.sNetType, 3, false); + this.sDeviceId = is.read(this.sDeviceId, 4, false); + this.sMId = is.read(this.sMId, 5, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/LiveProxyValue.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/LiveProxyValue.java new file mode 100644 index 0000000..619eb18 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/LiveProxyValue.java @@ -0,0 +1,67 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import cn.hutool.core.collection.CollUtil; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.List; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class LiveProxyValue extends TarsStructBase { + + private int eProxyType; + private List sProxy = CollUtil.newArrayList(""); + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.eProxyType, 0); + os.write(this.sProxy, 1); + } + + @Override + public void readFrom(TarsInputStream is) { + this.eProxyType = is.read(this.eProxyType, 0, false); + this.sProxy = is.readArray(this.sProxy, 1, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/LiveUserbase.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/LiveUserbase.java new file mode 100644 index 0000000..b6595a2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/LiveUserbase.java @@ -0,0 +1,67 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class LiveUserbase extends TarsStructBase { + + private int eSource; + private int eType; + private LiveAppUAEx tUAEx = new LiveAppUAEx(); + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.eSource, 0); + os.write(this.eType, 1); + os.write(this.tUAEx, 2); + } + + @Override + public void readFrom(TarsInputStream is) { + this.eSource = is.read(this.eSource, 0, false); + this.eType = is.read(this.eType, 1, false); + this.tUAEx = (LiveAppUAEx) is.directRead(this.tUAEx, 2, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MessageContentExpand.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MessageContentExpand.java new file mode 100644 index 0000000..4afd6c5 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MessageContentExpand.java @@ -0,0 +1,67 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/10 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class MessageContentExpand extends TarsStructBase { + + private int iAppId = 0; + private String sToast = ""; + private byte[] vData; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iAppId, 0); + os.write(this.sToast, 1); + os.write(this.vData, 2); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iAppId = is.read(this.iAppId, 0, false); + this.sToast = is.read(this.sToast, 1, false); + this.vData = is.read(this.vData, 2, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MessageTagInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MessageTagInfo.java new file mode 100644 index 0000000..bb8c0e7 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MessageTagInfo.java @@ -0,0 +1,64 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class MessageTagInfo extends TarsStructBase { + + private int iAppId = 0; + private String sTag = ""; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iAppId, 0); + os.write(this.sTag, 1); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iAppId = is.read(this.iAppId, 0, false); + this.sTag = is.read(this.sTag, 1, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MsgItem.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MsgItem.java new file mode 100644 index 0000000..22f85aa --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MsgItem.java @@ -0,0 +1,67 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.base.BaseHuyaCmdMsg; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class MsgItem extends BaseHuyaCmdMsg { + + private byte[] sMsg; + private long lMsgId; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(super.getLUri(), 0); + os.write(this.sMsg, 1); + os.write(this.lMsgId, 2); + } + + @Override + public void readFrom(TarsInputStream is) { + super.setLUri(is.read(super.getLUri(), 0, true)); + this.sMsg = is.read(this.sMsg, 1, true); + this.lMsgId = is.read(this.lMsgId, 2, true); + } + + @Override + public HuyaOperationEnum getOperationEnum() { + return HuyaOperationEnum.EWSCmdS2C_MsgPushReq_V2; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MsgStatInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MsgStatInfo.java new file mode 100644 index 0000000..d4d229e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/MsgStatInfo.java @@ -0,0 +1,70 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class MsgStatInfo extends TarsStructBase { + + private Map> mSignalPushUriCount = new HashMap<>(); + private Map> mP2pPushUriCount = new HashMap<>(); + private int iSupportAckMsgStat; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.mSignalPushUriCount, 0); + os.write(this.mP2pPushUriCount, 1); + os.write(this.iSupportAckMsgStat, 3); + } + + @Override + public void readFrom(TarsInputStream is) { + this.mSignalPushUriCount = is.readMap(this.mSignalPushUriCount, 0, false); + this.mP2pPushUriCount = is.readMap(this.mP2pPushUriCount, 1, false); + this.iSupportAckMsgStat = is.read(this.iSupportAckMsgStat, 3, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NobleInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NobleInfo.java new file mode 100644 index 0000000..db8adc1 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NobleInfo.java @@ -0,0 +1,94 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/12/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class NobleInfo extends TarsStructBase { + + private long lUid; + private long lPid; + private long lValidDate; + private String sNobleName = ""; + private int iNobleLevel; + private int iNoblePet; + private int iNobleStatus; + private int iNobleType; + private int iRemainDays; + private NobleLevelAttr tLevelAttr = new NobleLevelAttr(); + private NoblePetAttr tPetAttr = new NoblePetAttr(); + private long lOpenTime; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lUid, 0); + os.write(this.lPid, 1); + os.write(this.lValidDate, 2); + os.write(this.sNobleName, 3); + os.write(this.iNobleLevel, 4); + os.write(this.iNoblePet, 5); + os.write(this.iNobleStatus, 6); + os.write(this.iNobleType, 7); + os.write(this.iRemainDays, 8); + os.write(this.tLevelAttr, 9); + os.write(this.tPetAttr, 10); + os.write(this.lOpenTime, 11); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lUid = is.read(this.lUid, 0, false); + this.lPid = is.read(this.lPid, 1, false); + this.lValidDate = is.read(this.lValidDate, 2, false); + this.sNobleName = is.read(this.sNobleName, 3, false); + this.iNobleLevel = is.read(this.iNobleLevel, 4, false); + this.iNoblePet = is.read(this.iNoblePet, 5, false); + this.iNobleStatus = is.read(this.iNobleStatus, 6, false); + this.iNobleType = is.read(this.iNobleType, 7, false); + this.iRemainDays = is.read(this.iRemainDays, 8, false); + this.tLevelAttr = (NobleLevelAttr) is.directRead(this.tLevelAttr, 9, false); + this.tPetAttr = (NoblePetAttr) is.directRead(this.tPetAttr, 10, false); + this.lOpenTime = is.read(this.lOpenTime, 11, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NobleLevelAttr.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NobleLevelAttr.java new file mode 100644 index 0000000..e9199af --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NobleLevelAttr.java @@ -0,0 +1,79 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/12/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class NobleLevelAttr extends TarsStructBase { + + private int iAttrType; + private long lValidDate; + private int iAttrStatus; + private int iProgress; + private int iTask; + private int iRemainDays; + private String sReserve = ""; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iAttrType, 0); + os.write(this.lValidDate, 1); + os.write(this.iAttrStatus, 2); + os.write(this.iProgress, 3); + os.write(this.iTask, 4); + os.write(this.iRemainDays, 5); + os.write(this.sReserve, 6); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iAttrType = is.read(this.iAttrType, 0, false); + this.lValidDate = is.read(this.lValidDate, 1, false); + this.iAttrStatus = is.read(this.iAttrStatus, 2, false); + this.iProgress = is.read(this.iProgress, 3, false); + this.iTask = is.read(this.iTask, 4, false); + this.iRemainDays = is.read(this.iRemainDays, 5, false); + this.sReserve = is.read(this.sReserve, 6, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NobleLevelInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NobleLevelInfo.java new file mode 100644 index 0000000..0555b65 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NobleLevelInfo.java @@ -0,0 +1,64 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/3 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class NobleLevelInfo extends TarsStructBase { + + private int iNobleLevel; + private int iAttrType; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iNobleLevel, 0); + os.write(this.iAttrType, 1); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iNobleLevel = is.read(this.iNobleLevel, 0, true); + this.iAttrType = is.read(this.iAttrType, 1, true); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NoblePetAttr.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NoblePetAttr.java new file mode 100644 index 0000000..a9d2618 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/NoblePetAttr.java @@ -0,0 +1,77 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/12/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class NoblePetAttr extends TarsStructBase { + + private int iPetId; + private String sPetName = ""; + private String sPetAction = ""; + private int iFrame; + private int iBeginTime; + private int iEndTime; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iPetId, 0); + os.write(this.sPetName, 1); + os.write(this.sPetAction, 2); + os.write(this.iFrame, 3); + os.write(this.iBeginTime, 4); + os.write(this.iEndTime, 5); + + } + + @Override + public void readFrom(TarsInputStream is) { + this.iPetId = is.read(this.iPetId, 0, false); + this.sPetName = is.read(this.sPetName, 1, false); + this.sPetAction = is.read(this.sPetAction, 2, false); + this.iFrame = is.read(this.iFrame, 3, false); + this.iBeginTime = is.read(this.iBeginTime, 4, false); + this.iEndTime = is.read(this.iEndTime, 5, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PresenterChannelInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PresenterChannelInfo.java new file mode 100644 index 0000000..0204bca --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PresenterChannelInfo.java @@ -0,0 +1,82 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/10 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class PresenterChannelInfo extends TarsStructBase { + + private long lYYId; + private long lTid; + private long lSid; + private int iSourceType; + private int iScreenType; + private long lUid; + private int iGameId; + private int iRoomId; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lYYId, 0); + os.write(this.lTid, 1); + os.write(this.lSid, 3); + os.write(this.iSourceType, 4); + os.write(this.iScreenType, 5); + os.write(this.lUid, 6); + os.write(this.iGameId, 7); + os.write(this.iRoomId, 8); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lYYId = is.read(this.lYYId, 0, false); + this.lTid = is.read(this.lTid, 1, false); + this.lSid = is.read(this.lSid, 3, false); + this.iSourceType = is.read(this.iSourceType, 4, false); + this.iScreenType = is.read(this.iScreenType, 5, false); + this.lUid = is.read(this.lUid, 6, false); + this.iGameId = is.read(this.iGameId, 7, false); + this.iRoomId = is.read(this.iRoomId, 8, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PropView.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PropView.java new file mode 100644 index 0000000..d017b79 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PropView.java @@ -0,0 +1,70 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author mjz + * @date 2023/10/3 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class PropView extends TarsStructBase { + + private int id = 0; + private String name = ""; + private Map uids = new HashMap() {{ + put(-1L, (short) -1); + }}; + private String tips = ""; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.id, 0); + os.write(this.name, 1); + os.write(this.uids, 2); + os.write(this.tips, 3); + } + + @Override + public void readFrom(TarsInputStream is) { + this.id = is.read(this.id, 0, true); + this.name = is.read(this.name, 1, true); + this.uids = is.readMap(this.uids, 2, true); + this.tips = is.read(this.tips, 3, true); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PropsIdentity.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PropsIdentity.java new file mode 100644 index 0000000..ee1dba6 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PropsIdentity.java @@ -0,0 +1,125 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/3 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class PropsIdentity extends TarsStructBase { + + private int iPropsIdType = 0; + private String sPropsPic18 = ""; + private String sPropsPic24 = ""; + private String sPropsPicGif = ""; + private String sPropsBannerResource = ""; + private String sPropsBannerSize = ""; + private String sPropsBannerMaxTime = ""; + private String sPropsChatBannerResource = ""; + private String sPropsChatBannerSize = ""; + private String sPropsChatBannerMaxTime = ""; + private int iPropsChatBannerPos = 0; + private int iPropsChatBannerIsCombo = 0; + private String sPropsRollContent = ""; + private int iPropsBannerAnimationstyle = 0; + private String sPropFaceu = ""; + private String sPropH5Resource = ""; + private String sPropsWeb = ""; + private int sWitch = 0; + private String sCornerMark = ""; + private int iPropViewId = 0; + private String sPropStreamerResource = ""; + private short iStreamerFrameRate = 0; + private String sPropsPic108 = ""; + private String sPcBannerResource = ""; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iPropsIdType, 1); + os.write(this.sPropsPic18, 2); + os.write(this.sPropsPic24, 3); + os.write(this.sPropsPicGif, 4); + os.write(this.sPropsBannerResource, 5); + os.write(this.sPropsBannerSize, 6); + os.write(this.sPropsBannerMaxTime, 7); + os.write(this.sPropsChatBannerResource, 8); + os.write(this.sPropsChatBannerSize, 9); + os.write(this.sPropsChatBannerMaxTime, 10); + os.write(this.iPropsChatBannerPos, 11); + os.write(this.iPropsChatBannerIsCombo, 12); + os.write(this.sPropsRollContent, 13); + os.write(this.iPropsBannerAnimationstyle, 14); + os.write(this.sPropFaceu, 15); + os.write(this.sPropH5Resource, 16); + os.write(this.sPropsWeb, 17); + os.write(this.sWitch, 18); + os.write(this.sCornerMark, 19); + os.write(this.iPropViewId, 20); + os.write(this.sPropStreamerResource, 21); + os.write(this.iStreamerFrameRate, 22); + os.write(this.sPropsPic108, 23); + os.write(this.sPcBannerResource, 24); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iPropsIdType = is.read(this.iPropsIdType, 1, true); + this.sPropsPic18 = is.read(this.sPropsPic18, 2, true); + this.sPropsPic24 = is.read(this.sPropsPic24, 3, true); + this.sPropsPicGif = is.read(this.sPropsPicGif, 4, true); + this.sPropsBannerResource = is.read(this.sPropsBannerResource, 5, true); + this.sPropsBannerSize = is.read(this.sPropsBannerSize, 6, true); + this.sPropsBannerMaxTime = is.read(this.sPropsBannerMaxTime, 7, true); + this.sPropsChatBannerResource = is.read(this.sPropsChatBannerResource, 8, true); + this.sPropsChatBannerSize = is.read(this.sPropsChatBannerSize, 9, true); + this.sPropsChatBannerMaxTime = is.read(this.sPropsChatBannerMaxTime, 10, true); + this.iPropsChatBannerPos = is.read(this.iPropsChatBannerPos, 11, true); + this.iPropsChatBannerIsCombo = is.read(this.iPropsChatBannerIsCombo, 12, true); + this.sPropsRollContent = is.read(this.sPropsRollContent, 13, true); + this.iPropsBannerAnimationstyle = is.read(this.iPropsBannerAnimationstyle, 14, true); + this.sPropFaceu = is.read(this.sPropFaceu, 15, true); + this.sPropH5Resource = is.read(this.sPropH5Resource, 16, true); + this.sPropsWeb = is.read(this.sPropsWeb, 17, true); + this.sWitch = is.read(this.sWitch, 18, true); + this.sCornerMark = is.read(this.sCornerMark, 19, true); + this.iPropViewId = is.read(this.iPropViewId, 20, true); + this.sPropStreamerResource = is.read(this.sPropStreamerResource, 21, true); + this.iStreamerFrameRate = is.read(this.iStreamerFrameRate, 22, true); + this.sPropsPic108 = is.read(this.sPropsPic108, 23, true); + this.sPcBannerResource = is.read(this.sPcBannerResource, 24, true); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PropsItem.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PropsItem.java new file mode 100644 index 0000000..0c53ad4 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/PropsItem.java @@ -0,0 +1,181 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author mjz + * @date 2023/10/3 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class PropsItem extends TarsStructBase { + + public static final PropsItem DEFAULT = new PropsItem() {{ + setSPropsName("未知礼物"); + setIPropsYb(-1); + }}; + + private int iPropsId = 0; + private String sPropsName = ""; + private int iPropsYb = 0; + private int iPropsGreenBean = 0; + private int iPropsWhiteBean = 0; + private int iPropsGoldenBean = 0; + private int iPropsRed = 0; + private int iPropsPopular = 0; + private int iPropsExpendNum = -1; + private int iPropsFansValue = -1; + private List vPropsNum = new ArrayList() {{ + add(-1); + }}; + private int iPropsMaxNum = 0; + private int iPropsBatterFlag = 0; + private List vPropsChannel = new ArrayList() {{ + add(-1); + }}; + private String sPropsToolTip = ""; + private List vPropsIdentity = new ArrayList() {{ + add(new PropsIdentity()); + }}; + private int iPropsWeights = 0; + private int iPropsLevel = 0; + private DisplayInfo tDisplayInfo = new DisplayInfo(); + private SpecialInfo tSpecialInfo = new SpecialInfo(); + private int iPropsGrade = 0; + private int iPropsGroupNum = 0; + private String sPropsCommBannerResource = ""; + private String sPropsOwnBannerResource = ""; + private int iPropsShowFlag = 0; + private int iTemplateType = 0; + private int iShelfStatus = 0; + private String sAndroidLogo = ""; + private String sIpadLogo = ""; + private String sIphoneLogo = ""; + private String sPropsCommBannerResourceEx = ""; + private String sPropsOwnBannerResourceEx = ""; + private List vPresenterUid = new ArrayList() {{ + add(-1L); + }}; + private List vPropView = new ArrayList() {{ + add(new PropView()); + }}; + private short iFaceUSwitch = 0; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iPropsId, 1); + os.write(this.sPropsName, 2); + os.write(this.iPropsYb, 3); + os.write(this.iPropsGreenBean, 4); + os.write(this.iPropsWhiteBean, 5); + os.write(this.iPropsGoldenBean, 6); + os.write(this.iPropsRed, 7); + os.write(this.iPropsPopular, 8); + os.write(this.iPropsExpendNum, 9); + os.write(this.iPropsFansValue, 10); + os.write(this.vPropsNum, 11); + os.write(this.iPropsMaxNum, 12); + os.write(this.iPropsBatterFlag, 13); + os.write(this.vPropsChannel, 14); + os.write(this.sPropsToolTip, 15); + os.write(this.vPropsIdentity, 16); + os.write(this.iPropsWeights, 17); + os.write(this.iPropsLevel, 18); + os.write(this.tDisplayInfo, 19); + os.write(this.tSpecialInfo, 20); + os.write(this.iPropsGrade, 21); + os.write(this.iPropsGroupNum, 22); + os.write(this.sPropsCommBannerResource, 23); + os.write(this.sPropsOwnBannerResource, 24); + os.write(this.iPropsShowFlag, 25); + os.write(this.iTemplateType, 26); + os.write(this.iShelfStatus, 27); + os.write(this.sAndroidLogo, 28); + os.write(this.sIpadLogo, 29); + os.write(this.sIphoneLogo, 30); + os.write(this.sPropsCommBannerResourceEx, 31); + os.write(this.sPropsOwnBannerResourceEx, 32); + os.write(this.vPresenterUid, 33); + os.write(this.vPropView, 34); + os.write(this.iFaceUSwitch, 35); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iPropsId = is.read(this.iPropsId, 1, true); + this.sPropsName = is.read(this.sPropsName, 2, true); + this.iPropsYb = is.read(this.iPropsYb, 3, true); + this.iPropsGreenBean = is.read(this.iPropsGreenBean, 4, true); + this.iPropsWhiteBean = is.read(this.iPropsWhiteBean, 5, true); + this.iPropsGoldenBean = is.read(this.iPropsGoldenBean, 6, true); + this.iPropsRed = is.read(this.iPropsRed, 7, true); + this.iPropsPopular = is.read(this.iPropsPopular, 8, true); + this.iPropsExpendNum = is.read(this.iPropsExpendNum, 9, true); + this.iPropsFansValue = is.read(this.iPropsFansValue, 10, true); + this.vPropsNum = is.readArray(this.vPropsNum, 11, true); + this.iPropsMaxNum = is.read(this.iPropsMaxNum, 12, true); + this.iPropsBatterFlag = is.read(this.iPropsBatterFlag, 13, true); + this.vPropsChannel = is.readArray(this.vPropsChannel, 14, true); + this.sPropsToolTip = is.read(this.sPropsToolTip, 15, true); + this.vPropsIdentity = is.readArray(this.vPropsIdentity, 16, true); + this.iPropsWeights = is.read(this.iPropsWeights, 17, true); + this.iPropsLevel = is.read(this.iPropsLevel, 18, true); + this.tDisplayInfo = (DisplayInfo) is.directRead(this.tDisplayInfo, 19, true); + this.tSpecialInfo = (SpecialInfo) is.directRead(this.tSpecialInfo, 20, true); + this.iPropsGrade = is.read(this.iPropsGrade, 21, true); + this.iPropsGroupNum = is.read(this.iPropsGroupNum, 22, true); + this.sPropsCommBannerResource = is.read(this.sPropsCommBannerResource, 23, true); + this.sPropsOwnBannerResource = is.read(this.sPropsOwnBannerResource, 24, true); + this.iPropsShowFlag = is.read(this.iPropsShowFlag, 25, true); + this.iTemplateType = is.read(this.iTemplateType, 26, true); + this.iShelfStatus = is.read(this.iShelfStatus, 27, true); + this.sAndroidLogo = is.read(this.sAndroidLogo, 28, true); + this.sIpadLogo = is.read(this.sIpadLogo, 29, true); + this.sIphoneLogo = is.read(this.sIphoneLogo, 30, true); + this.sPropsCommBannerResourceEx = is.read(this.sPropsCommBannerResourceEx, 31, true); + this.sPropsOwnBannerResourceEx = is.read(this.sPropsOwnBannerResourceEx, 32, true); + this.vPresenterUid = is.readArray(this.vPresenterUid, 33, true); + this.vPropView = is.readArray(this.vPropView, 34, true); + this.iFaceUSwitch = is.read(this.iFaceUSwitch, 35, true); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SendMessageFormat.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SendMessageFormat.java new file mode 100644 index 0000000..a35a686 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SendMessageFormat.java @@ -0,0 +1,67 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class SendMessageFormat extends TarsStructBase { + + private int iSenceType; + private long lFormatId; + private long lSizeTemplateId; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iSenceType, 0); + os.write(this.lFormatId, 1); + os.write(this.lSizeTemplateId, 2); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iSenceType = is.read(this.iSenceType, 0, false); + this.lFormatId = is.read(this.lFormatId, 1, false); + this.lSizeTemplateId = is.read(this.lSizeTemplateId, 2, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SenderInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SenderInfo.java new file mode 100644 index 0000000..79ef4a5 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SenderInfo.java @@ -0,0 +1,85 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class SenderInfo extends TarsStructBase { + + private long lUid; + private long lImid; + private String sNickName = ""; + private int iGender; + private String sAvatarUrl; + private int iNobleLevel; + private NobleLevelInfo tNobleLevelInfo = new NobleLevelInfo(); + private String sGuid; + private String sHuYaUA; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lUid, 0); + os.write(this.lImid, 1); + os.write(this.sNickName, 2); + os.write(this.iGender, 3); + os.write(this.sAvatarUrl, 4); + os.write(this.iNobleLevel, 5); + os.write(this.tNobleLevelInfo, 6); + os.write(this.sGuid, 7); + os.write(this.sHuYaUA, 8); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lUid = is.read(this.lUid, 0, true); + this.lImid = is.read(this.lImid, 1, true); + this.sNickName = is.read(this.sNickName, 2, true); + this.iGender = is.read(this.iGender, 3, true); + this.sAvatarUrl = is.read(this.sAvatarUrl, 4, true); + this.iNobleLevel = is.read(this.iNobleLevel, 5, true); + this.tNobleLevelInfo = (NobleLevelInfo) is.directRead(this.tNobleLevelInfo, 6, true); + this.sGuid = is.read(this.sGuid, 7, true); + this.sHuYaUA = is.read(this.sHuYaUA, 8, true); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SpecialInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SpecialInfo.java new file mode 100644 index 0000000..055914c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SpecialInfo.java @@ -0,0 +1,91 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/3 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class SpecialInfo extends TarsStructBase { + + private int iFirstSingle = 0; + private int iFirstGroup = 0; + private String sFirstTips = ""; + private int iSecondSingle = 0; + private int iSecondGroup = 0; + private String sSecondTips = ""; + private int iThirdSingle = 0; + private int iThirdGroup = 0; + private String sThirdTips = ""; + private int iWorldSingle = 0; + private int iWorldGroup = 0; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.iFirstSingle, 1); + os.write(this.iFirstGroup, 2); + os.write(this.sFirstTips, 3); + os.write(this.iSecondSingle, 4); + os.write(this.iSecondGroup, 5); + os.write(this.sSecondTips, 6); + os.write(this.iThirdSingle, 7); + os.write(this.iThirdGroup, 8); + os.write(this.sThirdTips, 9); + os.write(this.iWorldSingle, 10); + os.write(this.iWorldGroup, 11); + } + + @Override + public void readFrom(TarsInputStream is) { + this.iFirstSingle = is.read(this.iFirstSingle, 1, true); + this.iFirstGroup = is.read(this.iFirstGroup, 2, true); + this.sFirstTips = is.read(this.sFirstTips, 3, true); + this.iSecondSingle = is.read(this.iSecondSingle, 4, true); + this.iSecondGroup = is.read(this.iSecondGroup, 5, true); + this.sSecondTips = is.read(this.sSecondTips, 6, true); + this.iThirdSingle = is.read(this.iThirdSingle, 7, true); + this.iThirdGroup = is.read(this.iThirdGroup, 8, true); + this.sThirdTips = is.read(this.sThirdTips, 9, true); + this.iWorldSingle = is.read(this.iWorldSingle, 10, true); + this.iWorldGroup = is.read(this.iWorldGroup, 11, true); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SuperFansInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SuperFansInfo.java new file mode 100644 index 0000000..cd1bd7a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/SuperFansInfo.java @@ -0,0 +1,76 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/10 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class SuperFansInfo extends TarsStructBase { + + private long lSFExpiredTS; + private int iSFFlag; + private long lSFAnnualTS; + private int iSFVariety; + private long lOpenTS; + private long lMemoryDay; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lSFExpiredTS, 0); + os.write(this.iSFFlag, 1); + os.write(this.lSFAnnualTS, 2); + os.write(this.iSFVariety, 3); + os.write(this.lOpenTS, 4); + os.write(this.lMemoryDay, 5); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lSFExpiredTS = is.read(this.lSFExpiredTS, 0, false); + this.iSFFlag = is.read(this.iSFFlag, 1, false); + this.lSFAnnualTS = is.read(this.lSFAnnualTS, 2, false); + this.iSFVariety = is.read(this.iSFVariety, 3, false); + this.lOpenTS = is.read(this.lOpenTS, 4, false); + this.lMemoryDay = is.read(this.lMemoryDay, 5, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UidNickName.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UidNickName.java new file mode 100644 index 0000000..8f36cc1 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UidNickName.java @@ -0,0 +1,64 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/3 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class UidNickName extends TarsStructBase { + + private long lUid = 0; + private String sNickName = ""; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lUid, 0); + os.write(this.sNickName, 1); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lUid = is.read(this.lUid, 0, true); + this.sNickName = is.read(this.sNickName, 1, true); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UserId.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UserId.java new file mode 100644 index 0000000..56faee8 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UserId.java @@ -0,0 +1,80 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class UserId extends TarsStructBase { + + private long lUid; + private String sGuid = ""; + private String sToken = ""; + private String sHuYaUA = ""; + private String sCookie = ""; + private int iTokenType; + private String sDeviceInfo = ""; + + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lUid, 0); + os.write(this.sGuid, 1); + os.write(this.sToken, 2); + os.write(this.sHuYaUA, 3); + os.write(this.sCookie, 4); + os.write(this.iTokenType, 5); + os.write(this.sDeviceInfo, 6); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lUid = is.read(this.lUid, 0, true); + this.sGuid = is.read(this.sGuid, 1, true); + this.sToken = is.read(this.sToken, 2, true); + this.sHuYaUA = is.read(this.sHuYaUA, 3, true); + this.sCookie = is.read(this.sCookie, 4, true); + this.iTokenType = is.read(this.iTokenType, 5, true); + this.sDeviceInfo = is.read(this.sDeviceInfo, 6, true); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UserIdentityInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UserIdentityInfo.java new file mode 100644 index 0000000..813943d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UserIdentityInfo.java @@ -0,0 +1,67 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import cn.hutool.core.collection.CollUtil; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.List; + +/** + * @author mjz + * @date 2023/10/10 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class UserIdentityInfo extends TarsStructBase { + + private List vDecorationPrefix = CollUtil.newArrayList(new DecorationInfo()); + private List vDecorationSuffix = CollUtil.newArrayList(new DecorationInfo()); + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.vDecorationPrefix, 0); + os.write(this.vDecorationSuffix, 1); + } + + @Override + public void readFrom(TarsInputStream is) { + this.vDecorationPrefix = is.readArray(this.vDecorationPrefix, 0, false); + this.vDecorationSuffix = is.readArray(this.vDecorationSuffix, 1, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UserRidePetInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UserRidePetInfo.java new file mode 100644 index 0000000..f74bb5a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/UserRidePetInfo.java @@ -0,0 +1,94 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author mjz + * @date 2023/12/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class UserRidePetInfo extends TarsStructBase { + + private long lPetId; + private String sPetName = ""; + private String sPetAction = ""; + private int iPetFlag; + private int iWeight; + private int iRideFlag; + private long lBeginTs; + private long lEndTs; + private int iSourceType; + private int iPetType; + private Map mPetDetail = new HashMap<>(); + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lPetId, 0); + os.write(this.sPetName, 1); + os.write(this.sPetAction, 2); + os.write(this.iPetFlag, 3); + os.write(this.iWeight, 4); + os.write(this.iRideFlag, 5); + os.write(this.lBeginTs, 6); + os.write(this.lEndTs, 7); + os.write(this.iSourceType, 8); + os.write(this.iPetType, 9); + os.write(this.mPetDetail, 10); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lPetId = is.read(this.lPetId, 0, false); + this.sPetName = is.read(this.sPetName, 1, false); + this.sPetAction = is.read(this.sPetAction, 2, false); + this.iPetFlag = is.read(this.iPetFlag, 3, false); + this.iWeight = is.read(this.iWeight, 4, false); + this.iRideFlag = is.read(this.iRideFlag, 5, false); + this.lBeginTs = is.read(this.lBeginTs, 6, false); + this.lEndTs = is.read(this.lEndTs, 7, false); + this.iSourceType = is.read(this.iSourceType, 8, false); + this.iPetType = is.read(this.iPetType, 9, false); + this.mPetDetail = is.readMap(this.mPetDetail, 10, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/WeekRankInfo.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/WeekRankInfo.java new file mode 100644 index 0000000..501273d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/dto/WeekRankInfo.java @@ -0,0 +1,64 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.dto; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/12/27 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class WeekRankInfo extends TarsStructBase { + + private long lUid; + private int iRank; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lUid, 0); + os.write(this.iRank, 1); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lUid = is.read(this.lUid, 0, false); + this.iRank = is.read(this.iRank, 1, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/GetLivingInfoReq.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/GetLivingInfoReq.java new file mode 100644 index 0000000..81a7b3c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/GetLivingInfoReq.java @@ -0,0 +1,86 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.req; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.UserId; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class GetLivingInfoReq extends TarsStructBase { + + private UserId tId = new UserId(); + private long lTopSid; + private long lSubSid; + private long lPresenterUid; + private String sTraceSource = ""; + private String sPassword = ""; + private long iRoomId; + private int iFreeFlowFlag; + private int iIpStack; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.tId, 0); + os.write(this.lTopSid, 1); + os.write(this.lSubSid, 2); + os.write(this.lPresenterUid, 3); + os.write(this.sTraceSource, 4); + os.write(this.sPassword, 5); + os.write(this.iRoomId, 6); + os.write(this.iFreeFlowFlag, 7); + os.write(this.iIpStack, 8); + } + + @Override + public void readFrom(TarsInputStream is) { + this.tId = (UserId) is.directRead(this.tId, 0, false); + this.lTopSid = is.read(this.lTopSid, 1, false); + this.lSubSid = is.read(this.lSubSid, 2, false); + this.lPresenterUid = is.read(this.lPresenterUid, 3, false); + this.sTraceSource = is.read(this.sTraceSource, 4, false); + this.sPassword = is.read(this.sPassword, 5, false); + this.iRoomId = is.read(this.iRoomId, 6, false); + this.iFreeFlowFlag = is.read(this.iFreeFlowFlag, 7, false); + this.iIpStack = is.read(this.iIpStack, 8, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/GetPropsListReq.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/GetPropsListReq.java new file mode 100644 index 0000000..e619dc3 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/GetPropsListReq.java @@ -0,0 +1,83 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.req; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.UserId; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class GetPropsListReq extends TarsStructBase { + + private UserId tUserId = new UserId(); + private String sMd5 = ""; + private int iTemplateType; + private String sVersion = ""; + private int iAppId; + private long lPresenterUid; + private long lSid; + private long lSubSid; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.tUserId, 1); + os.write(this.sMd5, 2); + os.write(this.iTemplateType, 3); + os.write(this.sVersion, 4); + os.write(this.iAppId, 5); + os.write(this.lPresenterUid, 6); + os.write(this.lSid, 7); + os.write(this.lSubSid, 8); + } + + @Override + public void readFrom(TarsInputStream is) { + is.read(this.tUserId, 1, true); + is.read(this.sMd5, 2, true); + is.read(this.iTemplateType, 3, true); + is.read(this.sVersion, 4, true); + is.read(this.iAppId, 5, true); + is.read(this.lPresenterUid, 6, true); + is.read(this.lSid, 7, true); + is.read(this.lSubSid, 8, true); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/GetPropsListRsp.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/GetPropsListRsp.java new file mode 100644 index 0000000..afc55ed --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/GetPropsListRsp.java @@ -0,0 +1,79 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.req; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.PropsItem; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author mjz + * @date 2023/10/3 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class GetPropsListRsp extends TarsStructBase { + + private List vPropsItemList = new ArrayList() {{ + add(new PropsItem()); + }}; + private String sMd5 = ""; + private short iNewEffectSwitch = 0; + private short iMirrorRoomShowNum = 0; + private short iGameRoomShowNum = 0; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.vPropsItemList, 1); + os.write(this.sMd5, 2); + os.write(this.iNewEffectSwitch, 3); + os.write(this.iMirrorRoomShowNum, 4); + os.write(this.iGameRoomShowNum, 5); + } + + @Override + public void readFrom(TarsInputStream is) { + this.vPropsItemList = is.readArray(this.vPropsItemList, 1, true); + this.sMd5 = is.read(this.sMd5, 2, true); + this.iNewEffectSwitch = is.read(this.iNewEffectSwitch, 3, true); + this.iMirrorRoomShowNum = is.read(this.iMirrorRoomShowNum, 4, true); + this.iGameRoomShowNum = is.read(this.iGameRoomShowNum, 5, true); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/LaunchReq.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/LaunchReq.java new file mode 100644 index 0000000..eaad983 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/LaunchReq.java @@ -0,0 +1,74 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.req; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.DeviceInfo; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class LaunchReq extends TarsStructBase { + + private long lUid; + private String sGuid = ""; + private String sUA = ""; + private String sAppSrc = ""; + private DeviceInfo tDeviceInfo = new DeviceInfo(); + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lUid, 0); + os.write(this.sGuid, 1); + os.write(this.sUA, 2); + os.write(this.sAppSrc, 3); + os.write(this.tDeviceInfo, 4); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lUid = is.read(this.lUid, 0, false); + this.sGuid = is.read(this.sGuid, 1, false); + this.sUA = is.read(this.sUA, 2, false); + this.sAppSrc = is.read(this.sAppSrc, 3, false); + this.tDeviceInfo = (DeviceInfo) is.directRead(this.tDeviceInfo, 4, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/LiveLaunchReq.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/LiveLaunchReq.java new file mode 100644 index 0000000..1c4ccd8 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/LiveLaunchReq.java @@ -0,0 +1,69 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.req; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.LiveUserbase; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.UserId; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class LiveLaunchReq extends TarsStructBase { + + private UserId tId = new UserId(); + private LiveUserbase tLiveUB = new LiveUserbase(); + private boolean bSupportDomain; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.tId, 0); + os.write(this.tLiveUB, 1); + os.write(this.bSupportDomain, 2); + } + + @Override + public void readFrom(TarsInputStream is) { + this.tId = (UserId) is.directRead(this.tId, 0, false); + this.tLiveUB = (LiveUserbase) is.directRead(this.tLiveUB, 1, false); + this.bSupportDomain = is.read(this.bSupportDomain, 2, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/RegisterGroupReq.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/RegisterGroupReq.java new file mode 100644 index 0000000..bcb5b24 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/RegisterGroupReq.java @@ -0,0 +1,67 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.req; + +import cn.hutool.core.collection.CollUtil; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.List; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class RegisterGroupReq extends TarsStructBase { + + private List vGroupId = CollUtil.newArrayList(""); + private String sToken = ""; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.vGroupId, 0); + os.write(this.sToken, 1); + } + + @Override + public void readFrom(TarsInputStream is) { + this.vGroupId = is.readArray(this.vGroupId, 0, true); + this.sToken = is.read(this.sToken, 1, true); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/SendMessageReq.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/SendMessageReq.java new file mode 100644 index 0000000..d21ebbd --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/SendMessageReq.java @@ -0,0 +1,99 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.req; + +import cn.hutool.core.collection.CollUtil; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.*; + +import java.util.List; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class SendMessageReq extends TarsStructBase { + + private UserId tUserId = new UserId(); + private long lTid; + private long lSid; + private String sContent = ""; + private int iShowMode; + private ContentFormat tFormat = new ContentFormat(); + private BulletFormat tBulletFormat = new BulletFormat(); + private List vAtSomeone; + private long lPid; + private List vTagInfo = CollUtil.newArrayList(new MessageTagInfo()); + private SendMessageFormat tSenceFormat = new SendMessageFormat(); + private int iMessageMode; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.tUserId, 0); + os.write(this.lTid, 1); + os.write(this.lSid, 2); + os.write(this.sContent, 3); + os.write(this.iShowMode, 4); + os.write(this.tFormat, 5); + os.write(this.tBulletFormat, 6); + os.write(this.vAtSomeone, 7); + os.write(this.lPid, 8); + os.write(this.vTagInfo, 9); + os.write(this.tSenceFormat, 10); + os.write(this.iMessageMode, 11); + + } + + @Override + public void readFrom(TarsInputStream is) { + this.tUserId = (UserId) is.directRead(this.tUserId, 0, false); + this.lTid = is.read(this.lTid, 1, false); + this.lSid = is.read(this.lSid, 2, false); + this.sContent = is.read(this.sContent, 3, false); + this.iShowMode = is.read(this.iShowMode, 4, false); + this.tFormat = (ContentFormat) is.directRead(this.tFormat, 5, false); + this.tBulletFormat = (BulletFormat) is.directRead(this.tBulletFormat, 6, false); + this.vAtSomeone = is.readArray(this.vAtSomeone, 7, false); + this.lPid = is.read(this.lPid, 8, false); + this.vTagInfo = is.readArray(this.vTagInfo, 9, false); + this.tSenceFormat = (SendMessageFormat) is.directRead(this.tSenceFormat, 10, false); + this.iMessageMode = is.read(this.iMessageMode, 11, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/UpdateUserInfoReq.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/UpdateUserInfoReq.java new file mode 100644 index 0000000..0a621f9 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/UpdateUserInfoReq.java @@ -0,0 +1,87 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.req; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.MsgStatInfo; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class UpdateUserInfoReq extends TarsStructBase { + + private String sAppSrc = ""; + private String sGuid = ""; + private int iReportMsgIdRatio; + private int iSupportAck; + private MsgStatInfo tWSMsgStatInfo = new MsgStatInfo(); + private Map mCustomHeader = new HashMap<>(); + private int iMsgDegradeLevel; + + public UpdateUserInfoReq(TarsInputStream is) { + this.readFrom(is); + } + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.sAppSrc, 0); + os.write(this.sGuid, 1); + os.write(this.iReportMsgIdRatio, 2); + os.write(this.iSupportAck, 3); + os.write(this.tWSMsgStatInfo, 6); + os.write(this.mCustomHeader, 7); + os.write(this.iMsgDegradeLevel, 8); + } + + @Override + public void readFrom(TarsInputStream is) { + this.sAppSrc = is.read(this.sAppSrc, 0, true); + this.sGuid = is.read(this.sGuid, 1, true); + this.iReportMsgIdRatio = is.read(this.iReportMsgIdRatio, 2, true); + this.iSupportAck = is.read(this.iSupportAck, 3, true); + this.tWSMsgStatInfo = (MsgStatInfo) is.directRead(this.tWSMsgStatInfo, 6, true); + this.mCustomHeader = is.readStringMap( 7, true); + this.iMsgDegradeLevel = is.read(this.iMsgDegradeLevel, 8, true); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/UserHeartBeatReq.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/UserHeartBeatReq.java new file mode 100644 index 0000000..a029366 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/UserHeartBeatReq.java @@ -0,0 +1,90 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.req; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.UserId; + +/** + * @author mjz + * @date 2023/10/2 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class UserHeartBeatReq extends TarsStructBase { + + private UserId tId = new UserId(); + private long lTid; + private long lSid; + private long lPid; + private boolean bWatchVideo; + private int eLineType; + private int iFps; + private int iAttendee; + private int iBandwidth; + private int iLastHeartElapseTime; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.tId, 0); + os.write(this.lTid, 1); + os.write(this.lSid, 2); + os.write(this.lPid, 4); + os.write(this.bWatchVideo, 5); + os.write(this.eLineType, 6); + os.write(this.iFps, 7); + os.write(this.iAttendee, 8); + os.write(this.iBandwidth, 9); + os.write(this.iLastHeartElapseTime, 10); + + } + + @Override + public void readFrom(TarsInputStream is) { + this.tId = (UserId) is.directRead(this.tId, 0, false); + this.lTid = is.read(this.lTid, 1, false); + this.lSid = is.read(this.lSid, 2, false); + this.lPid = is.read(this.lPid, 4, false); + this.bWatchVideo = is.read(this.bWatchVideo, 5, false); + this.eLineType = is.read(this.eLineType, 6, false); + this.iFps = is.read(this.iFps, 7, false); + this.iAttendee = is.read(this.iAttendee, 8, false); + this.iBandwidth = is.read(this.iBandwidth, 9, false); + this.iLastHeartElapseTime = is.read(this.iLastHeartElapseTime, 10, false); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/VerifyCookieReq.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/VerifyCookieReq.java new file mode 100644 index 0000000..cea49cc --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/VerifyCookieReq.java @@ -0,0 +1,76 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.req; + +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsOutputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * @author mjz + * @date 2023/10/5 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class VerifyCookieReq extends TarsStructBase { + + private long lUid; + private String sUA = ""; + private String sCookie = ""; + private String sGuid = ""; + private int bAutoRegisterUid; + private String sAppSrc = ""; + + @Override + public void writeTo(TarsOutputStream os) { + os.write(this.lUid, 0); + os.write(this.sUA, 1); + os.write(this.sCookie, 2); + os.write(this.sGuid, 3); + os.write(this.bAutoRegisterUid, 4); + os.write(this.sAppSrc, 5); + } + + @Override + public void readFrom(TarsInputStream is) { + this.lUid = is.read(this.lUid, 0, true); + this.sUA = is.read(this.sUA, 1, true); + this.sCookie = is.read(this.sCookie, 2, true); + this.sGuid = is.read(this.sGuid, 3, true); + this.bAutoRegisterUid = is.read(this.bAutoRegisterUid, 4, true); + this.sAppSrc = is.read(this.sAppSrc, 5, true); + } + + @Override + public TarsStructBase newInit() { + return this; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/WupReq.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/WupReq.java new file mode 100644 index 0000000..90fe256 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/msg/req/WupReq.java @@ -0,0 +1,42 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.msg.req; + +import lombok.NoArgsConstructor; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.BaseWup; + +/** + * @author mjz + * @date 2023/10/3 + */ +@NoArgsConstructor +public class WupReq extends BaseWup { + + @Override + public HuyaOperationEnum getOperationEnum() { + return HuyaOperationEnum.EWSCmd_WupReq; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/netty/frame/factory/HuyaWebSocketFrameFactory.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/netty/frame/factory/HuyaWebSocketFrameFactory.java new file mode 100644 index 0000000..2c21b34 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/netty/frame/factory/HuyaWebSocketFrameFactory.java @@ -0,0 +1,271 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.netty.frame.factory; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.StrUtil; +import com.fasterxml.jackson.databind.JsonNode; +import io.netty.buffer.Unpooled; +import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.util.OrLiveChatCookieUtil; +import tech.ordinaryroad.live.chat.client.huya.api.HuyaApis; +import tech.ordinaryroad.live.chat.client.huya.config.HuyaLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaClientTemplateTypeEnum; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaLiveSource; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaWupFunctionEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.WebSocketCommand; +import tech.ordinaryroad.live.chat.client.huya.msg.req.*; +import tech.ordinaryroad.live.chat.client.huya.util.HuyaCodecUtil; + +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author mjz + * @date 2023/1/5 + */ +public class HuyaWebSocketFrameFactory { + + private static final ConcurrentHashMap CACHE = new ConcurrentHashMap<>(); + public static final String KEY_COOKIE_GUID = "guid"; + public static final String KEY_COOKIE_YYUID = "yyuid"; + + /** + * 浏览器地址中的房间id,支持短id + */ + private final Object roomId; + private final JsonNode roomInfo; + private volatile static byte[] heartbeatMsg; + private volatile static byte[] giftListReqMsg; + + public HuyaWebSocketFrameFactory(Object roomId) { + this.roomId = roomId; + this.roomInfo = HuyaApis.roomInit(roomId); + } + + public synchronized static HuyaWebSocketFrameFactory getInstance(Object roomId) { + return CACHE.computeIfAbsent(roomId, aLong -> new HuyaWebSocketFrameFactory(roomId)); + } + + /** + * 创建弹幕包 + * + * @param msg 弹幕内容 + * @param ver {@link HuyaLiveChatClientConfig#getVer()} + * @param cookie {@link HuyaLiveChatClientConfig#getCookie()} ()} + * @return BinaryWebSocketFrame + */ + public BinaryWebSocketFrame createSendMessageReq(String msg, String ver, String cookie) { + String yyuid = OrLiveChatCookieUtil.getCookieByName(cookie, KEY_COOKIE_YYUID, () -> { + throw new BaseException("cookie中缺少参数" + KEY_COOKIE_YYUID); + }); + String guid = OrLiveChatCookieUtil.getCookieByName(cookie, KEY_COOKIE_GUID, () -> { + throw new BaseException("cookie中缺少参数" + KEY_COOKIE_GUID); + }); + SendMessageReq sendMessageReq = new SendMessageReq(); + sendMessageReq.getTUserId().setLUid(NumberUtil.parseLong(yyuid)); + sendMessageReq.getTUserId().setSGuid(guid); + sendMessageReq.getTUserId().setSHuYaUA("webh5&" + ver + "&websocket"); + sendMessageReq.getTUserId().setSCookie(cookie); + sendMessageReq.getTUserId().setSDeviceInfo("chrome"); + sendMessageReq.setSContent(msg); + sendMessageReq.setLPid(roomInfo.get("lChannelId").asLong()); + + WupReq wupReq = new WupReq(); + wupReq.getTarsServantRequest().setServantName("liveui"); + wupReq.getTarsServantRequest().setFunctionName("sendMessage"); + wupReq.getUniAttribute().put("tReq", sendMessageReq); + + WebSocketCommand webSocketCommand = new WebSocketCommand(); + webSocketCommand.setOperation(HuyaOperationEnum.EWSCmd_WupReq.getCode()); + webSocketCommand.setVData(wupReq.encode()); + return new BinaryWebSocketFrame(Unpooled.wrappedBuffer(webSocketCommand.toByteArray())); + } + + /** + * 创建认证包 + * 1. doLaunch + * 2. registerGroup + * 3. updateUserInfo + * + * @return AuthWebSocketFrame + */ + public BinaryWebSocketFrame createAuth(String ver, String cookie) { + // sFuncName + // getLivingInfo, huyaliveui + // getPresenterLiveScheduleInfo, presenterui + // doLaunch, liveui + // chat:1724691, live:1724691 + // getWebdbUserInfo, liveui + // OnUserHeartBeat, onlineuif +// try { +// UserInfo wsUserInfo = new UserInfo(); +// wsUserInfo.setLUid(roomInfo.get("lYyid").asLong()); +// wsUserInfo.setBAnonymous(roomInfo.get("lYyid").asLong() == 0); +// wsUserInfo.setLTid(roomInfo.get("lChannelId").asLong()); +// wsUserInfo.setLSid(roomInfo.get("lSubChannelId").asLong()); +// wsUserInfo.setLGroupId(roomInfo.get("lYyid").asLong()); +// wsUserInfo.setLGroupType(3); +// wsUserInfo.setSAppId(""); +// wsUserInfo.setSUA("webh5&%s&websocket".formatted(HuyaLiveChatClientConfig.VER)); +// +// WebSocketCommand webSocketCommand = new WebSocketCommand(); +// webSocketCommand.setOperation(HuyaOperationEnum.EWSCmd_RegisterReq.getCode()); +// webSocketCommand.setVData(wsUserInfo.toByteArray()); +// return new AuthWebSocketFrame(Unpooled.wrappedBuffer(webSocketCommand.toByteArray())); +// } catch (Exception e) { +// throw new BaseException("认证包创建失败,请检查房间号是否正确。roomId: %d, msg: %s".formatted(roomId, e.getMessage())); +// } + return createLiveLaunchReq(ver, cookie); + } + + public BinaryWebSocketFrame createGetLivingInfoReq(String ver, String cookie) { + GetLivingInfoReq getLivingInfoReq = new GetLivingInfoReq(); +// getLivingInfoReq.getTId().setSGuid("0a7dca72a3ce1b654001dd2ade2ae857"); + getLivingInfoReq.getTId().setSHuYaUA("webh5&" + ver + "&websocket"); + getLivingInfoReq.getTId().setSDeviceInfo("chrome"); + getLivingInfoReq.getTId().setSCookie(StrUtil.nullToEmpty(cookie)); +// getLivingInfoReq.getTId().setSCookie("vplayer_sbanner_1724691_1724691=1; SoundValue=0.50; alphaValue=0.80; game_did=R24J2g0mBzvdXJf7a9nheSl3zIci2BOp0-t; isInLiveRoom=true; guid=0a7dca72a3ce1b654001dd2ade2ae857; __yamid_tt1=0.8029935065011269; __yamid_new=CA75D4CD5C100001165B82B52140C900; guid=0a7dca72a3ce1b654001dd2ade2ae857; udb_guiddata=af5dbdbf76254a6e8a0a293ccae9b688; udb_deviceid=w_761623483861815296; udb_passdata=3; __yasmid=0.8029935065011269; _yasids=__rootsid%3DCA767045C1100001EC5A145C1E90FE00; Hm_lvt_51700b6c722f5bb4cf39906a596ea41f=1696473760,1696476745,1696483565,1696484212; Hm_lpvt_51700b6c722f5bb4cf39906a596ea41f=1696484212; huya_ua=webh5&0.0.1&activity; _rep_cnt=2; sdid=0UnHUgv0/qmfD4KAKlwzhqX98QrnPCcck6fN494iawS5Kmymgreu89o7gYta/QvQsBDeSeSRp4/grQ5fEuFAYrL59coAKuxuukiwgTLjfjEDWVkn9LtfFJw/Qo4kgKr8OZHDqNnuwg612sGyflFn1dkUeZYTToCzzl4GCHq7MUDahxGuPR8mUddfImFtjccs1; huya_flash_rep_cnt=74; huya_web_rep_cnt=125; rep_cnt=44"); + getLivingInfoReq.setLPresenterUid(roomInfo.get("lChannelId").asLong()); + + WupReq wupReq = new WupReq(); + wupReq.getTarsServantRequest().setServantName("huyaliveui"); + wupReq.getTarsServantRequest().setFunctionName("getLivingInfo"); + wupReq.getUniAttribute().put("tReq", getLivingInfoReq); + + WebSocketCommand webSocketCommand = new WebSocketCommand(); + webSocketCommand.setOperation(HuyaOperationEnum.EWSCmd_WupReq.getCode()); + webSocketCommand.setVData(wupReq.encode()); + return new BinaryWebSocketFrame(Unpooled.wrappedBuffer(webSocketCommand.toByteArray())); + } + + public BinaryWebSocketFrame createLiveLaunchReq(String ver, String cookie) { + LiveLaunchReq liveLaunchReq = new LiveLaunchReq(); + liveLaunchReq.setBSupportDomain(true); +// liveLaunchReq.getTId().setSGuid(UUID.fastUUID().toString(true)); + liveLaunchReq.getTId().setSHuYaUA("webh5&" + ver + "&websocket"); + liveLaunchReq.getTId().setSDeviceInfo("chrome"); + liveLaunchReq.getTId().setSCookie(StrUtil.nullToEmpty(cookie)); + liveLaunchReq.getTLiveUB().setESource(HuyaLiveSource.WEB_HUYA.getCode()); + + WupReq wupReq = new WupReq(); + wupReq.getTarsServantRequest().setServantName("liveui"); + wupReq.getTarsServantRequest().setFunctionName("doLaunch"); + wupReq.getUniAttribute().put("tReq", liveLaunchReq); + + WebSocketCommand webSocketCommand = new WebSocketCommand(); + webSocketCommand.setOperation(HuyaOperationEnum.EWSCmd_WupReq.getCode()); + webSocketCommand.setVData(wupReq.encode()); + return new BinaryWebSocketFrame(Unpooled.wrappedBuffer(webSocketCommand.toByteArray())); + } + + public BinaryWebSocketFrame createRegisterGroupReq() { + String lYyid = roomInfo.get("lChannelId").asText(); + + RegisterGroupReq registerGroupReq = new RegisterGroupReq(); + registerGroupReq.setVGroupId(CollUtil.newArrayList("live:" + lYyid, "chat:" + lYyid)); + + WebSocketCommand webSocketCommand = new WebSocketCommand(); + webSocketCommand.setOperation(HuyaOperationEnum.EWSCmdC2S_RegisterGroupReq.getCode()); + webSocketCommand.setVData(registerGroupReq.toByteArray()); + return new BinaryWebSocketFrame(Unpooled.wrappedBuffer(webSocketCommand.toByteArray())); + } + + public BinaryWebSocketFrame createUpdateUserInfoReq() { + UpdateUserInfoReq updateUserInfoReq = new UpdateUserInfoReq(); + updateUserInfoReq.setSAppSrc("HUYA&ZH&2052"); + updateUserInfoReq.getTWSMsgStatInfo().setISupportAckMsgStat(1); + + WebSocketCommand webSocketCommand = new WebSocketCommand(); + webSocketCommand.setOperation(HuyaOperationEnum.EWSCmdC2S_UpdateUserInfoReq.getCode()); + webSocketCommand.setVData(updateUserInfoReq.toByteArray()); + return new BinaryWebSocketFrame(Unpooled.wrappedBuffer(webSocketCommand.toByteArray())); + } + + /** + * 创建获取礼物列表请求包 + * + * @return BinaryWebSocketFrame + */ + public BinaryWebSocketFrame createGiftListReq(String ver) { + WebSocketCommand webSocketCommand = new WebSocketCommand(); + webSocketCommand.setOperation(HuyaOperationEnum.EWSCmd_WupReq.getCode()); + webSocketCommand.setVData(this.getGiftListReqMsg(ver)); + return new BinaryWebSocketFrame(Unpooled.wrappedBuffer(webSocketCommand.toByteArray())); + } + + public BinaryWebSocketFrame createHeartbeat(String ver, String cookie) { + WebSocketCommand webSocketCommand = new WebSocketCommand(); + webSocketCommand.setOperation(HuyaOperationEnum.EWSCmdC2S_HeartBeatReq.getCode()); + webSocketCommand.setVData(this.getHeartbeatMsg(ver, cookie)); + return new BinaryWebSocketFrame(Unpooled.wrappedBuffer(webSocketCommand.toByteArray())); + } + + /** + * 心跳包单例模式 + */ + public byte[] getHeartbeatMsg(String ver, String cookie) { + if (heartbeatMsg == null) { + synchronized (HuyaWebSocketFrameFactory.this) { + if (heartbeatMsg == null) { + UserHeartBeatReq userHeartBeatReq = new UserHeartBeatReq(); +// userHeartBeatReq.getTId().setSGuid(""); + userHeartBeatReq.getTId().setSHuYaUA("webh5&" + ver + "&websocket"); + userHeartBeatReq.getTId().setSDeviceInfo("chrome"); + userHeartBeatReq.getTId().setSCookie(StrUtil.nullToEmpty(cookie)); +// userHeartBeatReq.setLSid(roomInfo.get("lSubChannelId").asLong()); + userHeartBeatReq.setLPid(roomInfo.get("lChannelId").asLong()); +// userHeartBeatReq.setELineType(HuyaStreamLineTypeEnum.STREAM_LINE_WS.getCode()); + userHeartBeatReq.setELineType(-1); + + heartbeatMsg = HuyaCodecUtil.encode("onlineui", HuyaWupFunctionEnum.OnUserHeartBeat, userHeartBeatReq); + } + } + } + return heartbeatMsg; + } + + /** + * 礼物列表请求包单例模式 + */ + public byte[] getGiftListReqMsg(String ver) { + if (giftListReqMsg == null) { + synchronized (HuyaWebSocketFrameFactory.this) { + if (giftListReqMsg == null) { + GetPropsListReq getPropsListReq = new GetPropsListReq(); + getPropsListReq.getTUserId().setLUid(roomInfo.get("lYyid").asLong()); + getPropsListReq.getTUserId().setSHuYaUA("webh5&" + ver + "&websocket"); + getPropsListReq.setITemplateType(HuyaClientTemplateTypeEnum.TPL_MIRROR.getCode()); + + giftListReqMsg = HuyaCodecUtil.encode("PropsUIServer", HuyaWupFunctionEnum.getPropsList, getPropsListReq); + } + } + } + return giftListReqMsg; + } + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/netty/handler/HuyaBinaryFrameHandler.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/netty/handler/HuyaBinaryFrameHandler.java new file mode 100644 index 0000000..81a4f43 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/netty/handler/HuyaBinaryFrameHandler.java @@ -0,0 +1,199 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.netty.handler; + +import com.qq.tars.protocol.tars.TarsInputStream; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; +import tech.ordinaryroad.live.chat.client.huya.api.HuyaApis; +import tech.ordinaryroad.live.chat.client.huya.client.HuyaLiveChatClient; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaCmdEnum; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaWupFunctionEnum; +import tech.ordinaryroad.live.chat.client.huya.listener.IHuyaMsgListener; +import tech.ordinaryroad.live.chat.client.huya.msg.*; +import tech.ordinaryroad.live.chat.client.huya.msg.base.IHuyaMsg; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.MsgItem; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.PropsItem; +import tech.ordinaryroad.live.chat.client.huya.msg.req.GetPropsListRsp; +import tech.ordinaryroad.live.chat.client.huya.netty.frame.factory.HuyaWebSocketFrameFactory; +import tech.ordinaryroad.live.chat.client.huya.util.HuyaCodecUtil; +import tech.ordinaryroad.live.chat.client.servers.netty.client.handler.BaseNettyClientBinaryFrameHandler; + +import java.util.List; + + +/** + * 消息处理器 + * + * @author mjz + * @date 2023/9/5 + */ +@Slf4j +@ChannelHandler.Sharable +public class HuyaBinaryFrameHandler extends BaseNettyClientBinaryFrameHandler { + + /** + * 以ClientConfig为主 + */ + private final String ver; + private ChannelHandlerContext channelHandlerContext; + + public HuyaBinaryFrameHandler(List iHuyaMsgListeners, HuyaLiveChatClient client, long roomId) { + super(iHuyaMsgListeners, client, roomId); + this.ver = client.getConfig().getVer(); + } + + public HuyaBinaryFrameHandler(List iHuyaMsgListeners, HuyaLiveChatClient client) { + super(iHuyaMsgListeners, client); + this.ver = client.getConfig().getVer(); + } + + public HuyaBinaryFrameHandler(List iHuyaMsgListeners, long roomId, String ver) { + super(iHuyaMsgListeners, roomId); + this.ver = ver; + } + + @Override + public void handlerAdded(ChannelHandlerContext ctx) throws Exception { + super.handlerAdded(ctx); + channelHandlerContext = ctx; + } + + @Override + public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { + super.handlerRemoved(ctx); + channelHandlerContext = null; + } + + @Override + public void onMsg(IMsg msg) { + IHuyaMsg iHuyaMsg = (IHuyaMsg) msg; + HuyaOperationEnum operationEnum = iHuyaMsg.getOperationEnum(); + if (operationEnum == HuyaOperationEnum.EWSCmdS2C_RegisterGroupRsp) { +// channelHandlerContext.writeAndFlush(HuyaWebSocketFrameFactory.getInstance(getRoomId()).createUpdateUserInfoReq()); + // 获取礼物列表 +// if (channelHandlerContext == null) { +// log.error("channelHandlerContext is null, cannot get gift list"); +// return; +// } +// if (log.isDebugEnabled()) { +// log.debug("获取礼物列表"); +// } + channelHandlerContext.writeAndFlush(HuyaWebSocketFrameFactory.getInstance(getRoomId()).createGiftListReq(getVer())); + } else if (operationEnum == HuyaOperationEnum.EWSCmd_WupRsp) { + WupRsp wupRsp = (WupRsp) msg; + String functionName = wupRsp.getTarsServantRequest().getFunctionName(); + HuyaWupFunctionEnum wupFunctionEnum = HuyaWupFunctionEnum.getByName(functionName); + if (wupFunctionEnum == null) { + if (log.isWarnEnabled()) { + log.warn("未知 function {}", functionName); + } + return; + } + + switch (wupFunctionEnum) { + case doLaunch: { +// LiveLaunchRsp liveLaunchRsp = new LiveLaunchRsp(); +// liveLaunchRsp = wupRsp.getUniAttribute().getByClass("tRsp", liveLaunchRsp); + channelHandlerContext.writeAndFlush(HuyaWebSocketFrameFactory.getInstance(getRoomId()).createRegisterGroupReq()); + break; + } + case getPropsList: { + GetPropsListRsp getPropsListRsp = new GetPropsListRsp(); + getPropsListRsp = wupRsp.getUniAttribute().getByClass("tRsp", getPropsListRsp); + for (PropsItem propsItem : getPropsListRsp.getVPropsItemList()) { + HuyaApis.GIFT_ITEMS.put(propsItem.getIPropsId(), propsItem); + } + break; + } + default: { + if (log.isDebugEnabled()) { + log.debug("暂不支持 function {}", wupFunctionEnum); + } + } + } + } else { + // ignore + } + } + + @Override + public void onCmdMsg(HuyaCmdEnum cmd, ICmdMsg cmdMsg) { + if (super.msgListeners.isEmpty()) { + return; + } + + byte[] dataBytes; + if (cmdMsg instanceof PushMessage) { + PushMessage pushMessage = (PushMessage) cmdMsg; + dataBytes = pushMessage.getDataBytes(); + } else if (cmdMsg instanceof MsgItem) { + MsgItem msgItem = (MsgItem) cmdMsg; + dataBytes = msgItem.getSMsg(); + } else { + if (log.isDebugEnabled()) { + log.debug("非HuyaCmdMsg {}", cmdMsg.getClass()); + } + return; + } + TarsInputStream tarsInputStream = HuyaCodecUtil.newUtf8TarsInputStream(dataBytes); + + switch (cmd) { + case MessageNotice: { + MessageNoticeMsg messageNoticeMsg = new MessageNoticeMsg(tarsInputStream); + iteratorMsgListeners(msgListener -> msgListener.onDanmuMsg(HuyaBinaryFrameHandler.this, messageNoticeMsg)); + break; + } + case SendItemSubBroadcastPacket: { + SendItemSubBroadcastPacketMsg sendItemSubBroadcastPacketMsg = new SendItemSubBroadcastPacketMsg(tarsInputStream); + sendItemSubBroadcastPacketMsg.setPropsItem(HuyaApis.GIFT_ITEMS.getOrDefault(sendItemSubBroadcastPacketMsg.getIItemType(), PropsItem.DEFAULT)); + iteratorMsgListeners(msgListener -> msgListener.onGiftMsg(HuyaBinaryFrameHandler.this, sendItemSubBroadcastPacketMsg)); + break; + } + case VipEnterBanner: { + VipEnterBannerMsg vipEnterBannerMsg = new VipEnterBannerMsg(tarsInputStream); + iteratorMsgListeners(msgListener -> msgListener.onEnterRoomMsg(HuyaBinaryFrameHandler.this, vipEnterBannerMsg)); + break; + } + default: { + iteratorMsgListeners(msgListener -> msgListener.onOtherCmdMsg(HuyaBinaryFrameHandler.this, cmd, cmdMsg)); + } + } + } + + public String getVer() { + return client != null ? client.getConfig().getVer() : ver; + } + + @Override + protected List decode(ByteBuf byteBuf) { + return HuyaCodecUtil.decode(byteBuf); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/netty/handler/HuyaConnectionHandler.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/netty/handler/HuyaConnectionHandler.java new file mode 100644 index 0000000..ad052fc --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/netty/handler/HuyaConnectionHandler.java @@ -0,0 +1,152 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.netty.handler; + +import io.netty.channel.Channel; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.huya.client.HuyaLiveChatClient; +import tech.ordinaryroad.live.chat.client.huya.config.HuyaLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.huya.netty.frame.factory.HuyaWebSocketFrameFactory; +import tech.ordinaryroad.live.chat.client.servers.netty.client.handler.BaseNettyClientConnectionHandler; + + +/** + * 连接处理器 + * + * @author mjz + * @date 2023/8/21 + */ +@Slf4j +@ChannelHandler.Sharable +public class HuyaConnectionHandler extends BaseNettyClientConnectionHandler { + + /** + * 以ClientConfig为主 + */ + private final Object roomId; + /** + * 以ClientConfig为主 + */ + private final String ver; + /** + * 以ClientConfig为主 + */ + private String cookie; + + public HuyaConnectionHandler(WebSocketClientHandshaker handshaker, HuyaLiveChatClient client, IBaseConnectionListener listener) { + super(handshaker, client, listener); + this.roomId = client.getConfig().getRoomId(); + this.ver = client.getConfig().getVer(); + this.cookie = client.getConfig().getCookie(); + } + + public HuyaConnectionHandler(WebSocketClientHandshaker handshaker, HuyaLiveChatClient client) { + this(handshaker, client, null); + } + + public HuyaConnectionHandler(WebSocketClientHandshaker handshaker, long roomId, String ver, IBaseConnectionListener listener, String cookie) { + super(handshaker, listener); + this.roomId = roomId; + this.ver = ver; + this.cookie = cookie; + } + + public HuyaConnectionHandler(WebSocketClientHandshaker handshaker, long roomId, String ver, IBaseConnectionListener listener) { + this(handshaker, roomId, ver, listener, null); + } + + public HuyaConnectionHandler(WebSocketClientHandshaker handshaker, long roomId, String ver, String cookie) { + this(handshaker, roomId, ver, null, cookie); + } + + public HuyaConnectionHandler(WebSocketClientHandshaker handshaker, long roomId, String ver) { + this(handshaker, roomId, ver, null, null); + } + + @Override + protected void sendHeartbeat(ChannelHandlerContext ctx) { + if (log.isDebugEnabled()) { + log.debug("发送心跳包"); + } + ctx.writeAndFlush( + getWebSocketFrameFactory(getRoomId()).createHeartbeat(getVer(), getCookie()) + ).addListener((ChannelFutureListener) future -> { + if (future.isSuccess()) { + if (log.isDebugEnabled()) { + log.debug("心跳包发送完成"); + } + } else { + log.error("心跳包发送失败", future.cause()); + } + }); + } + + private static HuyaWebSocketFrameFactory getWebSocketFrameFactory(Object roomId) { + return HuyaWebSocketFrameFactory.getInstance(roomId); + } + + @Override + public void sendAuthRequest(Channel channel) { + if (log.isDebugEnabled()) { + log.debug("发送认证包"); + } + channel.writeAndFlush(getWebSocketFrameFactory(getRoomId()).createAuth(getVer(), getCookie())); + } + + public Object getRoomId() { + return client != null ? client.getConfig().getRoomId() : roomId; + } + + public String getVer() { + return client != null ? client.getConfig().getVer() : ver; + } + + private String getCookie() { + return client != null ? client.getConfig().getCookie() : cookie; + } + + @Override + protected long getHeartbeatPeriod() { + if (client == null) { + return HuyaLiveChatClientConfig.DEFAULT_HEARTBEAT_PERIOD; + } else { + return client.getConfig().getHeartbeatPeriod(); + } + } + + @Override + protected long getHeartbeatInitialDelay() { + if (client == null) { + return HuyaLiveChatClientConfig.DEFAULT_HEARTBEAT_INITIAL_DELAY; + } else { + return client.getConfig().getHeartbeatInitialDelay(); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/util/HuyaCodecUtil.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/util/HuyaCodecUtil.java new file mode 100644 index 0000000..e5b479e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/main/java/tech/ordinaryroad/live/chat/client/huya/util/HuyaCodecUtil.java @@ -0,0 +1,167 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.util; + +import cn.hutool.core.codec.Base64; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ByteUtil; +import com.qq.tars.protocol.tars.TarsInputStream; +import com.qq.tars.protocol.tars.TarsStructBase; +import io.netty.buffer.ByteBuf; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaDecorationAppTypeEnum; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaDecorationViewTypeEnum; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaOperationEnum; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaWupFunctionEnum; +import tech.ordinaryroad.live.chat.client.huya.msg.*; +import tech.ordinaryroad.live.chat.client.huya.msg.base.IHuyaMsg; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.BadgeInfo; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.DecorationInfo; +import tech.ordinaryroad.live.chat.client.huya.msg.req.WupReq; + +import java.nio.charset.StandardCharsets; +import java.util.*; + +/** + * @author mjz + * @date 2023/9/5 + */ +@Slf4j +public class HuyaCodecUtil { + + public static List decode(ByteBuf in) { + List msgList = new ArrayList<>(); + Queue pendingByteBuf = new LinkedList<>(); + + do { + msgList.addAll(doDecode(in, pendingByteBuf)); + in = pendingByteBuf.poll(); + } while (in != null); + + return msgList; + } + + /** + * 执行解码操作,有压缩则先解压,解压后可能得到多条消息 + * + * @param in handler收到的一条消息 + * @param pendingByteBuf 用于存放未读取完的ByteBuf + */ + private static List doDecode(ByteBuf in, Queue pendingByteBuf) { + byte[] bytes = new byte[in.readableBytes()]; + in.readBytes(bytes); + + WebSocketCommand webSocketCommand = new WebSocketCommand(newUtf8TarsInputStream(bytes)); + HuyaOperationEnum operationEnum = webSocketCommand.getOperationEnum(); + if (operationEnum == null) { + throw new BaseException(String.format("未知operation: %d", webSocketCommand.getOperation())); + } + + switch (operationEnum) { + case EWSCmd_RegisterRsp: { + return Collections.singletonList(new RegisterRsp(newUtf8TarsInputStream(webSocketCommand.getVData()))); + } + case EWSCmdS2C_RegisterGroupRsp: { + return Collections.singletonList(new RegisterGroupRsp(newUtf8TarsInputStream(webSocketCommand.getVData()))); + } + case EWSCmd_WupRsp: { + return Collections.singletonList(new WupRsp(webSocketCommand.getVData())); + } + case EWSCmdS2C_MsgPushReq: { + return Collections.singletonList(new PushMessage(newUtf8TarsInputStream(webSocketCommand.getVData()))); + } + case EWSCmdS2C_VerifyCookieRsp: { + return Collections.singletonList(new VerifyCookieRsp(newUtf8TarsInputStream(webSocketCommand.getVData()))); + } + case EWSCmdS2C_MsgPushReq_V2: { + PushMessage_V2 pushMessageV2 = new PushMessage_V2(newUtf8TarsInputStream(webSocketCommand.getVData())); + return pushMessageV2.getVMsgItem(); + } + default: { + return Collections.singletonList(webSocketCommand); + } + } + } + + public static byte[] encode(String servantName, HuyaWupFunctionEnum function, TarsStructBase req) { + WupReq wupReq = new WupReq(); + wupReq.getTarsServantRequest().setServantName(servantName); + wupReq.getTarsServantRequest().setFunctionName(function.name()); + wupReq.getUniAttribute().put("tReq", req); + return wupReq.encode(); + } + + public static TarsInputStream newUtf8TarsInputStream(byte[] bytes) { + TarsInputStream tarsInputStream = new TarsInputStream(bytes); + tarsInputStream.setServerEncoding(StandardCharsets.UTF_8.name()); + return tarsInputStream; + } + + public static Optional decodeDecorationInfo(DecorationInfo decorationInfo) { + int iViewType = decorationInfo.getIViewType(); + HuyaDecorationViewTypeEnum huyaDecorationViewTypeEnum = HuyaDecorationViewTypeEnum.getByCode(iViewType); + if (huyaDecorationViewTypeEnum == null) { + return Optional.empty(); + } + + switch (huyaDecorationViewTypeEnum) { + case kDecorationViewTypeCustomized: { + int iAppId = decorationInfo.getIAppId(); + HuyaDecorationAppTypeEnum huyaDecorationAppTypeEnum = HuyaDecorationAppTypeEnum.getByCode(iAppId); + if (huyaDecorationAppTypeEnum == null) { + return Optional.empty(); + } + + switch (huyaDecorationAppTypeEnum) { + case kDecorationAppTypeFans: { + BadgeInfo badgeInfo = new BadgeInfo(); + badgeInfo.readFrom(HuyaCodecUtil.newUtf8TarsInputStream(decorationInfo.getVData())); + return Optional.of(badgeInfo); + } + default: { + return Optional.empty(); + } + } + } + default: { + return Optional.empty(); + } + } + } + + public static String ab2str(byte[] bytes) { + char[] chars = new char[bytes.length]; + for (int i = 0; i < bytes.length; i++) { + int unsignedInt = ByteUtil.byteToUnsignedInt(bytes[i]); + chars[i] = (char) unsignedInt; + } + return ArrayUtil.join(chars, ""); + } + + public static String btoa(String string) { + return Base64.encode(string); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/test/java/tech/ordinaryroad/live/chat/client/huya/api/HuyaApisTest.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/test/java/tech/ordinaryroad/live/chat/client/huya/api/HuyaApisTest.java new file mode 100644 index 0000000..3de00e2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/test/java/tech/ordinaryroad/live/chat/client/huya/api/HuyaApisTest.java @@ -0,0 +1,20 @@ +package tech.ordinaryroad.live.chat.client.huya.api; + +import org.junit.jupiter.api.Test; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +/** + * @author mjz + * @date 2023/10/1 + */ +class HuyaApisTest { + + @Test + void roomInit() { + assertEquals(HuyaApis.roomInit(189201).size(), 3); + assertThrows(BaseException.class, () -> HuyaApis.roomInit(-1)); + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/test/java/tech/ordinaryroad/live/chat/client/huya/client/HuyaLiveChatClientTest.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/test/java/tech/ordinaryroad/live/chat/client/huya/client/HuyaLiveChatClientTest.java new file mode 100644 index 0000000..e8b8389 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/test/java/tech/ordinaryroad/live/chat/client/huya/client/HuyaLiveChatClientTest.java @@ -0,0 +1,150 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.huya.client; + +import cn.hutool.core.thread.ThreadUtil; +import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.StrUtil; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Test; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; +import tech.ordinaryroad.live.chat.client.huya.config.HuyaLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.huya.constant.HuyaCmdEnum; +import tech.ordinaryroad.live.chat.client.huya.listener.IHuyaMsgListener; +import tech.ordinaryroad.live.chat.client.huya.msg.MessageNoticeMsg; +import tech.ordinaryroad.live.chat.client.huya.msg.SendItemSubBroadcastPacketMsg; +import tech.ordinaryroad.live.chat.client.huya.msg.VipEnterBannerMsg; +import tech.ordinaryroad.live.chat.client.huya.netty.handler.HuyaBinaryFrameHandler; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * @author mjz + * @date 2023/9/5 + */ +@Slf4j +class HuyaLiveChatClientTest { + + static Object lock = new Object(); + HuyaLiveChatClient client; + + @Test + void example() throws InterruptedException { + HuyaLiveChatClientConfig config = HuyaLiveChatClientConfig.builder() + .roomId(353322) + .roomId(390001) + .roomId(527988) + .roomId(1995) + .roomId(116) + // bagea + .roomId(189201) + .build(); + + client = new HuyaLiveChatClient(config, new IHuyaMsgListener() { + @Override + public void onDanmuMsg(HuyaBinaryFrameHandler binaryFrameHandler, MessageNoticeMsg msg) { + log.info("{} 收到弹幕 {} {}({}):{}", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), msg.getContent()); + } + + @Override + public void onGiftMsg(HuyaBinaryFrameHandler binaryFrameHandler, SendItemSubBroadcastPacketMsg msg) { + long lPayTotal = msg.getLPayTotal(); + if (lPayTotal != 0) { + int giftPrice = msg.getGiftPrice(); + } + log.info("{} 收到礼物 {}({}) {} {}({})x{}({})", binaryFrameHandler.getRoomId(), msg.getUsername(), msg.getUid(), "赠送", msg.getGiftName(), msg.getGiftId(), msg.getGiftCount(), msg.getGiftPrice()); + } + + @Override + public void onEnterRoomMsg(HuyaBinaryFrameHandler binaryFrameHandler, VipEnterBannerMsg msg) { + // 虎牙目前只支持监听VIP用户的入房消息 + log.info("{} {}({}) 进入直播间", msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid()); + } + + @Override + public void onMsg(HuyaBinaryFrameHandler binaryFrameHandler, IMsg msg) { + log.debug("{} 收到{}消息 {}", binaryFrameHandler.getRoomId(), msg.getClass(), msg); + } + + @Override + public void onCmdMsg(HuyaBinaryFrameHandler binaryFrameHandler, HuyaCmdEnum cmd, ICmdMsg cmdMsg) { + log.info("{} 收到CMD消息{} {}", binaryFrameHandler.getRoomId(), cmd, cmdMsg); + } + + @Override + public void onOtherCmdMsg(HuyaBinaryFrameHandler binaryFrameHandler, HuyaCmdEnum cmd, ICmdMsg cmdMsg) { + log.debug("{} 收到其他CMD消息 {}", binaryFrameHandler.getRoomId(), cmd); + } + + @Override + public void onUnknownCmd(HuyaBinaryFrameHandler binaryFrameHandler, String cmdString, IMsg msg) { + log.debug("{} 收到未知CMD消息 {}", binaryFrameHandler.getRoomId(), cmdString); + } + }); + client.connect(); + + // 防止测试时直接退出 + while (true) { + synchronized (lock) { + lock.wait(); + } + } + } + + @Test + void sendDanmuTest() throws InterruptedException { + String cookie = System.getenv("cookie"); + assertTrue(StrUtil.isNotBlank(cookie)); + log.error("cookie: {}", cookie); + + HuyaLiveChatClientConfig config = HuyaLiveChatClientConfig.builder() + .cookie(cookie) + .roomId(189201) + .build(); + + client = new HuyaLiveChatClient(config); + client.connect(() -> { + String danmu = "66666" + RandomUtil.randomNumber(); + log.info("连接成功,5s后发送弹幕{}", danmu); + ThreadUtil.sleep(5000); + client.sendDanmu(danmu); + }); + client.addMsgListener(new IHuyaMsgListener() { + @Override + public void onMsg(IMsg msg) { + log.info("收到消息{}", msg); + } + }); + + // 防止测试时直接退出 + while (true) { + synchronized (lock) { + lock.wait(); + } + } + } + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/test/java/tech/ordinaryroad/live/chat/client/huya/util/HuyaCodecUtilTest.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/test/java/tech/ordinaryroad/live/chat/client/huya/util/HuyaCodecUtilTest.java new file mode 100644 index 0000000..aabfed7 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-huya/src/test/java/tech/ordinaryroad/live/chat/client/huya/util/HuyaCodecUtilTest.java @@ -0,0 +1,99 @@ +package tech.ordinaryroad.live.chat.client.huya.util; + +import cn.hutool.core.codec.Base64; +import org.junit.jupiter.api.Test; +import tech.ordinaryroad.live.chat.client.huya.msg.ConnectParaInfo; +import tech.ordinaryroad.live.chat.client.huya.msg.LiveLaunchRsp; +import tech.ordinaryroad.live.chat.client.huya.msg.WebSocketCommand; +import tech.ordinaryroad.live.chat.client.huya.msg.WupRsp; +import tech.ordinaryroad.live.chat.client.huya.msg.dto.UserId; +import tech.ordinaryroad.live.chat.client.huya.msg.req.*; + +import java.util.List; + +/** + * @author mjz + * @date 2023/10/3 + */ +class HuyaCodecUtilTest { + + private String ver = "2309271152"; + private String exp = "15547.23738,16582.25335,32083.50834"; + private String appSrc = "HUYA&ZH&2052"; + + @Test + void ab2str() { + ConnectParaInfo wsConnectParaInfo = ConnectParaInfo.newWSConnectParaInfo(ver, exp, appSrc); + byte[] byteArray = wsConnectParaInfo.toByteArray(); + String s = HuyaCodecUtil.ab2str(byteArray); + System.out.println(s); + } + + @Test + void btoa() { + ConnectParaInfo wsConnectParaInfo = ConnectParaInfo.newWSConnectParaInfo(ver, exp, appSrc); + byte[] byteArray = wsConnectParaInfo.toByteArray(); + String s = HuyaCodecUtil.ab2str(byteArray); + + String btoa = HuyaCodecUtil.btoa(s); + System.out.println(btoa); + } + + @Test + void decodeHeartbeatTest() { + byte[] decode = Base64.decode("AAMdAAEEKAAABCgQAyw8QAFWCG9ubGluZXVpZg9PblVzZXJIZWFydEJlYXR9AAED+QgAAQYEdFJlcR0AAQPrCgoMFiAwYTdkY2E3MmEzY2UxYjY1NDAwMWRkMmFkZTJhZTg1NyYANhp3ZWJoNSYyMzA5MjcxMTUyJndlYnNvY2tldEcAAAOKdnBsYXllcl9zYmFubmVyXzE3MjQ2OTFfMTcyNDY5MT0xOyBTb3VuZFZhbHVlPTAuNTA7IGFscGhhVmFsdWU9MC44MDsgZ2FtZV9kaWQ9UjI0SjJnMG1CenZkWEpmN2E5bmhlU2wzekljaTJCT3AwLXQ7IGlzSW5MaXZlUm9vbT10cnVlOyBndWlkPTBhN2RjYTcyYTNjZTFiNjU0MDAxZGQyYWRlMmFlODU3OyBfX3lhbWlkX3R0MT0wLjgwMjk5MzUwNjUwMTEyNjk7IF9feWFtaWRfbmV3PUNBNzVENENENUMxMDAwMDExNjVCODJCNTIxNDBDOTAwOyBndWlkPTBhN2RjYTcyYTNjZTFiNjU0MDAxZGQyYWRlMmFlODU3OyB1ZGJfZ3VpZGRhdGE9YWY1ZGJkYmY3NjI1NGE2ZThhMGEyOTNjY2FlOWI2ODg7IHVkYl9kZXZpY2VpZD13Xzc2MTYyMzQ4Mzg2MTgxNTI5NjsgdWRiX3Bhc3NkYXRhPTM7IF9feWFzbWlkPTAuODAyOTkzNTA2NTAxMTI2OTsgSG1fbHZ0XzUxNzAwYjZjNzIyZjViYjRjZjM5OTA2YTU5NmVhNDFmPTE2OTY0MDk0MjAsMTY5NjQxMTgwNiwxNjk2NDczNzYwLDE2OTY0NzY3NDU7IF95YXNpZHM9X19yb290c2lkJTNEQ0E3NjY5MjcwM0IwMDAwMTNGRkJCRkVBNjY4Nzk5RDA7IEhtX2xwdnRfNTE3MDBiNmM3MjJmNWJiNGNmMzk5MDZhNTk2ZWE0MWY9MTY5NjQ3Njg4MDsgaHV5YV91YT13ZWJoNSYwLjAuMSZhY3Rpdml0eTsgX3JlcF9jbnQ9Mzsgc2RpZD0wVW5IVWd2MC9xbWZENEtBS2x3emhxU1drU1d3a3RzZXhQSWNsTnQzUGJ3TVFha1dOTmZrMlc4KzFkNlFNZzVZYnU1bC9GcDRpaHRUTDdCd0Q2bTQ0MENHUUNkU0htZW1kOUNNLzVKRVZkanJXVmtuOUx0ZkZKdy9RbzRrZ0tyOE9aSERxTm51d2c2MTJzR3lmbEZuMWRrVWVaWVRUb0N6emw0R0NIcTdNVURhaHhHdVBSOG1VZGRmSW1GdGpjY3MxOyBodXlhX2ZsYXNoX3JlcF9jbnQ9NTc7IHJlcF9jbnQ9NDA7IGh1eWFfd2ViX3JlcF9jbnQ9MTY2XGYGY2hyb21lCxwsQgAaURNcYP98jJysC4yYDKgMLDYlYTgzMDdmMWM0YzRmNGVmMDphODMwN2YxYzRjNGY0ZWYwOjA6MExcZiAyYmZlZjAzNmEwMzBkOTgyN2ZjYmQwMmU5ZmM0NzY1OQ=="); + WupReq wupReq = new WupReq(); + wupReq.decode(decode); + UserHeartBeatReq userHeartBeatReq = new UserHeartBeatReq(); + userHeartBeatReq = wupReq.getUniAttribute().getByClass("tReq", userHeartBeatReq); + long lPid = userHeartBeatReq.getLPid(); + } + + @Test + void decodeRegisterGroupReq() { + byte[] decode = Base64.decode("ABAdAAAhCQACBgxsaXZlOjE3MjQ2OTEGDGNoYXQ6MTcyNDY5MRYAIAE2AExcZgA="); + WebSocketCommand webSocketCommand = new WebSocketCommand(HuyaCodecUtil.newUtf8TarsInputStream(decode)); + byte[] vData = webSocketCommand.getVData(); + RegisterGroupReq registerGroupReq = new RegisterGroupReq(); + registerGroupReq.readFrom(HuyaCodecUtil.newUtf8TarsInputStream(vData)); + List vGroupId = registerGroupReq.getVGroupId(); + } + + @Test + void decodeLiveLaunchReq() { + byte[] decode = Base64.decode("AAMdAAEEJAAABCQQAyw8QARWBmxpdmV1aWYIZG9MYXVuY2h9AAED/ggAAQYEdFJlcR0AAQPwCgoMFiAwYTdkY2E3MmEzY2UxYjY1NDAwMWRkMmFkZTJhZTg1NyYANhp3ZWJoNSYyMzA5MjcxMTUyJndlYnNvY2tldEcAAAOKdnBsYXllcl9zYmFubmVyXzE3MjQ2OTFfMTcyNDY5MT0xOyBTb3VuZFZhbHVlPTAuNTA7IGFscGhhVmFsdWU9MC44MDsgZ2FtZV9kaWQ9UjI0SjJnMG1CenZkWEpmN2E5bmhlU2wzekljaTJCT3AwLXQ7IGlzSW5MaXZlUm9vbT10cnVlOyBndWlkPTBhN2RjYTcyYTNjZTFiNjU0MDAxZGQyYWRlMmFlODU3OyBfX3lhbWlkX3R0MT0wLjgwMjk5MzUwNjUwMTEyNjk7IF9feWFtaWRfbmV3PUNBNzVENENENUMxMDAwMDExNjVCODJCNTIxNDBDOTAwOyBndWlkPTBhN2RjYTcyYTNjZTFiNjU0MDAxZGQyYWRlMmFlODU3OyB1ZGJfZ3VpZGRhdGE9YWY1ZGJkYmY3NjI1NGE2ZThhMGEyOTNjY2FlOWI2ODg7IHVkYl9kZXZpY2VpZD13Xzc2MTYyMzQ4Mzg2MTgxNTI5NjsgdWRiX3Bhc3NkYXRhPTM7IF9feWFzbWlkPTAuODAyOTkzNTA2NTAxMTI2OTsgSG1fbHZ0XzUxNzAwYjZjNzIyZjViYjRjZjM5OTA2YTU5NmVhNDFmPTE2OTY0MDk0MjAsMTY5NjQxMTgwNiwxNjk2NDczNzYwLDE2OTY0NzY3NDU7IF95YXNpZHM9X19yb290c2lkJTNEQ0E3NjY5MjcwM0IwMDAwMTNGRkJCRkVBNjY4Nzk5RDA7IEhtX2xwdnRfNTE3MDBiNmM3MjJmNWJiNGNmMzk5MDZhNTk2ZWE0MWY9MTY5NjQ3Njg4MDsgaHV5YV91YT13ZWJoNSYwLjAuMSZhY3Rpdml0eTsgX3JlcF9jbnQ9Mzsgc2RpZD0wVW5IVWd2MC9xbWZENEtBS2x3emhxU1drU1d3a3RzZXhQSWNsTnQzUGJ3TVFha1dOTmZrMlc4KzFkNlFNZzVZYnU1bC9GcDRpaHRUTDdCd0Q2bTQ0MENHUUNkU0htZW1kOUNNLzVKRVZkanJXVmtuOUx0ZkZKdy9RbzRrZ0tyOE9aSERxTm51d2c2MTJzR3lmbEZuMWRrVWVaWVRUb0N6emw0R0NIcTdNVURhaHhHdVBSOG1VZGRmSW1GdGpjY3MxOyBodXlhX2ZsYXNoX3JlcF9jbnQ9NTc7IHJlcF9jbnQ9NDA7IGh1eWFfd2ViX3JlcF9jbnQ9MTY2XGYGY2hyb21lCxoAAxwqFgAmADYARgBWAAsLIAELjJgMqAwsNiU5N2Q5NzQ4NTYyMzdiMWZiOjk3ZDk3NDg1NjIzN2IxZmI6MDowTFxmIGU2OTYzZjMwMTRmYzZlY2U2M2ExNmU3ZTlhMzMzOWVl"); + WupReq wupReq = new WupReq(); + wupReq.decode(decode); + LiveLaunchReq liveLaunchReq = new LiveLaunchReq(); + liveLaunchReq = wupReq.getUniAttribute().getByClass("tReq", liveLaunchReq); + UserId tId = liveLaunchReq.getTId(); + System.out.println(wupReq.getTarsServantRequest().getVersion()); + } + + @Test + void decodeLiveLaunchRsp() { + byte[] decode = Base64.decode("AAQdAAECXAAAAlwQAyw8QARWBmxpdmV1aWYIZG9MYXVuY2h9AAECNggAAgYAHQAAAQwGBHRSc3AdAAECIQoGIDBhN2RjYTcyYTNjZTFiNjU0MDAxZGQyYWRlMmFlODU3EmUeNXopAAUKAAEZAAQGETExMS4xOS4yMzkuMTExOjgwBhAxMTEuMTkuMjI1LjIzOjgwBhAxMTEuNjMuMTgwLjk4OjgwBhExMTEuNjMuMTgwLjEwMDo4MAsKAAUZAAQGFzZmMTNlZjZmLXdzLnZhLmh1eWEuY29tBhc2ZjEzZTExNy13cy52YS5odXlhLmNvbQYXNmYzZmI0NjItd3MudmEuaHV5YS5jb20GFzZmM2ZiNDY0LXdzLnZhLmh1eWEuY29tCwoABhkABAYRMTExLjE5LjIzOS4xMTE6ODAGEDExMS4xOS4yMjUuMjM6ODAGEDExMS42My4xODAuOTg6ODAGETExMS42My4xODAuMTAwOjgwCwoABxkABAYRMTExLjE5LjIzOS4xMTE6ODAGEDExMS4xOS4yMjUuMjM6ODAGEDExMS42My4xODAuOTg6ODAGETExMS42My4xODAuMTAwOjgwCwoACRkACAYOMTIwLjE5NS4xNTguNDYGDzExMy4xMDcuMjM2LjE5NQYMMTQuMTcuMTA5LjY2Bg8xMDMuMjI3LjEyMS4xMDAGDzExNS4yMzguMTg5LjIyNQYPMTgzLjIzMi4xMzYuMTMwBg4yMjEuMjI4Ljc5LjIyNQYMNjAuMjE3LjI1MC4xCzxGDTExMi40My45Mi4xMTgLjJgMqAwsNiU5N2Q5NzQ4NTYyMzdiMWZiOjk3ZDk3NDg1NjIzN2IxZmI6MDowTFxmAA=="); + WupRsp wupRsp = new WupRsp(); + wupRsp.decode(decode); + LiveLaunchRsp liveLaunchRsp = new LiveLaunchRsp(); + liveLaunchRsp = wupRsp.getUniAttribute().getByClass("tRsp", liveLaunchRsp); + int eAccess = liveLaunchRsp.getEAccess(); + } + + @Test + void decodeGetLivingInfoReq() { + byte[] decode = Base64.decode("AAMdAAEEKAAABCgQAyw8QAFWCmh1eWFsaXZldWlmDWdldExpdmluZ0luZm99AAED+QgAAQYEdFJlcR0AAQPrCgoMFiAwYTdkY2E3MmEzY2UxYjY1NDAwMWRkMmFkZTJhZTg1NyYANhp3ZWJoNSYyMzA5MjcxMTUyJndlYnNvY2tldEcAAAOKdnBsYXllcl9zYmFubmVyXzE3MjQ2OTFfMTcyNDY5MT0xOyBTb3VuZFZhbHVlPTAuNTA7IGFscGhhVmFsdWU9MC44MDsgZ2FtZV9kaWQ9UjI0SjJnMG1CenZkWEpmN2E5bmhlU2wzekljaTJCT3AwLXQ7IGlzSW5MaXZlUm9vbT10cnVlOyBndWlkPTBhN2RjYTcyYTNjZTFiNjU0MDAxZGQyYWRlMmFlODU3OyBfX3lhbWlkX3R0MT0wLjgwMjk5MzUwNjUwMTEyNjk7IF9feWFtaWRfbmV3PUNBNzVENENENUMxMDAwMDExNjVCODJCNTIxNDBDOTAwOyBndWlkPTBhN2RjYTcyYTNjZTFiNjU0MDAxZGQyYWRlMmFlODU3OyB1ZGJfZ3VpZGRhdGE9YWY1ZGJkYmY3NjI1NGE2ZThhMGEyOTNjY2FlOWI2ODg7IHVkYl9kZXZpY2VpZD13Xzc2MTYyMzQ4Mzg2MTgxNTI5NjsgdWRiX3Bhc3NkYXRhPTM7IF9feWFzbWlkPTAuODAyOTkzNTA2NTAxMTI2OTsgX3lhc2lkcz1fX3Jvb3RzaWQlM0RDQTc2NzA0NUMxMTAwMDAxRUM1QTE0NUMxRTkwRkUwMDsgSG1fbHZ0XzUxNzAwYjZjNzIyZjViYjRjZjM5OTA2YTU5NmVhNDFmPTE2OTY0NzM3NjAsMTY5NjQ3Njc0NSwxNjk2NDgzNTY1LDE2OTY0ODQyMTI7IEhtX2xwdnRfNTE3MDBiNmM3MjJmNWJiNGNmMzk5MDZhNTk2ZWE0MWY9MTY5NjQ4NDIxMjsgaHV5YV91YT13ZWJoNSYwLjAuMSZhY3Rpdml0eTsgX3JlcF9jbnQ9Mjsgc2RpZD0wVW5IVWd2MC9xbWZENEtBS2x3emhxWDk4UXJuUENjY2s2Zk40OTRpYXdTNUtteW1ncmV1ODlvN2dZdGEvUXZRc0JEZVNlU1JwNC9nclE1ZkV1RkFZckw1OWNvQUt1eHV1a2l3Z1RMamZqRURXVmtuOUx0ZkZKdy9RbzRrZ0tyOE9aSERxTm51d2c2MTJzR3lmbEZuMWRrVWVaWVRUb0N6emw0R0NIcTdNVURhaHhHdVBSOG1VZGRmSW1GdGpjY3MxOyBodXlhX2ZsYXNoX3JlcF9jbnQ9NzQ7IGh1eWFfd2ViX3JlcF9jbnQ9MTI1OyByZXBfY250PTQ0XGYGY2hyb21lCxwsMgAaURNGAFYAbHyMC4yYDKgMLDYlZTcxMDQ2OTExYzk2N2JjNDplNzEwNDY5MTFjOTY3YmM0OjA6MExcZiBjNTRlM2NkYmIyNGJjYzcyYmU1MjU5NTY4ZGVmY2Q1Ng=="); + WupReq wupReq = new WupReq(); + wupReq.decode(decode); + GetLivingInfoReq getLivingInfoReq = new GetLivingInfoReq(); + getLivingInfoReq = wupReq.getUniAttribute().getByClass("tReq", getLivingInfoReq); + + byte[] decode2 = Base64.decode("AAAEJxwsPEABVgpodXlhbGl2ZXVpZg1nZXRMaXZpbmdJbmZvfQABA/kIAAEGBHRSZXEdAAED6woKDBYgMGE3ZGNhNzJhM2NlMWI2NTQwMDFkZDJhZGUyYWU4NTcmADYad2ViaDUmMjMwOTI3MTE1MiZ3ZWJzb2NrZXRHAAADinZwbGF5ZXJfc2Jhbm5lcl8xNzI0NjkxXzE3MjQ2OTE9MTsgU291bmRWYWx1ZT0wLjUwOyBhbHBoYVZhbHVlPTAuODA7IGdhbWVfZGlkPVIyNEoyZzBtQnp2ZFhKZjdhOW5oZVNsM3pJY2kyQk9wMC10OyBpc0luTGl2ZVJvb209dHJ1ZTsgZ3VpZD0wYTdkY2E3MmEzY2UxYjY1NDAwMWRkMmFkZTJhZTg1NzsgX195YW1pZF90dDE9MC44MDI5OTM1MDY1MDExMjY5OyBfX3lhbWlkX25ldz1DQTc1RDRDRDVDMTAwMDAxMTY1QjgyQjUyMTQwQzkwMDsgZ3VpZD0wYTdkY2E3MmEzY2UxYjY1NDAwMWRkMmFkZTJhZTg1NzsgdWRiX2d1aWRkYXRhPWFmNWRiZGJmNzYyNTRhNmU4YTBhMjkzY2NhZTliNjg4OyB1ZGJfZGV2aWNlaWQ9d183NjE2MjM0ODM4NjE4MTUyOTY7IHVkYl9wYXNzZGF0YT0zOyBfX3lhc21pZD0wLjgwMjk5MzUwNjUwMTEyNjk7IF95YXNpZHM9X19yb290c2lkJTNEQ0E3NjcwNDVDMTEwMDAwMUVDNUExNDVDMUU5MEZFMDA7IEhtX2x2dF81MTcwMGI2YzcyMmY1YmI0Y2YzOTkwNmE1OTZlYTQxZj0xNjk2NDczNzYwLDE2OTY0NzY3NDUsMTY5NjQ4MzU2NSwxNjk2NDg0MjEyOyBIbV9scHZ0XzUxNzAwYjZjNzIyZjViYjRjZjM5OTA2YTU5NmVhNDFmPTE2OTY0ODQyMTI7IGh1eWFfdWE9d2ViaDUmMC4wLjEmYWN0aXZpdHk7IF9yZXBfY250PTI7IHNkaWQ9MFVuSFVndjAvcW1mRDRLQUtsd3pocVg5OFFyblBDY2NrNmZONDk0aWF3UzVLbXltZ3JldTg5bzdnWXRhL1F2UXNCRGVTZVNScDQvZ3JRNWZFdUZBWXJMNTljb0FLdXh1dWtpd2dUTGpmakVEV1ZrbjlMdGZGSncvUW80a2dLcjhPWkhEcU5udXdnNjEyc0d5ZmxGbjFka1VlWllUVG9DenpsNEdDSHE3TVVEYWh4R3VQUjhtVWRkZkltRnRqY2NzMTsgaHV5YV9mbGFzaF9yZXBfY250PTc0OyBodXlhX3dlYl9yZXBfY250PTEyNTsgcmVwX2NudD00NFxmBmNocm9tZQscLDIAGlETRgBWAGx8jAuMmAyoDA=="); + WupReq wupReq2 = new WupReq(); + wupReq2.decode(decode2); + GetLivingInfoReq getLivingInfoReq2 = new GetLivingInfoReq(); + getLivingInfoReq2 = wupReq2.getUniAttribute().getByClass("tReq", getLivingInfoReq2); + + UserId tId = getLivingInfoReq.getTId(); + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/pom.xml b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/pom.xml new file mode 100644 index 0000000..5522cff --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + + org.ruoyi + live-chat-clients + ${revision} + ../pom.xml + + jar + + live-chat-client-kuaishou + live-chat-client-kuaishou + + + UTF-8 + + + + + org.ruoyi + live-chat-client-servers-netty-client + + + + com.google.protobuf + protobuf-java-util + + + + ch.qos.logback + logback-classic + + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/ClientModeExample.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/ClientModeExample.java new file mode 100644 index 0000000..7809fda --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/ClientModeExample.java @@ -0,0 +1,99 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.kuaishou; + +import cn.hutool.core.util.RandomUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; +import tech.ordinaryroad.live.chat.client.commons.client.enums.ClientStatusEnums; +import tech.ordinaryroad.live.chat.client.kuaishou.client.KuaishouLiveChatClient; +import tech.ordinaryroad.live.chat.client.kuaishou.config.KuaishouLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.kuaishou.listener.IKuaishouMsgListener; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.KuaishouDanmuMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.KuaishouGiftMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.netty.handler.KuaishouBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + +public class ClientModeExample { + static Logger log = LoggerFactory.getLogger(ClientModeExample.class); + + public static void main(String[] args) { + // 1. 创建配置 + KuaishouLiveChatClientConfig config = KuaishouLiveChatClientConfig.builder() + // TODO 浏览器Cookie + .cookie("did=web_6c4ac2a8ef8855d35df4d564baeaa8e8; kuaishou.live.bfb1s=7206d814e5c089a58c910ed8bf52ace5; clientid=3; did=web_6c4ac2a8ef8855d35df4d564baeaa8e8; client_key=65890b29; kpn=GAME_ZONE; userId=3941614875; kuaishou.live.web_st=ChRrdWFpc2hvdS5saXZlLndlYi5zdBKgAbRhgemDxM_Z_lBn7EZ_-5unvtslsh7ci5VY_eg80qqjxy5yb7oBFrdcWSPlz6jMIBz9h_yoLzATE3ngj2WawpxvbJhmq0EnRYIHv308kTBmg4KN2JQf7w2mfrsp1vusFbZ3NkfsEO4PrGQfX0L6mJRbgXeBqyz4tUM5O0q2Jte_NzWkaOnezvIGRAG8Y6yA1dxGUmiA9syTrPrdnSOzZvAaEoJNhwQ4OUDtgURWN6k9Xgm8PSIgAfV-ZvahtgaYhopZno6OuS2pkaFZjrz4ymoEZ1DSnj0oBTAB; kuaishou.live.web_ph=a287be6ab01dce264c0554eed94c2d6ac991; userId=3941614875") + // TODO 直播间id(支持短id) + .roomId("tianci666") + .build(); + + // 2. 创建Client并传入配置、添加消息回调 + KuaishouLiveChatClient client = new KuaishouLiveChatClient(config, new IKuaishouMsgListener() { + @Override + public void onMsg(IMsg msg) { + log.debug("收到{}消息 {}", msg.getClass(), msg); + } + + @Override + public void onCmdMsg(PayloadTypeOuterClass.PayloadType cmd, ICmdMsg cmdMsg) { + log.debug("收到CMD消息{} {}", cmd, cmdMsg); + } + + @Override + public void onOtherCmdMsg(PayloadTypeOuterClass.PayloadType cmd, ICmdMsg cmdMsg) { + log.debug("收到其他CMD消息 {}", cmd); + } + + @Override + public void onUnknownCmd(String cmdString, IMsg msg) { + log.debug("收到未知CMD消息 {}", cmdString); + } + + @Override + public void onDanmuMsg(KuaishouBinaryFrameHandler binaryFrameHandler, KuaishouDanmuMsg msg) { + log.info("{} 收到弹幕 [{}] {}({}):{}", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), msg.getContent()); + } + + @Override + public void onGiftMsg(KuaishouBinaryFrameHandler binaryFrameHandler, KuaishouGiftMsg msg) { + log.info("{} 收到礼物 [{}] {}({}) {} {}({})x{}({}) mergeKey:{},comboCount:{}, batchSize:{}", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), "赠送", msg.getGiftName(), msg.getGiftId(), msg.getGiftCount(), msg.getGiftPrice(), msg.getMsg().getMergeKey(), msg.getMsg().getComboCount(), msg.getMsg().getBatchSize()); + } + }); + // 3. 开始监听直播间 + client.connect(); + + // 客户端连接状态回调 + client.addStatusChangeListener(evt -> { + if (evt.getNewValue().equals(ClientStatusEnums.CONNECTED)) { + // TODO 要发送的弹幕内容,请注意控制发送频率;框架内置支持设置发送弹幕的最少时间间隔,小于时将忽略该次发送 + client.sendDanmu("666666" + RandomUtil.randomNumbers(1)); + } + }); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/api/KuaishouApis.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/api/KuaishouApis.java new file mode 100644 index 0000000..114f697 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/api/KuaishouApis.java @@ -0,0 +1,235 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.kuaishou.api; + +import cn.hutool.cache.impl.TimedCache; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ReUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.core.util.URLUtil; +import cn.hutool.http.*; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ArrayNode; +import lombok.*; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.util.OrLiveChatCookieUtil; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; + +import static tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg.OBJECT_MAPPER; + +/** + * @author mjz + * @date 2024/1/5 + */ +public class KuaishouApis { + + /** + * 接口返回结果缓存 + * {@link #KEY_RESULT_CACHE_GIFT_ITEMS}:所有礼物信息 + */ + public static final TimedCache> RESULT_CACHE = new TimedCache<>(TimeUnit.DAYS.toMillis(1)); + public static final String KEY_RESULT_CACHE_GIFT_ITEMS = "GIFT_ITEMS"; + + public static final String PATTERN_LIVE_STREAM_ID = "\"liveStream\":\\{\"id\":\"([\\w\\d-_]+)\""; + public static final String USER_AGENT = GlobalHeaders.INSTANCE.header(Header.USER_AGENT).replace("Hutool", ""); + + public static RoomInitResult roomInit(Object roomId, String cookie) { + @Cleanup + HttpResponse response = createGetRequest("https://live.kuaishou.com/u/" + roomId, cookie) + .execute(); + + if (StrUtil.isBlank(cookie)) { + cookie = OrLiveChatCookieUtil.toString(response.getCookies()); + } + + String body = response.body(); + String liveStreamId = ReUtil.getGroup1(PATTERN_LIVE_STREAM_ID, body); + JsonNode websocketinfo = websocketinfo(roomId, liveStreamId, cookie); + if (!websocketinfo.has("token")) { + throwExceptionWithTip("主播未开播,token获取失败 " + websocketinfo); + } + ArrayNode websocketUrls = websocketinfo.withArray("websocketUrls"); + ArrayList websocketUrlList = CollUtil.newArrayList(); + for (JsonNode websocketUrl : websocketUrls) { + websocketUrlList.add(websocketUrl.asText()); + } + return RoomInitResult.builder() + .token(websocketinfo.required("token").asText()) + .websocketUrls(websocketUrlList) + .liveStreamId(liveStreamId) + .build(); + } + + public static RoomInitResult roomInit(Object roomId) { + return roomInit(roomId, null); + } + + public static JsonNode websocketinfo(Object roomId, String liveStreamId, String cookie) { + if (StrUtil.isBlank(liveStreamId)) { + throwExceptionWithTip("主播未开播,liveStreamId为空"); + } + @Cleanup + HttpResponse response = createGetRequest("https://live.kuaishou.com/live_api/liveroom/websocketinfo?liveStreamId=" + liveStreamId, cookie) + .header(Header.REFERER, "https://live.kuaishou.com/u/" + roomId) + .execute(); + return responseInterceptor(response.body()); + } + + public static Map allgifts() { + Map map = new HashMap<>(); + @Cleanup + HttpResponse response = createGetRequest("https://live.kuaishou.com/live_api/emoji/allgifts", null).execute(); + JsonNode jsonNode = responseInterceptor(response.body()); + jsonNode.fields().forEachRemaining(new Consumer>() { + @Override + public void accept(Map.Entry stringJsonNodeEntry) { + map.put(stringJsonNodeEntry.getKey(), OBJECT_MAPPER.convertValue(stringJsonNodeEntry.getValue(), GiftInfo.class)); + } + }); + return map; + } + + /** + * 根据礼物ID获取礼物信息 + * + * @param id 礼物ID + * @return 礼物信息 + */ + public static GiftInfo getGiftInfoById(String id) { + if (!RESULT_CACHE.containsKey(KEY_RESULT_CACHE_GIFT_ITEMS)) { + RESULT_CACHE.put(KEY_RESULT_CACHE_GIFT_ITEMS, allgifts()); + } + return RESULT_CACHE.get(KEY_RESULT_CACHE_GIFT_ITEMS).get(id); + } + + @SneakyThrows + public static JsonNode sendComment(String cookie, Object roomId, SendCommentRequest request) { + @Cleanup + HttpResponse response = createPostRequest("https://live.kuaishou.com/live_api/liveroom/sendComment", cookie) + .body(OBJECT_MAPPER.writeValueAsString(request), ContentType.JSON.getValue()) + .header(Header.REFERER, "https://live.kuaishou.com/u/" + roomId) + .execute(); + return responseInterceptor(response.body()); + } + + @SneakyThrows + public static JsonNode clickLike(String cookie, Object roomId, String liveStreamId, int count) { + @Cleanup + HttpResponse response = createPostRequest("https://live.kuaishou.com/live_api/liveroom/like", cookie) + .body(OBJECT_MAPPER.createObjectNode() + .put("liveStreamId", liveStreamId) + .put("count", count) + .toString(), ContentType.JSON.getValue() + ) + .header(Header.ORIGIN, "https://live.kuaishou.com") + .header(Header.REFERER, "https://live.kuaishou.com/u/" + roomId) + .execute(); + return responseInterceptor(response.body()); + } + + public static HttpRequest createRequest(Method method, String url, String cookie) { + return HttpUtil.createRequest(method, url) + .cookie(cookie) + .header(Header.HOST, URLUtil.url(url).getHost()) + .header(Header.USER_AGENT, USER_AGENT); + } + + public static HttpRequest createGetRequest(String url, String cookie) { + return createRequest(Method.GET, url, cookie); + } + + public static HttpRequest createPostRequest(String url, String cookie) { + return createRequest(Method.POST, url, cookie); + } + + private static JsonNode responseInterceptor(String responseString) { + try { + JsonNode jsonNode = OBJECT_MAPPER.readTree(responseString); + JsonNode data = jsonNode.required("data"); + if (data.has("result")) { + int result = data.get("result").asInt(); + if (result != 1) { + String message = ""; + switch (result) { + case 2: { + message = "请求过快,请稍后重试"; + break; + } + case 400002: { + message = "需要进行验证"; + break; + } + default: { + message = ""; + } + } + throwExceptionWithTip("接口访问失败:" + message + ",返回结果:" + jsonNode); + } + } + return data; + } catch (JsonProcessingException e) { + throw new BaseException(e); + } + } + + private static void throwExceptionWithTip(String message) { + throw new BaseException("『可能已触发滑块验证,建议配置Cookie或打开浏览器进行滑块验证后重试』" + message); + } + + @Data + @AllArgsConstructor + @NoArgsConstructor + @Builder + public static class SendCommentRequest { + private String liveStreamId; + private String content; + private String color; + } + + @Data + @AllArgsConstructor + @NoArgsConstructor + @Builder + public static class RoomInitResult { + private String token; + private String liveStreamId; + private List websocketUrls; + } + + @Data + @AllArgsConstructor + @NoArgsConstructor + public static class GiftInfo { + private String giftName; + private String giftUrl; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/client/KuaishouLiveChatClient.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/client/KuaishouLiveChatClient.java new file mode 100644 index 0000000..7c52bdc --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/client/KuaishouLiveChatClient.java @@ -0,0 +1,201 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.kuaishou.client; + + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.RandomUtil; +import com.fasterxml.jackson.databind.JsonNode; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.handler.codec.http.DefaultHttpHeaders; +import io.netty.handler.codec.http.websocketx.WebSocketClientHandshakerFactory; +import io.netty.handler.codec.http.websocketx.WebSocketVersion; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.kuaishou.api.KuaishouApis; +import tech.ordinaryroad.live.chat.client.kuaishou.config.KuaishouLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.kuaishou.listener.IKuaishouConnectionListener; +import tech.ordinaryroad.live.chat.client.kuaishou.listener.IKuaishouMsgListener; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.base.IKuaishouMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.netty.handler.KuaishouBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.kuaishou.netty.handler.KuaishouConnectionHandler; +import tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass; +import tech.ordinaryroad.live.chat.client.servers.netty.client.base.BaseNettyClient; + +import java.util.List; +import java.util.function.Consumer; + +/** + * @author mjz + * @date 2024/1/5 + */ +@Slf4j +public class KuaishouLiveChatClient extends BaseNettyClient< + KuaishouLiveChatClientConfig, + PayloadTypeOuterClass.PayloadType, + IKuaishouMsg, + IKuaishouMsgListener, + KuaishouConnectionHandler, + KuaishouBinaryFrameHandler> { + + @Getter + KuaishouApis.RoomInitResult roomInitResult = new KuaishouApis.RoomInitResult(); + + public KuaishouLiveChatClient(KuaishouLiveChatClientConfig config, List msgListeners, IKuaishouConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(config, workerGroup, connectionListener); + addMsgListeners(msgListeners); + + // 初始化 + this.init(); + } + + public KuaishouLiveChatClient(KuaishouLiveChatClientConfig config, IKuaishouMsgListener msgListener, IKuaishouConnectionListener connectionListener, EventLoopGroup workerGroup) { + super(config, workerGroup, connectionListener); + addMsgListener(msgListener); + + // 初始化 + this.init(); + } + + public KuaishouLiveChatClient(KuaishouLiveChatClientConfig config, IKuaishouMsgListener msgListener, IKuaishouConnectionListener connectionListener) { + this(config, msgListener, connectionListener, new NioEventLoopGroup()); + } + + public KuaishouLiveChatClient(KuaishouLiveChatClientConfig config, IKuaishouMsgListener msgListener) { + this(config, msgListener, null, new NioEventLoopGroup()); + } + + public KuaishouLiveChatClient(KuaishouLiveChatClientConfig config) { + this(config, null); + } + + @Override + public void init() { + roomInitResult = KuaishouApis.roomInit(getConfig().getRoomId(), getConfig().getCookie()); + super.init(); + } + + @Override + protected String getWebSocketUriString() { + List websocketUrls = roomInitResult.getWebsocketUrls(); + return CollUtil.get(websocketUrls, RandomUtil.randomInt(0, websocketUrls.size())); + } + + @Override + public KuaishouConnectionHandler initConnectionHandler(IBaseConnectionListener clientConnectionListener) { + return new KuaishouConnectionHandler( + WebSocketClientHandshakerFactory.newHandshaker(getWebsocketUri(), WebSocketVersion.V13, null, true, new DefaultHttpHeaders(), getConfig().getMaxFramePayloadLength()), + KuaishouLiveChatClient.this, clientConnectionListener + ); + } + + @Override + public KuaishouBinaryFrameHandler initBinaryFrameHandler() { + return new KuaishouBinaryFrameHandler(super.msgListeners, KuaishouLiveChatClient.this); + } + + @Override + public void sendDanmu(Object danmu, Runnable success, Consumer failed) { + if (!checkCanSendDanmu()) { + return; + } + if (danmu instanceof String) { + String msg = (String) danmu; + try { + if (log.isDebugEnabled()) { + log.debug("{} kuaishou发送弹幕 {}", getConfig().getRoomId(), danmu); + } + + boolean sendSuccess = false; + try { + KuaishouApis.sendComment(getConfig().getCookie(), + getConfig().getRoomId(), + KuaishouApis.SendCommentRequest.builder() + .liveStreamId(roomInitResult.getLiveStreamId()) + .content(msg) + .build() + ); + sendSuccess = true; + } catch (Exception e) { + log.error("kuaishou弹幕发送失败", e); + if (failed != null) { + failed.accept(e); + } + } + if (!sendSuccess) { + return; + } + + if (log.isDebugEnabled()) { + log.debug("kuaishou弹幕发送成功 {}", danmu); + } + if (success != null) { + success.run(); + } + finishSendDanmu(); + } catch (Exception e) { + log.error("kuaishou弹幕发送失败", e); + if (failed != null) { + failed.accept(e); + } + } + } else { + super.sendDanmu(danmu, success, failed); + } + } + + @Override + public void clickLike(int count, Runnable success, Consumer failed) { + if (count <= 0) { + throw new BaseException("点赞次数必须大于0"); + } + + boolean successfullyClicked = false; + try { + JsonNode jsonNode = KuaishouApis.clickLike(getConfig().getCookie(), getConfig().getRoomId(), roomInitResult.getLiveStreamId(), count); + if (jsonNode.asBoolean()) { + successfullyClicked = true; + } + } catch (Exception e) { + log.error("kuaishou为直播间点赞失败", e); + if (failed != null) { + failed.accept(e); + } + } + if (!successfullyClicked) { + return; + } + + if (log.isDebugEnabled()) { + log.debug("kuaishou为直播间点赞成功"); + } + if (success != null) { + success.run(); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/config/KuaishouLiveChatClientConfig.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/config/KuaishouLiveChatClientConfig.java new file mode 100644 index 0000000..d46ad21 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/config/KuaishouLiveChatClientConfig.java @@ -0,0 +1,47 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.kuaishou.config; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import tech.ordinaryroad.live.chat.client.servers.netty.client.config.BaseNettyClientConfig; + +/** + * @author mjz + * @date 2024/1/5 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@SuperBuilder(toBuilder = true) +public class KuaishouLiveChatClientConfig extends BaseNettyClientConfig { + + @Builder.Default + private long heartbeatPeriod = 20; + +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/listener/IKuaishouConnectionListener.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/listener/IKuaishouConnectionListener.java new file mode 100644 index 0000000..56a7342 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/listener/IKuaishouConnectionListener.java @@ -0,0 +1,35 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.kuaishou.listener; + +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.kuaishou.netty.handler.KuaishouConnectionHandler; + +/** + * @author mjz + * @date 2024/1/5 + */ +public interface IKuaishouConnectionListener extends IBaseConnectionListener { +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/listener/IKuaishouMsgListener.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/listener/IKuaishouMsgListener.java new file mode 100644 index 0000000..d280e06 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/listener/IKuaishouMsgListener.java @@ -0,0 +1,45 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.kuaishou.listener; + +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseMsgListener; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IDanmuMsgListener; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IGiftMsgListener; +import tech.ordinaryroad.live.chat.client.commons.base.listener.ILikeMsgListener; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.KuaishouDanmuMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.KuaishouGiftMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.KuaishouLikeMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.netty.handler.KuaishouBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass; + +/** + * @author mjz + * @date 2024/1/5 + */ +public interface IKuaishouMsgListener extends IBaseMsgListener, + IDanmuMsgListener, + IGiftMsgListener, + ILikeMsgListener { +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/KuaishouDanmuMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/KuaishouDanmuMsg.java new file mode 100644 index 0000000..fe4dabd --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/KuaishouDanmuMsg.java @@ -0,0 +1,100 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.kuaishou.msg; + +import com.google.protobuf.ByteString; +import com.google.protobuf.UnknownFieldSet; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IDanmuMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.base.IKuaishouMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass; + +import java.util.List; + +/** + * @author mjz + * @date 2024/1/9 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class KuaishouDanmuMsg implements IKuaishouMsg, IDanmuMsg { + + private WebCommentFeedOuterClass.WebCommentFeed msg; + + @Override + public String getBadgeName() { + String badgeName = null; + try { + UnknownFieldSet.Field field21 = msg.getSenderState().getUnknownFields().asMap().get(21); + List lengthDelimitedList = field21.getLengthDelimitedList(); + if (!lengthDelimitedList.isEmpty()) { + UnknownFieldSet.Field field21_1 = UnknownFieldSet.parseFrom( + lengthDelimitedList.size() > 1 ? lengthDelimitedList.get(1) : lengthDelimitedList.get(0) + ).getField(1); + List lengthDelimitedList1 = field21_1.getLengthDelimitedList(); + if (!lengthDelimitedList1.isEmpty()) { + UnknownFieldSet.Field field21_1_4 = UnknownFieldSet.parseFrom((lengthDelimitedList1.get(0))).getField(4); + List lengthDelimitedList2 = field21_1_4.getLengthDelimitedList(); + if (!lengthDelimitedList2.isEmpty()) { + badgeName = lengthDelimitedList2.get(0).toStringUtf8(); + } + } + } + } catch (Exception e) { + // ignore + } + return badgeName; + } + + @Override + public byte getBadgeLevel() { + return (byte) msg.getSenderState().getLiveFansGroupState().getIntimacyLevel(); + } + + @Override + public String getUid() { + return msg.getUser().getPrincipalId(); + } + + @Override + public String getUsername() { + return msg.getUser().getUserName(); + } + + @Override + public String getUserAvatar() { + return msg.getUser().getHeadUrl(); + } + + @Override + public String getContent() { + return msg.getContent(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/KuaishouGiftMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/KuaishouGiftMsg.java new file mode 100644 index 0000000..5ac39d9 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/KuaishouGiftMsg.java @@ -0,0 +1,108 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.kuaishou.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IGiftMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.api.KuaishouApis; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.base.IKuaishouMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass; + +/** + * @author mjz + * @date 2024/1/9 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class KuaishouGiftMsg implements IKuaishouMsg, IGiftMsg { + + private WebGiftFeedOuterClass.WebGiftFeed msg; + + @Override + public String getBadgeName() { + return IGiftMsg.super.getBadgeName(); + } + + @Override + public byte getBadgeLevel() { + return IGiftMsg.super.getBadgeLevel(); + } + + @Override + public String getUid() { + return msg.getUser().getPrincipalId(); + } + + @Override + public String getUsername() { + return msg.getUser().getUserName(); + } + + @Override + public String getUserAvatar() { + return msg.getUser().getHeadUrl(); + } + + @Override + public String getGiftName() { + return KuaishouApis.getGiftInfoById(this.getGiftId()).getGiftName(); + } + + @Override + public String getGiftImg() { + return KuaishouApis.getGiftInfoById(this.getGiftId()).getGiftUrl(); + } + + @Override + public String getGiftId() { + return Integer.toString(msg.getIntGiftId()); + } + + @Override + public int getGiftCount() { + // TODO 礼物个数?网页上只显示赠送了什么东西,不显示个数,只会显示连击 + return 0; + } + + @Override + public int getGiftPrice() { + return 0; + } + + @Override + public String getReceiveUid() { + return null; + } + + @Override + public String getReceiveUsername() { + return null; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/KuaishouLikeMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/KuaishouLikeMsg.java new file mode 100644 index 0000000..01bcefb --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/KuaishouLikeMsg.java @@ -0,0 +1,61 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.kuaishou.msg; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ILikeMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.base.IKuaishouMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass; + +/** + * @author mjz + * @date 2024/1/9 + */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class KuaishouLikeMsg implements IKuaishouMsg, ILikeMsg { + + private WebLikeFeedOuterClass.WebLikeFeed msg; + + @Override + public String getUid() { + return msg.getUser().getPrincipalId(); + } + + @Override + public String getUsername() { + return msg.getUser().getUserName(); + } + + @Override + public String getUserAvatar() { + return msg.getUser().getHeadUrl(); + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/base/IKuaishouCmdMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/base/IKuaishouCmdMsg.java new file mode 100644 index 0000000..eaaa8bc --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/base/IKuaishouCmdMsg.java @@ -0,0 +1,35 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.kuaishou.msg.base; + +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass; + +/** + * @author mjz + * @date 2024/1/5 + */ +public interface IKuaishouCmdMsg extends IKuaishouMsg, ICmdMsg { +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/base/IKuaishouMsg.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/base/IKuaishouMsg.java new file mode 100644 index 0000000..12ae6cd --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/msg/base/IKuaishouMsg.java @@ -0,0 +1,34 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.kuaishou.msg.base; + +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; + +/** + * @author mjz + * @date 2024/1/5 + */ +public interface IKuaishouMsg extends IMsg { +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/netty/handler/KuaishouBinaryFrameHandler.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/netty/handler/KuaishouBinaryFrameHandler.java new file mode 100644 index 0000000..d6bcb6d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/netty/handler/KuaishouBinaryFrameHandler.java @@ -0,0 +1,127 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.kuaishou.netty.handler; + +import cn.hutool.core.util.ZipUtil; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandler; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.client.KuaishouLiveChatClient; +import tech.ordinaryroad.live.chat.client.kuaishou.listener.IKuaishouMsgListener; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.KuaishouDanmuMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.KuaishouGiftMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.KuaishouLikeMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.base.IKuaishouMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.protobuf.*; +import tech.ordinaryroad.live.chat.client.servers.netty.client.handler.BaseNettyClientBinaryFrameHandler; + +import java.util.Collections; +import java.util.List; + +/** + * @author mjz + * @date 2024/1/5 + */ +@Slf4j +@ChannelHandler.Sharable +public class KuaishouBinaryFrameHandler extends BaseNettyClientBinaryFrameHandler { + + public KuaishouBinaryFrameHandler(List iKuaishouMsgListeners, KuaishouLiveChatClient client) { + super(iKuaishouMsgListeners, client); + } + + public KuaishouBinaryFrameHandler(List iKuaishouMsgListeners, long roomId) { + super(iKuaishouMsgListeners, roomId); + } + + @SneakyThrows + @Override + public void onCmdMsg(PayloadTypeOuterClass.PayloadType cmd, ICmdMsg cmdMsg) { + if (super.msgListeners.isEmpty()) { + return; + } + + SocketMessageOuterClass.SocketMessage socketMessage = (SocketMessageOuterClass.SocketMessage) cmdMsg; + ByteString payloadByteString = socketMessage.getPayload(); + switch (socketMessage.getPayloadType()) { + case SC_FEED_PUSH: { + SCWebFeedPushOuterClass.SCWebFeedPush scWebFeedPush = SCWebFeedPushOuterClass.SCWebFeedPush.parseFrom(payloadByteString); + if (scWebFeedPush.getCommentFeedsCount() > 0) { + for (WebCommentFeedOuterClass.WebCommentFeed webCommentFeed : scWebFeedPush.getCommentFeedsList()) { + iteratorMsgListeners(msgListener -> msgListener.onDanmuMsg(KuaishouBinaryFrameHandler.this, new KuaishouDanmuMsg(webCommentFeed))); + } + } + if (scWebFeedPush.getGiftFeedsCount() > 0) { + for (WebGiftFeedOuterClass.WebGiftFeed webGiftFeed : scWebFeedPush.getGiftFeedsList()) { + iteratorMsgListeners(msgListener -> msgListener.onGiftMsg(KuaishouBinaryFrameHandler.this, new KuaishouGiftMsg(webGiftFeed))); + } + } + if (scWebFeedPush.getLikeFeedsCount() > 0) { + for (WebLikeFeedOuterClass.WebLikeFeed webLikeFeed : scWebFeedPush.getLikeFeedsList()) { + iteratorMsgListeners(msgListener -> msgListener.onLikeMsg(KuaishouBinaryFrameHandler.this, new KuaishouLikeMsg(webLikeFeed))); + } + } + break; + } + default: { + iteratorMsgListeners(msgListener -> msgListener.onOtherCmdMsg(KuaishouBinaryFrameHandler.this, cmd, socketMessage)); + } + } + } + + @Override + protected List decode(ByteBuf byteBuf) { + try { + SocketMessageOuterClass.SocketMessage socketMessage = SocketMessageOuterClass.SocketMessage.parseFrom(byteBuf.nioBuffer()); + SocketMessageOuterClass.SocketMessage.CompressionType compressionType = socketMessage.getCompressionType(); + ByteString payloadByteString = socketMessage.getPayload(); + byte[] payload; + switch (compressionType) { + case NONE: { + payload = payloadByteString.toByteArray(); + break; + } + case GZIP: { + payload = ZipUtil.unGzip(payloadByteString.newInput()); + break; + } + default: { + if (log.isWarnEnabled()) { + log.warn("暂不支持的压缩方式 " + compressionType); + } + return Collections.emptyList(); + } + } + return Collections.singletonList(socketMessage.toBuilder().setPayload(ByteString.copyFrom(payload)).build()); + } catch (InvalidProtocolBufferException e) { + throw new BaseException(e); + } + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/netty/handler/KuaishouConnectionHandler.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/netty/handler/KuaishouConnectionHandler.java new file mode 100644 index 0000000..977710d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/netty/handler/KuaishouConnectionHandler.java @@ -0,0 +1,158 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package tech.ordinaryroad.live.chat.client.kuaishou.netty.handler; + +import cn.hutool.core.util.RandomUtil; +import io.netty.buffer.Unpooled; +import io.netty.channel.Channel; +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame; +import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker; +import lombok.extern.slf4j.Slf4j; +import tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener; +import tech.ordinaryroad.live.chat.client.kuaishou.api.KuaishouApis; +import tech.ordinaryroad.live.chat.client.kuaishou.client.KuaishouLiveChatClient; +import tech.ordinaryroad.live.chat.client.kuaishou.config.KuaishouLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass; +import tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass; +import tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass; +import tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass; +import tech.ordinaryroad.live.chat.client.servers.netty.client.handler.BaseNettyClientConnectionHandler; + +/** + * @author mjz + * @date 2024/1/5 + */ +@Slf4j +@ChannelHandler.Sharable +public class KuaishouConnectionHandler extends BaseNettyClientConnectionHandler { + + /** + * 以ClientConfig为主 + */ + private final Object roomId; + /** + * 以ClientConfig为主 + */ + private String cookie; + private final KuaishouApis.RoomInitResult roomInitResult; + + public KuaishouConnectionHandler(WebSocketClientHandshaker handshaker, KuaishouLiveChatClient client, IBaseConnectionListener listener) { + super(handshaker, client, listener); + this.roomId = client.getConfig().getRoomId(); + this.cookie = client.getConfig().getCookie(); + this.roomInitResult = client.getRoomInitResult(); + } + + public KuaishouConnectionHandler(WebSocketClientHandshaker handshaker, KuaishouLiveChatClient client) { + this(handshaker, client, null); + } + + public KuaishouConnectionHandler(WebSocketClientHandshaker handshaker, long roomId, KuaishouApis.RoomInitResult roomInitResult, IBaseConnectionListener listener, String cookie) { + super(handshaker, listener); + this.roomId = roomId; + this.cookie = cookie; + this.roomInitResult = roomInitResult; + } + + public KuaishouConnectionHandler(WebSocketClientHandshaker handshaker, long roomId, KuaishouApis.RoomInitResult roomInitResult, IBaseConnectionListener listener) { + this(handshaker, roomId, roomInitResult, listener, null); + } + + public KuaishouConnectionHandler(WebSocketClientHandshaker handshaker, long roomId, KuaishouApis.RoomInitResult roomInitResult, String cookie) { + this(handshaker, roomId, roomInitResult, null, cookie); + } + + public KuaishouConnectionHandler(WebSocketClientHandshaker handshaker, KuaishouApis.RoomInitResult roomInitResult, long roomId) { + this(handshaker, roomId, roomInitResult, null, null); + } + + @Override + protected void sendHeartbeat(ChannelHandlerContext ctx) { + ctx.writeAndFlush( + new BinaryWebSocketFrame( + Unpooled.wrappedBuffer(SocketMessageOuterClass.SocketMessage.newBuilder() + .setPayloadType(PayloadTypeOuterClass.PayloadType.CS_HEARTBEAT) + .setPayload( + CSHeartbeatOuterClass.CSHeartbeat.newBuilder() + .setTimestamp(System.currentTimeMillis()) + .build() + .toByteString() + ) + .build() + .toByteArray() + ) + ) + ); + } + + @Override + public void sendAuthRequest(Channel channel) { + channel.writeAndFlush( + new BinaryWebSocketFrame( + Unpooled.wrappedBuffer(SocketMessageOuterClass.SocketMessage.newBuilder() + .setPayloadType(PayloadTypeOuterClass.PayloadType.CS_ENTER_ROOM) + .setPayload( + CSWebEnterRoomOuterClass.CSWebEnterRoom.newBuilder() + .setToken(roomInitResult.getToken()) + .setLiveStreamId(roomInitResult.getLiveStreamId()) + .setPageId(RandomUtil.randomString(16) + System.currentTimeMillis()) + .build() + .toByteString() + ) + .build() + .toByteArray() + ) + ) + ); + } + + @Override + protected long getHeartbeatPeriod() { + if (client == null) { + return KuaishouLiveChatClientConfig.DEFAULT_HEARTBEAT_PERIOD; + } else { + return client.getConfig().getHeartbeatPeriod(); + } + } + + @Override + protected long getHeartbeatInitialDelay() { + if (client == null) { + return KuaishouLiveChatClientConfig.DEFAULT_HEARTBEAT_INITIAL_DELAY; + } else { + return client.getConfig().getHeartbeatInitialDelay(); + } + } + + public Object getRoomId() { + return client != null ? client.getConfig().getRoomId() : roomId; + } + + private String getCookie() { + return client != null ? client.getConfig().getCookie() : cookie; + } +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/AuditAudienceMaskOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/AuditAudienceMaskOuterClass.java new file mode 100644 index 0000000..7030eae --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/AuditAudienceMaskOuterClass.java @@ -0,0 +1,1155 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: AuditAudienceMask.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class AuditAudienceMaskOuterClass { + private AuditAudienceMaskOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface AuditAudienceMaskOrBuilder extends + // @@protoc_insertion_point(interface_extends:AuditAudienceMask) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + java.util.List + getIconCdnNodeViewList(); + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView getIconCdnNodeView(int index); + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + int getIconCdnNodeViewCount(); + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + java.util.List + getIconCdnNodeViewOrBuilderList(); + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeViewOrBuilder getIconCdnNodeViewOrBuilder( + int index); + + /** + * string title = 2; + * @return The title. + */ + java.lang.String getTitle(); + /** + * string title = 2; + * @return The bytes for title. + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + * string detail = 3; + * @return The detail. + */ + java.lang.String getDetail(); + /** + * string detail = 3; + * @return The bytes for detail. + */ + com.google.protobuf.ByteString + getDetailBytes(); + } + /** + * Protobuf type {@code AuditAudienceMask} + */ + public static final class AuditAudienceMask extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:AuditAudienceMask) + AuditAudienceMaskOrBuilder { + private static final long serialVersionUID = 0L; + // Use AuditAudienceMask.newBuilder() to construct. + private AuditAudienceMask(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AuditAudienceMask() { + iconCdnNodeView_ = java.util.Collections.emptyList(); + title_ = ""; + detail_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AuditAudienceMask(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.internal_static_AuditAudienceMask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.internal_static_AuditAudienceMask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.Builder.class); + } + + public static final int ICONCDNNODEVIEW_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List iconCdnNodeView_; + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + @java.lang.Override + public java.util.List getIconCdnNodeViewList() { + return iconCdnNodeView_; + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + @java.lang.Override + public java.util.List + getIconCdnNodeViewOrBuilderList() { + return iconCdnNodeView_; + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + @java.lang.Override + public int getIconCdnNodeViewCount() { + return iconCdnNodeView_.size(); + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView getIconCdnNodeView(int index) { + return iconCdnNodeView_.get(index); + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeViewOrBuilder getIconCdnNodeViewOrBuilder( + int index) { + return iconCdnNodeView_.get(index); + } + + public static final int TITLE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object title_ = ""; + /** + * string title = 2; + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * string title = 2; + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DETAIL_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object detail_ = ""; + /** + * string detail = 3; + * @return The detail. + */ + @java.lang.Override + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detail_ = s; + return s; + } + } + /** + * string detail = 3; + * @return The bytes for detail. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + detail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < iconCdnNodeView_.size(); i++) { + output.writeMessage(1, iconCdnNodeView_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, title_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(detail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, detail_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < iconCdnNodeView_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, iconCdnNodeView_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, title_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(detail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, detail_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask) obj; + + if (!getIconCdnNodeViewList() + .equals(other.getIconCdnNodeViewList())) return false; + if (!getTitle() + .equals(other.getTitle())) return false; + if (!getDetail() + .equals(other.getDetail())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getIconCdnNodeViewCount() > 0) { + hash = (37 * hash) + ICONCDNNODEVIEW_FIELD_NUMBER; + hash = (53 * hash) + getIconCdnNodeViewList().hashCode(); + } + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getDetail().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code AuditAudienceMask} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:AuditAudienceMask) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMaskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.internal_static_AuditAudienceMask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.internal_static_AuditAudienceMask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (iconCdnNodeViewBuilder_ == null) { + iconCdnNodeView_ = java.util.Collections.emptyList(); + } else { + iconCdnNodeView_ = null; + iconCdnNodeViewBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + title_ = ""; + detail_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.internal_static_AuditAudienceMask_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask result) { + if (iconCdnNodeViewBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + iconCdnNodeView_ = java.util.Collections.unmodifiableList(iconCdnNodeView_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.iconCdnNodeView_ = iconCdnNodeView_; + } else { + result.iconCdnNodeView_ = iconCdnNodeViewBuilder_.build(); + } + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.title_ = title_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.detail_ = detail_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.getDefaultInstance()) return this; + if (iconCdnNodeViewBuilder_ == null) { + if (!other.iconCdnNodeView_.isEmpty()) { + if (iconCdnNodeView_.isEmpty()) { + iconCdnNodeView_ = other.iconCdnNodeView_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIconCdnNodeViewIsMutable(); + iconCdnNodeView_.addAll(other.iconCdnNodeView_); + } + onChanged(); + } + } else { + if (!other.iconCdnNodeView_.isEmpty()) { + if (iconCdnNodeViewBuilder_.isEmpty()) { + iconCdnNodeViewBuilder_.dispose(); + iconCdnNodeViewBuilder_ = null; + iconCdnNodeView_ = other.iconCdnNodeView_; + bitField0_ = (bitField0_ & ~0x00000001); + iconCdnNodeViewBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getIconCdnNodeViewFieldBuilder() : null; + } else { + iconCdnNodeViewBuilder_.addAllMessages(other.iconCdnNodeView_); + } + } + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDetail().isEmpty()) { + detail_ = other.detail_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView m = + input.readMessage( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.parser(), + extensionRegistry); + if (iconCdnNodeViewBuilder_ == null) { + ensureIconCdnNodeViewIsMutable(); + iconCdnNodeView_.add(m); + } else { + iconCdnNodeViewBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + title_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + detail_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List iconCdnNodeView_ = + java.util.Collections.emptyList(); + private void ensureIconCdnNodeViewIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + iconCdnNodeView_ = new java.util.ArrayList(iconCdnNodeView_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeViewOrBuilder> iconCdnNodeViewBuilder_; + + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public java.util.List getIconCdnNodeViewList() { + if (iconCdnNodeViewBuilder_ == null) { + return java.util.Collections.unmodifiableList(iconCdnNodeView_); + } else { + return iconCdnNodeViewBuilder_.getMessageList(); + } + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public int getIconCdnNodeViewCount() { + if (iconCdnNodeViewBuilder_ == null) { + return iconCdnNodeView_.size(); + } else { + return iconCdnNodeViewBuilder_.getCount(); + } + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView getIconCdnNodeView(int index) { + if (iconCdnNodeViewBuilder_ == null) { + return iconCdnNodeView_.get(index); + } else { + return iconCdnNodeViewBuilder_.getMessage(index); + } + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public Builder setIconCdnNodeView( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView value) { + if (iconCdnNodeViewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIconCdnNodeViewIsMutable(); + iconCdnNodeView_.set(index, value); + onChanged(); + } else { + iconCdnNodeViewBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public Builder setIconCdnNodeView( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.Builder builderForValue) { + if (iconCdnNodeViewBuilder_ == null) { + ensureIconCdnNodeViewIsMutable(); + iconCdnNodeView_.set(index, builderForValue.build()); + onChanged(); + } else { + iconCdnNodeViewBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public Builder addIconCdnNodeView(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView value) { + if (iconCdnNodeViewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIconCdnNodeViewIsMutable(); + iconCdnNodeView_.add(value); + onChanged(); + } else { + iconCdnNodeViewBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public Builder addIconCdnNodeView( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView value) { + if (iconCdnNodeViewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIconCdnNodeViewIsMutable(); + iconCdnNodeView_.add(index, value); + onChanged(); + } else { + iconCdnNodeViewBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public Builder addIconCdnNodeView( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.Builder builderForValue) { + if (iconCdnNodeViewBuilder_ == null) { + ensureIconCdnNodeViewIsMutable(); + iconCdnNodeView_.add(builderForValue.build()); + onChanged(); + } else { + iconCdnNodeViewBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public Builder addIconCdnNodeView( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.Builder builderForValue) { + if (iconCdnNodeViewBuilder_ == null) { + ensureIconCdnNodeViewIsMutable(); + iconCdnNodeView_.add(index, builderForValue.build()); + onChanged(); + } else { + iconCdnNodeViewBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public Builder addAllIconCdnNodeView( + java.lang.Iterable values) { + if (iconCdnNodeViewBuilder_ == null) { + ensureIconCdnNodeViewIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, iconCdnNodeView_); + onChanged(); + } else { + iconCdnNodeViewBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public Builder clearIconCdnNodeView() { + if (iconCdnNodeViewBuilder_ == null) { + iconCdnNodeView_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + iconCdnNodeViewBuilder_.clear(); + } + return this; + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public Builder removeIconCdnNodeView(int index) { + if (iconCdnNodeViewBuilder_ == null) { + ensureIconCdnNodeViewIsMutable(); + iconCdnNodeView_.remove(index); + onChanged(); + } else { + iconCdnNodeViewBuilder_.remove(index); + } + return this; + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.Builder getIconCdnNodeViewBuilder( + int index) { + return getIconCdnNodeViewFieldBuilder().getBuilder(index); + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeViewOrBuilder getIconCdnNodeViewOrBuilder( + int index) { + if (iconCdnNodeViewBuilder_ == null) { + return iconCdnNodeView_.get(index); } else { + return iconCdnNodeViewBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public java.util.List + getIconCdnNodeViewOrBuilderList() { + if (iconCdnNodeViewBuilder_ != null) { + return iconCdnNodeViewBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(iconCdnNodeView_); + } + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.Builder addIconCdnNodeViewBuilder() { + return getIconCdnNodeViewFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.getDefaultInstance()); + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.Builder addIconCdnNodeViewBuilder( + int index) { + return getIconCdnNodeViewFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.getDefaultInstance()); + } + /** + * repeated .LiveCdnNodeView iconCdnNodeView = 1; + */ + public java.util.List + getIconCdnNodeViewBuilderList() { + return getIconCdnNodeViewFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeViewOrBuilder> + getIconCdnNodeViewFieldBuilder() { + if (iconCdnNodeViewBuilder_ == null) { + iconCdnNodeViewBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeViewOrBuilder>( + iconCdnNodeView_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + iconCdnNodeView_ = null; + } + return iconCdnNodeViewBuilder_; + } + + private java.lang.Object title_ = ""; + /** + * string title = 2; + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string title = 2; + * @return The bytes for title. + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string title = 2; + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + title_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string title = 2; + * @return This builder for chaining. + */ + public Builder clearTitle() { + title_ = getDefaultInstance().getTitle(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string title = 2; + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + title_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object detail_ = ""; + /** + * string detail = 3; + * @return The detail. + */ + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string detail = 3; + * @return The bytes for detail. + */ + public com.google.protobuf.ByteString + getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + detail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string detail = 3; + * @param value The detail to set. + * @return This builder for chaining. + */ + public Builder setDetail( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + detail_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * string detail = 3; + * @return This builder for chaining. + */ + public Builder clearDetail() { + detail_ = getDefaultInstance().getDetail(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * string detail = 3; + * @param value The bytes for detail to set. + * @return This builder for chaining. + */ + public Builder setDetailBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + detail_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:AuditAudienceMask) + } + + // @@protoc_insertion_point(class_scope:AuditAudienceMask) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuditAudienceMask parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_AuditAudienceMask_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_AuditAudienceMask_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\027AuditAudienceMask.proto\032\025LiveCdnNodeVi" + + "ew.proto\"]\n\021AuditAudienceMask\022)\n\017iconCdn" + + "NodeView\030\001 \003(\0132\020.LiveCdnNodeView\022\r\n\005titl" + + "e\030\002 \001(\t\022\016\n\006detail\030\003 \001(\tB6\n4tech.ordinary" + + "road.live.chat.client.kuaishou.protobufb" + + "\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.getDescriptor(), + }); + internal_static_AuditAudienceMask_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_AuditAudienceMask_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_AuditAudienceMask_descriptor, + new java.lang.String[] { "IconCdnNodeView", "Title", "Detail", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSErrorOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSErrorOuterClass.java new file mode 100644 index 0000000..d172708 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSErrorOuterClass.java @@ -0,0 +1,548 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: CSError.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class CSErrorOuterClass { + private CSErrorOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface CSErrorOrBuilder extends + // @@protoc_insertion_point(interface_extends:CSError) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 code = 1; + * @return The code. + */ + int getCode(); + } + /** + * Protobuf type {@code CSError} + */ + public static final class CSError extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:CSError) + CSErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use CSError.newBuilder() to construct. + private CSError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CSError() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CSError(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.internal_static_CSError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.internal_static_CSError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError.Builder.class); + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_ = 0; + /** + * uint32 code = 1; + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (code_ != 0) { + output.writeUInt32(1, code_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, code_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError) obj; + + if (getCode() + != other.getCode()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code CSError} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:CSError) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.internal_static_CSError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.internal_static_CSError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.internal_static_CSError_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError.getDefaultInstance()) return this; + if (other.getCode() != 0) { + setCode(other.getCode()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + code_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int code_ ; + /** + * uint32 code = 1; + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + /** + * uint32 code = 1; + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(int value) { + + code_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint32 code = 1; + * @return This builder for chaining. + */ + public Builder clearCode() { + bitField0_ = (bitField0_ & ~0x00000001); + code_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:CSError) + } + + // @@protoc_insertion_point(class_scope:CSError) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CSError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSErrorOuterClass.CSError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_CSError_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_CSError_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rCSError.proto\"\027\n\007CSError\022\014\n\004code\030\001 \001(\r" + + "B6\n4tech.ordinaryroad.live.chat.client.k" + + "uaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_CSError_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_CSError_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_CSError_descriptor, + new java.lang.String[] { "Code", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSHeartbeatOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSHeartbeatOuterClass.java new file mode 100644 index 0000000..635a577 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSHeartbeatOuterClass.java @@ -0,0 +1,549 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: CSHeartbeat.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class CSHeartbeatOuterClass { + private CSHeartbeatOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface CSHeartbeatOrBuilder extends + // @@protoc_insertion_point(interface_extends:CSHeartbeat) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 timestamp = 1; + * @return The timestamp. + */ + long getTimestamp(); + } + /** + * Protobuf type {@code CSHeartbeat} + */ + public static final class CSHeartbeat extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:CSHeartbeat) + CSHeartbeatOrBuilder { + private static final long serialVersionUID = 0L; + // Use CSHeartbeat.newBuilder() to construct. + private CSHeartbeat(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CSHeartbeat() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CSHeartbeat(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.internal_static_CSHeartbeat_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.internal_static_CSHeartbeat_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat.Builder.class); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 1; + private long timestamp_ = 0L; + /** + * uint64 timestamp = 1; + * @return The timestamp. + */ + @java.lang.Override + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (timestamp_ != 0L) { + output.writeUInt64(1, timestamp_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, timestamp_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat) obj; + + if (getTimestamp() + != other.getTimestamp()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code CSHeartbeat} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:CSHeartbeat) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeatOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.internal_static_CSHeartbeat_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.internal_static_CSHeartbeat_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + timestamp_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.internal_static_CSHeartbeat_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.timestamp_ = timestamp_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat.getDefaultInstance()) return this; + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + timestamp_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long timestamp_ ; + /** + * uint64 timestamp = 1; + * @return The timestamp. + */ + @java.lang.Override + public long getTimestamp() { + return timestamp_; + } + /** + * uint64 timestamp = 1; + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + timestamp_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:CSHeartbeat) + } + + // @@protoc_insertion_point(class_scope:CSHeartbeat) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CSHeartbeat parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSHeartbeatOuterClass.CSHeartbeat getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_CSHeartbeat_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_CSHeartbeat_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\021CSHeartbeat.proto\" \n\013CSHeartbeat\022\021\n\tti" + + "mestamp\030\001 \001(\004B6\n4tech.ordinaryroad.live." + + "chat.client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_CSHeartbeat_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_CSHeartbeat_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_CSHeartbeat_descriptor, + new java.lang.String[] { "Timestamp", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSPingOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSPingOuterClass.java new file mode 100644 index 0000000..1062bdc --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSPingOuterClass.java @@ -0,0 +1,1029 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: CSPing.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class CSPingOuterClass { + private CSPingOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface CSPingOrBuilder extends + // @@protoc_insertion_point(interface_extends:CSPing) + com.google.protobuf.MessageOrBuilder { + + /** + * string echoData = 1; + * @return The echoData. + */ + java.lang.String getEchoData(); + /** + * string echoData = 1; + * @return The bytes for echoData. + */ + com.google.protobuf.ByteString + getEchoDataBytes(); + + /** + * .ClientId clientId = 2; + * @return The enum numeric value on the wire for clientId. + */ + int getClientIdValue(); + /** + * .ClientId clientId = 2; + * @return The clientId. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.ClientId getClientId(); + + /** + * string deviceId = 3; + * @return The deviceId. + */ + java.lang.String getDeviceId(); + /** + * string deviceId = 3; + * @return The bytes for deviceId. + */ + com.google.protobuf.ByteString + getDeviceIdBytes(); + + /** + * string appVer = 4; + * @return The appVer. + */ + java.lang.String getAppVer(); + /** + * string appVer = 4; + * @return The bytes for appVer. + */ + com.google.protobuf.ByteString + getAppVerBytes(); + } + /** + * Protobuf type {@code CSPing} + */ + public static final class CSPing extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:CSPing) + CSPingOrBuilder { + private static final long serialVersionUID = 0L; + // Use CSPing.newBuilder() to construct. + private CSPing(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CSPing() { + echoData_ = ""; + clientId_ = 0; + deviceId_ = ""; + appVer_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CSPing(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.internal_static_CSPing_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.internal_static_CSPing_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing.Builder.class); + } + + public static final int ECHODATA_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object echoData_ = ""; + /** + * string echoData = 1; + * @return The echoData. + */ + @java.lang.Override + public java.lang.String getEchoData() { + java.lang.Object ref = echoData_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + echoData_ = s; + return s; + } + } + /** + * string echoData = 1; + * @return The bytes for echoData. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getEchoDataBytes() { + java.lang.Object ref = echoData_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + echoData_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENTID_FIELD_NUMBER = 2; + private int clientId_ = 0; + /** + * .ClientId clientId = 2; + * @return The enum numeric value on the wire for clientId. + */ + @java.lang.Override public int getClientIdValue() { + return clientId_; + } + /** + * .ClientId clientId = 2; + * @return The clientId. + */ + @java.lang.Override public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.ClientId getClientId() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.ClientId result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.ClientId.forNumber(clientId_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.ClientId.UNRECOGNIZED : result; + } + + public static final int DEVICEID_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object deviceId_ = ""; + /** + * string deviceId = 3; + * @return The deviceId. + */ + @java.lang.Override + public java.lang.String getDeviceId() { + java.lang.Object ref = deviceId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceId_ = s; + return s; + } + } + /** + * string deviceId = 3; + * @return The bytes for deviceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeviceIdBytes() { + java.lang.Object ref = deviceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APPVER_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object appVer_ = ""; + /** + * string appVer = 4; + * @return The appVer. + */ + @java.lang.Override + public java.lang.String getAppVer() { + java.lang.Object ref = appVer_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appVer_ = s; + return s; + } + } + /** + * string appVer = 4; + * @return The bytes for appVer. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAppVerBytes() { + java.lang.Object ref = appVer_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appVer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(echoData_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, echoData_); + } + if (clientId_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.ClientId.NONE.getNumber()) { + output.writeEnum(2, clientId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, deviceId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appVer_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, appVer_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(echoData_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, echoData_); + } + if (clientId_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.ClientId.NONE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, clientId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, deviceId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appVer_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, appVer_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing) obj; + + if (!getEchoData() + .equals(other.getEchoData())) return false; + if (clientId_ != other.clientId_) return false; + if (!getDeviceId() + .equals(other.getDeviceId())) return false; + if (!getAppVer() + .equals(other.getAppVer())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ECHODATA_FIELD_NUMBER; + hash = (53 * hash) + getEchoData().hashCode(); + hash = (37 * hash) + CLIENTID_FIELD_NUMBER; + hash = (53 * hash) + clientId_; + hash = (37 * hash) + DEVICEID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId().hashCode(); + hash = (37 * hash) + APPVER_FIELD_NUMBER; + hash = (53 * hash) + getAppVer().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code CSPing} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:CSPing) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.internal_static_CSPing_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.internal_static_CSPing_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + echoData_ = ""; + clientId_ = 0; + deviceId_ = ""; + appVer_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.internal_static_CSPing_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.echoData_ = echoData_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clientId_ = clientId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.deviceId_ = deviceId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.appVer_ = appVer_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing.getDefaultInstance()) return this; + if (!other.getEchoData().isEmpty()) { + echoData_ = other.echoData_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.clientId_ != 0) { + setClientIdValue(other.getClientIdValue()); + } + if (!other.getDeviceId().isEmpty()) { + deviceId_ = other.deviceId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getAppVer().isEmpty()) { + appVer_ = other.appVer_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + echoData_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + clientId_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + deviceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + appVer_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object echoData_ = ""; + /** + * string echoData = 1; + * @return The echoData. + */ + public java.lang.String getEchoData() { + java.lang.Object ref = echoData_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + echoData_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string echoData = 1; + * @return The bytes for echoData. + */ + public com.google.protobuf.ByteString + getEchoDataBytes() { + java.lang.Object ref = echoData_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + echoData_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string echoData = 1; + * @param value The echoData to set. + * @return This builder for chaining. + */ + public Builder setEchoData( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + echoData_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string echoData = 1; + * @return This builder for chaining. + */ + public Builder clearEchoData() { + echoData_ = getDefaultInstance().getEchoData(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string echoData = 1; + * @param value The bytes for echoData to set. + * @return This builder for chaining. + */ + public Builder setEchoDataBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + echoData_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int clientId_ = 0; + /** + * .ClientId clientId = 2; + * @return The enum numeric value on the wire for clientId. + */ + @java.lang.Override public int getClientIdValue() { + return clientId_; + } + /** + * .ClientId clientId = 2; + * @param value The enum numeric value on the wire for clientId to set. + * @return This builder for chaining. + */ + public Builder setClientIdValue(int value) { + clientId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .ClientId clientId = 2; + * @return The clientId. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.ClientId getClientId() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.ClientId result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.ClientId.forNumber(clientId_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.ClientId.UNRECOGNIZED : result; + } + /** + * .ClientId clientId = 2; + * @param value The clientId to set. + * @return This builder for chaining. + */ + public Builder setClientId(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.ClientId value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .ClientId clientId = 2; + * @return This builder for chaining. + */ + public Builder clearClientId() { + bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = 0; + onChanged(); + return this; + } + + private java.lang.Object deviceId_ = ""; + /** + * string deviceId = 3; + * @return The deviceId. + */ + public java.lang.String getDeviceId() { + java.lang.Object ref = deviceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string deviceId = 3; + * @return The bytes for deviceId. + */ + public com.google.protobuf.ByteString + getDeviceIdBytes() { + java.lang.Object ref = deviceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string deviceId = 3; + * @param value The deviceId to set. + * @return This builder for chaining. + */ + public Builder setDeviceId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + deviceId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * string deviceId = 3; + * @return This builder for chaining. + */ + public Builder clearDeviceId() { + deviceId_ = getDefaultInstance().getDeviceId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * string deviceId = 3; + * @param value The bytes for deviceId to set. + * @return This builder for chaining. + */ + public Builder setDeviceIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + deviceId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object appVer_ = ""; + /** + * string appVer = 4; + * @return The appVer. + */ + public java.lang.String getAppVer() { + java.lang.Object ref = appVer_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appVer_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string appVer = 4; + * @return The bytes for appVer. + */ + public com.google.protobuf.ByteString + getAppVerBytes() { + java.lang.Object ref = appVer_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appVer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string appVer = 4; + * @param value The appVer to set. + * @return This builder for chaining. + */ + public Builder setAppVer( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + appVer_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * string appVer = 4; + * @return This builder for chaining. + */ + public Builder clearAppVer() { + appVer_ = getDefaultInstance().getAppVer(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * string appVer = 4; + * @param value The bytes for appVer to set. + * @return This builder for chaining. + */ + public Builder setAppVerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + appVer_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:CSPing) + } + + // @@protoc_insertion_point(class_scope:CSPing) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CSPing parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSPingOuterClass.CSPing getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_CSPing_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_CSPing_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\014CSPing.proto\032\016ClientId.proto\"Y\n\006CSPing" + + "\022\020\n\010echoData\030\001 \001(\t\022\033\n\010clientId\030\002 \001(\0162\t.C" + + "lientId\022\020\n\010deviceId\030\003 \001(\t\022\016\n\006appVer\030\004 \001(" + + "\tB6\n4tech.ordinaryroad.live.chat.client." + + "kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.getDescriptor(), + }); + internal_static_CSPing_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_CSPing_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_CSPing_descriptor, + new java.lang.String[] { "EchoData", "ClientId", "DeviceId", "AppVer", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebEnterRoomOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebEnterRoomOuterClass.java new file mode 100644 index 0000000..8a6b155 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebEnterRoomOuterClass.java @@ -0,0 +1,1363 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: CSWebEnterRoom.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class CSWebEnterRoomOuterClass { + private CSWebEnterRoomOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface CSWebEnterRoomOrBuilder extends + // @@protoc_insertion_point(interface_extends:CSWebEnterRoom) + com.google.protobuf.MessageOrBuilder { + + /** + * string token = 1; + * @return The token. + */ + java.lang.String getToken(); + /** + * string token = 1; + * @return The bytes for token. + */ + com.google.protobuf.ByteString + getTokenBytes(); + + /** + * string liveStreamId = 2; + * @return The liveStreamId. + */ + java.lang.String getLiveStreamId(); + /** + * string liveStreamId = 2; + * @return The bytes for liveStreamId. + */ + com.google.protobuf.ByteString + getLiveStreamIdBytes(); + + /** + * uint32 reconnectCount = 3; + * @return The reconnectCount. + */ + int getReconnectCount(); + + /** + * uint32 lastErrorCode = 4; + * @return The lastErrorCode. + */ + int getLastErrorCode(); + + /** + * string expTag = 5; + * @return The expTag. + */ + java.lang.String getExpTag(); + /** + * string expTag = 5; + * @return The bytes for expTag. + */ + com.google.protobuf.ByteString + getExpTagBytes(); + + /** + * string attach = 6; + * @return The attach. + */ + java.lang.String getAttach(); + /** + * string attach = 6; + * @return The bytes for attach. + */ + com.google.protobuf.ByteString + getAttachBytes(); + + /** + * string pageId = 7; + * @return The pageId. + */ + java.lang.String getPageId(); + /** + * string pageId = 7; + * @return The bytes for pageId. + */ + com.google.protobuf.ByteString + getPageIdBytes(); + } + /** + * Protobuf type {@code CSWebEnterRoom} + */ + public static final class CSWebEnterRoom extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:CSWebEnterRoom) + CSWebEnterRoomOrBuilder { + private static final long serialVersionUID = 0L; + // Use CSWebEnterRoom.newBuilder() to construct. + private CSWebEnterRoom(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CSWebEnterRoom() { + token_ = ""; + liveStreamId_ = ""; + expTag_ = ""; + attach_ = ""; + pageId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CSWebEnterRoom(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.internal_static_CSWebEnterRoom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.internal_static_CSWebEnterRoom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom.Builder.class); + } + + public static final int TOKEN_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object token_ = ""; + /** + * string token = 1; + * @return The token. + */ + @java.lang.Override + public java.lang.String getToken() { + java.lang.Object ref = token_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + token_ = s; + return s; + } + } + /** + * string token = 1; + * @return The bytes for token. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LIVESTREAMID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object liveStreamId_ = ""; + /** + * string liveStreamId = 2; + * @return The liveStreamId. + */ + @java.lang.Override + public java.lang.String getLiveStreamId() { + java.lang.Object ref = liveStreamId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + liveStreamId_ = s; + return s; + } + } + /** + * string liveStreamId = 2; + * @return The bytes for liveStreamId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLiveStreamIdBytes() { + java.lang.Object ref = liveStreamId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + liveStreamId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECONNECTCOUNT_FIELD_NUMBER = 3; + private int reconnectCount_ = 0; + /** + * uint32 reconnectCount = 3; + * @return The reconnectCount. + */ + @java.lang.Override + public int getReconnectCount() { + return reconnectCount_; + } + + public static final int LASTERRORCODE_FIELD_NUMBER = 4; + private int lastErrorCode_ = 0; + /** + * uint32 lastErrorCode = 4; + * @return The lastErrorCode. + */ + @java.lang.Override + public int getLastErrorCode() { + return lastErrorCode_; + } + + public static final int EXPTAG_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object expTag_ = ""; + /** + * string expTag = 5; + * @return The expTag. + */ + @java.lang.Override + public java.lang.String getExpTag() { + java.lang.Object ref = expTag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + expTag_ = s; + return s; + } + } + /** + * string expTag = 5; + * @return The bytes for expTag. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getExpTagBytes() { + java.lang.Object ref = expTag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + expTag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTACH_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object attach_ = ""; + /** + * string attach = 6; + * @return The attach. + */ + @java.lang.Override + public java.lang.String getAttach() { + java.lang.Object ref = attach_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attach_ = s; + return s; + } + } + /** + * string attach = 6; + * @return The bytes for attach. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAttachBytes() { + java.lang.Object ref = attach_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + attach_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGEID_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object pageId_ = ""; + /** + * string pageId = 7; + * @return The pageId. + */ + @java.lang.Override + public java.lang.String getPageId() { + java.lang.Object ref = pageId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageId_ = s; + return s; + } + } + /** + * string pageId = 7; + * @return The bytes for pageId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageIdBytes() { + java.lang.Object ref = pageId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(token_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, token_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(liveStreamId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, liveStreamId_); + } + if (reconnectCount_ != 0) { + output.writeUInt32(3, reconnectCount_); + } + if (lastErrorCode_ != 0) { + output.writeUInt32(4, lastErrorCode_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(expTag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, expTag_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attach_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, attach_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, pageId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(token_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, token_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(liveStreamId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, liveStreamId_); + } + if (reconnectCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, reconnectCount_); + } + if (lastErrorCode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, lastErrorCode_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(expTag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, expTag_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attach_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, attach_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, pageId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom) obj; + + if (!getToken() + .equals(other.getToken())) return false; + if (!getLiveStreamId() + .equals(other.getLiveStreamId())) return false; + if (getReconnectCount() + != other.getReconnectCount()) return false; + if (getLastErrorCode() + != other.getLastErrorCode()) return false; + if (!getExpTag() + .equals(other.getExpTag())) return false; + if (!getAttach() + .equals(other.getAttach())) return false; + if (!getPageId() + .equals(other.getPageId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getToken().hashCode(); + hash = (37 * hash) + LIVESTREAMID_FIELD_NUMBER; + hash = (53 * hash) + getLiveStreamId().hashCode(); + hash = (37 * hash) + RECONNECTCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getReconnectCount(); + hash = (37 * hash) + LASTERRORCODE_FIELD_NUMBER; + hash = (53 * hash) + getLastErrorCode(); + hash = (37 * hash) + EXPTAG_FIELD_NUMBER; + hash = (53 * hash) + getExpTag().hashCode(); + hash = (37 * hash) + ATTACH_FIELD_NUMBER; + hash = (53 * hash) + getAttach().hashCode(); + hash = (37 * hash) + PAGEID_FIELD_NUMBER; + hash = (53 * hash) + getPageId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code CSWebEnterRoom} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:CSWebEnterRoom) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.internal_static_CSWebEnterRoom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.internal_static_CSWebEnterRoom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + token_ = ""; + liveStreamId_ = ""; + reconnectCount_ = 0; + lastErrorCode_ = 0; + expTag_ = ""; + attach_ = ""; + pageId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.internal_static_CSWebEnterRoom_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.token_ = token_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.liveStreamId_ = liveStreamId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.reconnectCount_ = reconnectCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.lastErrorCode_ = lastErrorCode_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.expTag_ = expTag_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.attach_ = attach_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pageId_ = pageId_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom.getDefaultInstance()) return this; + if (!other.getToken().isEmpty()) { + token_ = other.token_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getLiveStreamId().isEmpty()) { + liveStreamId_ = other.liveStreamId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getReconnectCount() != 0) { + setReconnectCount(other.getReconnectCount()); + } + if (other.getLastErrorCode() != 0) { + setLastErrorCode(other.getLastErrorCode()); + } + if (!other.getExpTag().isEmpty()) { + expTag_ = other.expTag_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getAttach().isEmpty()) { + attach_ = other.attach_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getPageId().isEmpty()) { + pageId_ = other.pageId_; + bitField0_ |= 0x00000040; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + token_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + liveStreamId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + reconnectCount_ = input.readUInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + lastErrorCode_ = input.readUInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + expTag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + attach_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + pageId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object token_ = ""; + /** + * string token = 1; + * @return The token. + */ + public java.lang.String getToken() { + java.lang.Object ref = token_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + token_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string token = 1; + * @return The bytes for token. + */ + public com.google.protobuf.ByteString + getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string token = 1; + * @param value The token to set. + * @return This builder for chaining. + */ + public Builder setToken( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + token_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string token = 1; + * @return This builder for chaining. + */ + public Builder clearToken() { + token_ = getDefaultInstance().getToken(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string token = 1; + * @param value The bytes for token to set. + * @return This builder for chaining. + */ + public Builder setTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + token_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object liveStreamId_ = ""; + /** + * string liveStreamId = 2; + * @return The liveStreamId. + */ + public java.lang.String getLiveStreamId() { + java.lang.Object ref = liveStreamId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + liveStreamId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string liveStreamId = 2; + * @return The bytes for liveStreamId. + */ + public com.google.protobuf.ByteString + getLiveStreamIdBytes() { + java.lang.Object ref = liveStreamId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + liveStreamId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string liveStreamId = 2; + * @param value The liveStreamId to set. + * @return This builder for chaining. + */ + public Builder setLiveStreamId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + liveStreamId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string liveStreamId = 2; + * @return This builder for chaining. + */ + public Builder clearLiveStreamId() { + liveStreamId_ = getDefaultInstance().getLiveStreamId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string liveStreamId = 2; + * @param value The bytes for liveStreamId to set. + * @return This builder for chaining. + */ + public Builder setLiveStreamIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + liveStreamId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int reconnectCount_ ; + /** + * uint32 reconnectCount = 3; + * @return The reconnectCount. + */ + @java.lang.Override + public int getReconnectCount() { + return reconnectCount_; + } + /** + * uint32 reconnectCount = 3; + * @param value The reconnectCount to set. + * @return This builder for chaining. + */ + public Builder setReconnectCount(int value) { + + reconnectCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint32 reconnectCount = 3; + * @return This builder for chaining. + */ + public Builder clearReconnectCount() { + bitField0_ = (bitField0_ & ~0x00000004); + reconnectCount_ = 0; + onChanged(); + return this; + } + + private int lastErrorCode_ ; + /** + * uint32 lastErrorCode = 4; + * @return The lastErrorCode. + */ + @java.lang.Override + public int getLastErrorCode() { + return lastErrorCode_; + } + /** + * uint32 lastErrorCode = 4; + * @param value The lastErrorCode to set. + * @return This builder for chaining. + */ + public Builder setLastErrorCode(int value) { + + lastErrorCode_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint32 lastErrorCode = 4; + * @return This builder for chaining. + */ + public Builder clearLastErrorCode() { + bitField0_ = (bitField0_ & ~0x00000008); + lastErrorCode_ = 0; + onChanged(); + return this; + } + + private java.lang.Object expTag_ = ""; + /** + * string expTag = 5; + * @return The expTag. + */ + public java.lang.String getExpTag() { + java.lang.Object ref = expTag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + expTag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string expTag = 5; + * @return The bytes for expTag. + */ + public com.google.protobuf.ByteString + getExpTagBytes() { + java.lang.Object ref = expTag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + expTag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string expTag = 5; + * @param value The expTag to set. + * @return This builder for chaining. + */ + public Builder setExpTag( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + expTag_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * string expTag = 5; + * @return This builder for chaining. + */ + public Builder clearExpTag() { + expTag_ = getDefaultInstance().getExpTag(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * string expTag = 5; + * @param value The bytes for expTag to set. + * @return This builder for chaining. + */ + public Builder setExpTagBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + expTag_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object attach_ = ""; + /** + * string attach = 6; + * @return The attach. + */ + public java.lang.String getAttach() { + java.lang.Object ref = attach_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attach_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string attach = 6; + * @return The bytes for attach. + */ + public com.google.protobuf.ByteString + getAttachBytes() { + java.lang.Object ref = attach_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + attach_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string attach = 6; + * @param value The attach to set. + * @return This builder for chaining. + */ + public Builder setAttach( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + attach_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * string attach = 6; + * @return This builder for chaining. + */ + public Builder clearAttach() { + attach_ = getDefaultInstance().getAttach(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * string attach = 6; + * @param value The bytes for attach to set. + * @return This builder for chaining. + */ + public Builder setAttachBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + attach_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object pageId_ = ""; + /** + * string pageId = 7; + * @return The pageId. + */ + public java.lang.String getPageId() { + java.lang.Object ref = pageId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string pageId = 7; + * @return The bytes for pageId. + */ + public com.google.protobuf.ByteString + getPageIdBytes() { + java.lang.Object ref = pageId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string pageId = 7; + * @param value The pageId to set. + * @return This builder for chaining. + */ + public Builder setPageId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + pageId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * string pageId = 7; + * @return This builder for chaining. + */ + public Builder clearPageId() { + pageId_ = getDefaultInstance().getPageId(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * string pageId = 7; + * @param value The bytes for pageId to set. + * @return This builder for chaining. + */ + public Builder setPageIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + pageId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:CSWebEnterRoom) + } + + // @@protoc_insertion_point(class_scope:CSWebEnterRoom) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CSWebEnterRoom parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebEnterRoomOuterClass.CSWebEnterRoom getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_CSWebEnterRoom_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_CSWebEnterRoom_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024CSWebEnterRoom.proto\"\224\001\n\016CSWebEnterRoo" + + "m\022\r\n\005token\030\001 \001(\t\022\024\n\014liveStreamId\030\002 \001(\t\022\026" + + "\n\016reconnectCount\030\003 \001(\r\022\025\n\rlastErrorCode\030" + + "\004 \001(\r\022\016\n\006expTag\030\005 \001(\t\022\016\n\006attach\030\006 \001(\t\022\016\n" + + "\006pageId\030\007 \001(\tB6\n4tech.ordinaryroad.live." + + "chat.client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_CSWebEnterRoom_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_CSWebEnterRoom_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_CSWebEnterRoom_descriptor, + new java.lang.String[] { "Token", "LiveStreamId", "ReconnectCount", "LastErrorCode", "ExpTag", "Attach", "PageId", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebErrorOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebErrorOuterClass.java new file mode 100644 index 0000000..7eacbd5 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebErrorOuterClass.java @@ -0,0 +1,697 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: CSWebError.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class CSWebErrorOuterClass { + private CSWebErrorOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface CSWebErrorOrBuilder extends + // @@protoc_insertion_point(interface_extends:CSWebError) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 code = 1; + * @return The code. + */ + int getCode(); + + /** + * string msg = 2; + * @return The msg. + */ + java.lang.String getMsg(); + /** + * string msg = 2; + * @return The bytes for msg. + */ + com.google.protobuf.ByteString + getMsgBytes(); + } + /** + * Protobuf type {@code CSWebError} + */ + public static final class CSWebError extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:CSWebError) + CSWebErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use CSWebError.newBuilder() to construct. + private CSWebError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CSWebError() { + msg_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CSWebError(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.internal_static_CSWebError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.internal_static_CSWebError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError.Builder.class); + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_ = 0; + /** + * uint32 code = 1; + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + public static final int MSG_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object msg_ = ""; + /** + * string msg = 2; + * @return The msg. + */ + @java.lang.Override + public java.lang.String getMsg() { + java.lang.Object ref = msg_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + msg_ = s; + return s; + } + } + /** + * string msg = 2; + * @return The bytes for msg. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMsgBytes() { + java.lang.Object ref = msg_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (code_ != 0) { + output.writeUInt32(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msg_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, msg_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msg_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, msg_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError) obj; + + if (getCode() + != other.getCode()) return false; + if (!getMsg() + .equals(other.getMsg())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode(); + hash = (37 * hash) + MSG_FIELD_NUMBER; + hash = (53 * hash) + getMsg().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code CSWebError} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:CSWebError) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.internal_static_CSWebError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.internal_static_CSWebError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = 0; + msg_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.internal_static_CSWebError_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.msg_ = msg_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError.getDefaultInstance()) return this; + if (other.getCode() != 0) { + setCode(other.getCode()); + } + if (!other.getMsg().isEmpty()) { + msg_ = other.msg_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + code_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + msg_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int code_ ; + /** + * uint32 code = 1; + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + /** + * uint32 code = 1; + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(int value) { + + code_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint32 code = 1; + * @return This builder for chaining. + */ + public Builder clearCode() { + bitField0_ = (bitField0_ & ~0x00000001); + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object msg_ = ""; + /** + * string msg = 2; + * @return The msg. + */ + public java.lang.String getMsg() { + java.lang.Object ref = msg_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + msg_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string msg = 2; + * @return The bytes for msg. + */ + public com.google.protobuf.ByteString + getMsgBytes() { + java.lang.Object ref = msg_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string msg = 2; + * @param value The msg to set. + * @return This builder for chaining. + */ + public Builder setMsg( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + msg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string msg = 2; + * @return This builder for chaining. + */ + public Builder clearMsg() { + msg_ = getDefaultInstance().getMsg(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string msg = 2; + * @param value The bytes for msg to set. + * @return This builder for chaining. + */ + public Builder setMsgBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + msg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:CSWebError) + } + + // @@protoc_insertion_point(class_scope:CSWebError) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CSWebError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebErrorOuterClass.CSWebError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_CSWebError_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_CSWebError_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\020CSWebError.proto\"\'\n\nCSWebError\022\014\n\004code" + + "\030\001 \001(\r\022\013\n\003msg\030\002 \001(\tB6\n4tech.ordinaryroad" + + ".live.chat.client.kuaishou.protobufb\006pro" + + "to3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_CSWebError_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_CSWebError_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_CSWebError_descriptor, + new java.lang.String[] { "Code", "Msg", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebHeartbeatOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebHeartbeatOuterClass.java new file mode 100644 index 0000000..f2c5d4e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebHeartbeatOuterClass.java @@ -0,0 +1,550 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: CSWebHeartbeat.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class CSWebHeartbeatOuterClass { + private CSWebHeartbeatOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface CSWebHeartbeatOrBuilder extends + // @@protoc_insertion_point(interface_extends:CSWebHeartbeat) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 timestamp = 1; + * @return The timestamp. + */ + long getTimestamp(); + } + /** + * Protobuf type {@code CSWebHeartbeat} + */ + public static final class CSWebHeartbeat extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:CSWebHeartbeat) + CSWebHeartbeatOrBuilder { + private static final long serialVersionUID = 0L; + // Use CSWebHeartbeat.newBuilder() to construct. + private CSWebHeartbeat(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CSWebHeartbeat() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CSWebHeartbeat(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.internal_static_CSWebHeartbeat_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.internal_static_CSWebHeartbeat_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat.Builder.class); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 1; + private long timestamp_ = 0L; + /** + * uint64 timestamp = 1; + * @return The timestamp. + */ + @java.lang.Override + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (timestamp_ != 0L) { + output.writeUInt64(1, timestamp_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, timestamp_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat) obj; + + if (getTimestamp() + != other.getTimestamp()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code CSWebHeartbeat} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:CSWebHeartbeat) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeatOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.internal_static_CSWebHeartbeat_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.internal_static_CSWebHeartbeat_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + timestamp_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.internal_static_CSWebHeartbeat_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.timestamp_ = timestamp_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat.getDefaultInstance()) return this; + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + timestamp_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long timestamp_ ; + /** + * uint64 timestamp = 1; + * @return The timestamp. + */ + @java.lang.Override + public long getTimestamp() { + return timestamp_; + } + /** + * uint64 timestamp = 1; + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + timestamp_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:CSWebHeartbeat) + } + + // @@protoc_insertion_point(class_scope:CSWebHeartbeat) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CSWebHeartbeat parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebHeartbeatOuterClass.CSWebHeartbeat getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_CSWebHeartbeat_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_CSWebHeartbeat_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024CSWebHeartbeat.proto\"#\n\016CSWebHeartbeat" + + "\022\021\n\ttimestamp\030\001 \001(\004B6\n4tech.ordinaryroad" + + ".live.chat.client.kuaishou.protobufb\006pro" + + "to3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_CSWebHeartbeat_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_CSWebHeartbeat_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_CSWebHeartbeat_descriptor, + new java.lang.String[] { "Timestamp", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebUserExitOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebUserExitOuterClass.java new file mode 100644 index 0000000..ebd72e5 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebUserExitOuterClass.java @@ -0,0 +1,549 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: CSWebUserExit.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class CSWebUserExitOuterClass { + private CSWebUserExitOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface CSWebUserExitOrBuilder extends + // @@protoc_insertion_point(interface_extends:CSWebUserExit) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 time = 1; + * @return The time. + */ + long getTime(); + } + /** + * Protobuf type {@code CSWebUserExit} + */ + public static final class CSWebUserExit extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:CSWebUserExit) + CSWebUserExitOrBuilder { + private static final long serialVersionUID = 0L; + // Use CSWebUserExit.newBuilder() to construct. + private CSWebUserExit(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CSWebUserExit() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CSWebUserExit(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.internal_static_CSWebUserExit_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.internal_static_CSWebUserExit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit.Builder.class); + } + + public static final int TIME_FIELD_NUMBER = 1; + private long time_ = 0L; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (time_ != 0L) { + output.writeUInt64(1, time_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (time_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, time_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit) obj; + + if (getTime() + != other.getTime()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTime()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code CSWebUserExit} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:CSWebUserExit) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExitOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.internal_static_CSWebUserExit_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.internal_static_CSWebUserExit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + time_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.internal_static_CSWebUserExit_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.time_ = time_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit.getDefaultInstance()) return this; + if (other.getTime() != 0L) { + setTime(other.getTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + time_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long time_ ; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + /** + * uint64 time = 1; + * @param value The time to set. + * @return This builder for chaining. + */ + public Builder setTime(long value) { + + time_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 time = 1; + * @return This builder for chaining. + */ + public Builder clearTime() { + bitField0_ = (bitField0_ & ~0x00000001); + time_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:CSWebUserExit) + } + + // @@protoc_insertion_point(class_scope:CSWebUserExit) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CSWebUserExit parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserExitOuterClass.CSWebUserExit getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_CSWebUserExit_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_CSWebUserExit_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\023CSWebUserExit.proto\"\035\n\rCSWebUserExit\022\014" + + "\n\004time\030\001 \001(\004B6\n4tech.ordinaryroad.live.c" + + "hat.client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_CSWebUserExit_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_CSWebUserExit_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_CSWebUserExit_descriptor, + new java.lang.String[] { "Time", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebUserPauseOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebUserPauseOuterClass.java new file mode 100644 index 0000000..a5527f1 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/CSWebUserPauseOuterClass.java @@ -0,0 +1,658 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: CSWebUserPause.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class CSWebUserPauseOuterClass { + private CSWebUserPauseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface CSWebUserPauseOrBuilder extends + // @@protoc_insertion_point(interface_extends:CSWebUserPause) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 time = 1; + * @return The time. + */ + long getTime(); + + /** + * .WebUserPauseType pauseType = 2; + * @return The enum numeric value on the wire for pauseType. + */ + int getPauseTypeValue(); + /** + * .WebUserPauseType pauseType = 2; + * @return The pauseType. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.WebUserPauseType getPauseType(); + } + /** + * Protobuf type {@code CSWebUserPause} + */ + public static final class CSWebUserPause extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:CSWebUserPause) + CSWebUserPauseOrBuilder { + private static final long serialVersionUID = 0L; + // Use CSWebUserPause.newBuilder() to construct. + private CSWebUserPause(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CSWebUserPause() { + pauseType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CSWebUserPause(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.internal_static_CSWebUserPause_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.internal_static_CSWebUserPause_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause.Builder.class); + } + + public static final int TIME_FIELD_NUMBER = 1; + private long time_ = 0L; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + + public static final int PAUSETYPE_FIELD_NUMBER = 2; + private int pauseType_ = 0; + /** + * .WebUserPauseType pauseType = 2; + * @return The enum numeric value on the wire for pauseType. + */ + @java.lang.Override public int getPauseTypeValue() { + return pauseType_; + } + /** + * .WebUserPauseType pauseType = 2; + * @return The pauseType. + */ + @java.lang.Override public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.WebUserPauseType getPauseType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.WebUserPauseType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.WebUserPauseType.forNumber(pauseType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.WebUserPauseType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (time_ != 0L) { + output.writeUInt64(1, time_); + } + if (pauseType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.WebUserPauseType.UNKNOWN_USER_PAUSE_TYPE.getNumber()) { + output.writeEnum(2, pauseType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (time_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, time_); + } + if (pauseType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.WebUserPauseType.UNKNOWN_USER_PAUSE_TYPE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, pauseType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause) obj; + + if (getTime() + != other.getTime()) return false; + if (pauseType_ != other.pauseType_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTime()); + hash = (37 * hash) + PAUSETYPE_FIELD_NUMBER; + hash = (53 * hash) + pauseType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code CSWebUserPause} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:CSWebUserPause) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPauseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.internal_static_CSWebUserPause_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.internal_static_CSWebUserPause_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + time_ = 0L; + pauseType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.internal_static_CSWebUserPause_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.time_ = time_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pauseType_ = pauseType_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause.getDefaultInstance()) return this; + if (other.getTime() != 0L) { + setTime(other.getTime()); + } + if (other.pauseType_ != 0) { + setPauseTypeValue(other.getPauseTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + time_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + pauseType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long time_ ; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + /** + * uint64 time = 1; + * @param value The time to set. + * @return This builder for chaining. + */ + public Builder setTime(long value) { + + time_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 time = 1; + * @return This builder for chaining. + */ + public Builder clearTime() { + bitField0_ = (bitField0_ & ~0x00000001); + time_ = 0L; + onChanged(); + return this; + } + + private int pauseType_ = 0; + /** + * .WebUserPauseType pauseType = 2; + * @return The enum numeric value on the wire for pauseType. + */ + @java.lang.Override public int getPauseTypeValue() { + return pauseType_; + } + /** + * .WebUserPauseType pauseType = 2; + * @param value The enum numeric value on the wire for pauseType to set. + * @return This builder for chaining. + */ + public Builder setPauseTypeValue(int value) { + pauseType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .WebUserPauseType pauseType = 2; + * @return The pauseType. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.WebUserPauseType getPauseType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.WebUserPauseType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.WebUserPauseType.forNumber(pauseType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.WebUserPauseType.UNRECOGNIZED : result; + } + /** + * .WebUserPauseType pauseType = 2; + * @param value The pauseType to set. + * @return This builder for chaining. + */ + public Builder setPauseType(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.WebUserPauseType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + pauseType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .WebUserPauseType pauseType = 2; + * @return This builder for chaining. + */ + public Builder clearPauseType() { + bitField0_ = (bitField0_ & ~0x00000002); + pauseType_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:CSWebUserPause) + } + + // @@protoc_insertion_point(class_scope:CSWebUserPause) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CSWebUserPause parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.CSWebUserPauseOuterClass.CSWebUserPause getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_CSWebUserPause_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_CSWebUserPause_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024CSWebUserPause.proto\032\026WebUserPauseType" + + ".proto\"D\n\016CSWebUserPause\022\014\n\004time\030\001 \001(\004\022$" + + "\n\tpauseType\030\002 \001(\0162\021.WebUserPauseTypeB6\n4" + + "tech.ordinaryroad.live.chat.client.kuais" + + "hou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.getDescriptor(), + }); + internal_static_CSWebUserPause_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_CSWebUserPause_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_CSWebUserPause_descriptor, + new java.lang.String[] { "Time", "PauseType", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/ClientIdOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/ClientIdOuterClass.java new file mode 100644 index 0000000..41434de --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/ClientIdOuterClass.java @@ -0,0 +1,216 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ClientId.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class ClientIdOuterClass { + private ClientIdOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code ClientId} + */ + public enum ClientId + implements com.google.protobuf.ProtocolMessageEnum { + /** + * NONE = 0; + */ + NONE(0), + /** + * IPHONE = 1; + */ + IPHONE(1), + /** + * ANDROID = 2; + */ + ANDROID(2), + /** + * WEB = 3; + */ + WEB(3), + /** + * PC = 6; + */ + PC(6), + /** + * IPHONE_LIVE_MATE = 8; + */ + IPHONE_LIVE_MATE(8), + /** + * ANDROID_LIVE_MATE = 9; + */ + ANDROID_LIVE_MATE(9), + UNRECOGNIZED(-1), + ; + + /** + * NONE = 0; + */ + public static final int NONE_VALUE = 0; + /** + * IPHONE = 1; + */ + public static final int IPHONE_VALUE = 1; + /** + * ANDROID = 2; + */ + public static final int ANDROID_VALUE = 2; + /** + * WEB = 3; + */ + public static final int WEB_VALUE = 3; + /** + * PC = 6; + */ + public static final int PC_VALUE = 6; + /** + * IPHONE_LIVE_MATE = 8; + */ + public static final int IPHONE_LIVE_MATE_VALUE = 8; + /** + * ANDROID_LIVE_MATE = 9; + */ + public static final int ANDROID_LIVE_MATE_VALUE = 9; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ClientId valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ClientId forNumber(int value) { + switch (value) { + case 0: return NONE; + case 1: return IPHONE; + case 2: return ANDROID; + case 3: return WEB; + case 6: return PC; + case 8: return IPHONE_LIVE_MATE; + case 9: return ANDROID_LIVE_MATE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ClientId> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ClientId findValueByNumber(int number) { + return ClientId.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ClientIdOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final ClientId[] VALUES = values(); + + public static ClientId valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ClientId(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:ClientId) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\016ClientId.proto*k\n\010ClientId\022\010\n\004NONE\020\000\022\n" + + "\n\006IPHONE\020\001\022\013\n\007ANDROID\020\002\022\007\n\003WEB\020\003\022\006\n\002PC\020\006" + + "\022\024\n\020IPHONE_LIVE_MATE\020\010\022\025\n\021ANDROID_LIVE_M" + + "ATE\020\tB6\n4tech.ordinaryroad.live.chat.cli" + + "ent.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/ConfigSwitchItemOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/ConfigSwitchItemOuterClass.java new file mode 100644 index 0000000..f73716d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/ConfigSwitchItemOuterClass.java @@ -0,0 +1,658 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ConfigSwitchItem.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class ConfigSwitchItemOuterClass { + private ConfigSwitchItemOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ConfigSwitchItemOrBuilder extends + // @@protoc_insertion_point(interface_extends:ConfigSwitchItem) + com.google.protobuf.MessageOrBuilder { + + /** + * .ConfigSwitchType configSwitchType = 1; + * @return The enum numeric value on the wire for configSwitchType. + */ + int getConfigSwitchTypeValue(); + /** + * .ConfigSwitchType configSwitchType = 1; + * @return The configSwitchType. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.ConfigSwitchType getConfigSwitchType(); + + /** + * bool value = 2; + * @return The value. + */ + boolean getValue(); + } + /** + * Protobuf type {@code ConfigSwitchItem} + */ + public static final class ConfigSwitchItem extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:ConfigSwitchItem) + ConfigSwitchItemOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfigSwitchItem.newBuilder() to construct. + private ConfigSwitchItem(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConfigSwitchItem() { + configSwitchType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ConfigSwitchItem(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.internal_static_ConfigSwitchItem_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.internal_static_ConfigSwitchItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.Builder.class); + } + + public static final int CONFIGSWITCHTYPE_FIELD_NUMBER = 1; + private int configSwitchType_ = 0; + /** + * .ConfigSwitchType configSwitchType = 1; + * @return The enum numeric value on the wire for configSwitchType. + */ + @java.lang.Override public int getConfigSwitchTypeValue() { + return configSwitchType_; + } + /** + * .ConfigSwitchType configSwitchType = 1; + * @return The configSwitchType. + */ + @java.lang.Override public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.ConfigSwitchType getConfigSwitchType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.ConfigSwitchType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.ConfigSwitchType.forNumber(configSwitchType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.ConfigSwitchType.UNRECOGNIZED : result; + } + + public static final int VALUE_FIELD_NUMBER = 2; + private boolean value_ = false; + /** + * bool value = 2; + * @return The value. + */ + @java.lang.Override + public boolean getValue() { + return value_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (configSwitchType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.ConfigSwitchType.UNKNOWN.getNumber()) { + output.writeEnum(1, configSwitchType_); + } + if (value_ != false) { + output.writeBool(2, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (configSwitchType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.ConfigSwitchType.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, configSwitchType_); + } + if (value_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem) obj; + + if (configSwitchType_ != other.configSwitchType_) return false; + if (getValue() + != other.getValue()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONFIGSWITCHTYPE_FIELD_NUMBER; + hash = (53 * hash) + configSwitchType_; + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getValue()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code ConfigSwitchItem} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:ConfigSwitchItem) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItemOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.internal_static_ConfigSwitchItem_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.internal_static_ConfigSwitchItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + configSwitchType_ = 0; + value_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.internal_static_ConfigSwitchItem_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.configSwitchType_ = configSwitchType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.getDefaultInstance()) return this; + if (other.configSwitchType_ != 0) { + setConfigSwitchTypeValue(other.getConfigSwitchTypeValue()); + } + if (other.getValue() != false) { + setValue(other.getValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + configSwitchType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + value_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int configSwitchType_ = 0; + /** + * .ConfigSwitchType configSwitchType = 1; + * @return The enum numeric value on the wire for configSwitchType. + */ + @java.lang.Override public int getConfigSwitchTypeValue() { + return configSwitchType_; + } + /** + * .ConfigSwitchType configSwitchType = 1; + * @param value The enum numeric value on the wire for configSwitchType to set. + * @return This builder for chaining. + */ + public Builder setConfigSwitchTypeValue(int value) { + configSwitchType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .ConfigSwitchType configSwitchType = 1; + * @return The configSwitchType. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.ConfigSwitchType getConfigSwitchType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.ConfigSwitchType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.ConfigSwitchType.forNumber(configSwitchType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.ConfigSwitchType.UNRECOGNIZED : result; + } + /** + * .ConfigSwitchType configSwitchType = 1; + * @param value The configSwitchType to set. + * @return This builder for chaining. + */ + public Builder setConfigSwitchType(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.ConfigSwitchType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + configSwitchType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .ConfigSwitchType configSwitchType = 1; + * @return This builder for chaining. + */ + public Builder clearConfigSwitchType() { + bitField0_ = (bitField0_ & ~0x00000001); + configSwitchType_ = 0; + onChanged(); + return this; + } + + private boolean value_ ; + /** + * bool value = 2; + * @return The value. + */ + @java.lang.Override + public boolean getValue() { + return value_; + } + /** + * bool value = 2; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(boolean value) { + + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * bool value = 2; + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:ConfigSwitchItem) + } + + // @@protoc_insertion_point(class_scope:ConfigSwitchItem) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConfigSwitchItem parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_ConfigSwitchItem_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_ConfigSwitchItem_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026ConfigSwitchItem.proto\032\026ConfigSwitchTy" + + "pe.proto\"N\n\020ConfigSwitchItem\022+\n\020configSw" + + "itchType\030\001 \001(\0162\021.ConfigSwitchType\022\r\n\005val" + + "ue\030\002 \001(\010B6\n4tech.ordinaryroad.live.chat." + + "client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.getDescriptor(), + }); + internal_static_ConfigSwitchItem_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_ConfigSwitchItem_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_ConfigSwitchItem_descriptor, + new java.lang.String[] { "ConfigSwitchType", "Value", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/ConfigSwitchTypeOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/ConfigSwitchTypeOuterClass.java new file mode 100644 index 0000000..0a53ef2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/ConfigSwitchTypeOuterClass.java @@ -0,0 +1,180 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ConfigSwitchType.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class ConfigSwitchTypeOuterClass { + private ConfigSwitchTypeOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code ConfigSwitchType} + */ + public enum ConfigSwitchType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + * HIDE_BARRAGE = 1; + */ + HIDE_BARRAGE(1), + /** + * HIDE_SPECIAL_EFFECT = 2; + */ + HIDE_SPECIAL_EFFECT(2), + UNRECOGNIZED(-1), + ; + + /** + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + * HIDE_BARRAGE = 1; + */ + public static final int HIDE_BARRAGE_VALUE = 1; + /** + * HIDE_SPECIAL_EFFECT = 2; + */ + public static final int HIDE_SPECIAL_EFFECT_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConfigSwitchType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ConfigSwitchType forNumber(int value) { + switch (value) { + case 0: return UNKNOWN; + case 1: return HIDE_BARRAGE; + case 2: return HIDE_SPECIAL_EFFECT; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ConfigSwitchType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ConfigSwitchType findValueByNumber(int number) { + return ConfigSwitchType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchTypeOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final ConfigSwitchType[] VALUES = values(); + + public static ConfigSwitchType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ConfigSwitchType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:ConfigSwitchType) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026ConfigSwitchType.proto*J\n\020ConfigSwitch" + + "Type\022\013\n\007UNKNOWN\020\000\022\020\n\014HIDE_BARRAGE\020\001\022\027\n\023H" + + "IDE_SPECIAL_EFFECT\020\002B6\n4tech.ordinaryroa" + + "d.live.chat.client.kuaishou.protobufb\006pr" + + "oto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/GzoneNameplateOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/GzoneNameplateOuterClass.java new file mode 100644 index 0000000..318cd1d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/GzoneNameplateOuterClass.java @@ -0,0 +1,1079 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: GzoneNameplate.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class GzoneNameplateOuterClass { + private GzoneNameplateOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface GzoneNameplateOrBuilder extends + // @@protoc_insertion_point(interface_extends:GzoneNameplate) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 id = 1; + * @return The id. + */ + long getId(); + + /** + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * repeated .PicUrl urls = 3; + */ + java.util.List + getUrlsList(); + /** + * repeated .PicUrl urls = 3; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl getUrls(int index); + /** + * repeated .PicUrl urls = 3; + */ + int getUrlsCount(); + /** + * repeated .PicUrl urls = 3; + */ + java.util.List + getUrlsOrBuilderList(); + /** + * repeated .PicUrl urls = 3; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder getUrlsOrBuilder( + int index); + } + /** + * Protobuf type {@code GzoneNameplate} + */ + public static final class GzoneNameplate extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:GzoneNameplate) + GzoneNameplateOrBuilder { + private static final long serialVersionUID = 0L; + // Use GzoneNameplate.newBuilder() to construct. + private GzoneNameplate(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GzoneNameplate() { + name_ = ""; + urls_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GzoneNameplate(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.internal_static_GzoneNameplate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.internal_static_GzoneNameplate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_ = 0L; + /** + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 2; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * string name = 2; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URLS_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List urls_; + /** + * repeated .PicUrl urls = 3; + */ + @java.lang.Override + public java.util.List getUrlsList() { + return urls_; + } + /** + * repeated .PicUrl urls = 3; + */ + @java.lang.Override + public java.util.List + getUrlsOrBuilderList() { + return urls_; + } + /** + * repeated .PicUrl urls = 3; + */ + @java.lang.Override + public int getUrlsCount() { + return urls_.size(); + } + /** + * repeated .PicUrl urls = 3; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl getUrls(int index) { + return urls_.get(index); + } + /** + * repeated .PicUrl urls = 3; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder getUrlsOrBuilder( + int index) { + return urls_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + for (int i = 0; i < urls_.size(); i++) { + output.writeMessage(3, urls_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + for (int i = 0; i < urls_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, urls_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate) obj; + + if (getId() + != other.getId()) return false; + if (!getName() + .equals(other.getName())) return false; + if (!getUrlsList() + .equals(other.getUrlsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getUrlsCount() > 0) { + hash = (37 * hash) + URLS_FIELD_NUMBER; + hash = (53 * hash) + getUrlsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code GzoneNameplate} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:GzoneNameplate) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.internal_static_GzoneNameplate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.internal_static_GzoneNameplate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = 0L; + name_ = ""; + if (urlsBuilder_ == null) { + urls_ = java.util.Collections.emptyList(); + } else { + urls_ = null; + urlsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.internal_static_GzoneNameplate_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate result) { + if (urlsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + urls_ = java.util.Collections.unmodifiableList(urls_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.urls_ = urls_; + } else { + result.urls_ = urlsBuilder_.build(); + } + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (urlsBuilder_ == null) { + if (!other.urls_.isEmpty()) { + if (urls_.isEmpty()) { + urls_ = other.urls_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUrlsIsMutable(); + urls_.addAll(other.urls_); + } + onChanged(); + } + } else { + if (!other.urls_.isEmpty()) { + if (urlsBuilder_.isEmpty()) { + urlsBuilder_.dispose(); + urlsBuilder_ = null; + urls_ = other.urls_; + bitField0_ = (bitField0_ & ~0x00000004); + urlsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getUrlsFieldBuilder() : null; + } else { + urlsBuilder_.addAllMessages(other.urls_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + id_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl m = + input.readMessage( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.parser(), + extensionRegistry); + if (urlsBuilder_ == null) { + ensureUrlsIsMutable(); + urls_.add(m); + } else { + urlsBuilder_.addMessage(m); + } + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long id_ ; + /** + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + * int64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * string name = 2; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string name = 2; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List urls_ = + java.util.Collections.emptyList(); + private void ensureUrlsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + urls_ = new java.util.ArrayList(urls_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder> urlsBuilder_; + + /** + * repeated .PicUrl urls = 3; + */ + public java.util.List getUrlsList() { + if (urlsBuilder_ == null) { + return java.util.Collections.unmodifiableList(urls_); + } else { + return urlsBuilder_.getMessageList(); + } + } + /** + * repeated .PicUrl urls = 3; + */ + public int getUrlsCount() { + if (urlsBuilder_ == null) { + return urls_.size(); + } else { + return urlsBuilder_.getCount(); + } + } + /** + * repeated .PicUrl urls = 3; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl getUrls(int index) { + if (urlsBuilder_ == null) { + return urls_.get(index); + } else { + return urlsBuilder_.getMessage(index); + } + } + /** + * repeated .PicUrl urls = 3; + */ + public Builder setUrls( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl value) { + if (urlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrlsIsMutable(); + urls_.set(index, value); + onChanged(); + } else { + urlsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .PicUrl urls = 3; + */ + public Builder setUrls( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder builderForValue) { + if (urlsBuilder_ == null) { + ensureUrlsIsMutable(); + urls_.set(index, builderForValue.build()); + onChanged(); + } else { + urlsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .PicUrl urls = 3; + */ + public Builder addUrls(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl value) { + if (urlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrlsIsMutable(); + urls_.add(value); + onChanged(); + } else { + urlsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .PicUrl urls = 3; + */ + public Builder addUrls( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl value) { + if (urlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrlsIsMutable(); + urls_.add(index, value); + onChanged(); + } else { + urlsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .PicUrl urls = 3; + */ + public Builder addUrls( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder builderForValue) { + if (urlsBuilder_ == null) { + ensureUrlsIsMutable(); + urls_.add(builderForValue.build()); + onChanged(); + } else { + urlsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .PicUrl urls = 3; + */ + public Builder addUrls( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder builderForValue) { + if (urlsBuilder_ == null) { + ensureUrlsIsMutable(); + urls_.add(index, builderForValue.build()); + onChanged(); + } else { + urlsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .PicUrl urls = 3; + */ + public Builder addAllUrls( + java.lang.Iterable values) { + if (urlsBuilder_ == null) { + ensureUrlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, urls_); + onChanged(); + } else { + urlsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .PicUrl urls = 3; + */ + public Builder clearUrls() { + if (urlsBuilder_ == null) { + urls_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + urlsBuilder_.clear(); + } + return this; + } + /** + * repeated .PicUrl urls = 3; + */ + public Builder removeUrls(int index) { + if (urlsBuilder_ == null) { + ensureUrlsIsMutable(); + urls_.remove(index); + onChanged(); + } else { + urlsBuilder_.remove(index); + } + return this; + } + /** + * repeated .PicUrl urls = 3; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder getUrlsBuilder( + int index) { + return getUrlsFieldBuilder().getBuilder(index); + } + /** + * repeated .PicUrl urls = 3; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder getUrlsOrBuilder( + int index) { + if (urlsBuilder_ == null) { + return urls_.get(index); } else { + return urlsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .PicUrl urls = 3; + */ + public java.util.List + getUrlsOrBuilderList() { + if (urlsBuilder_ != null) { + return urlsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(urls_); + } + } + /** + * repeated .PicUrl urls = 3; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder addUrlsBuilder() { + return getUrlsFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.getDefaultInstance()); + } + /** + * repeated .PicUrl urls = 3; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder addUrlsBuilder( + int index) { + return getUrlsFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.getDefaultInstance()); + } + /** + * repeated .PicUrl urls = 3; + */ + public java.util.List + getUrlsBuilderList() { + return getUrlsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder> + getUrlsFieldBuilder() { + if (urlsBuilder_ == null) { + urlsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder>( + urls_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + urls_ = null; + } + return urlsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:GzoneNameplate) + } + + // @@protoc_insertion_point(class_scope:GzoneNameplate) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GzoneNameplate parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_GzoneNameplate_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_GzoneNameplate_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024GzoneNameplate.proto\032\014PicUrl.proto\"A\n\016" + + "GzoneNameplate\022\n\n\002id\030\001 \001(\003\022\014\n\004name\030\002 \001(\t" + + "\022\025\n\004urls\030\003 \003(\0132\007.PicUrlB6\n4tech.ordinary" + + "road.live.chat.client.kuaishou.protobufb" + + "\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.getDescriptor(), + }); + internal_static_GzoneNameplate_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_GzoneNameplate_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_GzoneNameplate_descriptor, + new java.lang.String[] { "Id", "Name", "Urls", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/LiveAudienceStateOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/LiveAudienceStateOuterClass.java new file mode 100644 index 0000000..b5f94ec --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/LiveAudienceStateOuterClass.java @@ -0,0 +1,1541 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: LiveAudienceState.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class LiveAudienceStateOuterClass { + private LiveAudienceStateOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface LiveAudienceStateOrBuilder extends + // @@protoc_insertion_point(interface_extends:LiveAudienceState) + com.google.protobuf.MessageOrBuilder { + + /** + * bool isFromFansTop = 1; + * @return The isFromFansTop. + */ + boolean getIsFromFansTop(); + + /** + * bool isKoi = 2; + * @return The isKoi. + */ + boolean getIsKoi(); + + /** + * .LiveAudienceState.AssistantType assistantType = 3; + * @return The enum numeric value on the wire for assistantType. + */ + int getAssistantTypeValue(); + /** + * .LiveAudienceState.AssistantType assistantType = 3; + * @return The assistantType. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.AssistantType getAssistantType(); + + /** + * uint32 fansGroupIntimacyLevel = 4; + * @return The fansGroupIntimacyLevel. + */ + int getFansGroupIntimacyLevel(); + + /** + * .GzoneNameplate nameplate = 5; + * @return Whether the nameplate field is set. + */ + boolean hasNameplate(); + /** + * .GzoneNameplate nameplate = 5; + * @return The nameplate. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate getNameplate(); + /** + * .GzoneNameplate nameplate = 5; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplateOrBuilder getNameplateOrBuilder(); + + /** + * .LiveFansGroupState liveFansGroupState = 6; + * @return Whether the liveFansGroupState field is set. + */ + boolean hasLiveFansGroupState(); + /** + * .LiveFansGroupState liveFansGroupState = 6; + * @return The liveFansGroupState. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState getLiveFansGroupState(); + /** + * .LiveFansGroupState liveFansGroupState = 6; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupStateOrBuilder getLiveFansGroupStateOrBuilder(); + + /** + * uint32 wealthGrade = 7; + * @return The wealthGrade. + */ + int getWealthGrade(); + + /** + * string badgeKey = 8; + * @return The badgeKey. + */ + java.lang.String getBadgeKey(); + /** + * string badgeKey = 8; + * @return The bytes for badgeKey. + */ + com.google.protobuf.ByteString + getBadgeKeyBytes(); + } + /** + * Protobuf type {@code LiveAudienceState} + */ + public static final class LiveAudienceState extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:LiveAudienceState) + LiveAudienceStateOrBuilder { + private static final long serialVersionUID = 0L; + // Use LiveAudienceState.newBuilder() to construct. + private LiveAudienceState(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LiveAudienceState() { + assistantType_ = 0; + badgeKey_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LiveAudienceState(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.internal_static_LiveAudienceState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.internal_static_LiveAudienceState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.Builder.class); + } + + /** + * Protobuf enum {@code LiveAudienceState.AssistantType} + */ + public enum AssistantType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN_ASSISTANT_TYPE = 0; + */ + UNKNOWN_ASSISTANT_TYPE(0), + /** + * SUPER = 1; + */ + SUPER(1), + /** + * JUNIOR = 2; + */ + JUNIOR(2), + UNRECOGNIZED(-1), + ; + + /** + * UNKNOWN_ASSISTANT_TYPE = 0; + */ + public static final int UNKNOWN_ASSISTANT_TYPE_VALUE = 0; + /** + * SUPER = 1; + */ + public static final int SUPER_VALUE = 1; + /** + * JUNIOR = 2; + */ + public static final int JUNIOR_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AssistantType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static AssistantType forNumber(int value) { + switch (value) { + case 0: return UNKNOWN_ASSISTANT_TYPE; + case 1: return SUPER; + case 2: return JUNIOR; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AssistantType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AssistantType findValueByNumber(int number) { + return AssistantType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.getDescriptor().getEnumTypes().get(0); + } + + private static final AssistantType[] VALUES = values(); + + public static AssistantType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private AssistantType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:LiveAudienceState.AssistantType) + } + + public static final int ISFROMFANSTOP_FIELD_NUMBER = 1; + private boolean isFromFansTop_ = false; + /** + * bool isFromFansTop = 1; + * @return The isFromFansTop. + */ + @java.lang.Override + public boolean getIsFromFansTop() { + return isFromFansTop_; + } + + public static final int ISKOI_FIELD_NUMBER = 2; + private boolean isKoi_ = false; + /** + * bool isKoi = 2; + * @return The isKoi. + */ + @java.lang.Override + public boolean getIsKoi() { + return isKoi_; + } + + public static final int ASSISTANTTYPE_FIELD_NUMBER = 3; + private int assistantType_ = 0; + /** + * .LiveAudienceState.AssistantType assistantType = 3; + * @return The enum numeric value on the wire for assistantType. + */ + @java.lang.Override public int getAssistantTypeValue() { + return assistantType_; + } + /** + * .LiveAudienceState.AssistantType assistantType = 3; + * @return The assistantType. + */ + @java.lang.Override public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.AssistantType getAssistantType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.AssistantType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.AssistantType.forNumber(assistantType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.AssistantType.UNRECOGNIZED : result; + } + + public static final int FANSGROUPINTIMACYLEVEL_FIELD_NUMBER = 4; + private int fansGroupIntimacyLevel_ = 0; + /** + * uint32 fansGroupIntimacyLevel = 4; + * @return The fansGroupIntimacyLevel. + */ + @java.lang.Override + public int getFansGroupIntimacyLevel() { + return fansGroupIntimacyLevel_; + } + + public static final int NAMEPLATE_FIELD_NUMBER = 5; + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate nameplate_; + /** + * .GzoneNameplate nameplate = 5; + * @return Whether the nameplate field is set. + */ + @java.lang.Override + public boolean hasNameplate() { + return nameplate_ != null; + } + /** + * .GzoneNameplate nameplate = 5; + * @return The nameplate. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate getNameplate() { + return nameplate_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.getDefaultInstance() : nameplate_; + } + /** + * .GzoneNameplate nameplate = 5; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplateOrBuilder getNameplateOrBuilder() { + return nameplate_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.getDefaultInstance() : nameplate_; + } + + public static final int LIVEFANSGROUPSTATE_FIELD_NUMBER = 6; + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState liveFansGroupState_; + /** + * .LiveFansGroupState liveFansGroupState = 6; + * @return Whether the liveFansGroupState field is set. + */ + @java.lang.Override + public boolean hasLiveFansGroupState() { + return liveFansGroupState_ != null; + } + /** + * .LiveFansGroupState liveFansGroupState = 6; + * @return The liveFansGroupState. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState getLiveFansGroupState() { + return liveFansGroupState_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.getDefaultInstance() : liveFansGroupState_; + } + /** + * .LiveFansGroupState liveFansGroupState = 6; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupStateOrBuilder getLiveFansGroupStateOrBuilder() { + return liveFansGroupState_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.getDefaultInstance() : liveFansGroupState_; + } + + public static final int WEALTHGRADE_FIELD_NUMBER = 7; + private int wealthGrade_ = 0; + /** + * uint32 wealthGrade = 7; + * @return The wealthGrade. + */ + @java.lang.Override + public int getWealthGrade() { + return wealthGrade_; + } + + public static final int BADGEKEY_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private volatile java.lang.Object badgeKey_ = ""; + /** + * string badgeKey = 8; + * @return The badgeKey. + */ + @java.lang.Override + public java.lang.String getBadgeKey() { + java.lang.Object ref = badgeKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + badgeKey_ = s; + return s; + } + } + /** + * string badgeKey = 8; + * @return The bytes for badgeKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBadgeKeyBytes() { + java.lang.Object ref = badgeKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + badgeKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (isFromFansTop_ != false) { + output.writeBool(1, isFromFansTop_); + } + if (isKoi_ != false) { + output.writeBool(2, isKoi_); + } + if (assistantType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.AssistantType.UNKNOWN_ASSISTANT_TYPE.getNumber()) { + output.writeEnum(3, assistantType_); + } + if (fansGroupIntimacyLevel_ != 0) { + output.writeUInt32(4, fansGroupIntimacyLevel_); + } + if (nameplate_ != null) { + output.writeMessage(5, getNameplate()); + } + if (liveFansGroupState_ != null) { + output.writeMessage(6, getLiveFansGroupState()); + } + if (wealthGrade_ != 0) { + output.writeUInt32(7, wealthGrade_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(badgeKey_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, badgeKey_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (isFromFansTop_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, isFromFansTop_); + } + if (isKoi_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, isKoi_); + } + if (assistantType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.AssistantType.UNKNOWN_ASSISTANT_TYPE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, assistantType_); + } + if (fansGroupIntimacyLevel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, fansGroupIntimacyLevel_); + } + if (nameplate_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getNameplate()); + } + if (liveFansGroupState_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getLiveFansGroupState()); + } + if (wealthGrade_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(7, wealthGrade_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(badgeKey_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, badgeKey_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState) obj; + + if (getIsFromFansTop() + != other.getIsFromFansTop()) return false; + if (getIsKoi() + != other.getIsKoi()) return false; + if (assistantType_ != other.assistantType_) return false; + if (getFansGroupIntimacyLevel() + != other.getFansGroupIntimacyLevel()) return false; + if (hasNameplate() != other.hasNameplate()) return false; + if (hasNameplate()) { + if (!getNameplate() + .equals(other.getNameplate())) return false; + } + if (hasLiveFansGroupState() != other.hasLiveFansGroupState()) return false; + if (hasLiveFansGroupState()) { + if (!getLiveFansGroupState() + .equals(other.getLiveFansGroupState())) return false; + } + if (getWealthGrade() + != other.getWealthGrade()) return false; + if (!getBadgeKey() + .equals(other.getBadgeKey())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ISFROMFANSTOP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsFromFansTop()); + hash = (37 * hash) + ISKOI_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsKoi()); + hash = (37 * hash) + ASSISTANTTYPE_FIELD_NUMBER; + hash = (53 * hash) + assistantType_; + hash = (37 * hash) + FANSGROUPINTIMACYLEVEL_FIELD_NUMBER; + hash = (53 * hash) + getFansGroupIntimacyLevel(); + if (hasNameplate()) { + hash = (37 * hash) + NAMEPLATE_FIELD_NUMBER; + hash = (53 * hash) + getNameplate().hashCode(); + } + if (hasLiveFansGroupState()) { + hash = (37 * hash) + LIVEFANSGROUPSTATE_FIELD_NUMBER; + hash = (53 * hash) + getLiveFansGroupState().hashCode(); + } + hash = (37 * hash) + WEALTHGRADE_FIELD_NUMBER; + hash = (53 * hash) + getWealthGrade(); + hash = (37 * hash) + BADGEKEY_FIELD_NUMBER; + hash = (53 * hash) + getBadgeKey().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code LiveAudienceState} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:LiveAudienceState) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceStateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.internal_static_LiveAudienceState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.internal_static_LiveAudienceState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + isFromFansTop_ = false; + isKoi_ = false; + assistantType_ = 0; + fansGroupIntimacyLevel_ = 0; + nameplate_ = null; + if (nameplateBuilder_ != null) { + nameplateBuilder_.dispose(); + nameplateBuilder_ = null; + } + liveFansGroupState_ = null; + if (liveFansGroupStateBuilder_ != null) { + liveFansGroupStateBuilder_.dispose(); + liveFansGroupStateBuilder_ = null; + } + wealthGrade_ = 0; + badgeKey_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.internal_static_LiveAudienceState_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.isFromFansTop_ = isFromFansTop_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.isKoi_ = isKoi_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.assistantType_ = assistantType_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.fansGroupIntimacyLevel_ = fansGroupIntimacyLevel_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.nameplate_ = nameplateBuilder_ == null + ? nameplate_ + : nameplateBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.liveFansGroupState_ = liveFansGroupStateBuilder_ == null + ? liveFansGroupState_ + : liveFansGroupStateBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.wealthGrade_ = wealthGrade_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.badgeKey_ = badgeKey_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.getDefaultInstance()) return this; + if (other.getIsFromFansTop() != false) { + setIsFromFansTop(other.getIsFromFansTop()); + } + if (other.getIsKoi() != false) { + setIsKoi(other.getIsKoi()); + } + if (other.assistantType_ != 0) { + setAssistantTypeValue(other.getAssistantTypeValue()); + } + if (other.getFansGroupIntimacyLevel() != 0) { + setFansGroupIntimacyLevel(other.getFansGroupIntimacyLevel()); + } + if (other.hasNameplate()) { + mergeNameplate(other.getNameplate()); + } + if (other.hasLiveFansGroupState()) { + mergeLiveFansGroupState(other.getLiveFansGroupState()); + } + if (other.getWealthGrade() != 0) { + setWealthGrade(other.getWealthGrade()); + } + if (!other.getBadgeKey().isEmpty()) { + badgeKey_ = other.badgeKey_; + bitField0_ |= 0x00000080; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + isFromFansTop_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + isKoi_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + assistantType_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + fansGroupIntimacyLevel_ = input.readUInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + input.readMessage( + getNameplateFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + input.readMessage( + getLiveFansGroupStateFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: { + wealthGrade_ = input.readUInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 66: { + badgeKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean isFromFansTop_ ; + /** + * bool isFromFansTop = 1; + * @return The isFromFansTop. + */ + @java.lang.Override + public boolean getIsFromFansTop() { + return isFromFansTop_; + } + /** + * bool isFromFansTop = 1; + * @param value The isFromFansTop to set. + * @return This builder for chaining. + */ + public Builder setIsFromFansTop(boolean value) { + + isFromFansTop_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bool isFromFansTop = 1; + * @return This builder for chaining. + */ + public Builder clearIsFromFansTop() { + bitField0_ = (bitField0_ & ~0x00000001); + isFromFansTop_ = false; + onChanged(); + return this; + } + + private boolean isKoi_ ; + /** + * bool isKoi = 2; + * @return The isKoi. + */ + @java.lang.Override + public boolean getIsKoi() { + return isKoi_; + } + /** + * bool isKoi = 2; + * @param value The isKoi to set. + * @return This builder for chaining. + */ + public Builder setIsKoi(boolean value) { + + isKoi_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * bool isKoi = 2; + * @return This builder for chaining. + */ + public Builder clearIsKoi() { + bitField0_ = (bitField0_ & ~0x00000002); + isKoi_ = false; + onChanged(); + return this; + } + + private int assistantType_ = 0; + /** + * .LiveAudienceState.AssistantType assistantType = 3; + * @return The enum numeric value on the wire for assistantType. + */ + @java.lang.Override public int getAssistantTypeValue() { + return assistantType_; + } + /** + * .LiveAudienceState.AssistantType assistantType = 3; + * @param value The enum numeric value on the wire for assistantType to set. + * @return This builder for chaining. + */ + public Builder setAssistantTypeValue(int value) { + assistantType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .LiveAudienceState.AssistantType assistantType = 3; + * @return The assistantType. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.AssistantType getAssistantType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.AssistantType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.AssistantType.forNumber(assistantType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.AssistantType.UNRECOGNIZED : result; + } + /** + * .LiveAudienceState.AssistantType assistantType = 3; + * @param value The assistantType to set. + * @return This builder for chaining. + */ + public Builder setAssistantType(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.AssistantType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + assistantType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .LiveAudienceState.AssistantType assistantType = 3; + * @return This builder for chaining. + */ + public Builder clearAssistantType() { + bitField0_ = (bitField0_ & ~0x00000004); + assistantType_ = 0; + onChanged(); + return this; + } + + private int fansGroupIntimacyLevel_ ; + /** + * uint32 fansGroupIntimacyLevel = 4; + * @return The fansGroupIntimacyLevel. + */ + @java.lang.Override + public int getFansGroupIntimacyLevel() { + return fansGroupIntimacyLevel_; + } + /** + * uint32 fansGroupIntimacyLevel = 4; + * @param value The fansGroupIntimacyLevel to set. + * @return This builder for chaining. + */ + public Builder setFansGroupIntimacyLevel(int value) { + + fansGroupIntimacyLevel_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint32 fansGroupIntimacyLevel = 4; + * @return This builder for chaining. + */ + public Builder clearFansGroupIntimacyLevel() { + bitField0_ = (bitField0_ & ~0x00000008); + fansGroupIntimacyLevel_ = 0; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate nameplate_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplateOrBuilder> nameplateBuilder_; + /** + * .GzoneNameplate nameplate = 5; + * @return Whether the nameplate field is set. + */ + public boolean hasNameplate() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * .GzoneNameplate nameplate = 5; + * @return The nameplate. + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate getNameplate() { + if (nameplateBuilder_ == null) { + return nameplate_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.getDefaultInstance() : nameplate_; + } else { + return nameplateBuilder_.getMessage(); + } + } + /** + * .GzoneNameplate nameplate = 5; + */ + public Builder setNameplate(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate value) { + if (nameplateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + nameplate_ = value; + } else { + nameplateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .GzoneNameplate nameplate = 5; + */ + public Builder setNameplate( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.Builder builderForValue) { + if (nameplateBuilder_ == null) { + nameplate_ = builderForValue.build(); + } else { + nameplateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .GzoneNameplate nameplate = 5; + */ + public Builder mergeNameplate(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate value) { + if (nameplateBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + nameplate_ != null && + nameplate_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.getDefaultInstance()) { + getNameplateBuilder().mergeFrom(value); + } else { + nameplate_ = value; + } + } else { + nameplateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .GzoneNameplate nameplate = 5; + */ + public Builder clearNameplate() { + bitField0_ = (bitField0_ & ~0x00000010); + nameplate_ = null; + if (nameplateBuilder_ != null) { + nameplateBuilder_.dispose(); + nameplateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .GzoneNameplate nameplate = 5; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.Builder getNameplateBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getNameplateFieldBuilder().getBuilder(); + } + /** + * .GzoneNameplate nameplate = 5; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplateOrBuilder getNameplateOrBuilder() { + if (nameplateBuilder_ != null) { + return nameplateBuilder_.getMessageOrBuilder(); + } else { + return nameplate_ == null ? + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.getDefaultInstance() : nameplate_; + } + } + /** + * .GzoneNameplate nameplate = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplateOrBuilder> + getNameplateFieldBuilder() { + if (nameplateBuilder_ == null) { + nameplateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplate.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.GzoneNameplateOrBuilder>( + getNameplate(), + getParentForChildren(), + isClean()); + nameplate_ = null; + } + return nameplateBuilder_; + } + + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState liveFansGroupState_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupStateOrBuilder> liveFansGroupStateBuilder_; + /** + * .LiveFansGroupState liveFansGroupState = 6; + * @return Whether the liveFansGroupState field is set. + */ + public boolean hasLiveFansGroupState() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * .LiveFansGroupState liveFansGroupState = 6; + * @return The liveFansGroupState. + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState getLiveFansGroupState() { + if (liveFansGroupStateBuilder_ == null) { + return liveFansGroupState_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.getDefaultInstance() : liveFansGroupState_; + } else { + return liveFansGroupStateBuilder_.getMessage(); + } + } + /** + * .LiveFansGroupState liveFansGroupState = 6; + */ + public Builder setLiveFansGroupState(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState value) { + if (liveFansGroupStateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + liveFansGroupState_ = value; + } else { + liveFansGroupStateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * .LiveFansGroupState liveFansGroupState = 6; + */ + public Builder setLiveFansGroupState( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.Builder builderForValue) { + if (liveFansGroupStateBuilder_ == null) { + liveFansGroupState_ = builderForValue.build(); + } else { + liveFansGroupStateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * .LiveFansGroupState liveFansGroupState = 6; + */ + public Builder mergeLiveFansGroupState(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState value) { + if (liveFansGroupStateBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + liveFansGroupState_ != null && + liveFansGroupState_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.getDefaultInstance()) { + getLiveFansGroupStateBuilder().mergeFrom(value); + } else { + liveFansGroupState_ = value; + } + } else { + liveFansGroupStateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * .LiveFansGroupState liveFansGroupState = 6; + */ + public Builder clearLiveFansGroupState() { + bitField0_ = (bitField0_ & ~0x00000020); + liveFansGroupState_ = null; + if (liveFansGroupStateBuilder_ != null) { + liveFansGroupStateBuilder_.dispose(); + liveFansGroupStateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .LiveFansGroupState liveFansGroupState = 6; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.Builder getLiveFansGroupStateBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getLiveFansGroupStateFieldBuilder().getBuilder(); + } + /** + * .LiveFansGroupState liveFansGroupState = 6; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupStateOrBuilder getLiveFansGroupStateOrBuilder() { + if (liveFansGroupStateBuilder_ != null) { + return liveFansGroupStateBuilder_.getMessageOrBuilder(); + } else { + return liveFansGroupState_ == null ? + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.getDefaultInstance() : liveFansGroupState_; + } + } + /** + * .LiveFansGroupState liveFansGroupState = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupStateOrBuilder> + getLiveFansGroupStateFieldBuilder() { + if (liveFansGroupStateBuilder_ == null) { + liveFansGroupStateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupStateOrBuilder>( + getLiveFansGroupState(), + getParentForChildren(), + isClean()); + liveFansGroupState_ = null; + } + return liveFansGroupStateBuilder_; + } + + private int wealthGrade_ ; + /** + * uint32 wealthGrade = 7; + * @return The wealthGrade. + */ + @java.lang.Override + public int getWealthGrade() { + return wealthGrade_; + } + /** + * uint32 wealthGrade = 7; + * @param value The wealthGrade to set. + * @return This builder for chaining. + */ + public Builder setWealthGrade(int value) { + + wealthGrade_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * uint32 wealthGrade = 7; + * @return This builder for chaining. + */ + public Builder clearWealthGrade() { + bitField0_ = (bitField0_ & ~0x00000040); + wealthGrade_ = 0; + onChanged(); + return this; + } + + private java.lang.Object badgeKey_ = ""; + /** + * string badgeKey = 8; + * @return The badgeKey. + */ + public java.lang.String getBadgeKey() { + java.lang.Object ref = badgeKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + badgeKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string badgeKey = 8; + * @return The bytes for badgeKey. + */ + public com.google.protobuf.ByteString + getBadgeKeyBytes() { + java.lang.Object ref = badgeKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + badgeKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string badgeKey = 8; + * @param value The badgeKey to set. + * @return This builder for chaining. + */ + public Builder setBadgeKey( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + badgeKey_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * string badgeKey = 8; + * @return This builder for chaining. + */ + public Builder clearBadgeKey() { + badgeKey_ = getDefaultInstance().getBadgeKey(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * string badgeKey = 8; + * @param value The bytes for badgeKey to set. + * @return This builder for chaining. + */ + public Builder setBadgeKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + badgeKey_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:LiveAudienceState) + } + + // @@protoc_insertion_point(class_scope:LiveAudienceState) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LiveAudienceState parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_LiveAudienceState_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_LiveAudienceState_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\027LiveAudienceState.proto\032\024GzoneNameplat" + + "e.proto\032\030LiveFansGroupState.proto\"\322\002\n\021Li" + + "veAudienceState\022\025\n\risFromFansTop\030\001 \001(\010\022\r" + + "\n\005isKoi\030\002 \001(\010\0227\n\rassistantType\030\003 \001(\0162 .L" + + "iveAudienceState.AssistantType\022\036\n\026fansGr" + + "oupIntimacyLevel\030\004 \001(\r\022\"\n\tnameplate\030\005 \001(" + + "\0132\017.GzoneNameplate\022/\n\022liveFansGroupState" + + "\030\006 \001(\0132\023.LiveFansGroupState\022\023\n\013wealthGra" + + "de\030\007 \001(\r\022\020\n\010badgeKey\030\010 \001(\t\"B\n\rAssistantT" + + "ype\022\032\n\026UNKNOWN_ASSISTANT_TYPE\020\000\022\t\n\005SUPER" + + "\020\001\022\n\n\006JUNIOR\020\002B6\n4tech.ordinaryroad.live" + + ".chat.client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.getDescriptor(), + }); + internal_static_LiveAudienceState_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_LiveAudienceState_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_LiveAudienceState_descriptor, + new java.lang.String[] { "IsFromFansTop", "IsKoi", "AssistantType", "FansGroupIntimacyLevel", "Nameplate", "LiveFansGroupState", "WealthGrade", "BadgeKey", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.GzoneNameplateOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/LiveCdnNodeViewOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/LiveCdnNodeViewOuterClass.java new file mode 100644 index 0000000..683bf82 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/LiveCdnNodeViewOuterClass.java @@ -0,0 +1,846 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: LiveCdnNodeView.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class LiveCdnNodeViewOuterClass { + private LiveCdnNodeViewOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface LiveCdnNodeViewOrBuilder extends + // @@protoc_insertion_point(interface_extends:LiveCdnNodeView) + com.google.protobuf.MessageOrBuilder { + + /** + * string cdn = 1; + * @return The cdn. + */ + java.lang.String getCdn(); + /** + * string cdn = 1; + * @return The bytes for cdn. + */ + com.google.protobuf.ByteString + getCdnBytes(); + + /** + * string url = 2; + * @return The url. + */ + java.lang.String getUrl(); + /** + * string url = 2; + * @return The bytes for url. + */ + com.google.protobuf.ByteString + getUrlBytes(); + + /** + * bool freeTraffic = 3; + * @return The freeTraffic. + */ + boolean getFreeTraffic(); + } + /** + * Protobuf type {@code LiveCdnNodeView} + */ + public static final class LiveCdnNodeView extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:LiveCdnNodeView) + LiveCdnNodeViewOrBuilder { + private static final long serialVersionUID = 0L; + // Use LiveCdnNodeView.newBuilder() to construct. + private LiveCdnNodeView(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LiveCdnNodeView() { + cdn_ = ""; + url_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LiveCdnNodeView(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.internal_static_LiveCdnNodeView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.internal_static_LiveCdnNodeView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.Builder.class); + } + + public static final int CDN_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object cdn_ = ""; + /** + * string cdn = 1; + * @return The cdn. + */ + @java.lang.Override + public java.lang.String getCdn() { + java.lang.Object ref = cdn_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cdn_ = s; + return s; + } + } + /** + * string cdn = 1; + * @return The bytes for cdn. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCdnBytes() { + java.lang.Object ref = cdn_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cdn_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URL_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object url_ = ""; + /** + * string url = 2; + * @return The url. + */ + @java.lang.Override + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } + } + /** + * string url = 2; + * @return The bytes for url. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FREETRAFFIC_FIELD_NUMBER = 3; + private boolean freeTraffic_ = false; + /** + * bool freeTraffic = 3; + * @return The freeTraffic. + */ + @java.lang.Override + public boolean getFreeTraffic() { + return freeTraffic_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cdn_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cdn_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(url_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, url_); + } + if (freeTraffic_ != false) { + output.writeBool(3, freeTraffic_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cdn_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cdn_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(url_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, url_); + } + if (freeTraffic_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, freeTraffic_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView) obj; + + if (!getCdn() + .equals(other.getCdn())) return false; + if (!getUrl() + .equals(other.getUrl())) return false; + if (getFreeTraffic() + != other.getFreeTraffic()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CDN_FIELD_NUMBER; + hash = (53 * hash) + getCdn().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (37 * hash) + FREETRAFFIC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFreeTraffic()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code LiveCdnNodeView} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:LiveCdnNodeView) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeViewOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.internal_static_LiveCdnNodeView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.internal_static_LiveCdnNodeView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cdn_ = ""; + url_ = ""; + freeTraffic_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.internal_static_LiveCdnNodeView_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cdn_ = cdn_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.url_ = url_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.freeTraffic_ = freeTraffic_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView.getDefaultInstance()) return this; + if (!other.getCdn().isEmpty()) { + cdn_ = other.cdn_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getFreeTraffic() != false) { + setFreeTraffic(other.getFreeTraffic()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + cdn_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + url_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + freeTraffic_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object cdn_ = ""; + /** + * string cdn = 1; + * @return The cdn. + */ + public java.lang.String getCdn() { + java.lang.Object ref = cdn_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cdn_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string cdn = 1; + * @return The bytes for cdn. + */ + public com.google.protobuf.ByteString + getCdnBytes() { + java.lang.Object ref = cdn_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cdn_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string cdn = 1; + * @param value The cdn to set. + * @return This builder for chaining. + */ + public Builder setCdn( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + cdn_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string cdn = 1; + * @return This builder for chaining. + */ + public Builder clearCdn() { + cdn_ = getDefaultInstance().getCdn(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string cdn = 1; + * @param value The bytes for cdn to set. + * @return This builder for chaining. + */ + public Builder setCdnBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + cdn_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object url_ = ""; + /** + * string url = 2; + * @return The url. + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string url = 2; + * @return The bytes for url. + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string url = 2; + * @param value The url to set. + * @return This builder for chaining. + */ + public Builder setUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + url_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string url = 2; + * @return This builder for chaining. + */ + public Builder clearUrl() { + url_ = getDefaultInstance().getUrl(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string url = 2; + * @param value The bytes for url to set. + * @return This builder for chaining. + */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + url_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean freeTraffic_ ; + /** + * bool freeTraffic = 3; + * @return The freeTraffic. + */ + @java.lang.Override + public boolean getFreeTraffic() { + return freeTraffic_; + } + /** + * bool freeTraffic = 3; + * @param value The freeTraffic to set. + * @return This builder for chaining. + */ + public Builder setFreeTraffic(boolean value) { + + freeTraffic_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * bool freeTraffic = 3; + * @return This builder for chaining. + */ + public Builder clearFreeTraffic() { + bitField0_ = (bitField0_ & ~0x00000004); + freeTraffic_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:LiveCdnNodeView) + } + + // @@protoc_insertion_point(class_scope:LiveCdnNodeView) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LiveCdnNodeView parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveCdnNodeViewOuterClass.LiveCdnNodeView getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_LiveCdnNodeView_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_LiveCdnNodeView_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\025LiveCdnNodeView.proto\"@\n\017LiveCdnNodeVi" + + "ew\022\013\n\003cdn\030\001 \001(\t\022\013\n\003url\030\002 \001(\t\022\023\n\013freeTraf" + + "fic\030\003 \001(\010B6\n4tech.ordinaryroad.live.chat" + + ".client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_LiveCdnNodeView_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_LiveCdnNodeView_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_LiveCdnNodeView_descriptor, + new java.lang.String[] { "Cdn", "Url", "FreeTraffic", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/LiveFansGroupStateOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/LiveFansGroupStateOuterClass.java new file mode 100644 index 0000000..6ba076f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/LiveFansGroupStateOuterClass.java @@ -0,0 +1,622 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: LiveFansGroupState.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class LiveFansGroupStateOuterClass { + private LiveFansGroupStateOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface LiveFansGroupStateOrBuilder extends + // @@protoc_insertion_point(interface_extends:LiveFansGroupState) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 intimacyLevel = 1; + * @return The intimacyLevel. + */ + int getIntimacyLevel(); + + /** + * uint32 enterRoomSpecialEffect = 2; + * @return The enterRoomSpecialEffect. + */ + int getEnterRoomSpecialEffect(); + } + /** + * Protobuf type {@code LiveFansGroupState} + */ + public static final class LiveFansGroupState extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:LiveFansGroupState) + LiveFansGroupStateOrBuilder { + private static final long serialVersionUID = 0L; + // Use LiveFansGroupState.newBuilder() to construct. + private LiveFansGroupState(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LiveFansGroupState() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LiveFansGroupState(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.internal_static_LiveFansGroupState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.internal_static_LiveFansGroupState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.Builder.class); + } + + public static final int INTIMACYLEVEL_FIELD_NUMBER = 1; + private int intimacyLevel_ = 0; + /** + * uint32 intimacyLevel = 1; + * @return The intimacyLevel. + */ + @java.lang.Override + public int getIntimacyLevel() { + return intimacyLevel_; + } + + public static final int ENTERROOMSPECIALEFFECT_FIELD_NUMBER = 2; + private int enterRoomSpecialEffect_ = 0; + /** + * uint32 enterRoomSpecialEffect = 2; + * @return The enterRoomSpecialEffect. + */ + @java.lang.Override + public int getEnterRoomSpecialEffect() { + return enterRoomSpecialEffect_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (intimacyLevel_ != 0) { + output.writeUInt32(1, intimacyLevel_); + } + if (enterRoomSpecialEffect_ != 0) { + output.writeUInt32(2, enterRoomSpecialEffect_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (intimacyLevel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, intimacyLevel_); + } + if (enterRoomSpecialEffect_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, enterRoomSpecialEffect_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState) obj; + + if (getIntimacyLevel() + != other.getIntimacyLevel()) return false; + if (getEnterRoomSpecialEffect() + != other.getEnterRoomSpecialEffect()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + INTIMACYLEVEL_FIELD_NUMBER; + hash = (53 * hash) + getIntimacyLevel(); + hash = (37 * hash) + ENTERROOMSPECIALEFFECT_FIELD_NUMBER; + hash = (53 * hash) + getEnterRoomSpecialEffect(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code LiveFansGroupState} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:LiveFansGroupState) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupStateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.internal_static_LiveFansGroupState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.internal_static_LiveFansGroupState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + intimacyLevel_ = 0; + enterRoomSpecialEffect_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.internal_static_LiveFansGroupState_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.intimacyLevel_ = intimacyLevel_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.enterRoomSpecialEffect_ = enterRoomSpecialEffect_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState.getDefaultInstance()) return this; + if (other.getIntimacyLevel() != 0) { + setIntimacyLevel(other.getIntimacyLevel()); + } + if (other.getEnterRoomSpecialEffect() != 0) { + setEnterRoomSpecialEffect(other.getEnterRoomSpecialEffect()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + intimacyLevel_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + enterRoomSpecialEffect_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int intimacyLevel_ ; + /** + * uint32 intimacyLevel = 1; + * @return The intimacyLevel. + */ + @java.lang.Override + public int getIntimacyLevel() { + return intimacyLevel_; + } + /** + * uint32 intimacyLevel = 1; + * @param value The intimacyLevel to set. + * @return This builder for chaining. + */ + public Builder setIntimacyLevel(int value) { + + intimacyLevel_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint32 intimacyLevel = 1; + * @return This builder for chaining. + */ + public Builder clearIntimacyLevel() { + bitField0_ = (bitField0_ & ~0x00000001); + intimacyLevel_ = 0; + onChanged(); + return this; + } + + private int enterRoomSpecialEffect_ ; + /** + * uint32 enterRoomSpecialEffect = 2; + * @return The enterRoomSpecialEffect. + */ + @java.lang.Override + public int getEnterRoomSpecialEffect() { + return enterRoomSpecialEffect_; + } + /** + * uint32 enterRoomSpecialEffect = 2; + * @param value The enterRoomSpecialEffect to set. + * @return This builder for chaining. + */ + public Builder setEnterRoomSpecialEffect(int value) { + + enterRoomSpecialEffect_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint32 enterRoomSpecialEffect = 2; + * @return This builder for chaining. + */ + public Builder clearEnterRoomSpecialEffect() { + bitField0_ = (bitField0_ & ~0x00000002); + enterRoomSpecialEffect_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:LiveFansGroupState) + } + + // @@protoc_insertion_point(class_scope:LiveFansGroupState) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LiveFansGroupState parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveFansGroupStateOuterClass.LiveFansGroupState getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_LiveFansGroupState_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_LiveFansGroupState_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\030LiveFansGroupState.proto\"K\n\022LiveFansGr" + + "oupState\022\025\n\rintimacyLevel\030\001 \001(\r\022\036\n\026enter" + + "RoomSpecialEffect\030\002 \001(\rB6\n4tech.ordinary" + + "road.live.chat.client.kuaishou.protobufb" + + "\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_LiveFansGroupState_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_LiveFansGroupState_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_LiveFansGroupState_descriptor, + new java.lang.String[] { "IntimacyLevel", "EnterRoomSpecialEffect", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/PSHostInfoOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/PSHostInfoOuterClass.java new file mode 100644 index 0000000..73bc328 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/PSHostInfoOuterClass.java @@ -0,0 +1,697 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: PSHostInfo.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class PSHostInfoOuterClass { + private PSHostInfoOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface PSHostInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:PSHostInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * string ip = 1; + * @return The ip. + */ + java.lang.String getIp(); + /** + * string ip = 1; + * @return The bytes for ip. + */ + com.google.protobuf.ByteString + getIpBytes(); + + /** + * int32 port = 2; + * @return The port. + */ + int getPort(); + } + /** + * Protobuf type {@code PSHostInfo} + */ + public static final class PSHostInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:PSHostInfo) + PSHostInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use PSHostInfo.newBuilder() to construct. + private PSHostInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PSHostInfo() { + ip_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PSHostInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.internal_static_PSHostInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.internal_static_PSHostInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo.Builder.class); + } + + public static final int IP_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object ip_ = ""; + /** + * string ip = 1; + * @return The ip. + */ + @java.lang.Override + public java.lang.String getIp() { + java.lang.Object ref = ip_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ip_ = s; + return s; + } + } + /** + * string ip = 1; + * @return The bytes for ip. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIpBytes() { + java.lang.Object ref = ip_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ip_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PORT_FIELD_NUMBER = 2; + private int port_ = 0; + /** + * int32 port = 2; + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ip_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ip_); + } + if (port_ != 0) { + output.writeInt32(2, port_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ip_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ip_); + } + if (port_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, port_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo) obj; + + if (!getIp() + .equals(other.getIp())) return false; + if (getPort() + != other.getPort()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + IP_FIELD_NUMBER; + hash = (53 * hash) + getIp().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code PSHostInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:PSHostInfo) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.internal_static_PSHostInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.internal_static_PSHostInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + ip_ = ""; + port_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.internal_static_PSHostInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ip_ = ip_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.port_ = port_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo.getDefaultInstance()) return this; + if (!other.getIp().isEmpty()) { + ip_ = other.ip_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPort() != 0) { + setPort(other.getPort()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + ip_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + port_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object ip_ = ""; + /** + * string ip = 1; + * @return The ip. + */ + public java.lang.String getIp() { + java.lang.Object ref = ip_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ip_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string ip = 1; + * @return The bytes for ip. + */ + public com.google.protobuf.ByteString + getIpBytes() { + java.lang.Object ref = ip_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ip_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string ip = 1; + * @param value The ip to set. + * @return This builder for chaining. + */ + public Builder setIp( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ip_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string ip = 1; + * @return This builder for chaining. + */ + public Builder clearIp() { + ip_ = getDefaultInstance().getIp(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string ip = 1; + * @param value The bytes for ip to set. + * @return This builder for chaining. + */ + public Builder setIpBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ip_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int port_ ; + /** + * int32 port = 2; + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + /** + * int32 port = 2; + * @param value The port to set. + * @return This builder for chaining. + */ + public Builder setPort(int value) { + + port_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 port = 2; + * @return This builder for chaining. + */ + public Builder clearPort() { + bitField0_ = (bitField0_ & ~0x00000002); + port_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:PSHostInfo) + } + + // @@protoc_insertion_point(class_scope:PSHostInfo) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PSHostInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PSHostInfoOuterClass.PSHostInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_PSHostInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_PSHostInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\020PSHostInfo.proto\"&\n\nPSHostInfo\022\n\n\002ip\030\001" + + " \001(\t\022\014\n\004port\030\002 \001(\005B6\n4tech.ordinaryroad." + + "live.chat.client.kuaishou.protobufb\006prot" + + "o3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_PSHostInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_PSHostInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_PSHostInfo_descriptor, + new java.lang.String[] { "Ip", "Port", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/PayloadTypeOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/PayloadTypeOuterClass.java new file mode 100644 index 0000000..5711bf4 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/PayloadTypeOuterClass.java @@ -0,0 +1,708 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: PayloadType.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class PayloadTypeOuterClass { + private PayloadTypeOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code PayloadType} + */ + public enum PayloadType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + * CS_HEARTBEAT = 1; + */ + CS_HEARTBEAT(1), + /** + * CS_ERROR = 3; + */ + CS_ERROR(3), + /** + * CS_PING = 4; + */ + CS_PING(4), + /** + * PS_HOST_INFO = 51; + */ + PS_HOST_INFO(51), + /** + * SC_HEARTBEAT_ACK = 101; + */ + SC_HEARTBEAT_ACK(101), + /** + * SC_ECHO = 102; + */ + SC_ECHO(102), + /** + * SC_ERROR = 103; + */ + SC_ERROR(103), + /** + * SC_PING_ACK = 104; + */ + SC_PING_ACK(104), + /** + * SC_INFO = 105; + */ + SC_INFO(105), + /** + * CS_ENTER_ROOM = 200; + */ + CS_ENTER_ROOM(200), + /** + * CS_USER_PAUSE = 201; + */ + CS_USER_PAUSE(201), + /** + * CS_USER_EXIT = 202; + */ + CS_USER_EXIT(202), + /** + * CS_AUTHOR_PUSH_TRAFFIC_ZERO = 203; + */ + CS_AUTHOR_PUSH_TRAFFIC_ZERO(203), + /** + * CS_HORSE_RACING = 204; + */ + CS_HORSE_RACING(204), + /** + * CS_RACE_LOSE = 205; + */ + CS_RACE_LOSE(205), + /** + * CS_VOIP_SIGNAL = 206; + */ + CS_VOIP_SIGNAL(206), + /** + * SC_ENTER_ROOM_ACK = 300; + */ + SC_ENTER_ROOM_ACK(300), + /** + * SC_AUTHOR_PAUSE = 301; + */ + SC_AUTHOR_PAUSE(301), + /** + * SC_AUTHOR_RESUME = 302; + */ + SC_AUTHOR_RESUME(302), + /** + * SC_AUTHOR_PUSH_TRAFFIC_ZERO = 303; + */ + SC_AUTHOR_PUSH_TRAFFIC_ZERO(303), + /** + * SC_AUTHOR_HEARTBEAT_MISS = 304; + */ + SC_AUTHOR_HEARTBEAT_MISS(304), + /** + * SC_PIP_STARTED = 305; + */ + SC_PIP_STARTED(305), + /** + * SC_PIP_ENDED = 306; + */ + SC_PIP_ENDED(306), + /** + * SC_HORSE_RACING_ACK = 307; + */ + SC_HORSE_RACING_ACK(307), + /** + * SC_VOIP_SIGNAL = 308; + */ + SC_VOIP_SIGNAL(308), + /** + * SC_FEED_PUSH = 310; + */ + SC_FEED_PUSH(310), + /** + * SC_ASSISTANT_STATUS = 311; + */ + SC_ASSISTANT_STATUS(311), + /** + * SC_REFRESH_WALLET = 312; + */ + SC_REFRESH_WALLET(312), + /** + * SC_LIVE_CHAT_CALL = 320; + */ + SC_LIVE_CHAT_CALL(320), + /** + * SC_LIVE_CHAT_CALL_ACCEPTED = 321; + */ + SC_LIVE_CHAT_CALL_ACCEPTED(321), + /** + * SC_LIVE_CHAT_CALL_REJECTED = 322; + */ + SC_LIVE_CHAT_CALL_REJECTED(322), + /** + * SC_LIVE_CHAT_READY = 323; + */ + SC_LIVE_CHAT_READY(323), + /** + * SC_LIVE_CHAT_GUEST_END = 324; + */ + SC_LIVE_CHAT_GUEST_END(324), + /** + * SC_LIVE_CHAT_ENDED = 325; + */ + SC_LIVE_CHAT_ENDED(325), + /** + * SC_RENDERING_MAGIC_FACE_DISABLE = 326; + */ + SC_RENDERING_MAGIC_FACE_DISABLE(326), + /** + * SC_RENDERING_MAGIC_FACE_ENABLE = 327; + */ + SC_RENDERING_MAGIC_FACE_ENABLE(327), + /** + * SC_RED_PACK_FEED = 330; + */ + SC_RED_PACK_FEED(330), + /** + * SC_LIVE_WATCHING_LIST = 340; + */ + SC_LIVE_WATCHING_LIST(340), + /** + * SC_LIVE_QUIZ_QUESTION_ASKED = 350; + */ + SC_LIVE_QUIZ_QUESTION_ASKED(350), + /** + * SC_LIVE_QUIZ_QUESTION_REVIEWED = 351; + */ + SC_LIVE_QUIZ_QUESTION_REVIEWED(351), + /** + * SC_LIVE_QUIZ_SYNC = 352; + */ + SC_LIVE_QUIZ_SYNC(352), + /** + * SC_LIVE_QUIZ_ENDED = 353; + */ + SC_LIVE_QUIZ_ENDED(353), + /** + * SC_LIVE_QUIZ_WINNERS = 354; + */ + SC_LIVE_QUIZ_WINNERS(354), + /** + * SC_SUSPECTED_VIOLATION = 355; + */ + SC_SUSPECTED_VIOLATION(355), + /** + * SC_SHOP_OPENED = 360; + */ + SC_SHOP_OPENED(360), + /** + * SC_SHOP_CLOSED = 361; + */ + SC_SHOP_CLOSED(361), + /** + * SC_GUESS_OPENED = 370; + */ + SC_GUESS_OPENED(370), + /** + * SC_GUESS_CLOSED = 371; + */ + SC_GUESS_CLOSED(371), + /** + * SC_PK_INVITATION = 380; + */ + SC_PK_INVITATION(380), + /** + * SC_PK_STATISTIC = 381; + */ + SC_PK_STATISTIC(381), + /** + * SC_RIDDLE_OPENED = 390; + */ + SC_RIDDLE_OPENED(390), + /** + * SC_RIDDLE_CLOESED = 391; + */ + SC_RIDDLE_CLOESED(391), + /** + * SC_RIDE_CHANGED = 412; + */ + SC_RIDE_CHANGED(412), + /** + * SC_BET_CHANGED = 441; + */ + SC_BET_CHANGED(441), + /** + * SC_BET_CLOSED = 442; + */ + SC_BET_CLOSED(442), + /** + * SC_LIVE_SPECIAL_ACCOUNT_CONFIG_STATE = 645; + */ + SC_LIVE_SPECIAL_ACCOUNT_CONFIG_STATE(645), + /** + * SC_LIVE_WARNING_MASK_STATUS_CHANGED_AUDIENCE = 758; + */ + SC_LIVE_WARNING_MASK_STATUS_CHANGED_AUDIENCE(758), + UNRECOGNIZED(-1), + ; + + /** + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + * CS_HEARTBEAT = 1; + */ + public static final int CS_HEARTBEAT_VALUE = 1; + /** + * CS_ERROR = 3; + */ + public static final int CS_ERROR_VALUE = 3; + /** + * CS_PING = 4; + */ + public static final int CS_PING_VALUE = 4; + /** + * PS_HOST_INFO = 51; + */ + public static final int PS_HOST_INFO_VALUE = 51; + /** + * SC_HEARTBEAT_ACK = 101; + */ + public static final int SC_HEARTBEAT_ACK_VALUE = 101; + /** + * SC_ECHO = 102; + */ + public static final int SC_ECHO_VALUE = 102; + /** + * SC_ERROR = 103; + */ + public static final int SC_ERROR_VALUE = 103; + /** + * SC_PING_ACK = 104; + */ + public static final int SC_PING_ACK_VALUE = 104; + /** + * SC_INFO = 105; + */ + public static final int SC_INFO_VALUE = 105; + /** + * CS_ENTER_ROOM = 200; + */ + public static final int CS_ENTER_ROOM_VALUE = 200; + /** + * CS_USER_PAUSE = 201; + */ + public static final int CS_USER_PAUSE_VALUE = 201; + /** + * CS_USER_EXIT = 202; + */ + public static final int CS_USER_EXIT_VALUE = 202; + /** + * CS_AUTHOR_PUSH_TRAFFIC_ZERO = 203; + */ + public static final int CS_AUTHOR_PUSH_TRAFFIC_ZERO_VALUE = 203; + /** + * CS_HORSE_RACING = 204; + */ + public static final int CS_HORSE_RACING_VALUE = 204; + /** + * CS_RACE_LOSE = 205; + */ + public static final int CS_RACE_LOSE_VALUE = 205; + /** + * CS_VOIP_SIGNAL = 206; + */ + public static final int CS_VOIP_SIGNAL_VALUE = 206; + /** + * SC_ENTER_ROOM_ACK = 300; + */ + public static final int SC_ENTER_ROOM_ACK_VALUE = 300; + /** + * SC_AUTHOR_PAUSE = 301; + */ + public static final int SC_AUTHOR_PAUSE_VALUE = 301; + /** + * SC_AUTHOR_RESUME = 302; + */ + public static final int SC_AUTHOR_RESUME_VALUE = 302; + /** + * SC_AUTHOR_PUSH_TRAFFIC_ZERO = 303; + */ + public static final int SC_AUTHOR_PUSH_TRAFFIC_ZERO_VALUE = 303; + /** + * SC_AUTHOR_HEARTBEAT_MISS = 304; + */ + public static final int SC_AUTHOR_HEARTBEAT_MISS_VALUE = 304; + /** + * SC_PIP_STARTED = 305; + */ + public static final int SC_PIP_STARTED_VALUE = 305; + /** + * SC_PIP_ENDED = 306; + */ + public static final int SC_PIP_ENDED_VALUE = 306; + /** + * SC_HORSE_RACING_ACK = 307; + */ + public static final int SC_HORSE_RACING_ACK_VALUE = 307; + /** + * SC_VOIP_SIGNAL = 308; + */ + public static final int SC_VOIP_SIGNAL_VALUE = 308; + /** + * SC_FEED_PUSH = 310; + */ + public static final int SC_FEED_PUSH_VALUE = 310; + /** + * SC_ASSISTANT_STATUS = 311; + */ + public static final int SC_ASSISTANT_STATUS_VALUE = 311; + /** + * SC_REFRESH_WALLET = 312; + */ + public static final int SC_REFRESH_WALLET_VALUE = 312; + /** + * SC_LIVE_CHAT_CALL = 320; + */ + public static final int SC_LIVE_CHAT_CALL_VALUE = 320; + /** + * SC_LIVE_CHAT_CALL_ACCEPTED = 321; + */ + public static final int SC_LIVE_CHAT_CALL_ACCEPTED_VALUE = 321; + /** + * SC_LIVE_CHAT_CALL_REJECTED = 322; + */ + public static final int SC_LIVE_CHAT_CALL_REJECTED_VALUE = 322; + /** + * SC_LIVE_CHAT_READY = 323; + */ + public static final int SC_LIVE_CHAT_READY_VALUE = 323; + /** + * SC_LIVE_CHAT_GUEST_END = 324; + */ + public static final int SC_LIVE_CHAT_GUEST_END_VALUE = 324; + /** + * SC_LIVE_CHAT_ENDED = 325; + */ + public static final int SC_LIVE_CHAT_ENDED_VALUE = 325; + /** + * SC_RENDERING_MAGIC_FACE_DISABLE = 326; + */ + public static final int SC_RENDERING_MAGIC_FACE_DISABLE_VALUE = 326; + /** + * SC_RENDERING_MAGIC_FACE_ENABLE = 327; + */ + public static final int SC_RENDERING_MAGIC_FACE_ENABLE_VALUE = 327; + /** + * SC_RED_PACK_FEED = 330; + */ + public static final int SC_RED_PACK_FEED_VALUE = 330; + /** + * SC_LIVE_WATCHING_LIST = 340; + */ + public static final int SC_LIVE_WATCHING_LIST_VALUE = 340; + /** + * SC_LIVE_QUIZ_QUESTION_ASKED = 350; + */ + public static final int SC_LIVE_QUIZ_QUESTION_ASKED_VALUE = 350; + /** + * SC_LIVE_QUIZ_QUESTION_REVIEWED = 351; + */ + public static final int SC_LIVE_QUIZ_QUESTION_REVIEWED_VALUE = 351; + /** + * SC_LIVE_QUIZ_SYNC = 352; + */ + public static final int SC_LIVE_QUIZ_SYNC_VALUE = 352; + /** + * SC_LIVE_QUIZ_ENDED = 353; + */ + public static final int SC_LIVE_QUIZ_ENDED_VALUE = 353; + /** + * SC_LIVE_QUIZ_WINNERS = 354; + */ + public static final int SC_LIVE_QUIZ_WINNERS_VALUE = 354; + /** + * SC_SUSPECTED_VIOLATION = 355; + */ + public static final int SC_SUSPECTED_VIOLATION_VALUE = 355; + /** + * SC_SHOP_OPENED = 360; + */ + public static final int SC_SHOP_OPENED_VALUE = 360; + /** + * SC_SHOP_CLOSED = 361; + */ + public static final int SC_SHOP_CLOSED_VALUE = 361; + /** + * SC_GUESS_OPENED = 370; + */ + public static final int SC_GUESS_OPENED_VALUE = 370; + /** + * SC_GUESS_CLOSED = 371; + */ + public static final int SC_GUESS_CLOSED_VALUE = 371; + /** + * SC_PK_INVITATION = 380; + */ + public static final int SC_PK_INVITATION_VALUE = 380; + /** + * SC_PK_STATISTIC = 381; + */ + public static final int SC_PK_STATISTIC_VALUE = 381; + /** + * SC_RIDDLE_OPENED = 390; + */ + public static final int SC_RIDDLE_OPENED_VALUE = 390; + /** + * SC_RIDDLE_CLOESED = 391; + */ + public static final int SC_RIDDLE_CLOESED_VALUE = 391; + /** + * SC_RIDE_CHANGED = 412; + */ + public static final int SC_RIDE_CHANGED_VALUE = 412; + /** + * SC_BET_CHANGED = 441; + */ + public static final int SC_BET_CHANGED_VALUE = 441; + /** + * SC_BET_CLOSED = 442; + */ + public static final int SC_BET_CLOSED_VALUE = 442; + /** + * SC_LIVE_SPECIAL_ACCOUNT_CONFIG_STATE = 645; + */ + public static final int SC_LIVE_SPECIAL_ACCOUNT_CONFIG_STATE_VALUE = 645; + /** + * SC_LIVE_WARNING_MASK_STATUS_CHANGED_AUDIENCE = 758; + */ + public static final int SC_LIVE_WARNING_MASK_STATUS_CHANGED_AUDIENCE_VALUE = 758; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static PayloadType forNumber(int value) { + switch (value) { + case 0: return UNKNOWN; + case 1: return CS_HEARTBEAT; + case 3: return CS_ERROR; + case 4: return CS_PING; + case 51: return PS_HOST_INFO; + case 101: return SC_HEARTBEAT_ACK; + case 102: return SC_ECHO; + case 103: return SC_ERROR; + case 104: return SC_PING_ACK; + case 105: return SC_INFO; + case 200: return CS_ENTER_ROOM; + case 201: return CS_USER_PAUSE; + case 202: return CS_USER_EXIT; + case 203: return CS_AUTHOR_PUSH_TRAFFIC_ZERO; + case 204: return CS_HORSE_RACING; + case 205: return CS_RACE_LOSE; + case 206: return CS_VOIP_SIGNAL; + case 300: return SC_ENTER_ROOM_ACK; + case 301: return SC_AUTHOR_PAUSE; + case 302: return SC_AUTHOR_RESUME; + case 303: return SC_AUTHOR_PUSH_TRAFFIC_ZERO; + case 304: return SC_AUTHOR_HEARTBEAT_MISS; + case 305: return SC_PIP_STARTED; + case 306: return SC_PIP_ENDED; + case 307: return SC_HORSE_RACING_ACK; + case 308: return SC_VOIP_SIGNAL; + case 310: return SC_FEED_PUSH; + case 311: return SC_ASSISTANT_STATUS; + case 312: return SC_REFRESH_WALLET; + case 320: return SC_LIVE_CHAT_CALL; + case 321: return SC_LIVE_CHAT_CALL_ACCEPTED; + case 322: return SC_LIVE_CHAT_CALL_REJECTED; + case 323: return SC_LIVE_CHAT_READY; + case 324: return SC_LIVE_CHAT_GUEST_END; + case 325: return SC_LIVE_CHAT_ENDED; + case 326: return SC_RENDERING_MAGIC_FACE_DISABLE; + case 327: return SC_RENDERING_MAGIC_FACE_ENABLE; + case 330: return SC_RED_PACK_FEED; + case 340: return SC_LIVE_WATCHING_LIST; + case 350: return SC_LIVE_QUIZ_QUESTION_ASKED; + case 351: return SC_LIVE_QUIZ_QUESTION_REVIEWED; + case 352: return SC_LIVE_QUIZ_SYNC; + case 353: return SC_LIVE_QUIZ_ENDED; + case 354: return SC_LIVE_QUIZ_WINNERS; + case 355: return SC_SUSPECTED_VIOLATION; + case 360: return SC_SHOP_OPENED; + case 361: return SC_SHOP_CLOSED; + case 370: return SC_GUESS_OPENED; + case 371: return SC_GUESS_CLOSED; + case 380: return SC_PK_INVITATION; + case 381: return SC_PK_STATISTIC; + case 390: return SC_RIDDLE_OPENED; + case 391: return SC_RIDDLE_CLOESED; + case 412: return SC_RIDE_CHANGED; + case 441: return SC_BET_CHANGED; + case 442: return SC_BET_CLOSED; + case 645: return SC_LIVE_SPECIAL_ACCOUNT_CONFIG_STATE; + case 758: return SC_LIVE_WARNING_MASK_STATUS_CHANGED_AUDIENCE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + PayloadType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PayloadType findValueByNumber(int number) { + return PayloadType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final PayloadType[] VALUES = values(); + + public static PayloadType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private PayloadType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:PayloadType) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\021PayloadType.proto*\213\013\n\013PayloadType\022\013\n\007U" + + "NKNOWN\020\000\022\020\n\014CS_HEARTBEAT\020\001\022\014\n\010CS_ERROR\020\003" + + "\022\013\n\007CS_PING\020\004\022\020\n\014PS_HOST_INFO\0203\022\024\n\020SC_HE" + + "ARTBEAT_ACK\020e\022\013\n\007SC_ECHO\020f\022\014\n\010SC_ERROR\020g" + + "\022\017\n\013SC_PING_ACK\020h\022\013\n\007SC_INFO\020i\022\022\n\rCS_ENT" + + "ER_ROOM\020\310\001\022\022\n\rCS_USER_PAUSE\020\311\001\022\021\n\014CS_USE" + + "R_EXIT\020\312\001\022 \n\033CS_AUTHOR_PUSH_TRAFFIC_ZERO" + + "\020\313\001\022\024\n\017CS_HORSE_RACING\020\314\001\022\021\n\014CS_RACE_LOS" + + "E\020\315\001\022\023\n\016CS_VOIP_SIGNAL\020\316\001\022\026\n\021SC_ENTER_RO" + + "OM_ACK\020\254\002\022\024\n\017SC_AUTHOR_PAUSE\020\255\002\022\025\n\020SC_AU" + + "THOR_RESUME\020\256\002\022 \n\033SC_AUTHOR_PUSH_TRAFFIC" + + "_ZERO\020\257\002\022\035\n\030SC_AUTHOR_HEARTBEAT_MISS\020\260\002\022" + + "\023\n\016SC_PIP_STARTED\020\261\002\022\021\n\014SC_PIP_ENDED\020\262\002\022" + + "\030\n\023SC_HORSE_RACING_ACK\020\263\002\022\023\n\016SC_VOIP_SIG" + + "NAL\020\264\002\022\021\n\014SC_FEED_PUSH\020\266\002\022\030\n\023SC_ASSISTAN" + + "T_STATUS\020\267\002\022\026\n\021SC_REFRESH_WALLET\020\270\002\022\026\n\021S" + + "C_LIVE_CHAT_CALL\020\300\002\022\037\n\032SC_LIVE_CHAT_CALL" + + "_ACCEPTED\020\301\002\022\037\n\032SC_LIVE_CHAT_CALL_REJECT" + + "ED\020\302\002\022\027\n\022SC_LIVE_CHAT_READY\020\303\002\022\033\n\026SC_LIV" + + "E_CHAT_GUEST_END\020\304\002\022\027\n\022SC_LIVE_CHAT_ENDE" + + "D\020\305\002\022$\n\037SC_RENDERING_MAGIC_FACE_DISABLE\020" + + "\306\002\022#\n\036SC_RENDERING_MAGIC_FACE_ENABLE\020\307\002\022" + + "\025\n\020SC_RED_PACK_FEED\020\312\002\022\032\n\025SC_LIVE_WATCHI" + + "NG_LIST\020\324\002\022 \n\033SC_LIVE_QUIZ_QUESTION_ASKE" + + "D\020\336\002\022#\n\036SC_LIVE_QUIZ_QUESTION_REVIEWED\020\337" + + "\002\022\026\n\021SC_LIVE_QUIZ_SYNC\020\340\002\022\027\n\022SC_LIVE_QUI" + + "Z_ENDED\020\341\002\022\031\n\024SC_LIVE_QUIZ_WINNERS\020\342\002\022\033\n" + + "\026SC_SUSPECTED_VIOLATION\020\343\002\022\023\n\016SC_SHOP_OP" + + "ENED\020\350\002\022\023\n\016SC_SHOP_CLOSED\020\351\002\022\024\n\017SC_GUESS" + + "_OPENED\020\362\002\022\024\n\017SC_GUESS_CLOSED\020\363\002\022\025\n\020SC_P" + + "K_INVITATION\020\374\002\022\024\n\017SC_PK_STATISTIC\020\375\002\022\025\n" + + "\020SC_RIDDLE_OPENED\020\206\003\022\026\n\021SC_RIDDLE_CLOESE" + + "D\020\207\003\022\024\n\017SC_RIDE_CHANGED\020\234\003\022\023\n\016SC_BET_CHA" + + "NGED\020\271\003\022\022\n\rSC_BET_CLOSED\020\272\003\022)\n$SC_LIVE_S" + + "PECIAL_ACCOUNT_CONFIG_STATE\020\205\005\0221\n,SC_LIV" + + "E_WARNING_MASK_STATUS_CHANGED_AUDIENCE\020\366" + + "\005B6\n4tech.ordinaryroad.live.chat.client." + + "kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/PicUrlOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/PicUrlOuterClass.java new file mode 100644 index 0000000..935c3bb --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/PicUrlOuterClass.java @@ -0,0 +1,1069 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: PicUrl.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class PicUrlOuterClass { + private PicUrlOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface PicUrlOrBuilder extends + // @@protoc_insertion_point(interface_extends:PicUrl) + com.google.protobuf.MessageOrBuilder { + + /** + * string cdn = 1; + * @return The cdn. + */ + java.lang.String getCdn(); + /** + * string cdn = 1; + * @return The bytes for cdn. + */ + com.google.protobuf.ByteString + getCdnBytes(); + + /** + * string url = 2; + * @return The url. + */ + java.lang.String getUrl(); + /** + * string url = 2; + * @return The bytes for url. + */ + com.google.protobuf.ByteString + getUrlBytes(); + + /** + * string urlPattern = 3; + * @return The urlPattern. + */ + java.lang.String getUrlPattern(); + /** + * string urlPattern = 3; + * @return The bytes for urlPattern. + */ + com.google.protobuf.ByteString + getUrlPatternBytes(); + + /** + * string ip = 4; + * @return The ip. + */ + java.lang.String getIp(); + /** + * string ip = 4; + * @return The bytes for ip. + */ + com.google.protobuf.ByteString + getIpBytes(); + } + /** + * Protobuf type {@code PicUrl} + */ + public static final class PicUrl extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:PicUrl) + PicUrlOrBuilder { + private static final long serialVersionUID = 0L; + // Use PicUrl.newBuilder() to construct. + private PicUrl(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PicUrl() { + cdn_ = ""; + url_ = ""; + urlPattern_ = ""; + ip_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PicUrl(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.internal_static_PicUrl_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.internal_static_PicUrl_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder.class); + } + + public static final int CDN_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object cdn_ = ""; + /** + * string cdn = 1; + * @return The cdn. + */ + @java.lang.Override + public java.lang.String getCdn() { + java.lang.Object ref = cdn_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cdn_ = s; + return s; + } + } + /** + * string cdn = 1; + * @return The bytes for cdn. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCdnBytes() { + java.lang.Object ref = cdn_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cdn_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URL_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object url_ = ""; + /** + * string url = 2; + * @return The url. + */ + @java.lang.Override + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } + } + /** + * string url = 2; + * @return The bytes for url. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URLPATTERN_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object urlPattern_ = ""; + /** + * string urlPattern = 3; + * @return The urlPattern. + */ + @java.lang.Override + public java.lang.String getUrlPattern() { + java.lang.Object ref = urlPattern_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + urlPattern_ = s; + return s; + } + } + /** + * string urlPattern = 3; + * @return The bytes for urlPattern. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUrlPatternBytes() { + java.lang.Object ref = urlPattern_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + urlPattern_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object ip_ = ""; + /** + * string ip = 4; + * @return The ip. + */ + @java.lang.Override + public java.lang.String getIp() { + java.lang.Object ref = ip_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ip_ = s; + return s; + } + } + /** + * string ip = 4; + * @return The bytes for ip. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIpBytes() { + java.lang.Object ref = ip_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ip_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cdn_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cdn_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(url_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, url_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(urlPattern_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, urlPattern_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ip_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, ip_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cdn_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cdn_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(url_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, url_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(urlPattern_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, urlPattern_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ip_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, ip_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl) obj; + + if (!getCdn() + .equals(other.getCdn())) return false; + if (!getUrl() + .equals(other.getUrl())) return false; + if (!getUrlPattern() + .equals(other.getUrlPattern())) return false; + if (!getIp() + .equals(other.getIp())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CDN_FIELD_NUMBER; + hash = (53 * hash) + getCdn().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (37 * hash) + URLPATTERN_FIELD_NUMBER; + hash = (53 * hash) + getUrlPattern().hashCode(); + hash = (37 * hash) + IP_FIELD_NUMBER; + hash = (53 * hash) + getIp().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code PicUrl} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:PicUrl) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.internal_static_PicUrl_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.internal_static_PicUrl_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cdn_ = ""; + url_ = ""; + urlPattern_ = ""; + ip_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.internal_static_PicUrl_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cdn_ = cdn_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.url_ = url_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.urlPattern_ = urlPattern_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.ip_ = ip_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.getDefaultInstance()) return this; + if (!other.getCdn().isEmpty()) { + cdn_ = other.cdn_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getUrlPattern().isEmpty()) { + urlPattern_ = other.urlPattern_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getIp().isEmpty()) { + ip_ = other.ip_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + cdn_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + url_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + urlPattern_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + ip_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object cdn_ = ""; + /** + * string cdn = 1; + * @return The cdn. + */ + public java.lang.String getCdn() { + java.lang.Object ref = cdn_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cdn_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string cdn = 1; + * @return The bytes for cdn. + */ + public com.google.protobuf.ByteString + getCdnBytes() { + java.lang.Object ref = cdn_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cdn_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string cdn = 1; + * @param value The cdn to set. + * @return This builder for chaining. + */ + public Builder setCdn( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + cdn_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string cdn = 1; + * @return This builder for chaining. + */ + public Builder clearCdn() { + cdn_ = getDefaultInstance().getCdn(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string cdn = 1; + * @param value The bytes for cdn to set. + * @return This builder for chaining. + */ + public Builder setCdnBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + cdn_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object url_ = ""; + /** + * string url = 2; + * @return The url. + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string url = 2; + * @return The bytes for url. + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string url = 2; + * @param value The url to set. + * @return This builder for chaining. + */ + public Builder setUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + url_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string url = 2; + * @return This builder for chaining. + */ + public Builder clearUrl() { + url_ = getDefaultInstance().getUrl(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string url = 2; + * @param value The bytes for url to set. + * @return This builder for chaining. + */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + url_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object urlPattern_ = ""; + /** + * string urlPattern = 3; + * @return The urlPattern. + */ + public java.lang.String getUrlPattern() { + java.lang.Object ref = urlPattern_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + urlPattern_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string urlPattern = 3; + * @return The bytes for urlPattern. + */ + public com.google.protobuf.ByteString + getUrlPatternBytes() { + java.lang.Object ref = urlPattern_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + urlPattern_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string urlPattern = 3; + * @param value The urlPattern to set. + * @return This builder for chaining. + */ + public Builder setUrlPattern( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + urlPattern_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * string urlPattern = 3; + * @return This builder for chaining. + */ + public Builder clearUrlPattern() { + urlPattern_ = getDefaultInstance().getUrlPattern(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * string urlPattern = 3; + * @param value The bytes for urlPattern to set. + * @return This builder for chaining. + */ + public Builder setUrlPatternBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + urlPattern_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object ip_ = ""; + /** + * string ip = 4; + * @return The ip. + */ + public java.lang.String getIp() { + java.lang.Object ref = ip_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ip_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string ip = 4; + * @return The bytes for ip. + */ + public com.google.protobuf.ByteString + getIpBytes() { + java.lang.Object ref = ip_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ip_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string ip = 4; + * @param value The ip to set. + * @return This builder for chaining. + */ + public Builder setIp( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ip_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * string ip = 4; + * @return This builder for chaining. + */ + public Builder clearIp() { + ip_ = getDefaultInstance().getIp(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * string ip = 4; + * @param value The bytes for ip to set. + * @return This builder for chaining. + */ + public Builder setIpBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ip_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:PicUrl) + } + + // @@protoc_insertion_point(class_scope:PicUrl) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PicUrl parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_PicUrl_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_PicUrl_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\014PicUrl.proto\"B\n\006PicUrl\022\013\n\003cdn\030\001 \001(\t\022\013\n" + + "\003url\030\002 \001(\t\022\022\n\nurlPattern\030\003 \001(\t\022\n\n\002ip\030\004 \001" + + "(\tB6\n4tech.ordinaryroad.live.chat.client" + + ".kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_PicUrl_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_PicUrl_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_PicUrl_descriptor, + new java.lang.String[] { "Cdn", "Url", "UrlPattern", "Ip", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCEchoOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCEchoOuterClass.java new file mode 100644 index 0000000..c39aa9c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCEchoOuterClass.java @@ -0,0 +1,624 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCEcho.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCEchoOuterClass { + private SCEchoOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCEchoOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCEcho) + com.google.protobuf.MessageOrBuilder { + + /** + * string content = 1; + * @return The content. + */ + java.lang.String getContent(); + /** + * string content = 1; + * @return The bytes for content. + */ + com.google.protobuf.ByteString + getContentBytes(); + } + /** + * Protobuf type {@code SCEcho} + */ + public static final class SCEcho extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCEcho) + SCEchoOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCEcho.newBuilder() to construct. + private SCEcho(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCEcho() { + content_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCEcho(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.internal_static_SCEcho_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.internal_static_SCEcho_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + /** + * string content = 1; + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 1; + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho) obj; + + if (!getContent() + .equals(other.getContent())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCEcho} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCEcho) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEchoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.internal_static_SCEcho_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.internal_static_SCEcho_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.internal_static_SCEcho_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object content_ = ""; + /** + * string content = 1; + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 1; + * @return The bytes for content. + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 1; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string content = 1; + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string content = 1; + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCEcho) + } + + // @@protoc_insertion_point(class_scope:SCEcho) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCEcho parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCEchoOuterClass.SCEcho getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCEcho_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCEcho_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\014SCEcho.proto\"\031\n\006SCEcho\022\017\n\007content\030\001 \001(" + + "\tB6\n4tech.ordinaryroad.live.chat.client." + + "kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCEcho_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCEcho_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCEcho_descriptor, + new java.lang.String[] { "Content", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCErrorOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCErrorOuterClass.java new file mode 100644 index 0000000..4bb004e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCErrorOuterClass.java @@ -0,0 +1,769 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCError.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCErrorOuterClass { + private SCErrorOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCErrorOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCError) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 code = 1; + * @return The code. + */ + int getCode(); + + /** + * string msg = 2; + * @return The msg. + */ + java.lang.String getMsg(); + /** + * string msg = 2; + * @return The bytes for msg. + */ + com.google.protobuf.ByteString + getMsgBytes(); + + /** + * uint32 subCode = 3; + * @return The subCode. + */ + int getSubCode(); + } + /** + * Protobuf type {@code SCError} + */ + public static final class SCError extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCError) + SCErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCError.newBuilder() to construct. + private SCError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCError() { + msg_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCError(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.internal_static_SCError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.internal_static_SCError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError.Builder.class); + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_ = 0; + /** + * uint32 code = 1; + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + public static final int MSG_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object msg_ = ""; + /** + * string msg = 2; + * @return The msg. + */ + @java.lang.Override + public java.lang.String getMsg() { + java.lang.Object ref = msg_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + msg_ = s; + return s; + } + } + /** + * string msg = 2; + * @return The bytes for msg. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMsgBytes() { + java.lang.Object ref = msg_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUBCODE_FIELD_NUMBER = 3; + private int subCode_ = 0; + /** + * uint32 subCode = 3; + * @return The subCode. + */ + @java.lang.Override + public int getSubCode() { + return subCode_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (code_ != 0) { + output.writeUInt32(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msg_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, msg_); + } + if (subCode_ != 0) { + output.writeUInt32(3, subCode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msg_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, msg_); + } + if (subCode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, subCode_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError) obj; + + if (getCode() + != other.getCode()) return false; + if (!getMsg() + .equals(other.getMsg())) return false; + if (getSubCode() + != other.getSubCode()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode(); + hash = (37 * hash) + MSG_FIELD_NUMBER; + hash = (53 * hash) + getMsg().hashCode(); + hash = (37 * hash) + SUBCODE_FIELD_NUMBER; + hash = (53 * hash) + getSubCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCError} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCError) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.internal_static_SCError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.internal_static_SCError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = 0; + msg_ = ""; + subCode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.internal_static_SCError_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.msg_ = msg_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.subCode_ = subCode_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError.getDefaultInstance()) return this; + if (other.getCode() != 0) { + setCode(other.getCode()); + } + if (!other.getMsg().isEmpty()) { + msg_ = other.msg_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getSubCode() != 0) { + setSubCode(other.getSubCode()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + code_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + msg_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + subCode_ = input.readUInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int code_ ; + /** + * uint32 code = 1; + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + /** + * uint32 code = 1; + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(int value) { + + code_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint32 code = 1; + * @return This builder for chaining. + */ + public Builder clearCode() { + bitField0_ = (bitField0_ & ~0x00000001); + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object msg_ = ""; + /** + * string msg = 2; + * @return The msg. + */ + public java.lang.String getMsg() { + java.lang.Object ref = msg_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + msg_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string msg = 2; + * @return The bytes for msg. + */ + public com.google.protobuf.ByteString + getMsgBytes() { + java.lang.Object ref = msg_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string msg = 2; + * @param value The msg to set. + * @return This builder for chaining. + */ + public Builder setMsg( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + msg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string msg = 2; + * @return This builder for chaining. + */ + public Builder clearMsg() { + msg_ = getDefaultInstance().getMsg(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string msg = 2; + * @param value The bytes for msg to set. + * @return This builder for chaining. + */ + public Builder setMsgBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + msg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int subCode_ ; + /** + * uint32 subCode = 3; + * @return The subCode. + */ + @java.lang.Override + public int getSubCode() { + return subCode_; + } + /** + * uint32 subCode = 3; + * @param value The subCode to set. + * @return This builder for chaining. + */ + public Builder setSubCode(int value) { + + subCode_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint32 subCode = 3; + * @return This builder for chaining. + */ + public Builder clearSubCode() { + bitField0_ = (bitField0_ & ~0x00000004); + subCode_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCError) + } + + // @@protoc_insertion_point(class_scope:SCError) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCErrorOuterClass.SCError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCError_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCError_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rSCError.proto\"5\n\007SCError\022\014\n\004code\030\001 \001(\r" + + "\022\013\n\003msg\030\002 \001(\t\022\017\n\007subCode\030\003 \001(\rB6\n4tech.o" + + "rdinaryroad.live.chat.client.kuaishou.pr" + + "otobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCError_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCError_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCError_descriptor, + new java.lang.String[] { "Code", "Msg", "SubCode", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCHeartbeatAckOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCHeartbeatAckOuterClass.java new file mode 100644 index 0000000..c2f9a23 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCHeartbeatAckOuterClass.java @@ -0,0 +1,623 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCHeartbeatAck.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCHeartbeatAckOuterClass { + private SCHeartbeatAckOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCHeartbeatAckOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCHeartbeatAck) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 timestamp = 1; + * @return The timestamp. + */ + long getTimestamp(); + + /** + * uint64 clientTimestamp = 2; + * @return The clientTimestamp. + */ + long getClientTimestamp(); + } + /** + * Protobuf type {@code SCHeartbeatAck} + */ + public static final class SCHeartbeatAck extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCHeartbeatAck) + SCHeartbeatAckOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCHeartbeatAck.newBuilder() to construct. + private SCHeartbeatAck(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCHeartbeatAck() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCHeartbeatAck(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.internal_static_SCHeartbeatAck_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.internal_static_SCHeartbeatAck_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck.Builder.class); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 1; + private long timestamp_ = 0L; + /** + * uint64 timestamp = 1; + * @return The timestamp. + */ + @java.lang.Override + public long getTimestamp() { + return timestamp_; + } + + public static final int CLIENTTIMESTAMP_FIELD_NUMBER = 2; + private long clientTimestamp_ = 0L; + /** + * uint64 clientTimestamp = 2; + * @return The clientTimestamp. + */ + @java.lang.Override + public long getClientTimestamp() { + return clientTimestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (timestamp_ != 0L) { + output.writeUInt64(1, timestamp_); + } + if (clientTimestamp_ != 0L) { + output.writeUInt64(2, clientTimestamp_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, timestamp_); + } + if (clientTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, clientTimestamp_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck) obj; + + if (getTimestamp() + != other.getTimestamp()) return false; + if (getClientTimestamp() + != other.getClientTimestamp()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (37 * hash) + CLIENTTIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getClientTimestamp()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCHeartbeatAck} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCHeartbeatAck) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAckOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.internal_static_SCHeartbeatAck_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.internal_static_SCHeartbeatAck_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + timestamp_ = 0L; + clientTimestamp_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.internal_static_SCHeartbeatAck_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.timestamp_ = timestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clientTimestamp_ = clientTimestamp_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck.getDefaultInstance()) return this; + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + if (other.getClientTimestamp() != 0L) { + setClientTimestamp(other.getClientTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + timestamp_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + clientTimestamp_ = input.readUInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long timestamp_ ; + /** + * uint64 timestamp = 1; + * @return The timestamp. + */ + @java.lang.Override + public long getTimestamp() { + return timestamp_; + } + /** + * uint64 timestamp = 1; + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + timestamp_ = 0L; + onChanged(); + return this; + } + + private long clientTimestamp_ ; + /** + * uint64 clientTimestamp = 2; + * @return The clientTimestamp. + */ + @java.lang.Override + public long getClientTimestamp() { + return clientTimestamp_; + } + /** + * uint64 clientTimestamp = 2; + * @param value The clientTimestamp to set. + * @return This builder for chaining. + */ + public Builder setClientTimestamp(long value) { + + clientTimestamp_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint64 clientTimestamp = 2; + * @return This builder for chaining. + */ + public Builder clearClientTimestamp() { + bitField0_ = (bitField0_ & ~0x00000002); + clientTimestamp_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCHeartbeatAck) + } + + // @@protoc_insertion_point(class_scope:SCHeartbeatAck) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCHeartbeatAck parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCHeartbeatAckOuterClass.SCHeartbeatAck getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCHeartbeatAck_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCHeartbeatAck_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024SCHeartbeatAck.proto\"<\n\016SCHeartbeatAck" + + "\022\021\n\ttimestamp\030\001 \001(\004\022\027\n\017clientTimestamp\030\002" + + " \001(\004B6\n4tech.ordinaryroad.live.chat.clie" + + "nt.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCHeartbeatAck_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCHeartbeatAck_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCHeartbeatAck_descriptor, + new java.lang.String[] { "Timestamp", "ClientTimestamp", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCInfoOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCInfoOuterClass.java new file mode 100644 index 0000000..8191432 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCInfoOuterClass.java @@ -0,0 +1,696 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCInfo.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCInfoOuterClass { + private SCInfoOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 code = 1; + * @return The code. + */ + int getCode(); + + /** + * string msg = 2; + * @return The msg. + */ + java.lang.String getMsg(); + /** + * string msg = 2; + * @return The bytes for msg. + */ + com.google.protobuf.ByteString + getMsgBytes(); + } + /** + * Protobuf type {@code SCInfo} + */ + public static final class SCInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCInfo) + SCInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCInfo.newBuilder() to construct. + private SCInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCInfo() { + msg_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.internal_static_SCInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.internal_static_SCInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo.Builder.class); + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_ = 0; + /** + * uint32 code = 1; + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + public static final int MSG_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object msg_ = ""; + /** + * string msg = 2; + * @return The msg. + */ + @java.lang.Override + public java.lang.String getMsg() { + java.lang.Object ref = msg_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + msg_ = s; + return s; + } + } + /** + * string msg = 2; + * @return The bytes for msg. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMsgBytes() { + java.lang.Object ref = msg_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (code_ != 0) { + output.writeUInt32(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msg_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, msg_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msg_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, msg_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo) obj; + + if (getCode() + != other.getCode()) return false; + if (!getMsg() + .equals(other.getMsg())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode(); + hash = (37 * hash) + MSG_FIELD_NUMBER; + hash = (53 * hash) + getMsg().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCInfo) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.internal_static_SCInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.internal_static_SCInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = 0; + msg_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.internal_static_SCInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.msg_ = msg_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo.getDefaultInstance()) return this; + if (other.getCode() != 0) { + setCode(other.getCode()); + } + if (!other.getMsg().isEmpty()) { + msg_ = other.msg_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + code_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + msg_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int code_ ; + /** + * uint32 code = 1; + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + /** + * uint32 code = 1; + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(int value) { + + code_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint32 code = 1; + * @return This builder for chaining. + */ + public Builder clearCode() { + bitField0_ = (bitField0_ & ~0x00000001); + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object msg_ = ""; + /** + * string msg = 2; + * @return The msg. + */ + public java.lang.String getMsg() { + java.lang.Object ref = msg_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + msg_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string msg = 2; + * @return The bytes for msg. + */ + public com.google.protobuf.ByteString + getMsgBytes() { + java.lang.Object ref = msg_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string msg = 2; + * @param value The msg to set. + * @return This builder for chaining. + */ + public Builder setMsg( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + msg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string msg = 2; + * @return This builder for chaining. + */ + public Builder clearMsg() { + msg_ = getDefaultInstance().getMsg(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string msg = 2; + * @param value The bytes for msg to set. + * @return This builder for chaining. + */ + public Builder setMsgBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + msg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCInfo) + } + + // @@protoc_insertion_point(class_scope:SCInfo) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCInfoOuterClass.SCInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\014SCInfo.proto\"#\n\006SCInfo\022\014\n\004code\030\001 \001(\r\022\013" + + "\n\003msg\030\002 \001(\tB6\n4tech.ordinaryroad.live.ch" + + "at.client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCInfo_descriptor, + new java.lang.String[] { "Code", "Msg", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCLiveWarningMaskStatusChangedAudienceOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCLiveWarningMaskStatusChangedAudienceOuterClass.java new file mode 100644 index 0000000..507aad2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCLiveWarningMaskStatusChangedAudienceOuterClass.java @@ -0,0 +1,750 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCLiveWarningMaskStatusChangedAudience.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCLiveWarningMaskStatusChangedAudienceOuterClass { + private SCLiveWarningMaskStatusChangedAudienceOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCLiveWarningMaskStatusChangedAudienceOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCLiveWarningMaskStatusChangedAudience) + com.google.protobuf.MessageOrBuilder { + + /** + * bool displayMask = 1; + * @return The displayMask. + */ + boolean getDisplayMask(); + + /** + * .AuditAudienceMask warningMask = 2; + * @return Whether the warningMask field is set. + */ + boolean hasWarningMask(); + /** + * .AuditAudienceMask warningMask = 2; + * @return The warningMask. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask getWarningMask(); + /** + * .AuditAudienceMask warningMask = 2; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMaskOrBuilder getWarningMaskOrBuilder(); + } + /** + * Protobuf type {@code SCLiveWarningMaskStatusChangedAudience} + */ + public static final class SCLiveWarningMaskStatusChangedAudience extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCLiveWarningMaskStatusChangedAudience) + SCLiveWarningMaskStatusChangedAudienceOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCLiveWarningMaskStatusChangedAudience.newBuilder() to construct. + private SCLiveWarningMaskStatusChangedAudience(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCLiveWarningMaskStatusChangedAudience() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCLiveWarningMaskStatusChangedAudience(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.internal_static_SCLiveWarningMaskStatusChangedAudience_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.internal_static_SCLiveWarningMaskStatusChangedAudience_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience.Builder.class); + } + + public static final int DISPLAYMASK_FIELD_NUMBER = 1; + private boolean displayMask_ = false; + /** + * bool displayMask = 1; + * @return The displayMask. + */ + @java.lang.Override + public boolean getDisplayMask() { + return displayMask_; + } + + public static final int WARNINGMASK_FIELD_NUMBER = 2; + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask warningMask_; + /** + * .AuditAudienceMask warningMask = 2; + * @return Whether the warningMask field is set. + */ + @java.lang.Override + public boolean hasWarningMask() { + return warningMask_ != null; + } + /** + * .AuditAudienceMask warningMask = 2; + * @return The warningMask. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask getWarningMask() { + return warningMask_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.getDefaultInstance() : warningMask_; + } + /** + * .AuditAudienceMask warningMask = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMaskOrBuilder getWarningMaskOrBuilder() { + return warningMask_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.getDefaultInstance() : warningMask_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (displayMask_ != false) { + output.writeBool(1, displayMask_); + } + if (warningMask_ != null) { + output.writeMessage(2, getWarningMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (displayMask_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, displayMask_); + } + if (warningMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getWarningMask()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience) obj; + + if (getDisplayMask() + != other.getDisplayMask()) return false; + if (hasWarningMask() != other.hasWarningMask()) return false; + if (hasWarningMask()) { + if (!getWarningMask() + .equals(other.getWarningMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DISPLAYMASK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDisplayMask()); + if (hasWarningMask()) { + hash = (37 * hash) + WARNINGMASK_FIELD_NUMBER; + hash = (53 * hash) + getWarningMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCLiveWarningMaskStatusChangedAudience} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCLiveWarningMaskStatusChangedAudience) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudienceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.internal_static_SCLiveWarningMaskStatusChangedAudience_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.internal_static_SCLiveWarningMaskStatusChangedAudience_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + displayMask_ = false; + warningMask_ = null; + if (warningMaskBuilder_ != null) { + warningMaskBuilder_.dispose(); + warningMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.internal_static_SCLiveWarningMaskStatusChangedAudience_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.displayMask_ = displayMask_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.warningMask_ = warningMaskBuilder_ == null + ? warningMask_ + : warningMaskBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience.getDefaultInstance()) return this; + if (other.getDisplayMask() != false) { + setDisplayMask(other.getDisplayMask()); + } + if (other.hasWarningMask()) { + mergeWarningMask(other.getWarningMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + displayMask_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getWarningMaskFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean displayMask_ ; + /** + * bool displayMask = 1; + * @return The displayMask. + */ + @java.lang.Override + public boolean getDisplayMask() { + return displayMask_; + } + /** + * bool displayMask = 1; + * @param value The displayMask to set. + * @return This builder for chaining. + */ + public Builder setDisplayMask(boolean value) { + + displayMask_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bool displayMask = 1; + * @return This builder for chaining. + */ + public Builder clearDisplayMask() { + bitField0_ = (bitField0_ & ~0x00000001); + displayMask_ = false; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask warningMask_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMaskOrBuilder> warningMaskBuilder_; + /** + * .AuditAudienceMask warningMask = 2; + * @return Whether the warningMask field is set. + */ + public boolean hasWarningMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .AuditAudienceMask warningMask = 2; + * @return The warningMask. + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask getWarningMask() { + if (warningMaskBuilder_ == null) { + return warningMask_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.getDefaultInstance() : warningMask_; + } else { + return warningMaskBuilder_.getMessage(); + } + } + /** + * .AuditAudienceMask warningMask = 2; + */ + public Builder setWarningMask(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask value) { + if (warningMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + warningMask_ = value; + } else { + warningMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .AuditAudienceMask warningMask = 2; + */ + public Builder setWarningMask( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.Builder builderForValue) { + if (warningMaskBuilder_ == null) { + warningMask_ = builderForValue.build(); + } else { + warningMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .AuditAudienceMask warningMask = 2; + */ + public Builder mergeWarningMask(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask value) { + if (warningMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + warningMask_ != null && + warningMask_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.getDefaultInstance()) { + getWarningMaskBuilder().mergeFrom(value); + } else { + warningMask_ = value; + } + } else { + warningMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .AuditAudienceMask warningMask = 2; + */ + public Builder clearWarningMask() { + bitField0_ = (bitField0_ & ~0x00000002); + warningMask_ = null; + if (warningMaskBuilder_ != null) { + warningMaskBuilder_.dispose(); + warningMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .AuditAudienceMask warningMask = 2; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.Builder getWarningMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getWarningMaskFieldBuilder().getBuilder(); + } + /** + * .AuditAudienceMask warningMask = 2; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMaskOrBuilder getWarningMaskOrBuilder() { + if (warningMaskBuilder_ != null) { + return warningMaskBuilder_.getMessageOrBuilder(); + } else { + return warningMask_ == null ? + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.getDefaultInstance() : warningMask_; + } + } + /** + * .AuditAudienceMask warningMask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMaskOrBuilder> + getWarningMaskFieldBuilder() { + if (warningMaskBuilder_ == null) { + warningMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMask.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.AuditAudienceMaskOrBuilder>( + getWarningMask(), + getParentForChildren(), + isClean()); + warningMask_ = null; + } + return warningMaskBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCLiveWarningMaskStatusChangedAudience) + } + + // @@protoc_insertion_point(class_scope:SCLiveWarningMaskStatusChangedAudience) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCLiveWarningMaskStatusChangedAudience parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCLiveWarningMaskStatusChangedAudienceOuterClass.SCLiveWarningMaskStatusChangedAudience getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCLiveWarningMaskStatusChangedAudience_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCLiveWarningMaskStatusChangedAudience_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n,SCLiveWarningMaskStatusChangedAudience" + + ".proto\032\027AuditAudienceMask.proto\"f\n&SCLiv" + + "eWarningMaskStatusChangedAudience\022\023\n\013dis" + + "playMask\030\001 \001(\010\022\'\n\013warningMask\030\002 \001(\0132\022.Au" + + "ditAudienceMaskB6\n4tech.ordinaryroad.liv" + + "e.chat.client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.getDescriptor(), + }); + internal_static_SCLiveWarningMaskStatusChangedAudience_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCLiveWarningMaskStatusChangedAudience_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCLiveWarningMaskStatusChangedAudience_descriptor, + new java.lang.String[] { "DisplayMask", "WarningMask", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.AuditAudienceMaskOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCPingAckOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCPingAckOuterClass.java new file mode 100644 index 0000000..68e4df3 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCPingAckOuterClass.java @@ -0,0 +1,624 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCPingAck.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCPingAckOuterClass { + private SCPingAckOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCPingAckOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCPingAck) + com.google.protobuf.MessageOrBuilder { + + /** + * string echoData = 1; + * @return The echoData. + */ + java.lang.String getEchoData(); + /** + * string echoData = 1; + * @return The bytes for echoData. + */ + com.google.protobuf.ByteString + getEchoDataBytes(); + } + /** + * Protobuf type {@code SCPingAck} + */ + public static final class SCPingAck extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCPingAck) + SCPingAckOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCPingAck.newBuilder() to construct. + private SCPingAck(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCPingAck() { + echoData_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCPingAck(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.internal_static_SCPingAck_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.internal_static_SCPingAck_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck.Builder.class); + } + + public static final int ECHODATA_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object echoData_ = ""; + /** + * string echoData = 1; + * @return The echoData. + */ + @java.lang.Override + public java.lang.String getEchoData() { + java.lang.Object ref = echoData_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + echoData_ = s; + return s; + } + } + /** + * string echoData = 1; + * @return The bytes for echoData. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getEchoDataBytes() { + java.lang.Object ref = echoData_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + echoData_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(echoData_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, echoData_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(echoData_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, echoData_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck) obj; + + if (!getEchoData() + .equals(other.getEchoData())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ECHODATA_FIELD_NUMBER; + hash = (53 * hash) + getEchoData().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCPingAck} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCPingAck) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAckOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.internal_static_SCPingAck_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.internal_static_SCPingAck_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + echoData_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.internal_static_SCPingAck_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.echoData_ = echoData_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck.getDefaultInstance()) return this; + if (!other.getEchoData().isEmpty()) { + echoData_ = other.echoData_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + echoData_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object echoData_ = ""; + /** + * string echoData = 1; + * @return The echoData. + */ + public java.lang.String getEchoData() { + java.lang.Object ref = echoData_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + echoData_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string echoData = 1; + * @return The bytes for echoData. + */ + public com.google.protobuf.ByteString + getEchoDataBytes() { + java.lang.Object ref = echoData_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + echoData_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string echoData = 1; + * @param value The echoData to set. + * @return This builder for chaining. + */ + public Builder setEchoData( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + echoData_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string echoData = 1; + * @return This builder for chaining. + */ + public Builder clearEchoData() { + echoData_ = getDefaultInstance().getEchoData(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string echoData = 1; + * @param value The bytes for echoData to set. + * @return This builder for chaining. + */ + public Builder setEchoDataBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + echoData_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCPingAck) + } + + // @@protoc_insertion_point(class_scope:SCPingAck) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCPingAck parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCPingAckOuterClass.SCPingAck getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCPingAck_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCPingAck_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\017SCPingAck.proto\"\035\n\tSCPingAck\022\020\n\010echoDa" + + "ta\030\001 \001(\tB6\n4tech.ordinaryroad.live.chat." + + "client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCPingAck_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCPingAck_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCPingAck_descriptor, + new java.lang.String[] { "EchoData", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebAuthorPauseOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebAuthorPauseOuterClass.java new file mode 100644 index 0000000..c2e6f94 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebAuthorPauseOuterClass.java @@ -0,0 +1,658 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebAuthorPause.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebAuthorPauseOuterClass { + private SCWebAuthorPauseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebAuthorPauseOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebAuthorPause) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 time = 1; + * @return The time. + */ + long getTime(); + + /** + * .WebPauseType pauseType = 2; + * @return The enum numeric value on the wire for pauseType. + */ + int getPauseTypeValue(); + /** + * .WebPauseType pauseType = 2; + * @return The pauseType. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.WebPauseType getPauseType(); + } + /** + * Protobuf type {@code SCWebAuthorPause} + */ + public static final class SCWebAuthorPause extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebAuthorPause) + SCWebAuthorPauseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebAuthorPause.newBuilder() to construct. + private SCWebAuthorPause(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebAuthorPause() { + pauseType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebAuthorPause(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.internal_static_SCWebAuthorPause_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.internal_static_SCWebAuthorPause_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause.Builder.class); + } + + public static final int TIME_FIELD_NUMBER = 1; + private long time_ = 0L; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + + public static final int PAUSETYPE_FIELD_NUMBER = 2; + private int pauseType_ = 0; + /** + * .WebPauseType pauseType = 2; + * @return The enum numeric value on the wire for pauseType. + */ + @java.lang.Override public int getPauseTypeValue() { + return pauseType_; + } + /** + * .WebPauseType pauseType = 2; + * @return The pauseType. + */ + @java.lang.Override public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.WebPauseType getPauseType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.WebPauseType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.WebPauseType.forNumber(pauseType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.WebPauseType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (time_ != 0L) { + output.writeUInt64(1, time_); + } + if (pauseType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.WebPauseType.UNKNOWN_PAUSE_TYPE.getNumber()) { + output.writeEnum(2, pauseType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (time_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, time_); + } + if (pauseType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.WebPauseType.UNKNOWN_PAUSE_TYPE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, pauseType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause) obj; + + if (getTime() + != other.getTime()) return false; + if (pauseType_ != other.pauseType_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTime()); + hash = (37 * hash) + PAUSETYPE_FIELD_NUMBER; + hash = (53 * hash) + pauseType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebAuthorPause} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebAuthorPause) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPauseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.internal_static_SCWebAuthorPause_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.internal_static_SCWebAuthorPause_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + time_ = 0L; + pauseType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.internal_static_SCWebAuthorPause_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.time_ = time_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pauseType_ = pauseType_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause.getDefaultInstance()) return this; + if (other.getTime() != 0L) { + setTime(other.getTime()); + } + if (other.pauseType_ != 0) { + setPauseTypeValue(other.getPauseTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + time_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + pauseType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long time_ ; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + /** + * uint64 time = 1; + * @param value The time to set. + * @return This builder for chaining. + */ + public Builder setTime(long value) { + + time_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 time = 1; + * @return This builder for chaining. + */ + public Builder clearTime() { + bitField0_ = (bitField0_ & ~0x00000001); + time_ = 0L; + onChanged(); + return this; + } + + private int pauseType_ = 0; + /** + * .WebPauseType pauseType = 2; + * @return The enum numeric value on the wire for pauseType. + */ + @java.lang.Override public int getPauseTypeValue() { + return pauseType_; + } + /** + * .WebPauseType pauseType = 2; + * @param value The enum numeric value on the wire for pauseType to set. + * @return This builder for chaining. + */ + public Builder setPauseTypeValue(int value) { + pauseType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .WebPauseType pauseType = 2; + * @return The pauseType. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.WebPauseType getPauseType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.WebPauseType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.WebPauseType.forNumber(pauseType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.WebPauseType.UNRECOGNIZED : result; + } + /** + * .WebPauseType pauseType = 2; + * @param value The pauseType to set. + * @return This builder for chaining. + */ + public Builder setPauseType(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.WebPauseType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + pauseType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .WebPauseType pauseType = 2; + * @return This builder for chaining. + */ + public Builder clearPauseType() { + bitField0_ = (bitField0_ & ~0x00000002); + pauseType_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebAuthorPause) + } + + // @@protoc_insertion_point(class_scope:SCWebAuthorPause) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebAuthorPause parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorPauseOuterClass.SCWebAuthorPause getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebAuthorPause_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebAuthorPause_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026SCWebAuthorPause.proto\032\022WebPauseType.p" + + "roto\"B\n\020SCWebAuthorPause\022\014\n\004time\030\001 \001(\004\022 " + + "\n\tpauseType\030\002 \001(\0162\r.WebPauseTypeB6\n4tech" + + ".ordinaryroad.live.chat.client.kuaishou." + + "protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.getDescriptor(), + }); + internal_static_SCWebAuthorPause_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebAuthorPause_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebAuthorPause_descriptor, + new java.lang.String[] { "Time", "PauseType", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebAuthorResumeOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebAuthorResumeOuterClass.java new file mode 100644 index 0000000..77e3c12 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebAuthorResumeOuterClass.java @@ -0,0 +1,550 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebAuthorResume.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebAuthorResumeOuterClass { + private SCWebAuthorResumeOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebAuthorResumeOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebAuthorResume) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 time = 1; + * @return The time. + */ + long getTime(); + } + /** + * Protobuf type {@code SCWebAuthorResume} + */ + public static final class SCWebAuthorResume extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebAuthorResume) + SCWebAuthorResumeOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebAuthorResume.newBuilder() to construct. + private SCWebAuthorResume(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebAuthorResume() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebAuthorResume(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.internal_static_SCWebAuthorResume_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.internal_static_SCWebAuthorResume_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume.Builder.class); + } + + public static final int TIME_FIELD_NUMBER = 1; + private long time_ = 0L; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (time_ != 0L) { + output.writeUInt64(1, time_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (time_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, time_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume) obj; + + if (getTime() + != other.getTime()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTime()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebAuthorResume} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebAuthorResume) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResumeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.internal_static_SCWebAuthorResume_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.internal_static_SCWebAuthorResume_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + time_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.internal_static_SCWebAuthorResume_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.time_ = time_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume.getDefaultInstance()) return this; + if (other.getTime() != 0L) { + setTime(other.getTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + time_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long time_ ; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + /** + * uint64 time = 1; + * @param value The time to set. + * @return This builder for chaining. + */ + public Builder setTime(long value) { + + time_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 time = 1; + * @return This builder for chaining. + */ + public Builder clearTime() { + bitField0_ = (bitField0_ & ~0x00000001); + time_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebAuthorResume) + } + + // @@protoc_insertion_point(class_scope:SCWebAuthorResume) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebAuthorResume parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebAuthorResumeOuterClass.SCWebAuthorResume getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebAuthorResume_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebAuthorResume_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\027SCWebAuthorResume.proto\"!\n\021SCWebAuthor" + + "Resume\022\014\n\004time\030\001 \001(\004B6\n4tech.ordinaryroa" + + "d.live.chat.client.kuaishou.protobufb\006pr" + + "oto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCWebAuthorResume_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebAuthorResume_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebAuthorResume_descriptor, + new java.lang.String[] { "Time", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebBetChangedOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebBetChangedOuterClass.java new file mode 100644 index 0000000..2aa5e58 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebBetChangedOuterClass.java @@ -0,0 +1,550 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebBetChanged.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebBetChangedOuterClass { + private SCWebBetChangedOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebBetChangedOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebBetChanged) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 maxDelayMillis = 1; + * @return The maxDelayMillis. + */ + long getMaxDelayMillis(); + } + /** + * Protobuf type {@code SCWebBetChanged} + */ + public static final class SCWebBetChanged extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebBetChanged) + SCWebBetChangedOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebBetChanged.newBuilder() to construct. + private SCWebBetChanged(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebBetChanged() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebBetChanged(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.internal_static_SCWebBetChanged_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.internal_static_SCWebBetChanged_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged.Builder.class); + } + + public static final int MAXDELAYMILLIS_FIELD_NUMBER = 1; + private long maxDelayMillis_ = 0L; + /** + * uint64 maxDelayMillis = 1; + * @return The maxDelayMillis. + */ + @java.lang.Override + public long getMaxDelayMillis() { + return maxDelayMillis_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (maxDelayMillis_ != 0L) { + output.writeUInt64(1, maxDelayMillis_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (maxDelayMillis_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, maxDelayMillis_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged) obj; + + if (getMaxDelayMillis() + != other.getMaxDelayMillis()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MAXDELAYMILLIS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMaxDelayMillis()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebBetChanged} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebBetChanged) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChangedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.internal_static_SCWebBetChanged_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.internal_static_SCWebBetChanged_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + maxDelayMillis_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.internal_static_SCWebBetChanged_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.maxDelayMillis_ = maxDelayMillis_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged.getDefaultInstance()) return this; + if (other.getMaxDelayMillis() != 0L) { + setMaxDelayMillis(other.getMaxDelayMillis()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + maxDelayMillis_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long maxDelayMillis_ ; + /** + * uint64 maxDelayMillis = 1; + * @return The maxDelayMillis. + */ + @java.lang.Override + public long getMaxDelayMillis() { + return maxDelayMillis_; + } + /** + * uint64 maxDelayMillis = 1; + * @param value The maxDelayMillis to set. + * @return This builder for chaining. + */ + public Builder setMaxDelayMillis(long value) { + + maxDelayMillis_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 maxDelayMillis = 1; + * @return This builder for chaining. + */ + public Builder clearMaxDelayMillis() { + bitField0_ = (bitField0_ & ~0x00000001); + maxDelayMillis_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebBetChanged) + } + + // @@protoc_insertion_point(class_scope:SCWebBetChanged) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebBetChanged parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetChangedOuterClass.SCWebBetChanged getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebBetChanged_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebBetChanged_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\025SCWebBetChanged.proto\")\n\017SCWebBetChang" + + "ed\022\026\n\016maxDelayMillis\030\001 \001(\004B6\n4tech.ordin" + + "aryroad.live.chat.client.kuaishou.protob" + + "ufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCWebBetChanged_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebBetChanged_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebBetChanged_descriptor, + new java.lang.String[] { "MaxDelayMillis", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebBetClosedOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebBetClosedOuterClass.java new file mode 100644 index 0000000..5fa5356 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebBetClosedOuterClass.java @@ -0,0 +1,550 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebBetClosed.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebBetClosedOuterClass { + private SCWebBetClosedOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebBetClosedOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebBetClosed) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 maxDelayMillis = 1; + * @return The maxDelayMillis. + */ + long getMaxDelayMillis(); + } + /** + * Protobuf type {@code SCWebBetClosed} + */ + public static final class SCWebBetClosed extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebBetClosed) + SCWebBetClosedOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebBetClosed.newBuilder() to construct. + private SCWebBetClosed(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebBetClosed() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebBetClosed(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.internal_static_SCWebBetClosed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.internal_static_SCWebBetClosed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed.Builder.class); + } + + public static final int MAXDELAYMILLIS_FIELD_NUMBER = 1; + private long maxDelayMillis_ = 0L; + /** + * uint64 maxDelayMillis = 1; + * @return The maxDelayMillis. + */ + @java.lang.Override + public long getMaxDelayMillis() { + return maxDelayMillis_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (maxDelayMillis_ != 0L) { + output.writeUInt64(1, maxDelayMillis_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (maxDelayMillis_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, maxDelayMillis_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed) obj; + + if (getMaxDelayMillis() + != other.getMaxDelayMillis()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MAXDELAYMILLIS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMaxDelayMillis()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebBetClosed} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebBetClosed) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.internal_static_SCWebBetClosed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.internal_static_SCWebBetClosed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + maxDelayMillis_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.internal_static_SCWebBetClosed_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.maxDelayMillis_ = maxDelayMillis_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed.getDefaultInstance()) return this; + if (other.getMaxDelayMillis() != 0L) { + setMaxDelayMillis(other.getMaxDelayMillis()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + maxDelayMillis_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long maxDelayMillis_ ; + /** + * uint64 maxDelayMillis = 1; + * @return The maxDelayMillis. + */ + @java.lang.Override + public long getMaxDelayMillis() { + return maxDelayMillis_; + } + /** + * uint64 maxDelayMillis = 1; + * @param value The maxDelayMillis to set. + * @return This builder for chaining. + */ + public Builder setMaxDelayMillis(long value) { + + maxDelayMillis_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 maxDelayMillis = 1; + * @return This builder for chaining. + */ + public Builder clearMaxDelayMillis() { + bitField0_ = (bitField0_ & ~0x00000001); + maxDelayMillis_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebBetClosed) + } + + // @@protoc_insertion_point(class_scope:SCWebBetClosed) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebBetClosed parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebBetClosedOuterClass.SCWebBetClosed getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebBetClosed_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebBetClosed_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024SCWebBetClosed.proto\"(\n\016SCWebBetClosed" + + "\022\026\n\016maxDelayMillis\030\001 \001(\004B6\n4tech.ordinar" + + "yroad.live.chat.client.kuaishou.protobuf" + + "b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCWebBetClosed_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebBetClosed_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebBetClosed_descriptor, + new java.lang.String[] { "MaxDelayMillis", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebCurrentRedPackFeedOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebCurrentRedPackFeedOuterClass.java new file mode 100644 index 0000000..fc3d24a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebCurrentRedPackFeedOuterClass.java @@ -0,0 +1,858 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebCurrentRedPackFeed.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebCurrentRedPackFeedOuterClass { + private SCWebCurrentRedPackFeedOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebCurrentRedPackFeedOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebCurrentRedPackFeed) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .WebRedPackInfo redPack = 1; + */ + java.util.List + getRedPackList(); + /** + * repeated .WebRedPackInfo redPack = 1; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo getRedPack(int index); + /** + * repeated .WebRedPackInfo redPack = 1; + */ + int getRedPackCount(); + /** + * repeated .WebRedPackInfo redPack = 1; + */ + java.util.List + getRedPackOrBuilderList(); + /** + * repeated .WebRedPackInfo redPack = 1; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfoOrBuilder getRedPackOrBuilder( + int index); + } + /** + * Protobuf type {@code SCWebCurrentRedPackFeed} + */ + public static final class SCWebCurrentRedPackFeed extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebCurrentRedPackFeed) + SCWebCurrentRedPackFeedOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebCurrentRedPackFeed.newBuilder() to construct. + private SCWebCurrentRedPackFeed(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebCurrentRedPackFeed() { + redPack_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebCurrentRedPackFeed(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.internal_static_SCWebCurrentRedPackFeed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.internal_static_SCWebCurrentRedPackFeed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed.Builder.class); + } + + public static final int REDPACK_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List redPack_; + /** + * repeated .WebRedPackInfo redPack = 1; + */ + @java.lang.Override + public java.util.List getRedPackList() { + return redPack_; + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + @java.lang.Override + public java.util.List + getRedPackOrBuilderList() { + return redPack_; + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + @java.lang.Override + public int getRedPackCount() { + return redPack_.size(); + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo getRedPack(int index) { + return redPack_.get(index); + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfoOrBuilder getRedPackOrBuilder( + int index) { + return redPack_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < redPack_.size(); i++) { + output.writeMessage(1, redPack_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < redPack_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, redPack_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed) obj; + + if (!getRedPackList() + .equals(other.getRedPackList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRedPackCount() > 0) { + hash = (37 * hash) + REDPACK_FIELD_NUMBER; + hash = (53 * hash) + getRedPackList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebCurrentRedPackFeed} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebCurrentRedPackFeed) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.internal_static_SCWebCurrentRedPackFeed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.internal_static_SCWebCurrentRedPackFeed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (redPackBuilder_ == null) { + redPack_ = java.util.Collections.emptyList(); + } else { + redPack_ = null; + redPackBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.internal_static_SCWebCurrentRedPackFeed_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed result) { + if (redPackBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + redPack_ = java.util.Collections.unmodifiableList(redPack_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.redPack_ = redPack_; + } else { + result.redPack_ = redPackBuilder_.build(); + } + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed.getDefaultInstance()) return this; + if (redPackBuilder_ == null) { + if (!other.redPack_.isEmpty()) { + if (redPack_.isEmpty()) { + redPack_ = other.redPack_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRedPackIsMutable(); + redPack_.addAll(other.redPack_); + } + onChanged(); + } + } else { + if (!other.redPack_.isEmpty()) { + if (redPackBuilder_.isEmpty()) { + redPackBuilder_.dispose(); + redPackBuilder_ = null; + redPack_ = other.redPack_; + bitField0_ = (bitField0_ & ~0x00000001); + redPackBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getRedPackFieldBuilder() : null; + } else { + redPackBuilder_.addAllMessages(other.redPack_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo m = + input.readMessage( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.parser(), + extensionRegistry); + if (redPackBuilder_ == null) { + ensureRedPackIsMutable(); + redPack_.add(m); + } else { + redPackBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List redPack_ = + java.util.Collections.emptyList(); + private void ensureRedPackIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + redPack_ = new java.util.ArrayList(redPack_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfoOrBuilder> redPackBuilder_; + + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public java.util.List getRedPackList() { + if (redPackBuilder_ == null) { + return java.util.Collections.unmodifiableList(redPack_); + } else { + return redPackBuilder_.getMessageList(); + } + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public int getRedPackCount() { + if (redPackBuilder_ == null) { + return redPack_.size(); + } else { + return redPackBuilder_.getCount(); + } + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo getRedPack(int index) { + if (redPackBuilder_ == null) { + return redPack_.get(index); + } else { + return redPackBuilder_.getMessage(index); + } + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public Builder setRedPack( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo value) { + if (redPackBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRedPackIsMutable(); + redPack_.set(index, value); + onChanged(); + } else { + redPackBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public Builder setRedPack( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.Builder builderForValue) { + if (redPackBuilder_ == null) { + ensureRedPackIsMutable(); + redPack_.set(index, builderForValue.build()); + onChanged(); + } else { + redPackBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public Builder addRedPack(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo value) { + if (redPackBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRedPackIsMutable(); + redPack_.add(value); + onChanged(); + } else { + redPackBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public Builder addRedPack( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo value) { + if (redPackBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRedPackIsMutable(); + redPack_.add(index, value); + onChanged(); + } else { + redPackBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public Builder addRedPack( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.Builder builderForValue) { + if (redPackBuilder_ == null) { + ensureRedPackIsMutable(); + redPack_.add(builderForValue.build()); + onChanged(); + } else { + redPackBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public Builder addRedPack( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.Builder builderForValue) { + if (redPackBuilder_ == null) { + ensureRedPackIsMutable(); + redPack_.add(index, builderForValue.build()); + onChanged(); + } else { + redPackBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public Builder addAllRedPack( + java.lang.Iterable values) { + if (redPackBuilder_ == null) { + ensureRedPackIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, redPack_); + onChanged(); + } else { + redPackBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public Builder clearRedPack() { + if (redPackBuilder_ == null) { + redPack_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + redPackBuilder_.clear(); + } + return this; + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public Builder removeRedPack(int index) { + if (redPackBuilder_ == null) { + ensureRedPackIsMutable(); + redPack_.remove(index); + onChanged(); + } else { + redPackBuilder_.remove(index); + } + return this; + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.Builder getRedPackBuilder( + int index) { + return getRedPackFieldBuilder().getBuilder(index); + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfoOrBuilder getRedPackOrBuilder( + int index) { + if (redPackBuilder_ == null) { + return redPack_.get(index); } else { + return redPackBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public java.util.List + getRedPackOrBuilderList() { + if (redPackBuilder_ != null) { + return redPackBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(redPack_); + } + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.Builder addRedPackBuilder() { + return getRedPackFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.getDefaultInstance()); + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.Builder addRedPackBuilder( + int index) { + return getRedPackFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.getDefaultInstance()); + } + /** + * repeated .WebRedPackInfo redPack = 1; + */ + public java.util.List + getRedPackBuilderList() { + return getRedPackFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfoOrBuilder> + getRedPackFieldBuilder() { + if (redPackBuilder_ == null) { + redPackBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfoOrBuilder>( + redPack_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + redPack_ = null; + } + return redPackBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebCurrentRedPackFeed) + } + + // @@protoc_insertion_point(class_scope:SCWebCurrentRedPackFeed) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebCurrentRedPackFeed parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebCurrentRedPackFeedOuterClass.SCWebCurrentRedPackFeed getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebCurrentRedPackFeed_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebCurrentRedPackFeed_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\035SCWebCurrentRedPackFeed.proto\032\024WebRedP" + + "ackInfo.proto\";\n\027SCWebCurrentRedPackFeed" + + "\022 \n\007redPack\030\001 \003(\0132\017.WebRedPackInfoB6\n4te" + + "ch.ordinaryroad.live.chat.client.kuaisho" + + "u.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.getDescriptor(), + }); + internal_static_SCWebCurrentRedPackFeed_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebCurrentRedPackFeed_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebCurrentRedPackFeed_descriptor, + new java.lang.String[] { "RedPack", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebEnterRoomAckOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebEnterRoomAckOuterClass.java new file mode 100644 index 0000000..bc9092d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebEnterRoomAckOuterClass.java @@ -0,0 +1,697 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebEnterRoomAck.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebEnterRoomAckOuterClass { + private SCWebEnterRoomAckOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebEnterRoomAckOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebEnterRoomAck) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 minReconnectMs = 1; + * @return The minReconnectMs. + */ + long getMinReconnectMs(); + + /** + * uint64 maxReconnectMs = 2; + * @return The maxReconnectMs. + */ + long getMaxReconnectMs(); + + /** + * uint64 heartbeatIntervalMs = 3; + * @return The heartbeatIntervalMs. + */ + long getHeartbeatIntervalMs(); + } + /** + * Protobuf type {@code SCWebEnterRoomAck} + */ + public static final class SCWebEnterRoomAck extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebEnterRoomAck) + SCWebEnterRoomAckOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebEnterRoomAck.newBuilder() to construct. + private SCWebEnterRoomAck(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebEnterRoomAck() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebEnterRoomAck(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.internal_static_SCWebEnterRoomAck_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.internal_static_SCWebEnterRoomAck_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck.Builder.class); + } + + public static final int MINRECONNECTMS_FIELD_NUMBER = 1; + private long minReconnectMs_ = 0L; + /** + * uint64 minReconnectMs = 1; + * @return The minReconnectMs. + */ + @java.lang.Override + public long getMinReconnectMs() { + return minReconnectMs_; + } + + public static final int MAXRECONNECTMS_FIELD_NUMBER = 2; + private long maxReconnectMs_ = 0L; + /** + * uint64 maxReconnectMs = 2; + * @return The maxReconnectMs. + */ + @java.lang.Override + public long getMaxReconnectMs() { + return maxReconnectMs_; + } + + public static final int HEARTBEATINTERVALMS_FIELD_NUMBER = 3; + private long heartbeatIntervalMs_ = 0L; + /** + * uint64 heartbeatIntervalMs = 3; + * @return The heartbeatIntervalMs. + */ + @java.lang.Override + public long getHeartbeatIntervalMs() { + return heartbeatIntervalMs_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (minReconnectMs_ != 0L) { + output.writeUInt64(1, minReconnectMs_); + } + if (maxReconnectMs_ != 0L) { + output.writeUInt64(2, maxReconnectMs_); + } + if (heartbeatIntervalMs_ != 0L) { + output.writeUInt64(3, heartbeatIntervalMs_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minReconnectMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, minReconnectMs_); + } + if (maxReconnectMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, maxReconnectMs_); + } + if (heartbeatIntervalMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, heartbeatIntervalMs_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck) obj; + + if (getMinReconnectMs() + != other.getMinReconnectMs()) return false; + if (getMaxReconnectMs() + != other.getMaxReconnectMs()) return false; + if (getHeartbeatIntervalMs() + != other.getHeartbeatIntervalMs()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MINRECONNECTMS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMinReconnectMs()); + hash = (37 * hash) + MAXRECONNECTMS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMaxReconnectMs()); + hash = (37 * hash) + HEARTBEATINTERVALMS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getHeartbeatIntervalMs()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebEnterRoomAck} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebEnterRoomAck) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAckOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.internal_static_SCWebEnterRoomAck_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.internal_static_SCWebEnterRoomAck_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minReconnectMs_ = 0L; + maxReconnectMs_ = 0L; + heartbeatIntervalMs_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.internal_static_SCWebEnterRoomAck_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.minReconnectMs_ = minReconnectMs_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxReconnectMs_ = maxReconnectMs_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.heartbeatIntervalMs_ = heartbeatIntervalMs_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck.getDefaultInstance()) return this; + if (other.getMinReconnectMs() != 0L) { + setMinReconnectMs(other.getMinReconnectMs()); + } + if (other.getMaxReconnectMs() != 0L) { + setMaxReconnectMs(other.getMaxReconnectMs()); + } + if (other.getHeartbeatIntervalMs() != 0L) { + setHeartbeatIntervalMs(other.getHeartbeatIntervalMs()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + minReconnectMs_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + maxReconnectMs_ = input.readUInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + heartbeatIntervalMs_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long minReconnectMs_ ; + /** + * uint64 minReconnectMs = 1; + * @return The minReconnectMs. + */ + @java.lang.Override + public long getMinReconnectMs() { + return minReconnectMs_; + } + /** + * uint64 minReconnectMs = 1; + * @param value The minReconnectMs to set. + * @return This builder for chaining. + */ + public Builder setMinReconnectMs(long value) { + + minReconnectMs_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 minReconnectMs = 1; + * @return This builder for chaining. + */ + public Builder clearMinReconnectMs() { + bitField0_ = (bitField0_ & ~0x00000001); + minReconnectMs_ = 0L; + onChanged(); + return this; + } + + private long maxReconnectMs_ ; + /** + * uint64 maxReconnectMs = 2; + * @return The maxReconnectMs. + */ + @java.lang.Override + public long getMaxReconnectMs() { + return maxReconnectMs_; + } + /** + * uint64 maxReconnectMs = 2; + * @param value The maxReconnectMs to set. + * @return This builder for chaining. + */ + public Builder setMaxReconnectMs(long value) { + + maxReconnectMs_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint64 maxReconnectMs = 2; + * @return This builder for chaining. + */ + public Builder clearMaxReconnectMs() { + bitField0_ = (bitField0_ & ~0x00000002); + maxReconnectMs_ = 0L; + onChanged(); + return this; + } + + private long heartbeatIntervalMs_ ; + /** + * uint64 heartbeatIntervalMs = 3; + * @return The heartbeatIntervalMs. + */ + @java.lang.Override + public long getHeartbeatIntervalMs() { + return heartbeatIntervalMs_; + } + /** + * uint64 heartbeatIntervalMs = 3; + * @param value The heartbeatIntervalMs to set. + * @return This builder for chaining. + */ + public Builder setHeartbeatIntervalMs(long value) { + + heartbeatIntervalMs_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 heartbeatIntervalMs = 3; + * @return This builder for chaining. + */ + public Builder clearHeartbeatIntervalMs() { + bitField0_ = (bitField0_ & ~0x00000004); + heartbeatIntervalMs_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebEnterRoomAck) + } + + // @@protoc_insertion_point(class_scope:SCWebEnterRoomAck) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebEnterRoomAck parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebEnterRoomAckOuterClass.SCWebEnterRoomAck getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebEnterRoomAck_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebEnterRoomAck_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\027SCWebEnterRoomAck.proto\"`\n\021SCWebEnterR" + + "oomAck\022\026\n\016minReconnectMs\030\001 \001(\004\022\026\n\016maxRec" + + "onnectMs\030\002 \001(\004\022\033\n\023heartbeatIntervalMs\030\003 " + + "\001(\004B6\n4tech.ordinaryroad.live.chat.clien" + + "t.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCWebEnterRoomAck_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebEnterRoomAck_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebEnterRoomAck_descriptor, + new java.lang.String[] { "MinReconnectMs", "MaxReconnectMs", "HeartbeatIntervalMs", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebErrorOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebErrorOuterClass.java new file mode 100644 index 0000000..e033d81 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebErrorOuterClass.java @@ -0,0 +1,769 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebError.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebErrorOuterClass { + private SCWebErrorOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebErrorOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebError) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 code = 1; + * @return The code. + */ + int getCode(); + + /** + * string msg = 2; + * @return The msg. + */ + java.lang.String getMsg(); + /** + * string msg = 2; + * @return The bytes for msg. + */ + com.google.protobuf.ByteString + getMsgBytes(); + + /** + * uint32 subCode = 3; + * @return The subCode. + */ + int getSubCode(); + } + /** + * Protobuf type {@code SCWebError} + */ + public static final class SCWebError extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebError) + SCWebErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebError.newBuilder() to construct. + private SCWebError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebError() { + msg_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebError(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.internal_static_SCWebError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.internal_static_SCWebError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError.Builder.class); + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_ = 0; + /** + * uint32 code = 1; + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + public static final int MSG_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object msg_ = ""; + /** + * string msg = 2; + * @return The msg. + */ + @java.lang.Override + public java.lang.String getMsg() { + java.lang.Object ref = msg_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + msg_ = s; + return s; + } + } + /** + * string msg = 2; + * @return The bytes for msg. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMsgBytes() { + java.lang.Object ref = msg_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUBCODE_FIELD_NUMBER = 3; + private int subCode_ = 0; + /** + * uint32 subCode = 3; + * @return The subCode. + */ + @java.lang.Override + public int getSubCode() { + return subCode_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (code_ != 0) { + output.writeUInt32(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msg_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, msg_); + } + if (subCode_ != 0) { + output.writeUInt32(3, subCode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msg_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, msg_); + } + if (subCode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, subCode_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError) obj; + + if (getCode() + != other.getCode()) return false; + if (!getMsg() + .equals(other.getMsg())) return false; + if (getSubCode() + != other.getSubCode()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode(); + hash = (37 * hash) + MSG_FIELD_NUMBER; + hash = (53 * hash) + getMsg().hashCode(); + hash = (37 * hash) + SUBCODE_FIELD_NUMBER; + hash = (53 * hash) + getSubCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebError} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebError) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.internal_static_SCWebError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.internal_static_SCWebError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = 0; + msg_ = ""; + subCode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.internal_static_SCWebError_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.msg_ = msg_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.subCode_ = subCode_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError.getDefaultInstance()) return this; + if (other.getCode() != 0) { + setCode(other.getCode()); + } + if (!other.getMsg().isEmpty()) { + msg_ = other.msg_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getSubCode() != 0) { + setSubCode(other.getSubCode()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + code_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + msg_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + subCode_ = input.readUInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int code_ ; + /** + * uint32 code = 1; + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + /** + * uint32 code = 1; + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(int value) { + + code_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint32 code = 1; + * @return This builder for chaining. + */ + public Builder clearCode() { + bitField0_ = (bitField0_ & ~0x00000001); + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object msg_ = ""; + /** + * string msg = 2; + * @return The msg. + */ + public java.lang.String getMsg() { + java.lang.Object ref = msg_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + msg_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string msg = 2; + * @return The bytes for msg. + */ + public com.google.protobuf.ByteString + getMsgBytes() { + java.lang.Object ref = msg_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string msg = 2; + * @param value The msg to set. + * @return This builder for chaining. + */ + public Builder setMsg( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + msg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string msg = 2; + * @return This builder for chaining. + */ + public Builder clearMsg() { + msg_ = getDefaultInstance().getMsg(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string msg = 2; + * @param value The bytes for msg to set. + * @return This builder for chaining. + */ + public Builder setMsgBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + msg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int subCode_ ; + /** + * uint32 subCode = 3; + * @return The subCode. + */ + @java.lang.Override + public int getSubCode() { + return subCode_; + } + /** + * uint32 subCode = 3; + * @param value The subCode to set. + * @return This builder for chaining. + */ + public Builder setSubCode(int value) { + + subCode_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint32 subCode = 3; + * @return This builder for chaining. + */ + public Builder clearSubCode() { + bitField0_ = (bitField0_ & ~0x00000004); + subCode_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebError) + } + + // @@protoc_insertion_point(class_scope:SCWebError) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebErrorOuterClass.SCWebError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebError_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebError_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\020SCWebError.proto\"8\n\nSCWebError\022\014\n\004code" + + "\030\001 \001(\r\022\013\n\003msg\030\002 \001(\t\022\017\n\007subCode\030\003 \001(\rB6\n4" + + "tech.ordinaryroad.live.chat.client.kuais" + + "hou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCWebError_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebError_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebError_descriptor, + new java.lang.String[] { "Code", "Msg", "SubCode", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebFeedPushOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebFeedPushOuterClass.java new file mode 100644 index 0000000..ab940c6 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebFeedPushOuterClass.java @@ -0,0 +1,3487 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebFeedPush.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebFeedPushOuterClass { + private SCWebFeedPushOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebFeedPushOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebFeedPush) + com.google.protobuf.MessageOrBuilder { + + /** + * string displayWatchingCount = 1; + * @return The displayWatchingCount. + */ + java.lang.String getDisplayWatchingCount(); + /** + * string displayWatchingCount = 1; + * @return The bytes for displayWatchingCount. + */ + com.google.protobuf.ByteString + getDisplayWatchingCountBytes(); + + /** + * string displayLikeCount = 2; + * @return The displayLikeCount. + */ + java.lang.String getDisplayLikeCount(); + /** + * string displayLikeCount = 2; + * @return The bytes for displayLikeCount. + */ + com.google.protobuf.ByteString + getDisplayLikeCountBytes(); + + /** + * uint64 pendingLikeCount = 3; + * @return The pendingLikeCount. + */ + long getPendingLikeCount(); + + /** + * uint64 pushInterval = 4; + * @return The pushInterval. + */ + long getPushInterval(); + + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + java.util.List + getCommentFeedsList(); + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed getCommentFeeds(int index); + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + int getCommentFeedsCount(); + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + java.util.List + getCommentFeedsOrBuilderList(); + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeedOrBuilder getCommentFeedsOrBuilder( + int index); + + /** + * string commentCursor = 6; + * @return The commentCursor. + */ + java.lang.String getCommentCursor(); + /** + * string commentCursor = 6; + * @return The bytes for commentCursor. + */ + com.google.protobuf.ByteString + getCommentCursorBytes(); + + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + java.util.List + getComboCommentFeedList(); + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed getComboCommentFeed(int index); + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + int getComboCommentFeedCount(); + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + java.util.List + getComboCommentFeedOrBuilderList(); + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeedOrBuilder getComboCommentFeedOrBuilder( + int index); + + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + java.util.List + getLikeFeedsList(); + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed getLikeFeeds(int index); + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + int getLikeFeedsCount(); + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + java.util.List + getLikeFeedsOrBuilderList(); + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeedOrBuilder getLikeFeedsOrBuilder( + int index); + + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + java.util.List + getGiftFeedsList(); + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed getGiftFeeds(int index); + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + int getGiftFeedsCount(); + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + java.util.List + getGiftFeedsOrBuilderList(); + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeedOrBuilder getGiftFeedsOrBuilder( + int index); + + /** + * string giftCursor = 10; + * @return The giftCursor. + */ + java.lang.String getGiftCursor(); + /** + * string giftCursor = 10; + * @return The bytes for giftCursor. + */ + com.google.protobuf.ByteString + getGiftCursorBytes(); + + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + java.util.List + getSystemNoticeFeedsList(); + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed getSystemNoticeFeeds(int index); + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + int getSystemNoticeFeedsCount(); + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + java.util.List + getSystemNoticeFeedsOrBuilderList(); + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeedOrBuilder getSystemNoticeFeedsOrBuilder( + int index); + + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + java.util.List + getShareFeedsList(); + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed getShareFeeds(int index); + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + int getShareFeedsCount(); + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + java.util.List + getShareFeedsOrBuilderList(); + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeedOrBuilder getShareFeedsOrBuilder( + int index); + } + /** + * Protobuf type {@code SCWebFeedPush} + */ + public static final class SCWebFeedPush extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebFeedPush) + SCWebFeedPushOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebFeedPush.newBuilder() to construct. + private SCWebFeedPush(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebFeedPush() { + displayWatchingCount_ = ""; + displayLikeCount_ = ""; + commentFeeds_ = java.util.Collections.emptyList(); + commentCursor_ = ""; + comboCommentFeed_ = java.util.Collections.emptyList(); + likeFeeds_ = java.util.Collections.emptyList(); + giftFeeds_ = java.util.Collections.emptyList(); + giftCursor_ = ""; + systemNoticeFeeds_ = java.util.Collections.emptyList(); + shareFeeds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebFeedPush(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.internal_static_SCWebFeedPush_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.internal_static_SCWebFeedPush_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush.Builder.class); + } + + public static final int DISPLAYWATCHINGCOUNT_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object displayWatchingCount_ = ""; + /** + * string displayWatchingCount = 1; + * @return The displayWatchingCount. + */ + @java.lang.Override + public java.lang.String getDisplayWatchingCount() { + java.lang.Object ref = displayWatchingCount_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayWatchingCount_ = s; + return s; + } + } + /** + * string displayWatchingCount = 1; + * @return The bytes for displayWatchingCount. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDisplayWatchingCountBytes() { + java.lang.Object ref = displayWatchingCount_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayWatchingCount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAYLIKECOUNT_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object displayLikeCount_ = ""; + /** + * string displayLikeCount = 2; + * @return The displayLikeCount. + */ + @java.lang.Override + public java.lang.String getDisplayLikeCount() { + java.lang.Object ref = displayLikeCount_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayLikeCount_ = s; + return s; + } + } + /** + * string displayLikeCount = 2; + * @return The bytes for displayLikeCount. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDisplayLikeCountBytes() { + java.lang.Object ref = displayLikeCount_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayLikeCount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PENDINGLIKECOUNT_FIELD_NUMBER = 3; + private long pendingLikeCount_ = 0L; + /** + * uint64 pendingLikeCount = 3; + * @return The pendingLikeCount. + */ + @java.lang.Override + public long getPendingLikeCount() { + return pendingLikeCount_; + } + + public static final int PUSHINTERVAL_FIELD_NUMBER = 4; + private long pushInterval_ = 0L; + /** + * uint64 pushInterval = 4; + * @return The pushInterval. + */ + @java.lang.Override + public long getPushInterval() { + return pushInterval_; + } + + public static final int COMMENTFEEDS_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private java.util.List commentFeeds_; + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + @java.lang.Override + public java.util.List getCommentFeedsList() { + return commentFeeds_; + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + @java.lang.Override + public java.util.List + getCommentFeedsOrBuilderList() { + return commentFeeds_; + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + @java.lang.Override + public int getCommentFeedsCount() { + return commentFeeds_.size(); + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed getCommentFeeds(int index) { + return commentFeeds_.get(index); + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeedOrBuilder getCommentFeedsOrBuilder( + int index) { + return commentFeeds_.get(index); + } + + public static final int COMMENTCURSOR_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object commentCursor_ = ""; + /** + * string commentCursor = 6; + * @return The commentCursor. + */ + @java.lang.Override + public java.lang.String getCommentCursor() { + java.lang.Object ref = commentCursor_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + commentCursor_ = s; + return s; + } + } + /** + * string commentCursor = 6; + * @return The bytes for commentCursor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCommentCursorBytes() { + java.lang.Object ref = commentCursor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + commentCursor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMBOCOMMENTFEED_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private java.util.List comboCommentFeed_; + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + @java.lang.Override + public java.util.List getComboCommentFeedList() { + return comboCommentFeed_; + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + @java.lang.Override + public java.util.List + getComboCommentFeedOrBuilderList() { + return comboCommentFeed_; + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + @java.lang.Override + public int getComboCommentFeedCount() { + return comboCommentFeed_.size(); + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed getComboCommentFeed(int index) { + return comboCommentFeed_.get(index); + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeedOrBuilder getComboCommentFeedOrBuilder( + int index) { + return comboCommentFeed_.get(index); + } + + public static final int LIKEFEEDS_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private java.util.List likeFeeds_; + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + @java.lang.Override + public java.util.List getLikeFeedsList() { + return likeFeeds_; + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + @java.lang.Override + public java.util.List + getLikeFeedsOrBuilderList() { + return likeFeeds_; + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + @java.lang.Override + public int getLikeFeedsCount() { + return likeFeeds_.size(); + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed getLikeFeeds(int index) { + return likeFeeds_.get(index); + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeedOrBuilder getLikeFeedsOrBuilder( + int index) { + return likeFeeds_.get(index); + } + + public static final int GIFTFEEDS_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private java.util.List giftFeeds_; + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + @java.lang.Override + public java.util.List getGiftFeedsList() { + return giftFeeds_; + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + @java.lang.Override + public java.util.List + getGiftFeedsOrBuilderList() { + return giftFeeds_; + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + @java.lang.Override + public int getGiftFeedsCount() { + return giftFeeds_.size(); + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed getGiftFeeds(int index) { + return giftFeeds_.get(index); + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeedOrBuilder getGiftFeedsOrBuilder( + int index) { + return giftFeeds_.get(index); + } + + public static final int GIFTCURSOR_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private volatile java.lang.Object giftCursor_ = ""; + /** + * string giftCursor = 10; + * @return The giftCursor. + */ + @java.lang.Override + public java.lang.String getGiftCursor() { + java.lang.Object ref = giftCursor_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + giftCursor_ = s; + return s; + } + } + /** + * string giftCursor = 10; + * @return The bytes for giftCursor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGiftCursorBytes() { + java.lang.Object ref = giftCursor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + giftCursor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SYSTEMNOTICEFEEDS_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private java.util.List systemNoticeFeeds_; + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + @java.lang.Override + public java.util.List getSystemNoticeFeedsList() { + return systemNoticeFeeds_; + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + @java.lang.Override + public java.util.List + getSystemNoticeFeedsOrBuilderList() { + return systemNoticeFeeds_; + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + @java.lang.Override + public int getSystemNoticeFeedsCount() { + return systemNoticeFeeds_.size(); + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed getSystemNoticeFeeds(int index) { + return systemNoticeFeeds_.get(index); + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeedOrBuilder getSystemNoticeFeedsOrBuilder( + int index) { + return systemNoticeFeeds_.get(index); + } + + public static final int SHAREFEEDS_FIELD_NUMBER = 12; + @SuppressWarnings("serial") + private java.util.List shareFeeds_; + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + @java.lang.Override + public java.util.List getShareFeedsList() { + return shareFeeds_; + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + @java.lang.Override + public java.util.List + getShareFeedsOrBuilderList() { + return shareFeeds_; + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + @java.lang.Override + public int getShareFeedsCount() { + return shareFeeds_.size(); + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed getShareFeeds(int index) { + return shareFeeds_.get(index); + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeedOrBuilder getShareFeedsOrBuilder( + int index) { + return shareFeeds_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayWatchingCount_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, displayWatchingCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayLikeCount_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayLikeCount_); + } + if (pendingLikeCount_ != 0L) { + output.writeUInt64(3, pendingLikeCount_); + } + if (pushInterval_ != 0L) { + output.writeUInt64(4, pushInterval_); + } + for (int i = 0; i < commentFeeds_.size(); i++) { + output.writeMessage(5, commentFeeds_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(commentCursor_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, commentCursor_); + } + for (int i = 0; i < comboCommentFeed_.size(); i++) { + output.writeMessage(7, comboCommentFeed_.get(i)); + } + for (int i = 0; i < likeFeeds_.size(); i++) { + output.writeMessage(8, likeFeeds_.get(i)); + } + for (int i = 0; i < giftFeeds_.size(); i++) { + output.writeMessage(9, giftFeeds_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(giftCursor_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, giftCursor_); + } + for (int i = 0; i < systemNoticeFeeds_.size(); i++) { + output.writeMessage(11, systemNoticeFeeds_.get(i)); + } + for (int i = 0; i < shareFeeds_.size(); i++) { + output.writeMessage(12, shareFeeds_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayWatchingCount_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, displayWatchingCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayLikeCount_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayLikeCount_); + } + if (pendingLikeCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, pendingLikeCount_); + } + if (pushInterval_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, pushInterval_); + } + for (int i = 0; i < commentFeeds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, commentFeeds_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(commentCursor_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, commentCursor_); + } + for (int i = 0; i < comboCommentFeed_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, comboCommentFeed_.get(i)); + } + for (int i = 0; i < likeFeeds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, likeFeeds_.get(i)); + } + for (int i = 0; i < giftFeeds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, giftFeeds_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(giftCursor_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, giftCursor_); + } + for (int i = 0; i < systemNoticeFeeds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, systemNoticeFeeds_.get(i)); + } + for (int i = 0; i < shareFeeds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, shareFeeds_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush) obj; + + if (!getDisplayWatchingCount() + .equals(other.getDisplayWatchingCount())) return false; + if (!getDisplayLikeCount() + .equals(other.getDisplayLikeCount())) return false; + if (getPendingLikeCount() + != other.getPendingLikeCount()) return false; + if (getPushInterval() + != other.getPushInterval()) return false; + if (!getCommentFeedsList() + .equals(other.getCommentFeedsList())) return false; + if (!getCommentCursor() + .equals(other.getCommentCursor())) return false; + if (!getComboCommentFeedList() + .equals(other.getComboCommentFeedList())) return false; + if (!getLikeFeedsList() + .equals(other.getLikeFeedsList())) return false; + if (!getGiftFeedsList() + .equals(other.getGiftFeedsList())) return false; + if (!getGiftCursor() + .equals(other.getGiftCursor())) return false; + if (!getSystemNoticeFeedsList() + .equals(other.getSystemNoticeFeedsList())) return false; + if (!getShareFeedsList() + .equals(other.getShareFeedsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DISPLAYWATCHINGCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getDisplayWatchingCount().hashCode(); + hash = (37 * hash) + DISPLAYLIKECOUNT_FIELD_NUMBER; + hash = (53 * hash) + getDisplayLikeCount().hashCode(); + hash = (37 * hash) + PENDINGLIKECOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPendingLikeCount()); + hash = (37 * hash) + PUSHINTERVAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPushInterval()); + if (getCommentFeedsCount() > 0) { + hash = (37 * hash) + COMMENTFEEDS_FIELD_NUMBER; + hash = (53 * hash) + getCommentFeedsList().hashCode(); + } + hash = (37 * hash) + COMMENTCURSOR_FIELD_NUMBER; + hash = (53 * hash) + getCommentCursor().hashCode(); + if (getComboCommentFeedCount() > 0) { + hash = (37 * hash) + COMBOCOMMENTFEED_FIELD_NUMBER; + hash = (53 * hash) + getComboCommentFeedList().hashCode(); + } + if (getLikeFeedsCount() > 0) { + hash = (37 * hash) + LIKEFEEDS_FIELD_NUMBER; + hash = (53 * hash) + getLikeFeedsList().hashCode(); + } + if (getGiftFeedsCount() > 0) { + hash = (37 * hash) + GIFTFEEDS_FIELD_NUMBER; + hash = (53 * hash) + getGiftFeedsList().hashCode(); + } + hash = (37 * hash) + GIFTCURSOR_FIELD_NUMBER; + hash = (53 * hash) + getGiftCursor().hashCode(); + if (getSystemNoticeFeedsCount() > 0) { + hash = (37 * hash) + SYSTEMNOTICEFEEDS_FIELD_NUMBER; + hash = (53 * hash) + getSystemNoticeFeedsList().hashCode(); + } + if (getShareFeedsCount() > 0) { + hash = (37 * hash) + SHAREFEEDS_FIELD_NUMBER; + hash = (53 * hash) + getShareFeedsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebFeedPush} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebFeedPush) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPushOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.internal_static_SCWebFeedPush_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.internal_static_SCWebFeedPush_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + displayWatchingCount_ = ""; + displayLikeCount_ = ""; + pendingLikeCount_ = 0L; + pushInterval_ = 0L; + if (commentFeedsBuilder_ == null) { + commentFeeds_ = java.util.Collections.emptyList(); + } else { + commentFeeds_ = null; + commentFeedsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + commentCursor_ = ""; + if (comboCommentFeedBuilder_ == null) { + comboCommentFeed_ = java.util.Collections.emptyList(); + } else { + comboCommentFeed_ = null; + comboCommentFeedBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + if (likeFeedsBuilder_ == null) { + likeFeeds_ = java.util.Collections.emptyList(); + } else { + likeFeeds_ = null; + likeFeedsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + if (giftFeedsBuilder_ == null) { + giftFeeds_ = java.util.Collections.emptyList(); + } else { + giftFeeds_ = null; + giftFeedsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + giftCursor_ = ""; + if (systemNoticeFeedsBuilder_ == null) { + systemNoticeFeeds_ = java.util.Collections.emptyList(); + } else { + systemNoticeFeeds_ = null; + systemNoticeFeedsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + if (shareFeedsBuilder_ == null) { + shareFeeds_ = java.util.Collections.emptyList(); + } else { + shareFeeds_ = null; + shareFeedsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000800); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.internal_static_SCWebFeedPush_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush result) { + if (commentFeedsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + commentFeeds_ = java.util.Collections.unmodifiableList(commentFeeds_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.commentFeeds_ = commentFeeds_; + } else { + result.commentFeeds_ = commentFeedsBuilder_.build(); + } + if (comboCommentFeedBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + comboCommentFeed_ = java.util.Collections.unmodifiableList(comboCommentFeed_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.comboCommentFeed_ = comboCommentFeed_; + } else { + result.comboCommentFeed_ = comboCommentFeedBuilder_.build(); + } + if (likeFeedsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + likeFeeds_ = java.util.Collections.unmodifiableList(likeFeeds_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.likeFeeds_ = likeFeeds_; + } else { + result.likeFeeds_ = likeFeedsBuilder_.build(); + } + if (giftFeedsBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0)) { + giftFeeds_ = java.util.Collections.unmodifiableList(giftFeeds_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.giftFeeds_ = giftFeeds_; + } else { + result.giftFeeds_ = giftFeedsBuilder_.build(); + } + if (systemNoticeFeedsBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + systemNoticeFeeds_ = java.util.Collections.unmodifiableList(systemNoticeFeeds_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.systemNoticeFeeds_ = systemNoticeFeeds_; + } else { + result.systemNoticeFeeds_ = systemNoticeFeedsBuilder_.build(); + } + if (shareFeedsBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0)) { + shareFeeds_ = java.util.Collections.unmodifiableList(shareFeeds_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.shareFeeds_ = shareFeeds_; + } else { + result.shareFeeds_ = shareFeedsBuilder_.build(); + } + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.displayWatchingCount_ = displayWatchingCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayLikeCount_ = displayLikeCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pendingLikeCount_ = pendingLikeCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pushInterval_ = pushInterval_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.commentCursor_ = commentCursor_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.giftCursor_ = giftCursor_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush.getDefaultInstance()) return this; + if (!other.getDisplayWatchingCount().isEmpty()) { + displayWatchingCount_ = other.displayWatchingCount_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayLikeCount().isEmpty()) { + displayLikeCount_ = other.displayLikeCount_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPendingLikeCount() != 0L) { + setPendingLikeCount(other.getPendingLikeCount()); + } + if (other.getPushInterval() != 0L) { + setPushInterval(other.getPushInterval()); + } + if (commentFeedsBuilder_ == null) { + if (!other.commentFeeds_.isEmpty()) { + if (commentFeeds_.isEmpty()) { + commentFeeds_ = other.commentFeeds_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureCommentFeedsIsMutable(); + commentFeeds_.addAll(other.commentFeeds_); + } + onChanged(); + } + } else { + if (!other.commentFeeds_.isEmpty()) { + if (commentFeedsBuilder_.isEmpty()) { + commentFeedsBuilder_.dispose(); + commentFeedsBuilder_ = null; + commentFeeds_ = other.commentFeeds_; + bitField0_ = (bitField0_ & ~0x00000010); + commentFeedsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getCommentFeedsFieldBuilder() : null; + } else { + commentFeedsBuilder_.addAllMessages(other.commentFeeds_); + } + } + } + if (!other.getCommentCursor().isEmpty()) { + commentCursor_ = other.commentCursor_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (comboCommentFeedBuilder_ == null) { + if (!other.comboCommentFeed_.isEmpty()) { + if (comboCommentFeed_.isEmpty()) { + comboCommentFeed_ = other.comboCommentFeed_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureComboCommentFeedIsMutable(); + comboCommentFeed_.addAll(other.comboCommentFeed_); + } + onChanged(); + } + } else { + if (!other.comboCommentFeed_.isEmpty()) { + if (comboCommentFeedBuilder_.isEmpty()) { + comboCommentFeedBuilder_.dispose(); + comboCommentFeedBuilder_ = null; + comboCommentFeed_ = other.comboCommentFeed_; + bitField0_ = (bitField0_ & ~0x00000040); + comboCommentFeedBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getComboCommentFeedFieldBuilder() : null; + } else { + comboCommentFeedBuilder_.addAllMessages(other.comboCommentFeed_); + } + } + } + if (likeFeedsBuilder_ == null) { + if (!other.likeFeeds_.isEmpty()) { + if (likeFeeds_.isEmpty()) { + likeFeeds_ = other.likeFeeds_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureLikeFeedsIsMutable(); + likeFeeds_.addAll(other.likeFeeds_); + } + onChanged(); + } + } else { + if (!other.likeFeeds_.isEmpty()) { + if (likeFeedsBuilder_.isEmpty()) { + likeFeedsBuilder_.dispose(); + likeFeedsBuilder_ = null; + likeFeeds_ = other.likeFeeds_; + bitField0_ = (bitField0_ & ~0x00000080); + likeFeedsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLikeFeedsFieldBuilder() : null; + } else { + likeFeedsBuilder_.addAllMessages(other.likeFeeds_); + } + } + } + if (giftFeedsBuilder_ == null) { + if (!other.giftFeeds_.isEmpty()) { + if (giftFeeds_.isEmpty()) { + giftFeeds_ = other.giftFeeds_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureGiftFeedsIsMutable(); + giftFeeds_.addAll(other.giftFeeds_); + } + onChanged(); + } + } else { + if (!other.giftFeeds_.isEmpty()) { + if (giftFeedsBuilder_.isEmpty()) { + giftFeedsBuilder_.dispose(); + giftFeedsBuilder_ = null; + giftFeeds_ = other.giftFeeds_; + bitField0_ = (bitField0_ & ~0x00000100); + giftFeedsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getGiftFeedsFieldBuilder() : null; + } else { + giftFeedsBuilder_.addAllMessages(other.giftFeeds_); + } + } + } + if (!other.getGiftCursor().isEmpty()) { + giftCursor_ = other.giftCursor_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (systemNoticeFeedsBuilder_ == null) { + if (!other.systemNoticeFeeds_.isEmpty()) { + if (systemNoticeFeeds_.isEmpty()) { + systemNoticeFeeds_ = other.systemNoticeFeeds_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureSystemNoticeFeedsIsMutable(); + systemNoticeFeeds_.addAll(other.systemNoticeFeeds_); + } + onChanged(); + } + } else { + if (!other.systemNoticeFeeds_.isEmpty()) { + if (systemNoticeFeedsBuilder_.isEmpty()) { + systemNoticeFeedsBuilder_.dispose(); + systemNoticeFeedsBuilder_ = null; + systemNoticeFeeds_ = other.systemNoticeFeeds_; + bitField0_ = (bitField0_ & ~0x00000400); + systemNoticeFeedsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSystemNoticeFeedsFieldBuilder() : null; + } else { + systemNoticeFeedsBuilder_.addAllMessages(other.systemNoticeFeeds_); + } + } + } + if (shareFeedsBuilder_ == null) { + if (!other.shareFeeds_.isEmpty()) { + if (shareFeeds_.isEmpty()) { + shareFeeds_ = other.shareFeeds_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensureShareFeedsIsMutable(); + shareFeeds_.addAll(other.shareFeeds_); + } + onChanged(); + } + } else { + if (!other.shareFeeds_.isEmpty()) { + if (shareFeedsBuilder_.isEmpty()) { + shareFeedsBuilder_.dispose(); + shareFeedsBuilder_ = null; + shareFeeds_ = other.shareFeeds_; + bitField0_ = (bitField0_ & ~0x00000800); + shareFeedsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getShareFeedsFieldBuilder() : null; + } else { + shareFeedsBuilder_.addAllMessages(other.shareFeeds_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + displayWatchingCount_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + displayLikeCount_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + pendingLikeCount_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + pushInterval_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed m = + input.readMessage( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.parser(), + extensionRegistry); + if (commentFeedsBuilder_ == null) { + ensureCommentFeedsIsMutable(); + commentFeeds_.add(m); + } else { + commentFeedsBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: { + commentCursor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed m = + input.readMessage( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.parser(), + extensionRegistry); + if (comboCommentFeedBuilder_ == null) { + ensureComboCommentFeedIsMutable(); + comboCommentFeed_.add(m); + } else { + comboCommentFeedBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed m = + input.readMessage( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.parser(), + extensionRegistry); + if (likeFeedsBuilder_ == null) { + ensureLikeFeedsIsMutable(); + likeFeeds_.add(m); + } else { + likeFeedsBuilder_.addMessage(m); + } + break; + } // case 66 + case 74: { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed m = + input.readMessage( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.parser(), + extensionRegistry); + if (giftFeedsBuilder_ == null) { + ensureGiftFeedsIsMutable(); + giftFeeds_.add(m); + } else { + giftFeedsBuilder_.addMessage(m); + } + break; + } // case 74 + case 82: { + giftCursor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed m = + input.readMessage( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.parser(), + extensionRegistry); + if (systemNoticeFeedsBuilder_ == null) { + ensureSystemNoticeFeedsIsMutable(); + systemNoticeFeeds_.add(m); + } else { + systemNoticeFeedsBuilder_.addMessage(m); + } + break; + } // case 90 + case 98: { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed m = + input.readMessage( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.parser(), + extensionRegistry); + if (shareFeedsBuilder_ == null) { + ensureShareFeedsIsMutable(); + shareFeeds_.add(m); + } else { + shareFeedsBuilder_.addMessage(m); + } + break; + } // case 98 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object displayWatchingCount_ = ""; + /** + * string displayWatchingCount = 1; + * @return The displayWatchingCount. + */ + public java.lang.String getDisplayWatchingCount() { + java.lang.Object ref = displayWatchingCount_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayWatchingCount_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string displayWatchingCount = 1; + * @return The bytes for displayWatchingCount. + */ + public com.google.protobuf.ByteString + getDisplayWatchingCountBytes() { + java.lang.Object ref = displayWatchingCount_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayWatchingCount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string displayWatchingCount = 1; + * @param value The displayWatchingCount to set. + * @return This builder for chaining. + */ + public Builder setDisplayWatchingCount( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + displayWatchingCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string displayWatchingCount = 1; + * @return This builder for chaining. + */ + public Builder clearDisplayWatchingCount() { + displayWatchingCount_ = getDefaultInstance().getDisplayWatchingCount(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string displayWatchingCount = 1; + * @param value The bytes for displayWatchingCount to set. + * @return This builder for chaining. + */ + public Builder setDisplayWatchingCountBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + displayWatchingCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayLikeCount_ = ""; + /** + * string displayLikeCount = 2; + * @return The displayLikeCount. + */ + public java.lang.String getDisplayLikeCount() { + java.lang.Object ref = displayLikeCount_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayLikeCount_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string displayLikeCount = 2; + * @return The bytes for displayLikeCount. + */ + public com.google.protobuf.ByteString + getDisplayLikeCountBytes() { + java.lang.Object ref = displayLikeCount_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayLikeCount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string displayLikeCount = 2; + * @param value The displayLikeCount to set. + * @return This builder for chaining. + */ + public Builder setDisplayLikeCount( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + displayLikeCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string displayLikeCount = 2; + * @return This builder for chaining. + */ + public Builder clearDisplayLikeCount() { + displayLikeCount_ = getDefaultInstance().getDisplayLikeCount(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string displayLikeCount = 2; + * @param value The bytes for displayLikeCount to set. + * @return This builder for chaining. + */ + public Builder setDisplayLikeCountBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + displayLikeCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long pendingLikeCount_ ; + /** + * uint64 pendingLikeCount = 3; + * @return The pendingLikeCount. + */ + @java.lang.Override + public long getPendingLikeCount() { + return pendingLikeCount_; + } + /** + * uint64 pendingLikeCount = 3; + * @param value The pendingLikeCount to set. + * @return This builder for chaining. + */ + public Builder setPendingLikeCount(long value) { + + pendingLikeCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 pendingLikeCount = 3; + * @return This builder for chaining. + */ + public Builder clearPendingLikeCount() { + bitField0_ = (bitField0_ & ~0x00000004); + pendingLikeCount_ = 0L; + onChanged(); + return this; + } + + private long pushInterval_ ; + /** + * uint64 pushInterval = 4; + * @return The pushInterval. + */ + @java.lang.Override + public long getPushInterval() { + return pushInterval_; + } + /** + * uint64 pushInterval = 4; + * @param value The pushInterval to set. + * @return This builder for chaining. + */ + public Builder setPushInterval(long value) { + + pushInterval_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint64 pushInterval = 4; + * @return This builder for chaining. + */ + public Builder clearPushInterval() { + bitField0_ = (bitField0_ & ~0x00000008); + pushInterval_ = 0L; + onChanged(); + return this; + } + + private java.util.List commentFeeds_ = + java.util.Collections.emptyList(); + private void ensureCommentFeedsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + commentFeeds_ = new java.util.ArrayList(commentFeeds_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeedOrBuilder> commentFeedsBuilder_; + + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public java.util.List getCommentFeedsList() { + if (commentFeedsBuilder_ == null) { + return java.util.Collections.unmodifiableList(commentFeeds_); + } else { + return commentFeedsBuilder_.getMessageList(); + } + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public int getCommentFeedsCount() { + if (commentFeedsBuilder_ == null) { + return commentFeeds_.size(); + } else { + return commentFeedsBuilder_.getCount(); + } + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed getCommentFeeds(int index) { + if (commentFeedsBuilder_ == null) { + return commentFeeds_.get(index); + } else { + return commentFeedsBuilder_.getMessage(index); + } + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public Builder setCommentFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed value) { + if (commentFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommentFeedsIsMutable(); + commentFeeds_.set(index, value); + onChanged(); + } else { + commentFeedsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public Builder setCommentFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.Builder builderForValue) { + if (commentFeedsBuilder_ == null) { + ensureCommentFeedsIsMutable(); + commentFeeds_.set(index, builderForValue.build()); + onChanged(); + } else { + commentFeedsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public Builder addCommentFeeds(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed value) { + if (commentFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommentFeedsIsMutable(); + commentFeeds_.add(value); + onChanged(); + } else { + commentFeedsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public Builder addCommentFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed value) { + if (commentFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommentFeedsIsMutable(); + commentFeeds_.add(index, value); + onChanged(); + } else { + commentFeedsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public Builder addCommentFeeds( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.Builder builderForValue) { + if (commentFeedsBuilder_ == null) { + ensureCommentFeedsIsMutable(); + commentFeeds_.add(builderForValue.build()); + onChanged(); + } else { + commentFeedsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public Builder addCommentFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.Builder builderForValue) { + if (commentFeedsBuilder_ == null) { + ensureCommentFeedsIsMutable(); + commentFeeds_.add(index, builderForValue.build()); + onChanged(); + } else { + commentFeedsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public Builder addAllCommentFeeds( + java.lang.Iterable values) { + if (commentFeedsBuilder_ == null) { + ensureCommentFeedsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, commentFeeds_); + onChanged(); + } else { + commentFeedsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public Builder clearCommentFeeds() { + if (commentFeedsBuilder_ == null) { + commentFeeds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + commentFeedsBuilder_.clear(); + } + return this; + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public Builder removeCommentFeeds(int index) { + if (commentFeedsBuilder_ == null) { + ensureCommentFeedsIsMutable(); + commentFeeds_.remove(index); + onChanged(); + } else { + commentFeedsBuilder_.remove(index); + } + return this; + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.Builder getCommentFeedsBuilder( + int index) { + return getCommentFeedsFieldBuilder().getBuilder(index); + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeedOrBuilder getCommentFeedsOrBuilder( + int index) { + if (commentFeedsBuilder_ == null) { + return commentFeeds_.get(index); } else { + return commentFeedsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public java.util.List + getCommentFeedsOrBuilderList() { + if (commentFeedsBuilder_ != null) { + return commentFeedsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(commentFeeds_); + } + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.Builder addCommentFeedsBuilder() { + return getCommentFeedsFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.getDefaultInstance()); + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.Builder addCommentFeedsBuilder( + int index) { + return getCommentFeedsFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.getDefaultInstance()); + } + /** + * repeated .WebCommentFeed commentFeeds = 5; + */ + public java.util.List + getCommentFeedsBuilderList() { + return getCommentFeedsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeedOrBuilder> + getCommentFeedsFieldBuilder() { + if (commentFeedsBuilder_ == null) { + commentFeedsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeedOrBuilder>( + commentFeeds_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + commentFeeds_ = null; + } + return commentFeedsBuilder_; + } + + private java.lang.Object commentCursor_ = ""; + /** + * string commentCursor = 6; + * @return The commentCursor. + */ + public java.lang.String getCommentCursor() { + java.lang.Object ref = commentCursor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + commentCursor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string commentCursor = 6; + * @return The bytes for commentCursor. + */ + public com.google.protobuf.ByteString + getCommentCursorBytes() { + java.lang.Object ref = commentCursor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + commentCursor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string commentCursor = 6; + * @param value The commentCursor to set. + * @return This builder for chaining. + */ + public Builder setCommentCursor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + commentCursor_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * string commentCursor = 6; + * @return This builder for chaining. + */ + public Builder clearCommentCursor() { + commentCursor_ = getDefaultInstance().getCommentCursor(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * string commentCursor = 6; + * @param value The bytes for commentCursor to set. + * @return This builder for chaining. + */ + public Builder setCommentCursorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + commentCursor_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.util.List comboCommentFeed_ = + java.util.Collections.emptyList(); + private void ensureComboCommentFeedIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + comboCommentFeed_ = new java.util.ArrayList(comboCommentFeed_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeedOrBuilder> comboCommentFeedBuilder_; + + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public java.util.List getComboCommentFeedList() { + if (comboCommentFeedBuilder_ == null) { + return java.util.Collections.unmodifiableList(comboCommentFeed_); + } else { + return comboCommentFeedBuilder_.getMessageList(); + } + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public int getComboCommentFeedCount() { + if (comboCommentFeedBuilder_ == null) { + return comboCommentFeed_.size(); + } else { + return comboCommentFeedBuilder_.getCount(); + } + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed getComboCommentFeed(int index) { + if (comboCommentFeedBuilder_ == null) { + return comboCommentFeed_.get(index); + } else { + return comboCommentFeedBuilder_.getMessage(index); + } + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public Builder setComboCommentFeed( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed value) { + if (comboCommentFeedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComboCommentFeedIsMutable(); + comboCommentFeed_.set(index, value); + onChanged(); + } else { + comboCommentFeedBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public Builder setComboCommentFeed( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.Builder builderForValue) { + if (comboCommentFeedBuilder_ == null) { + ensureComboCommentFeedIsMutable(); + comboCommentFeed_.set(index, builderForValue.build()); + onChanged(); + } else { + comboCommentFeedBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public Builder addComboCommentFeed(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed value) { + if (comboCommentFeedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComboCommentFeedIsMutable(); + comboCommentFeed_.add(value); + onChanged(); + } else { + comboCommentFeedBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public Builder addComboCommentFeed( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed value) { + if (comboCommentFeedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComboCommentFeedIsMutable(); + comboCommentFeed_.add(index, value); + onChanged(); + } else { + comboCommentFeedBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public Builder addComboCommentFeed( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.Builder builderForValue) { + if (comboCommentFeedBuilder_ == null) { + ensureComboCommentFeedIsMutable(); + comboCommentFeed_.add(builderForValue.build()); + onChanged(); + } else { + comboCommentFeedBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public Builder addComboCommentFeed( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.Builder builderForValue) { + if (comboCommentFeedBuilder_ == null) { + ensureComboCommentFeedIsMutable(); + comboCommentFeed_.add(index, builderForValue.build()); + onChanged(); + } else { + comboCommentFeedBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public Builder addAllComboCommentFeed( + java.lang.Iterable values) { + if (comboCommentFeedBuilder_ == null) { + ensureComboCommentFeedIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, comboCommentFeed_); + onChanged(); + } else { + comboCommentFeedBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public Builder clearComboCommentFeed() { + if (comboCommentFeedBuilder_ == null) { + comboCommentFeed_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + comboCommentFeedBuilder_.clear(); + } + return this; + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public Builder removeComboCommentFeed(int index) { + if (comboCommentFeedBuilder_ == null) { + ensureComboCommentFeedIsMutable(); + comboCommentFeed_.remove(index); + onChanged(); + } else { + comboCommentFeedBuilder_.remove(index); + } + return this; + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.Builder getComboCommentFeedBuilder( + int index) { + return getComboCommentFeedFieldBuilder().getBuilder(index); + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeedOrBuilder getComboCommentFeedOrBuilder( + int index) { + if (comboCommentFeedBuilder_ == null) { + return comboCommentFeed_.get(index); } else { + return comboCommentFeedBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public java.util.List + getComboCommentFeedOrBuilderList() { + if (comboCommentFeedBuilder_ != null) { + return comboCommentFeedBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(comboCommentFeed_); + } + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.Builder addComboCommentFeedBuilder() { + return getComboCommentFeedFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.getDefaultInstance()); + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.Builder addComboCommentFeedBuilder( + int index) { + return getComboCommentFeedFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.getDefaultInstance()); + } + /** + * repeated .WebComboCommentFeed comboCommentFeed = 7; + */ + public java.util.List + getComboCommentFeedBuilderList() { + return getComboCommentFeedFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeedOrBuilder> + getComboCommentFeedFieldBuilder() { + if (comboCommentFeedBuilder_ == null) { + comboCommentFeedBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeedOrBuilder>( + comboCommentFeed_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + comboCommentFeed_ = null; + } + return comboCommentFeedBuilder_; + } + + private java.util.List likeFeeds_ = + java.util.Collections.emptyList(); + private void ensureLikeFeedsIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + likeFeeds_ = new java.util.ArrayList(likeFeeds_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeedOrBuilder> likeFeedsBuilder_; + + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public java.util.List getLikeFeedsList() { + if (likeFeedsBuilder_ == null) { + return java.util.Collections.unmodifiableList(likeFeeds_); + } else { + return likeFeedsBuilder_.getMessageList(); + } + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public int getLikeFeedsCount() { + if (likeFeedsBuilder_ == null) { + return likeFeeds_.size(); + } else { + return likeFeedsBuilder_.getCount(); + } + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed getLikeFeeds(int index) { + if (likeFeedsBuilder_ == null) { + return likeFeeds_.get(index); + } else { + return likeFeedsBuilder_.getMessage(index); + } + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public Builder setLikeFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed value) { + if (likeFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLikeFeedsIsMutable(); + likeFeeds_.set(index, value); + onChanged(); + } else { + likeFeedsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public Builder setLikeFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.Builder builderForValue) { + if (likeFeedsBuilder_ == null) { + ensureLikeFeedsIsMutable(); + likeFeeds_.set(index, builderForValue.build()); + onChanged(); + } else { + likeFeedsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public Builder addLikeFeeds(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed value) { + if (likeFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLikeFeedsIsMutable(); + likeFeeds_.add(value); + onChanged(); + } else { + likeFeedsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public Builder addLikeFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed value) { + if (likeFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLikeFeedsIsMutable(); + likeFeeds_.add(index, value); + onChanged(); + } else { + likeFeedsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public Builder addLikeFeeds( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.Builder builderForValue) { + if (likeFeedsBuilder_ == null) { + ensureLikeFeedsIsMutable(); + likeFeeds_.add(builderForValue.build()); + onChanged(); + } else { + likeFeedsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public Builder addLikeFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.Builder builderForValue) { + if (likeFeedsBuilder_ == null) { + ensureLikeFeedsIsMutable(); + likeFeeds_.add(index, builderForValue.build()); + onChanged(); + } else { + likeFeedsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public Builder addAllLikeFeeds( + java.lang.Iterable values) { + if (likeFeedsBuilder_ == null) { + ensureLikeFeedsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, likeFeeds_); + onChanged(); + } else { + likeFeedsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public Builder clearLikeFeeds() { + if (likeFeedsBuilder_ == null) { + likeFeeds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + likeFeedsBuilder_.clear(); + } + return this; + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public Builder removeLikeFeeds(int index) { + if (likeFeedsBuilder_ == null) { + ensureLikeFeedsIsMutable(); + likeFeeds_.remove(index); + onChanged(); + } else { + likeFeedsBuilder_.remove(index); + } + return this; + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.Builder getLikeFeedsBuilder( + int index) { + return getLikeFeedsFieldBuilder().getBuilder(index); + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeedOrBuilder getLikeFeedsOrBuilder( + int index) { + if (likeFeedsBuilder_ == null) { + return likeFeeds_.get(index); } else { + return likeFeedsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public java.util.List + getLikeFeedsOrBuilderList() { + if (likeFeedsBuilder_ != null) { + return likeFeedsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(likeFeeds_); + } + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.Builder addLikeFeedsBuilder() { + return getLikeFeedsFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.getDefaultInstance()); + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.Builder addLikeFeedsBuilder( + int index) { + return getLikeFeedsFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.getDefaultInstance()); + } + /** + * repeated .WebLikeFeed likeFeeds = 8; + */ + public java.util.List + getLikeFeedsBuilderList() { + return getLikeFeedsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeedOrBuilder> + getLikeFeedsFieldBuilder() { + if (likeFeedsBuilder_ == null) { + likeFeedsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeedOrBuilder>( + likeFeeds_, + ((bitField0_ & 0x00000080) != 0), + getParentForChildren(), + isClean()); + likeFeeds_ = null; + } + return likeFeedsBuilder_; + } + + private java.util.List giftFeeds_ = + java.util.Collections.emptyList(); + private void ensureGiftFeedsIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + giftFeeds_ = new java.util.ArrayList(giftFeeds_); + bitField0_ |= 0x00000100; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeedOrBuilder> giftFeedsBuilder_; + + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public java.util.List getGiftFeedsList() { + if (giftFeedsBuilder_ == null) { + return java.util.Collections.unmodifiableList(giftFeeds_); + } else { + return giftFeedsBuilder_.getMessageList(); + } + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public int getGiftFeedsCount() { + if (giftFeedsBuilder_ == null) { + return giftFeeds_.size(); + } else { + return giftFeedsBuilder_.getCount(); + } + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed getGiftFeeds(int index) { + if (giftFeedsBuilder_ == null) { + return giftFeeds_.get(index); + } else { + return giftFeedsBuilder_.getMessage(index); + } + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public Builder setGiftFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed value) { + if (giftFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGiftFeedsIsMutable(); + giftFeeds_.set(index, value); + onChanged(); + } else { + giftFeedsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public Builder setGiftFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.Builder builderForValue) { + if (giftFeedsBuilder_ == null) { + ensureGiftFeedsIsMutable(); + giftFeeds_.set(index, builderForValue.build()); + onChanged(); + } else { + giftFeedsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public Builder addGiftFeeds(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed value) { + if (giftFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGiftFeedsIsMutable(); + giftFeeds_.add(value); + onChanged(); + } else { + giftFeedsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public Builder addGiftFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed value) { + if (giftFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGiftFeedsIsMutable(); + giftFeeds_.add(index, value); + onChanged(); + } else { + giftFeedsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public Builder addGiftFeeds( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.Builder builderForValue) { + if (giftFeedsBuilder_ == null) { + ensureGiftFeedsIsMutable(); + giftFeeds_.add(builderForValue.build()); + onChanged(); + } else { + giftFeedsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public Builder addGiftFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.Builder builderForValue) { + if (giftFeedsBuilder_ == null) { + ensureGiftFeedsIsMutable(); + giftFeeds_.add(index, builderForValue.build()); + onChanged(); + } else { + giftFeedsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public Builder addAllGiftFeeds( + java.lang.Iterable values) { + if (giftFeedsBuilder_ == null) { + ensureGiftFeedsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, giftFeeds_); + onChanged(); + } else { + giftFeedsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public Builder clearGiftFeeds() { + if (giftFeedsBuilder_ == null) { + giftFeeds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + } else { + giftFeedsBuilder_.clear(); + } + return this; + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public Builder removeGiftFeeds(int index) { + if (giftFeedsBuilder_ == null) { + ensureGiftFeedsIsMutable(); + giftFeeds_.remove(index); + onChanged(); + } else { + giftFeedsBuilder_.remove(index); + } + return this; + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.Builder getGiftFeedsBuilder( + int index) { + return getGiftFeedsFieldBuilder().getBuilder(index); + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeedOrBuilder getGiftFeedsOrBuilder( + int index) { + if (giftFeedsBuilder_ == null) { + return giftFeeds_.get(index); } else { + return giftFeedsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public java.util.List + getGiftFeedsOrBuilderList() { + if (giftFeedsBuilder_ != null) { + return giftFeedsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(giftFeeds_); + } + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.Builder addGiftFeedsBuilder() { + return getGiftFeedsFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.getDefaultInstance()); + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.Builder addGiftFeedsBuilder( + int index) { + return getGiftFeedsFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.getDefaultInstance()); + } + /** + * repeated .WebGiftFeed giftFeeds = 9; + */ + public java.util.List + getGiftFeedsBuilderList() { + return getGiftFeedsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeedOrBuilder> + getGiftFeedsFieldBuilder() { + if (giftFeedsBuilder_ == null) { + giftFeedsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeedOrBuilder>( + giftFeeds_, + ((bitField0_ & 0x00000100) != 0), + getParentForChildren(), + isClean()); + giftFeeds_ = null; + } + return giftFeedsBuilder_; + } + + private java.lang.Object giftCursor_ = ""; + /** + * string giftCursor = 10; + * @return The giftCursor. + */ + public java.lang.String getGiftCursor() { + java.lang.Object ref = giftCursor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + giftCursor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string giftCursor = 10; + * @return The bytes for giftCursor. + */ + public com.google.protobuf.ByteString + getGiftCursorBytes() { + java.lang.Object ref = giftCursor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + giftCursor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string giftCursor = 10; + * @param value The giftCursor to set. + * @return This builder for chaining. + */ + public Builder setGiftCursor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + giftCursor_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * string giftCursor = 10; + * @return This builder for chaining. + */ + public Builder clearGiftCursor() { + giftCursor_ = getDefaultInstance().getGiftCursor(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * string giftCursor = 10; + * @param value The bytes for giftCursor to set. + * @return This builder for chaining. + */ + public Builder setGiftCursorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + giftCursor_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.util.List systemNoticeFeeds_ = + java.util.Collections.emptyList(); + private void ensureSystemNoticeFeedsIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + systemNoticeFeeds_ = new java.util.ArrayList(systemNoticeFeeds_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeedOrBuilder> systemNoticeFeedsBuilder_; + + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public java.util.List getSystemNoticeFeedsList() { + if (systemNoticeFeedsBuilder_ == null) { + return java.util.Collections.unmodifiableList(systemNoticeFeeds_); + } else { + return systemNoticeFeedsBuilder_.getMessageList(); + } + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public int getSystemNoticeFeedsCount() { + if (systemNoticeFeedsBuilder_ == null) { + return systemNoticeFeeds_.size(); + } else { + return systemNoticeFeedsBuilder_.getCount(); + } + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed getSystemNoticeFeeds(int index) { + if (systemNoticeFeedsBuilder_ == null) { + return systemNoticeFeeds_.get(index); + } else { + return systemNoticeFeedsBuilder_.getMessage(index); + } + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public Builder setSystemNoticeFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed value) { + if (systemNoticeFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSystemNoticeFeedsIsMutable(); + systemNoticeFeeds_.set(index, value); + onChanged(); + } else { + systemNoticeFeedsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public Builder setSystemNoticeFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.Builder builderForValue) { + if (systemNoticeFeedsBuilder_ == null) { + ensureSystemNoticeFeedsIsMutable(); + systemNoticeFeeds_.set(index, builderForValue.build()); + onChanged(); + } else { + systemNoticeFeedsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public Builder addSystemNoticeFeeds(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed value) { + if (systemNoticeFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSystemNoticeFeedsIsMutable(); + systemNoticeFeeds_.add(value); + onChanged(); + } else { + systemNoticeFeedsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public Builder addSystemNoticeFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed value) { + if (systemNoticeFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSystemNoticeFeedsIsMutable(); + systemNoticeFeeds_.add(index, value); + onChanged(); + } else { + systemNoticeFeedsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public Builder addSystemNoticeFeeds( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.Builder builderForValue) { + if (systemNoticeFeedsBuilder_ == null) { + ensureSystemNoticeFeedsIsMutable(); + systemNoticeFeeds_.add(builderForValue.build()); + onChanged(); + } else { + systemNoticeFeedsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public Builder addSystemNoticeFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.Builder builderForValue) { + if (systemNoticeFeedsBuilder_ == null) { + ensureSystemNoticeFeedsIsMutable(); + systemNoticeFeeds_.add(index, builderForValue.build()); + onChanged(); + } else { + systemNoticeFeedsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public Builder addAllSystemNoticeFeeds( + java.lang.Iterable values) { + if (systemNoticeFeedsBuilder_ == null) { + ensureSystemNoticeFeedsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, systemNoticeFeeds_); + onChanged(); + } else { + systemNoticeFeedsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public Builder clearSystemNoticeFeeds() { + if (systemNoticeFeedsBuilder_ == null) { + systemNoticeFeeds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + systemNoticeFeedsBuilder_.clear(); + } + return this; + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public Builder removeSystemNoticeFeeds(int index) { + if (systemNoticeFeedsBuilder_ == null) { + ensureSystemNoticeFeedsIsMutable(); + systemNoticeFeeds_.remove(index); + onChanged(); + } else { + systemNoticeFeedsBuilder_.remove(index); + } + return this; + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.Builder getSystemNoticeFeedsBuilder( + int index) { + return getSystemNoticeFeedsFieldBuilder().getBuilder(index); + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeedOrBuilder getSystemNoticeFeedsOrBuilder( + int index) { + if (systemNoticeFeedsBuilder_ == null) { + return systemNoticeFeeds_.get(index); } else { + return systemNoticeFeedsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public java.util.List + getSystemNoticeFeedsOrBuilderList() { + if (systemNoticeFeedsBuilder_ != null) { + return systemNoticeFeedsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(systemNoticeFeeds_); + } + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.Builder addSystemNoticeFeedsBuilder() { + return getSystemNoticeFeedsFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.getDefaultInstance()); + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.Builder addSystemNoticeFeedsBuilder( + int index) { + return getSystemNoticeFeedsFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.getDefaultInstance()); + } + /** + * repeated .WebSystemNoticeFeed systemNoticeFeeds = 11; + */ + public java.util.List + getSystemNoticeFeedsBuilderList() { + return getSystemNoticeFeedsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeedOrBuilder> + getSystemNoticeFeedsFieldBuilder() { + if (systemNoticeFeedsBuilder_ == null) { + systemNoticeFeedsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeedOrBuilder>( + systemNoticeFeeds_, + ((bitField0_ & 0x00000400) != 0), + getParentForChildren(), + isClean()); + systemNoticeFeeds_ = null; + } + return systemNoticeFeedsBuilder_; + } + + private java.util.List shareFeeds_ = + java.util.Collections.emptyList(); + private void ensureShareFeedsIsMutable() { + if (!((bitField0_ & 0x00000800) != 0)) { + shareFeeds_ = new java.util.ArrayList(shareFeeds_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeedOrBuilder> shareFeedsBuilder_; + + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public java.util.List getShareFeedsList() { + if (shareFeedsBuilder_ == null) { + return java.util.Collections.unmodifiableList(shareFeeds_); + } else { + return shareFeedsBuilder_.getMessageList(); + } + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public int getShareFeedsCount() { + if (shareFeedsBuilder_ == null) { + return shareFeeds_.size(); + } else { + return shareFeedsBuilder_.getCount(); + } + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed getShareFeeds(int index) { + if (shareFeedsBuilder_ == null) { + return shareFeeds_.get(index); + } else { + return shareFeedsBuilder_.getMessage(index); + } + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public Builder setShareFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed value) { + if (shareFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShareFeedsIsMutable(); + shareFeeds_.set(index, value); + onChanged(); + } else { + shareFeedsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public Builder setShareFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.Builder builderForValue) { + if (shareFeedsBuilder_ == null) { + ensureShareFeedsIsMutable(); + shareFeeds_.set(index, builderForValue.build()); + onChanged(); + } else { + shareFeedsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public Builder addShareFeeds(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed value) { + if (shareFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShareFeedsIsMutable(); + shareFeeds_.add(value); + onChanged(); + } else { + shareFeedsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public Builder addShareFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed value) { + if (shareFeedsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShareFeedsIsMutable(); + shareFeeds_.add(index, value); + onChanged(); + } else { + shareFeedsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public Builder addShareFeeds( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.Builder builderForValue) { + if (shareFeedsBuilder_ == null) { + ensureShareFeedsIsMutable(); + shareFeeds_.add(builderForValue.build()); + onChanged(); + } else { + shareFeedsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public Builder addShareFeeds( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.Builder builderForValue) { + if (shareFeedsBuilder_ == null) { + ensureShareFeedsIsMutable(); + shareFeeds_.add(index, builderForValue.build()); + onChanged(); + } else { + shareFeedsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public Builder addAllShareFeeds( + java.lang.Iterable values) { + if (shareFeedsBuilder_ == null) { + ensureShareFeedsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, shareFeeds_); + onChanged(); + } else { + shareFeedsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public Builder clearShareFeeds() { + if (shareFeedsBuilder_ == null) { + shareFeeds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + } else { + shareFeedsBuilder_.clear(); + } + return this; + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public Builder removeShareFeeds(int index) { + if (shareFeedsBuilder_ == null) { + ensureShareFeedsIsMutable(); + shareFeeds_.remove(index); + onChanged(); + } else { + shareFeedsBuilder_.remove(index); + } + return this; + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.Builder getShareFeedsBuilder( + int index) { + return getShareFeedsFieldBuilder().getBuilder(index); + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeedOrBuilder getShareFeedsOrBuilder( + int index) { + if (shareFeedsBuilder_ == null) { + return shareFeeds_.get(index); } else { + return shareFeedsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public java.util.List + getShareFeedsOrBuilderList() { + if (shareFeedsBuilder_ != null) { + return shareFeedsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(shareFeeds_); + } + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.Builder addShareFeedsBuilder() { + return getShareFeedsFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.getDefaultInstance()); + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.Builder addShareFeedsBuilder( + int index) { + return getShareFeedsFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.getDefaultInstance()); + } + /** + * repeated .WebShareFeed shareFeeds = 12; + */ + public java.util.List + getShareFeedsBuilderList() { + return getShareFeedsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeedOrBuilder> + getShareFeedsFieldBuilder() { + if (shareFeedsBuilder_ == null) { + shareFeedsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeedOrBuilder>( + shareFeeds_, + ((bitField0_ & 0x00000800) != 0), + getParentForChildren(), + isClean()); + shareFeeds_ = null; + } + return shareFeedsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebFeedPush) + } + + // @@protoc_insertion_point(class_scope:SCWebFeedPush) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebFeedPush parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebFeedPushOuterClass.SCWebFeedPush getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebFeedPush_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebFeedPush_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\023SCWebFeedPush.proto\032\024WebCommentFeed.pr" + + "oto\032\031WebComboCommentFeed.proto\032\021WebLikeF" + + "eed.proto\032\021WebGiftFeed.proto\032\031WebSystemN" + + "oticeFeed.proto\032\022WebShareFeed.proto\"\217\003\n\r" + + "SCWebFeedPush\022\034\n\024displayWatchingCount\030\001 " + + "\001(\t\022\030\n\020displayLikeCount\030\002 \001(\t\022\030\n\020pending" + + "LikeCount\030\003 \001(\004\022\024\n\014pushInterval\030\004 \001(\004\022%\n" + + "\014commentFeeds\030\005 \003(\0132\017.WebCommentFeed\022\025\n\r" + + "commentCursor\030\006 \001(\t\022.\n\020comboCommentFeed\030" + + "\007 \003(\0132\024.WebComboCommentFeed\022\037\n\tlikeFeeds" + + "\030\010 \003(\0132\014.WebLikeFeed\022\037\n\tgiftFeeds\030\t \003(\0132" + + "\014.WebGiftFeed\022\022\n\ngiftCursor\030\n \001(\t\022/\n\021sys" + + "temNoticeFeeds\030\013 \003(\0132\024.WebSystemNoticeFe" + + "ed\022!\n\nshareFeeds\030\014 \003(\0132\r.WebShareFeedB6\n" + + "4tech.ordinaryroad.live.chat.client.kuai" + + "shou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.getDescriptor(), + }); + internal_static_SCWebFeedPush_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebFeedPush_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebFeedPush_descriptor, + new java.lang.String[] { "DisplayWatchingCount", "DisplayLikeCount", "PendingLikeCount", "PushInterval", "CommentFeeds", "CommentCursor", "ComboCommentFeed", "LikeFeeds", "GiftFeeds", "GiftCursor", "SystemNoticeFeeds", "ShareFeeds", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebGuessClosedOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebGuessClosedOuterClass.java new file mode 100644 index 0000000..7ee548d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebGuessClosedOuterClass.java @@ -0,0 +1,772 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebGuessClosed.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebGuessClosedOuterClass { + private SCWebGuessClosedOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebGuessClosedOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebGuessClosed) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 time = 1; + * @return The time. + */ + long getTime(); + + /** + * string guessId = 2; + * @return The guessId. + */ + java.lang.String getGuessId(); + /** + * string guessId = 2; + * @return The bytes for guessId. + */ + com.google.protobuf.ByteString + getGuessIdBytes(); + + /** + * uint64 displayMaxDelayMillis = 3; + * @return The displayMaxDelayMillis. + */ + long getDisplayMaxDelayMillis(); + } + /** + * Protobuf type {@code SCWebGuessClosed} + */ + public static final class SCWebGuessClosed extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebGuessClosed) + SCWebGuessClosedOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebGuessClosed.newBuilder() to construct. + private SCWebGuessClosed(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebGuessClosed() { + guessId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebGuessClosed(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.internal_static_SCWebGuessClosed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.internal_static_SCWebGuessClosed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed.Builder.class); + } + + public static final int TIME_FIELD_NUMBER = 1; + private long time_ = 0L; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + + public static final int GUESSID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object guessId_ = ""; + /** + * string guessId = 2; + * @return The guessId. + */ + @java.lang.Override + public java.lang.String getGuessId() { + java.lang.Object ref = guessId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + guessId_ = s; + return s; + } + } + /** + * string guessId = 2; + * @return The bytes for guessId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGuessIdBytes() { + java.lang.Object ref = guessId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + guessId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAYMAXDELAYMILLIS_FIELD_NUMBER = 3; + private long displayMaxDelayMillis_ = 0L; + /** + * uint64 displayMaxDelayMillis = 3; + * @return The displayMaxDelayMillis. + */ + @java.lang.Override + public long getDisplayMaxDelayMillis() { + return displayMaxDelayMillis_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (time_ != 0L) { + output.writeUInt64(1, time_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(guessId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, guessId_); + } + if (displayMaxDelayMillis_ != 0L) { + output.writeUInt64(3, displayMaxDelayMillis_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (time_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, time_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(guessId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, guessId_); + } + if (displayMaxDelayMillis_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, displayMaxDelayMillis_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed) obj; + + if (getTime() + != other.getTime()) return false; + if (!getGuessId() + .equals(other.getGuessId())) return false; + if (getDisplayMaxDelayMillis() + != other.getDisplayMaxDelayMillis()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTime()); + hash = (37 * hash) + GUESSID_FIELD_NUMBER; + hash = (53 * hash) + getGuessId().hashCode(); + hash = (37 * hash) + DISPLAYMAXDELAYMILLIS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDisplayMaxDelayMillis()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebGuessClosed} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebGuessClosed) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.internal_static_SCWebGuessClosed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.internal_static_SCWebGuessClosed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + time_ = 0L; + guessId_ = ""; + displayMaxDelayMillis_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.internal_static_SCWebGuessClosed_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.time_ = time_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.guessId_ = guessId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.displayMaxDelayMillis_ = displayMaxDelayMillis_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed.getDefaultInstance()) return this; + if (other.getTime() != 0L) { + setTime(other.getTime()); + } + if (!other.getGuessId().isEmpty()) { + guessId_ = other.guessId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getDisplayMaxDelayMillis() != 0L) { + setDisplayMaxDelayMillis(other.getDisplayMaxDelayMillis()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + time_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + guessId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + displayMaxDelayMillis_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long time_ ; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + /** + * uint64 time = 1; + * @param value The time to set. + * @return This builder for chaining. + */ + public Builder setTime(long value) { + + time_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 time = 1; + * @return This builder for chaining. + */ + public Builder clearTime() { + bitField0_ = (bitField0_ & ~0x00000001); + time_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object guessId_ = ""; + /** + * string guessId = 2; + * @return The guessId. + */ + public java.lang.String getGuessId() { + java.lang.Object ref = guessId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + guessId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string guessId = 2; + * @return The bytes for guessId. + */ + public com.google.protobuf.ByteString + getGuessIdBytes() { + java.lang.Object ref = guessId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + guessId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string guessId = 2; + * @param value The guessId to set. + * @return This builder for chaining. + */ + public Builder setGuessId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + guessId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string guessId = 2; + * @return This builder for chaining. + */ + public Builder clearGuessId() { + guessId_ = getDefaultInstance().getGuessId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string guessId = 2; + * @param value The bytes for guessId to set. + * @return This builder for chaining. + */ + public Builder setGuessIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + guessId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long displayMaxDelayMillis_ ; + /** + * uint64 displayMaxDelayMillis = 3; + * @return The displayMaxDelayMillis. + */ + @java.lang.Override + public long getDisplayMaxDelayMillis() { + return displayMaxDelayMillis_; + } + /** + * uint64 displayMaxDelayMillis = 3; + * @param value The displayMaxDelayMillis to set. + * @return This builder for chaining. + */ + public Builder setDisplayMaxDelayMillis(long value) { + + displayMaxDelayMillis_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 displayMaxDelayMillis = 3; + * @return This builder for chaining. + */ + public Builder clearDisplayMaxDelayMillis() { + bitField0_ = (bitField0_ & ~0x00000004); + displayMaxDelayMillis_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebGuessClosed) + } + + // @@protoc_insertion_point(class_scope:SCWebGuessClosed) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebGuessClosed parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessClosedOuterClass.SCWebGuessClosed getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebGuessClosed_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebGuessClosed_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026SCWebGuessClosed.proto\"P\n\020SCWebGuessCl" + + "osed\022\014\n\004time\030\001 \001(\004\022\017\n\007guessId\030\002 \001(\t\022\035\n\025d" + + "isplayMaxDelayMillis\030\003 \001(\004B6\n4tech.ordin" + + "aryroad.live.chat.client.kuaishou.protob" + + "ufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCWebGuessClosed_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebGuessClosed_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebGuessClosed_descriptor, + new java.lang.String[] { "Time", "GuessId", "DisplayMaxDelayMillis", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebGuessOpenedOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebGuessOpenedOuterClass.java new file mode 100644 index 0000000..952322d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebGuessOpenedOuterClass.java @@ -0,0 +1,845 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebGuessOpened.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebGuessOpenedOuterClass { + private SCWebGuessOpenedOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebGuessOpenedOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebGuessOpened) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 time = 1; + * @return The time. + */ + long getTime(); + + /** + * string guessId = 2; + * @return The guessId. + */ + java.lang.String getGuessId(); + /** + * string guessId = 2; + * @return The bytes for guessId. + */ + com.google.protobuf.ByteString + getGuessIdBytes(); + + /** + * uint64 submitDeadline = 3; + * @return The submitDeadline. + */ + long getSubmitDeadline(); + + /** + * uint64 displayMaxDelayMillis = 4; + * @return The displayMaxDelayMillis. + */ + long getDisplayMaxDelayMillis(); + } + /** + * Protobuf type {@code SCWebGuessOpened} + */ + public static final class SCWebGuessOpened extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebGuessOpened) + SCWebGuessOpenedOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebGuessOpened.newBuilder() to construct. + private SCWebGuessOpened(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebGuessOpened() { + guessId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebGuessOpened(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.internal_static_SCWebGuessOpened_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.internal_static_SCWebGuessOpened_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened.Builder.class); + } + + public static final int TIME_FIELD_NUMBER = 1; + private long time_ = 0L; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + + public static final int GUESSID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object guessId_ = ""; + /** + * string guessId = 2; + * @return The guessId. + */ + @java.lang.Override + public java.lang.String getGuessId() { + java.lang.Object ref = guessId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + guessId_ = s; + return s; + } + } + /** + * string guessId = 2; + * @return The bytes for guessId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGuessIdBytes() { + java.lang.Object ref = guessId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + guessId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUBMITDEADLINE_FIELD_NUMBER = 3; + private long submitDeadline_ = 0L; + /** + * uint64 submitDeadline = 3; + * @return The submitDeadline. + */ + @java.lang.Override + public long getSubmitDeadline() { + return submitDeadline_; + } + + public static final int DISPLAYMAXDELAYMILLIS_FIELD_NUMBER = 4; + private long displayMaxDelayMillis_ = 0L; + /** + * uint64 displayMaxDelayMillis = 4; + * @return The displayMaxDelayMillis. + */ + @java.lang.Override + public long getDisplayMaxDelayMillis() { + return displayMaxDelayMillis_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (time_ != 0L) { + output.writeUInt64(1, time_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(guessId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, guessId_); + } + if (submitDeadline_ != 0L) { + output.writeUInt64(3, submitDeadline_); + } + if (displayMaxDelayMillis_ != 0L) { + output.writeUInt64(4, displayMaxDelayMillis_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (time_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, time_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(guessId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, guessId_); + } + if (submitDeadline_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, submitDeadline_); + } + if (displayMaxDelayMillis_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, displayMaxDelayMillis_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened) obj; + + if (getTime() + != other.getTime()) return false; + if (!getGuessId() + .equals(other.getGuessId())) return false; + if (getSubmitDeadline() + != other.getSubmitDeadline()) return false; + if (getDisplayMaxDelayMillis() + != other.getDisplayMaxDelayMillis()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTime()); + hash = (37 * hash) + GUESSID_FIELD_NUMBER; + hash = (53 * hash) + getGuessId().hashCode(); + hash = (37 * hash) + SUBMITDEADLINE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSubmitDeadline()); + hash = (37 * hash) + DISPLAYMAXDELAYMILLIS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDisplayMaxDelayMillis()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebGuessOpened} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebGuessOpened) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpenedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.internal_static_SCWebGuessOpened_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.internal_static_SCWebGuessOpened_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + time_ = 0L; + guessId_ = ""; + submitDeadline_ = 0L; + displayMaxDelayMillis_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.internal_static_SCWebGuessOpened_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.time_ = time_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.guessId_ = guessId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.submitDeadline_ = submitDeadline_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.displayMaxDelayMillis_ = displayMaxDelayMillis_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened.getDefaultInstance()) return this; + if (other.getTime() != 0L) { + setTime(other.getTime()); + } + if (!other.getGuessId().isEmpty()) { + guessId_ = other.guessId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getSubmitDeadline() != 0L) { + setSubmitDeadline(other.getSubmitDeadline()); + } + if (other.getDisplayMaxDelayMillis() != 0L) { + setDisplayMaxDelayMillis(other.getDisplayMaxDelayMillis()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + time_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + guessId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + submitDeadline_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + displayMaxDelayMillis_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long time_ ; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + /** + * uint64 time = 1; + * @param value The time to set. + * @return This builder for chaining. + */ + public Builder setTime(long value) { + + time_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 time = 1; + * @return This builder for chaining. + */ + public Builder clearTime() { + bitField0_ = (bitField0_ & ~0x00000001); + time_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object guessId_ = ""; + /** + * string guessId = 2; + * @return The guessId. + */ + public java.lang.String getGuessId() { + java.lang.Object ref = guessId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + guessId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string guessId = 2; + * @return The bytes for guessId. + */ + public com.google.protobuf.ByteString + getGuessIdBytes() { + java.lang.Object ref = guessId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + guessId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string guessId = 2; + * @param value The guessId to set. + * @return This builder for chaining. + */ + public Builder setGuessId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + guessId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string guessId = 2; + * @return This builder for chaining. + */ + public Builder clearGuessId() { + guessId_ = getDefaultInstance().getGuessId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string guessId = 2; + * @param value The bytes for guessId to set. + * @return This builder for chaining. + */ + public Builder setGuessIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + guessId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long submitDeadline_ ; + /** + * uint64 submitDeadline = 3; + * @return The submitDeadline. + */ + @java.lang.Override + public long getSubmitDeadline() { + return submitDeadline_; + } + /** + * uint64 submitDeadline = 3; + * @param value The submitDeadline to set. + * @return This builder for chaining. + */ + public Builder setSubmitDeadline(long value) { + + submitDeadline_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 submitDeadline = 3; + * @return This builder for chaining. + */ + public Builder clearSubmitDeadline() { + bitField0_ = (bitField0_ & ~0x00000004); + submitDeadline_ = 0L; + onChanged(); + return this; + } + + private long displayMaxDelayMillis_ ; + /** + * uint64 displayMaxDelayMillis = 4; + * @return The displayMaxDelayMillis. + */ + @java.lang.Override + public long getDisplayMaxDelayMillis() { + return displayMaxDelayMillis_; + } + /** + * uint64 displayMaxDelayMillis = 4; + * @param value The displayMaxDelayMillis to set. + * @return This builder for chaining. + */ + public Builder setDisplayMaxDelayMillis(long value) { + + displayMaxDelayMillis_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint64 displayMaxDelayMillis = 4; + * @return This builder for chaining. + */ + public Builder clearDisplayMaxDelayMillis() { + bitField0_ = (bitField0_ & ~0x00000008); + displayMaxDelayMillis_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebGuessOpened) + } + + // @@protoc_insertion_point(class_scope:SCWebGuessOpened) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebGuessOpened parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebGuessOpenedOuterClass.SCWebGuessOpened getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebGuessOpened_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebGuessOpened_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026SCWebGuessOpened.proto\"h\n\020SCWebGuessOp" + + "ened\022\014\n\004time\030\001 \001(\004\022\017\n\007guessId\030\002 \001(\t\022\026\n\016s" + + "ubmitDeadline\030\003 \001(\004\022\035\n\025displayMaxDelayMi" + + "llis\030\004 \001(\004B6\n4tech.ordinaryroad.live.cha" + + "t.client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCWebGuessOpened_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebGuessOpened_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebGuessOpened_descriptor, + new java.lang.String[] { "Time", "GuessId", "SubmitDeadline", "DisplayMaxDelayMillis", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebHeartbeatAckOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebHeartbeatAckOuterClass.java new file mode 100644 index 0000000..2493292 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebHeartbeatAckOuterClass.java @@ -0,0 +1,623 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebHeartbeatAck.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebHeartbeatAckOuterClass { + private SCWebHeartbeatAckOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebHeartbeatAckOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebHeartbeatAck) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 timestamp = 1; + * @return The timestamp. + */ + long getTimestamp(); + + /** + * uint64 clientTimestamp = 2; + * @return The clientTimestamp. + */ + long getClientTimestamp(); + } + /** + * Protobuf type {@code SCWebHeartbeatAck} + */ + public static final class SCWebHeartbeatAck extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebHeartbeatAck) + SCWebHeartbeatAckOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebHeartbeatAck.newBuilder() to construct. + private SCWebHeartbeatAck(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebHeartbeatAck() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebHeartbeatAck(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.internal_static_SCWebHeartbeatAck_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.internal_static_SCWebHeartbeatAck_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck.Builder.class); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 1; + private long timestamp_ = 0L; + /** + * uint64 timestamp = 1; + * @return The timestamp. + */ + @java.lang.Override + public long getTimestamp() { + return timestamp_; + } + + public static final int CLIENTTIMESTAMP_FIELD_NUMBER = 2; + private long clientTimestamp_ = 0L; + /** + * uint64 clientTimestamp = 2; + * @return The clientTimestamp. + */ + @java.lang.Override + public long getClientTimestamp() { + return clientTimestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (timestamp_ != 0L) { + output.writeUInt64(1, timestamp_); + } + if (clientTimestamp_ != 0L) { + output.writeUInt64(2, clientTimestamp_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, timestamp_); + } + if (clientTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, clientTimestamp_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck) obj; + + if (getTimestamp() + != other.getTimestamp()) return false; + if (getClientTimestamp() + != other.getClientTimestamp()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (37 * hash) + CLIENTTIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getClientTimestamp()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebHeartbeatAck} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebHeartbeatAck) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAckOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.internal_static_SCWebHeartbeatAck_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.internal_static_SCWebHeartbeatAck_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + timestamp_ = 0L; + clientTimestamp_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.internal_static_SCWebHeartbeatAck_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.timestamp_ = timestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clientTimestamp_ = clientTimestamp_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck.getDefaultInstance()) return this; + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + if (other.getClientTimestamp() != 0L) { + setClientTimestamp(other.getClientTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + timestamp_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + clientTimestamp_ = input.readUInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long timestamp_ ; + /** + * uint64 timestamp = 1; + * @return The timestamp. + */ + @java.lang.Override + public long getTimestamp() { + return timestamp_; + } + /** + * uint64 timestamp = 1; + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + timestamp_ = 0L; + onChanged(); + return this; + } + + private long clientTimestamp_ ; + /** + * uint64 clientTimestamp = 2; + * @return The clientTimestamp. + */ + @java.lang.Override + public long getClientTimestamp() { + return clientTimestamp_; + } + /** + * uint64 clientTimestamp = 2; + * @param value The clientTimestamp to set. + * @return This builder for chaining. + */ + public Builder setClientTimestamp(long value) { + + clientTimestamp_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint64 clientTimestamp = 2; + * @return This builder for chaining. + */ + public Builder clearClientTimestamp() { + bitField0_ = (bitField0_ & ~0x00000002); + clientTimestamp_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebHeartbeatAck) + } + + // @@protoc_insertion_point(class_scope:SCWebHeartbeatAck) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebHeartbeatAck parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebHeartbeatAckOuterClass.SCWebHeartbeatAck getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebHeartbeatAck_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebHeartbeatAck_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\027SCWebHeartbeatAck.proto\"?\n\021SCWebHeartb" + + "eatAck\022\021\n\ttimestamp\030\001 \001(\004\022\027\n\017clientTimes" + + "tamp\030\002 \001(\004B6\n4tech.ordinaryroad.live.cha" + + "t.client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCWebHeartbeatAck_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebHeartbeatAck_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebHeartbeatAck_descriptor, + new java.lang.String[] { "Timestamp", "ClientTimestamp", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebLiveSpecialAccountConfigStateOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebLiveSpecialAccountConfigStateOuterClass.java new file mode 100644 index 0000000..3aa0095 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebLiveSpecialAccountConfigStateOuterClass.java @@ -0,0 +1,932 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebLiveSpecialAccountConfigState.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebLiveSpecialAccountConfigStateOuterClass { + private SCWebLiveSpecialAccountConfigStateOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebLiveSpecialAccountConfigStateOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebLiveSpecialAccountConfigState) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + java.util.List + getConfigSwitchItemList(); + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem getConfigSwitchItem(int index); + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + int getConfigSwitchItemCount(); + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + java.util.List + getConfigSwitchItemOrBuilderList(); + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItemOrBuilder getConfigSwitchItemOrBuilder( + int index); + + /** + * uint64 timestamp = 2; + * @return The timestamp. + */ + long getTimestamp(); + } + /** + * Protobuf type {@code SCWebLiveSpecialAccountConfigState} + */ + public static final class SCWebLiveSpecialAccountConfigState extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebLiveSpecialAccountConfigState) + SCWebLiveSpecialAccountConfigStateOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebLiveSpecialAccountConfigState.newBuilder() to construct. + private SCWebLiveSpecialAccountConfigState(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebLiveSpecialAccountConfigState() { + configSwitchItem_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebLiveSpecialAccountConfigState(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.internal_static_SCWebLiveSpecialAccountConfigState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.internal_static_SCWebLiveSpecialAccountConfigState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState.Builder.class); + } + + public static final int CONFIGSWITCHITEM_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List configSwitchItem_; + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + @java.lang.Override + public java.util.List getConfigSwitchItemList() { + return configSwitchItem_; + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + @java.lang.Override + public java.util.List + getConfigSwitchItemOrBuilderList() { + return configSwitchItem_; + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + @java.lang.Override + public int getConfigSwitchItemCount() { + return configSwitchItem_.size(); + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem getConfigSwitchItem(int index) { + return configSwitchItem_.get(index); + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItemOrBuilder getConfigSwitchItemOrBuilder( + int index) { + return configSwitchItem_.get(index); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 2; + private long timestamp_ = 0L; + /** + * uint64 timestamp = 2; + * @return The timestamp. + */ + @java.lang.Override + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < configSwitchItem_.size(); i++) { + output.writeMessage(1, configSwitchItem_.get(i)); + } + if (timestamp_ != 0L) { + output.writeUInt64(2, timestamp_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < configSwitchItem_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, configSwitchItem_.get(i)); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, timestamp_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState) obj; + + if (!getConfigSwitchItemList() + .equals(other.getConfigSwitchItemList())) return false; + if (getTimestamp() + != other.getTimestamp()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getConfigSwitchItemCount() > 0) { + hash = (37 * hash) + CONFIGSWITCHITEM_FIELD_NUMBER; + hash = (53 * hash) + getConfigSwitchItemList().hashCode(); + } + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebLiveSpecialAccountConfigState} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebLiveSpecialAccountConfigState) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigStateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.internal_static_SCWebLiveSpecialAccountConfigState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.internal_static_SCWebLiveSpecialAccountConfigState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (configSwitchItemBuilder_ == null) { + configSwitchItem_ = java.util.Collections.emptyList(); + } else { + configSwitchItem_ = null; + configSwitchItemBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + timestamp_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.internal_static_SCWebLiveSpecialAccountConfigState_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState result) { + if (configSwitchItemBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + configSwitchItem_ = java.util.Collections.unmodifiableList(configSwitchItem_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.configSwitchItem_ = configSwitchItem_; + } else { + result.configSwitchItem_ = configSwitchItemBuilder_.build(); + } + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.timestamp_ = timestamp_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState.getDefaultInstance()) return this; + if (configSwitchItemBuilder_ == null) { + if (!other.configSwitchItem_.isEmpty()) { + if (configSwitchItem_.isEmpty()) { + configSwitchItem_ = other.configSwitchItem_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConfigSwitchItemIsMutable(); + configSwitchItem_.addAll(other.configSwitchItem_); + } + onChanged(); + } + } else { + if (!other.configSwitchItem_.isEmpty()) { + if (configSwitchItemBuilder_.isEmpty()) { + configSwitchItemBuilder_.dispose(); + configSwitchItemBuilder_ = null; + configSwitchItem_ = other.configSwitchItem_; + bitField0_ = (bitField0_ & ~0x00000001); + configSwitchItemBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getConfigSwitchItemFieldBuilder() : null; + } else { + configSwitchItemBuilder_.addAllMessages(other.configSwitchItem_); + } + } + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem m = + input.readMessage( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.parser(), + extensionRegistry); + if (configSwitchItemBuilder_ == null) { + ensureConfigSwitchItemIsMutable(); + configSwitchItem_.add(m); + } else { + configSwitchItemBuilder_.addMessage(m); + } + break; + } // case 10 + case 16: { + timestamp_ = input.readUInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List configSwitchItem_ = + java.util.Collections.emptyList(); + private void ensureConfigSwitchItemIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + configSwitchItem_ = new java.util.ArrayList(configSwitchItem_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItemOrBuilder> configSwitchItemBuilder_; + + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public java.util.List getConfigSwitchItemList() { + if (configSwitchItemBuilder_ == null) { + return java.util.Collections.unmodifiableList(configSwitchItem_); + } else { + return configSwitchItemBuilder_.getMessageList(); + } + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public int getConfigSwitchItemCount() { + if (configSwitchItemBuilder_ == null) { + return configSwitchItem_.size(); + } else { + return configSwitchItemBuilder_.getCount(); + } + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem getConfigSwitchItem(int index) { + if (configSwitchItemBuilder_ == null) { + return configSwitchItem_.get(index); + } else { + return configSwitchItemBuilder_.getMessage(index); + } + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public Builder setConfigSwitchItem( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem value) { + if (configSwitchItemBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigSwitchItemIsMutable(); + configSwitchItem_.set(index, value); + onChanged(); + } else { + configSwitchItemBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public Builder setConfigSwitchItem( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.Builder builderForValue) { + if (configSwitchItemBuilder_ == null) { + ensureConfigSwitchItemIsMutable(); + configSwitchItem_.set(index, builderForValue.build()); + onChanged(); + } else { + configSwitchItemBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public Builder addConfigSwitchItem(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem value) { + if (configSwitchItemBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigSwitchItemIsMutable(); + configSwitchItem_.add(value); + onChanged(); + } else { + configSwitchItemBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public Builder addConfigSwitchItem( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem value) { + if (configSwitchItemBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigSwitchItemIsMutable(); + configSwitchItem_.add(index, value); + onChanged(); + } else { + configSwitchItemBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public Builder addConfigSwitchItem( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.Builder builderForValue) { + if (configSwitchItemBuilder_ == null) { + ensureConfigSwitchItemIsMutable(); + configSwitchItem_.add(builderForValue.build()); + onChanged(); + } else { + configSwitchItemBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public Builder addConfigSwitchItem( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.Builder builderForValue) { + if (configSwitchItemBuilder_ == null) { + ensureConfigSwitchItemIsMutable(); + configSwitchItem_.add(index, builderForValue.build()); + onChanged(); + } else { + configSwitchItemBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public Builder addAllConfigSwitchItem( + java.lang.Iterable values) { + if (configSwitchItemBuilder_ == null) { + ensureConfigSwitchItemIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, configSwitchItem_); + onChanged(); + } else { + configSwitchItemBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public Builder clearConfigSwitchItem() { + if (configSwitchItemBuilder_ == null) { + configSwitchItem_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + configSwitchItemBuilder_.clear(); + } + return this; + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public Builder removeConfigSwitchItem(int index) { + if (configSwitchItemBuilder_ == null) { + ensureConfigSwitchItemIsMutable(); + configSwitchItem_.remove(index); + onChanged(); + } else { + configSwitchItemBuilder_.remove(index); + } + return this; + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.Builder getConfigSwitchItemBuilder( + int index) { + return getConfigSwitchItemFieldBuilder().getBuilder(index); + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItemOrBuilder getConfigSwitchItemOrBuilder( + int index) { + if (configSwitchItemBuilder_ == null) { + return configSwitchItem_.get(index); } else { + return configSwitchItemBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public java.util.List + getConfigSwitchItemOrBuilderList() { + if (configSwitchItemBuilder_ != null) { + return configSwitchItemBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(configSwitchItem_); + } + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.Builder addConfigSwitchItemBuilder() { + return getConfigSwitchItemFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.getDefaultInstance()); + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.Builder addConfigSwitchItemBuilder( + int index) { + return getConfigSwitchItemFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.getDefaultInstance()); + } + /** + * repeated .ConfigSwitchItem configSwitchItem = 1; + */ + public java.util.List + getConfigSwitchItemBuilderList() { + return getConfigSwitchItemFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItemOrBuilder> + getConfigSwitchItemFieldBuilder() { + if (configSwitchItemBuilder_ == null) { + configSwitchItemBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItem.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.ConfigSwitchItemOrBuilder>( + configSwitchItem_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + configSwitchItem_ = null; + } + return configSwitchItemBuilder_; + } + + private long timestamp_ ; + /** + * uint64 timestamp = 2; + * @return The timestamp. + */ + @java.lang.Override + public long getTimestamp() { + return timestamp_; + } + /** + * uint64 timestamp = 2; + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint64 timestamp = 2; + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000002); + timestamp_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebLiveSpecialAccountConfigState) + } + + // @@protoc_insertion_point(class_scope:SCWebLiveSpecialAccountConfigState) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebLiveSpecialAccountConfigState parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveSpecialAccountConfigStateOuterClass.SCWebLiveSpecialAccountConfigState getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebLiveSpecialAccountConfigState_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebLiveSpecialAccountConfigState_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n(SCWebLiveSpecialAccountConfigState.pro" + + "to\032\026ConfigSwitchItem.proto\"d\n\"SCWebLiveS" + + "pecialAccountConfigState\022+\n\020configSwitch" + + "Item\030\001 \003(\0132\021.ConfigSwitchItem\022\021\n\ttimesta" + + "mp\030\002 \001(\004B6\n4tech.ordinaryroad.live.chat." + + "client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.getDescriptor(), + }); + internal_static_SCWebLiveSpecialAccountConfigState_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebLiveSpecialAccountConfigState_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebLiveSpecialAccountConfigState_descriptor, + new java.lang.String[] { "ConfigSwitchItem", "Timestamp", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.ConfigSwitchItemOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebLiveWatchingUsersOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebLiveWatchingUsersOuterClass.java new file mode 100644 index 0000000..5a39e0b --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebLiveWatchingUsersOuterClass.java @@ -0,0 +1,1081 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebLiveWatchingUsers.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebLiveWatchingUsersOuterClass { + private SCWebLiveWatchingUsersOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebLiveWatchingUsersOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebLiveWatchingUsers) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + java.util.List + getWatchingUserList(); + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo getWatchingUser(int index); + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + int getWatchingUserCount(); + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + java.util.List + getWatchingUserOrBuilderList(); + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfoOrBuilder getWatchingUserOrBuilder( + int index); + + /** + * string displayWatchingCount = 2; + * @return The displayWatchingCount. + */ + java.lang.String getDisplayWatchingCount(); + /** + * string displayWatchingCount = 2; + * @return The bytes for displayWatchingCount. + */ + com.google.protobuf.ByteString + getDisplayWatchingCountBytes(); + + /** + * uint64 pendingDuration = 3; + * @return The pendingDuration. + */ + long getPendingDuration(); + } + /** + * Protobuf type {@code SCWebLiveWatchingUsers} + */ + public static final class SCWebLiveWatchingUsers extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebLiveWatchingUsers) + SCWebLiveWatchingUsersOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebLiveWatchingUsers.newBuilder() to construct. + private SCWebLiveWatchingUsers(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebLiveWatchingUsers() { + watchingUser_ = java.util.Collections.emptyList(); + displayWatchingCount_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebLiveWatchingUsers(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.internal_static_SCWebLiveWatchingUsers_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.internal_static_SCWebLiveWatchingUsers_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers.Builder.class); + } + + public static final int WATCHINGUSER_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List watchingUser_; + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + @java.lang.Override + public java.util.List getWatchingUserList() { + return watchingUser_; + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + @java.lang.Override + public java.util.List + getWatchingUserOrBuilderList() { + return watchingUser_; + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + @java.lang.Override + public int getWatchingUserCount() { + return watchingUser_.size(); + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo getWatchingUser(int index) { + return watchingUser_.get(index); + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfoOrBuilder getWatchingUserOrBuilder( + int index) { + return watchingUser_.get(index); + } + + public static final int DISPLAYWATCHINGCOUNT_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object displayWatchingCount_ = ""; + /** + * string displayWatchingCount = 2; + * @return The displayWatchingCount. + */ + @java.lang.Override + public java.lang.String getDisplayWatchingCount() { + java.lang.Object ref = displayWatchingCount_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayWatchingCount_ = s; + return s; + } + } + /** + * string displayWatchingCount = 2; + * @return The bytes for displayWatchingCount. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDisplayWatchingCountBytes() { + java.lang.Object ref = displayWatchingCount_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayWatchingCount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PENDINGDURATION_FIELD_NUMBER = 3; + private long pendingDuration_ = 0L; + /** + * uint64 pendingDuration = 3; + * @return The pendingDuration. + */ + @java.lang.Override + public long getPendingDuration() { + return pendingDuration_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < watchingUser_.size(); i++) { + output.writeMessage(1, watchingUser_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayWatchingCount_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayWatchingCount_); + } + if (pendingDuration_ != 0L) { + output.writeUInt64(3, pendingDuration_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < watchingUser_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, watchingUser_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayWatchingCount_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayWatchingCount_); + } + if (pendingDuration_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, pendingDuration_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers) obj; + + if (!getWatchingUserList() + .equals(other.getWatchingUserList())) return false; + if (!getDisplayWatchingCount() + .equals(other.getDisplayWatchingCount())) return false; + if (getPendingDuration() + != other.getPendingDuration()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getWatchingUserCount() > 0) { + hash = (37 * hash) + WATCHINGUSER_FIELD_NUMBER; + hash = (53 * hash) + getWatchingUserList().hashCode(); + } + hash = (37 * hash) + DISPLAYWATCHINGCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getDisplayWatchingCount().hashCode(); + hash = (37 * hash) + PENDINGDURATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPendingDuration()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebLiveWatchingUsers} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebLiveWatchingUsers) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsersOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.internal_static_SCWebLiveWatchingUsers_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.internal_static_SCWebLiveWatchingUsers_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (watchingUserBuilder_ == null) { + watchingUser_ = java.util.Collections.emptyList(); + } else { + watchingUser_ = null; + watchingUserBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + displayWatchingCount_ = ""; + pendingDuration_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.internal_static_SCWebLiveWatchingUsers_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers result) { + if (watchingUserBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + watchingUser_ = java.util.Collections.unmodifiableList(watchingUser_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.watchingUser_ = watchingUser_; + } else { + result.watchingUser_ = watchingUserBuilder_.build(); + } + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayWatchingCount_ = displayWatchingCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pendingDuration_ = pendingDuration_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers.getDefaultInstance()) return this; + if (watchingUserBuilder_ == null) { + if (!other.watchingUser_.isEmpty()) { + if (watchingUser_.isEmpty()) { + watchingUser_ = other.watchingUser_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWatchingUserIsMutable(); + watchingUser_.addAll(other.watchingUser_); + } + onChanged(); + } + } else { + if (!other.watchingUser_.isEmpty()) { + if (watchingUserBuilder_.isEmpty()) { + watchingUserBuilder_.dispose(); + watchingUserBuilder_ = null; + watchingUser_ = other.watchingUser_; + bitField0_ = (bitField0_ & ~0x00000001); + watchingUserBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getWatchingUserFieldBuilder() : null; + } else { + watchingUserBuilder_.addAllMessages(other.watchingUser_); + } + } + } + if (!other.getDisplayWatchingCount().isEmpty()) { + displayWatchingCount_ = other.displayWatchingCount_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPendingDuration() != 0L) { + setPendingDuration(other.getPendingDuration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo m = + input.readMessage( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.parser(), + extensionRegistry); + if (watchingUserBuilder_ == null) { + ensureWatchingUserIsMutable(); + watchingUser_.add(m); + } else { + watchingUserBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + displayWatchingCount_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + pendingDuration_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List watchingUser_ = + java.util.Collections.emptyList(); + private void ensureWatchingUserIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + watchingUser_ = new java.util.ArrayList(watchingUser_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfoOrBuilder> watchingUserBuilder_; + + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public java.util.List getWatchingUserList() { + if (watchingUserBuilder_ == null) { + return java.util.Collections.unmodifiableList(watchingUser_); + } else { + return watchingUserBuilder_.getMessageList(); + } + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public int getWatchingUserCount() { + if (watchingUserBuilder_ == null) { + return watchingUser_.size(); + } else { + return watchingUserBuilder_.getCount(); + } + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo getWatchingUser(int index) { + if (watchingUserBuilder_ == null) { + return watchingUser_.get(index); + } else { + return watchingUserBuilder_.getMessage(index); + } + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public Builder setWatchingUser( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo value) { + if (watchingUserBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWatchingUserIsMutable(); + watchingUser_.set(index, value); + onChanged(); + } else { + watchingUserBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public Builder setWatchingUser( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.Builder builderForValue) { + if (watchingUserBuilder_ == null) { + ensureWatchingUserIsMutable(); + watchingUser_.set(index, builderForValue.build()); + onChanged(); + } else { + watchingUserBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public Builder addWatchingUser(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo value) { + if (watchingUserBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWatchingUserIsMutable(); + watchingUser_.add(value); + onChanged(); + } else { + watchingUserBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public Builder addWatchingUser( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo value) { + if (watchingUserBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWatchingUserIsMutable(); + watchingUser_.add(index, value); + onChanged(); + } else { + watchingUserBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public Builder addWatchingUser( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.Builder builderForValue) { + if (watchingUserBuilder_ == null) { + ensureWatchingUserIsMutable(); + watchingUser_.add(builderForValue.build()); + onChanged(); + } else { + watchingUserBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public Builder addWatchingUser( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.Builder builderForValue) { + if (watchingUserBuilder_ == null) { + ensureWatchingUserIsMutable(); + watchingUser_.add(index, builderForValue.build()); + onChanged(); + } else { + watchingUserBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public Builder addAllWatchingUser( + java.lang.Iterable values) { + if (watchingUserBuilder_ == null) { + ensureWatchingUserIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, watchingUser_); + onChanged(); + } else { + watchingUserBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public Builder clearWatchingUser() { + if (watchingUserBuilder_ == null) { + watchingUser_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + watchingUserBuilder_.clear(); + } + return this; + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public Builder removeWatchingUser(int index) { + if (watchingUserBuilder_ == null) { + ensureWatchingUserIsMutable(); + watchingUser_.remove(index); + onChanged(); + } else { + watchingUserBuilder_.remove(index); + } + return this; + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.Builder getWatchingUserBuilder( + int index) { + return getWatchingUserFieldBuilder().getBuilder(index); + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfoOrBuilder getWatchingUserOrBuilder( + int index) { + if (watchingUserBuilder_ == null) { + return watchingUser_.get(index); } else { + return watchingUserBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public java.util.List + getWatchingUserOrBuilderList() { + if (watchingUserBuilder_ != null) { + return watchingUserBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(watchingUser_); + } + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.Builder addWatchingUserBuilder() { + return getWatchingUserFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.getDefaultInstance()); + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.Builder addWatchingUserBuilder( + int index) { + return getWatchingUserFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.getDefaultInstance()); + } + /** + * repeated .WebWatchingUserInfo watchingUser = 1; + */ + public java.util.List + getWatchingUserBuilderList() { + return getWatchingUserFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfoOrBuilder> + getWatchingUserFieldBuilder() { + if (watchingUserBuilder_ == null) { + watchingUserBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfoOrBuilder>( + watchingUser_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + watchingUser_ = null; + } + return watchingUserBuilder_; + } + + private java.lang.Object displayWatchingCount_ = ""; + /** + * string displayWatchingCount = 2; + * @return The displayWatchingCount. + */ + public java.lang.String getDisplayWatchingCount() { + java.lang.Object ref = displayWatchingCount_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayWatchingCount_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string displayWatchingCount = 2; + * @return The bytes for displayWatchingCount. + */ + public com.google.protobuf.ByteString + getDisplayWatchingCountBytes() { + java.lang.Object ref = displayWatchingCount_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayWatchingCount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string displayWatchingCount = 2; + * @param value The displayWatchingCount to set. + * @return This builder for chaining. + */ + public Builder setDisplayWatchingCount( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + displayWatchingCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string displayWatchingCount = 2; + * @return This builder for chaining. + */ + public Builder clearDisplayWatchingCount() { + displayWatchingCount_ = getDefaultInstance().getDisplayWatchingCount(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string displayWatchingCount = 2; + * @param value The bytes for displayWatchingCount to set. + * @return This builder for chaining. + */ + public Builder setDisplayWatchingCountBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + displayWatchingCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long pendingDuration_ ; + /** + * uint64 pendingDuration = 3; + * @return The pendingDuration. + */ + @java.lang.Override + public long getPendingDuration() { + return pendingDuration_; + } + /** + * uint64 pendingDuration = 3; + * @param value The pendingDuration to set. + * @return This builder for chaining. + */ + public Builder setPendingDuration(long value) { + + pendingDuration_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 pendingDuration = 3; + * @return This builder for chaining. + */ + public Builder clearPendingDuration() { + bitField0_ = (bitField0_ & ~0x00000004); + pendingDuration_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebLiveWatchingUsers) + } + + // @@protoc_insertion_point(class_scope:SCWebLiveWatchingUsers) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebLiveWatchingUsers parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebLiveWatchingUsersOuterClass.SCWebLiveWatchingUsers getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebLiveWatchingUsers_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebLiveWatchingUsers_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\034SCWebLiveWatchingUsers.proto\032\031WebWatch" + + "ingUserInfo.proto\"{\n\026SCWebLiveWatchingUs" + + "ers\022*\n\014watchingUser\030\001 \003(\0132\024.WebWatchingU" + + "serInfo\022\034\n\024displayWatchingCount\030\002 \001(\t\022\027\n" + + "\017pendingDuration\030\003 \001(\004B6\n4tech.ordinaryr" + + "oad.live.chat.client.kuaishou.protobufb\006" + + "proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.getDescriptor(), + }); + internal_static_SCWebLiveWatchingUsers_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebLiveWatchingUsers_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebLiveWatchingUsers_descriptor, + new java.lang.String[] { "WatchingUser", "DisplayWatchingCount", "PendingDuration", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebPipEndedOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebPipEndedOuterClass.java new file mode 100644 index 0000000..150867c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebPipEndedOuterClass.java @@ -0,0 +1,549 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebPipEnded.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebPipEndedOuterClass { + private SCWebPipEndedOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebPipEndedOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebPipEnded) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 time = 1; + * @return The time. + */ + long getTime(); + } + /** + * Protobuf type {@code SCWebPipEnded} + */ + public static final class SCWebPipEnded extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebPipEnded) + SCWebPipEndedOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebPipEnded.newBuilder() to construct. + private SCWebPipEnded(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebPipEnded() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebPipEnded(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.internal_static_SCWebPipEnded_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.internal_static_SCWebPipEnded_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded.Builder.class); + } + + public static final int TIME_FIELD_NUMBER = 1; + private long time_ = 0L; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (time_ != 0L) { + output.writeUInt64(1, time_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (time_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, time_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded) obj; + + if (getTime() + != other.getTime()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTime()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebPipEnded} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebPipEnded) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEndedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.internal_static_SCWebPipEnded_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.internal_static_SCWebPipEnded_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + time_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.internal_static_SCWebPipEnded_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.time_ = time_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded.getDefaultInstance()) return this; + if (other.getTime() != 0L) { + setTime(other.getTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + time_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long time_ ; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + /** + * uint64 time = 1; + * @param value The time to set. + * @return This builder for chaining. + */ + public Builder setTime(long value) { + + time_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 time = 1; + * @return This builder for chaining. + */ + public Builder clearTime() { + bitField0_ = (bitField0_ & ~0x00000001); + time_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebPipEnded) + } + + // @@protoc_insertion_point(class_scope:SCWebPipEnded) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebPipEnded parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipEndedOuterClass.SCWebPipEnded getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebPipEnded_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebPipEnded_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\023SCWebPipEnded.proto\"\035\n\rSCWebPipEnded\022\014" + + "\n\004time\030\001 \001(\004B6\n4tech.ordinaryroad.live.c" + + "hat.client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCWebPipEnded_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebPipEnded_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebPipEnded_descriptor, + new java.lang.String[] { "Time", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebPipStartedOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebPipStartedOuterClass.java new file mode 100644 index 0000000..4b4e9ff --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebPipStartedOuterClass.java @@ -0,0 +1,549 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebPipStarted.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebPipStartedOuterClass { + private SCWebPipStartedOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebPipStartedOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebPipStarted) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 time = 1; + * @return The time. + */ + long getTime(); + } + /** + * Protobuf type {@code SCWebPipStarted} + */ + public static final class SCWebPipStarted extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebPipStarted) + SCWebPipStartedOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebPipStarted.newBuilder() to construct. + private SCWebPipStarted(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebPipStarted() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebPipStarted(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.internal_static_SCWebPipStarted_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.internal_static_SCWebPipStarted_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted.Builder.class); + } + + public static final int TIME_FIELD_NUMBER = 1; + private long time_ = 0L; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (time_ != 0L) { + output.writeUInt64(1, time_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (time_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, time_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted) obj; + + if (getTime() + != other.getTime()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTime()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebPipStarted} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebPipStarted) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStartedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.internal_static_SCWebPipStarted_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.internal_static_SCWebPipStarted_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + time_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.internal_static_SCWebPipStarted_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.time_ = time_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted.getDefaultInstance()) return this; + if (other.getTime() != 0L) { + setTime(other.getTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + time_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long time_ ; + /** + * uint64 time = 1; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + /** + * uint64 time = 1; + * @param value The time to set. + * @return This builder for chaining. + */ + public Builder setTime(long value) { + + time_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 time = 1; + * @return This builder for chaining. + */ + public Builder clearTime() { + bitField0_ = (bitField0_ & ~0x00000001); + time_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebPipStarted) + } + + // @@protoc_insertion_point(class_scope:SCWebPipStarted) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebPipStarted parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebPipStartedOuterClass.SCWebPipStarted getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebPipStarted_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebPipStarted_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\025SCWebPipStarted.proto\"\037\n\017SCWebPipStart" + + "ed\022\014\n\004time\030\001 \001(\004B6\n4tech.ordinaryroad.li" + + "ve.chat.client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCWebPipStarted_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebPipStarted_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebPipStarted_descriptor, + new java.lang.String[] { "Time", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebRefreshWalletOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebRefreshWalletOuterClass.java new file mode 100644 index 0000000..44f11b1 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebRefreshWalletOuterClass.java @@ -0,0 +1,469 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebRefreshWallet.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebRefreshWalletOuterClass { + private SCWebRefreshWalletOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebRefreshWalletOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebRefreshWallet) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code SCWebRefreshWallet} + */ + public static final class SCWebRefreshWallet extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebRefreshWallet) + SCWebRefreshWalletOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebRefreshWallet.newBuilder() to construct. + private SCWebRefreshWallet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebRefreshWallet() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebRefreshWallet(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.internal_static_SCWebRefreshWallet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.internal_static_SCWebRefreshWallet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet.Builder.class); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebRefreshWallet} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebRefreshWallet) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWalletOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.internal_static_SCWebRefreshWallet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.internal_static_SCWebRefreshWallet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.internal_static_SCWebRefreshWallet_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebRefreshWallet) + } + + // @@protoc_insertion_point(class_scope:SCWebRefreshWallet) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebRefreshWallet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRefreshWalletOuterClass.SCWebRefreshWallet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebRefreshWallet_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebRefreshWallet_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\030SCWebRefreshWallet.proto\"\024\n\022SCWebRefre" + + "shWalletB6\n4tech.ordinaryroad.live.chat." + + "client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCWebRefreshWallet_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebRefreshWallet_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebRefreshWallet_descriptor, + new java.lang.String[] { }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebRideChangedOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebRideChangedOuterClass.java new file mode 100644 index 0000000..4e6cd79 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebRideChangedOuterClass.java @@ -0,0 +1,697 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebRideChanged.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebRideChangedOuterClass { + private SCWebRideChangedOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebRideChangedOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebRideChanged) + com.google.protobuf.MessageOrBuilder { + + /** + * string rideId = 1; + * @return The rideId. + */ + java.lang.String getRideId(); + /** + * string rideId = 1; + * @return The bytes for rideId. + */ + com.google.protobuf.ByteString + getRideIdBytes(); + + /** + * uint32 requestMaxDelayMillis = 2; + * @return The requestMaxDelayMillis. + */ + int getRequestMaxDelayMillis(); + } + /** + * Protobuf type {@code SCWebRideChanged} + */ + public static final class SCWebRideChanged extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebRideChanged) + SCWebRideChangedOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebRideChanged.newBuilder() to construct. + private SCWebRideChanged(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebRideChanged() { + rideId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebRideChanged(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.internal_static_SCWebRideChanged_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.internal_static_SCWebRideChanged_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged.Builder.class); + } + + public static final int RIDEID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object rideId_ = ""; + /** + * string rideId = 1; + * @return The rideId. + */ + @java.lang.Override + public java.lang.String getRideId() { + java.lang.Object ref = rideId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rideId_ = s; + return s; + } + } + /** + * string rideId = 1; + * @return The bytes for rideId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRideIdBytes() { + java.lang.Object ref = rideId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + rideId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTMAXDELAYMILLIS_FIELD_NUMBER = 2; + private int requestMaxDelayMillis_ = 0; + /** + * uint32 requestMaxDelayMillis = 2; + * @return The requestMaxDelayMillis. + */ + @java.lang.Override + public int getRequestMaxDelayMillis() { + return requestMaxDelayMillis_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rideId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, rideId_); + } + if (requestMaxDelayMillis_ != 0) { + output.writeUInt32(2, requestMaxDelayMillis_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rideId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, rideId_); + } + if (requestMaxDelayMillis_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, requestMaxDelayMillis_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged) obj; + + if (!getRideId() + .equals(other.getRideId())) return false; + if (getRequestMaxDelayMillis() + != other.getRequestMaxDelayMillis()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RIDEID_FIELD_NUMBER; + hash = (53 * hash) + getRideId().hashCode(); + hash = (37 * hash) + REQUESTMAXDELAYMILLIS_FIELD_NUMBER; + hash = (53 * hash) + getRequestMaxDelayMillis(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebRideChanged} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebRideChanged) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChangedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.internal_static_SCWebRideChanged_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.internal_static_SCWebRideChanged_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rideId_ = ""; + requestMaxDelayMillis_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.internal_static_SCWebRideChanged_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rideId_ = rideId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestMaxDelayMillis_ = requestMaxDelayMillis_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged.getDefaultInstance()) return this; + if (!other.getRideId().isEmpty()) { + rideId_ = other.rideId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getRequestMaxDelayMillis() != 0) { + setRequestMaxDelayMillis(other.getRequestMaxDelayMillis()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + rideId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + requestMaxDelayMillis_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object rideId_ = ""; + /** + * string rideId = 1; + * @return The rideId. + */ + public java.lang.String getRideId() { + java.lang.Object ref = rideId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rideId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string rideId = 1; + * @return The bytes for rideId. + */ + public com.google.protobuf.ByteString + getRideIdBytes() { + java.lang.Object ref = rideId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + rideId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string rideId = 1; + * @param value The rideId to set. + * @return This builder for chaining. + */ + public Builder setRideId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + rideId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string rideId = 1; + * @return This builder for chaining. + */ + public Builder clearRideId() { + rideId_ = getDefaultInstance().getRideId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string rideId = 1; + * @param value The bytes for rideId to set. + * @return This builder for chaining. + */ + public Builder setRideIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + rideId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int requestMaxDelayMillis_ ; + /** + * uint32 requestMaxDelayMillis = 2; + * @return The requestMaxDelayMillis. + */ + @java.lang.Override + public int getRequestMaxDelayMillis() { + return requestMaxDelayMillis_; + } + /** + * uint32 requestMaxDelayMillis = 2; + * @param value The requestMaxDelayMillis to set. + * @return This builder for chaining. + */ + public Builder setRequestMaxDelayMillis(int value) { + + requestMaxDelayMillis_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * uint32 requestMaxDelayMillis = 2; + * @return This builder for chaining. + */ + public Builder clearRequestMaxDelayMillis() { + bitField0_ = (bitField0_ & ~0x00000002); + requestMaxDelayMillis_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebRideChanged) + } + + // @@protoc_insertion_point(class_scope:SCWebRideChanged) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebRideChanged parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebRideChangedOuterClass.SCWebRideChanged getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebRideChanged_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebRideChanged_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026SCWebRideChanged.proto\"A\n\020SCWebRideCha" + + "nged\022\016\n\006rideId\030\001 \001(\t\022\035\n\025requestMaxDelayM" + + "illis\030\002 \001(\rB6\n4tech.ordinaryroad.live.ch" + + "at.client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCWebRideChanged_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebRideChanged_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebRideChanged_descriptor, + new java.lang.String[] { "RideId", "RequestMaxDelayMillis", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebSuspectedViolationOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebSuspectedViolationOuterClass.java new file mode 100644 index 0000000..dabcda8 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SCWebSuspectedViolationOuterClass.java @@ -0,0 +1,550 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SCWebSuspectedViolation.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SCWebSuspectedViolationOuterClass { + private SCWebSuspectedViolationOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SCWebSuspectedViolationOrBuilder extends + // @@protoc_insertion_point(interface_extends:SCWebSuspectedViolation) + com.google.protobuf.MessageOrBuilder { + + /** + * bool suspectedViolation = 1; + * @return The suspectedViolation. + */ + boolean getSuspectedViolation(); + } + /** + * Protobuf type {@code SCWebSuspectedViolation} + */ + public static final class SCWebSuspectedViolation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SCWebSuspectedViolation) + SCWebSuspectedViolationOrBuilder { + private static final long serialVersionUID = 0L; + // Use SCWebSuspectedViolation.newBuilder() to construct. + private SCWebSuspectedViolation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SCWebSuspectedViolation() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SCWebSuspectedViolation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.internal_static_SCWebSuspectedViolation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.internal_static_SCWebSuspectedViolation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation.Builder.class); + } + + public static final int SUSPECTEDVIOLATION_FIELD_NUMBER = 1; + private boolean suspectedViolation_ = false; + /** + * bool suspectedViolation = 1; + * @return The suspectedViolation. + */ + @java.lang.Override + public boolean getSuspectedViolation() { + return suspectedViolation_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (suspectedViolation_ != false) { + output.writeBool(1, suspectedViolation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (suspectedViolation_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, suspectedViolation_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation) obj; + + if (getSuspectedViolation() + != other.getSuspectedViolation()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SUSPECTEDVIOLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSuspectedViolation()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SCWebSuspectedViolation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SCWebSuspectedViolation) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.internal_static_SCWebSuspectedViolation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.internal_static_SCWebSuspectedViolation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + suspectedViolation_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.internal_static_SCWebSuspectedViolation_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.suspectedViolation_ = suspectedViolation_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation.getDefaultInstance()) return this; + if (other.getSuspectedViolation() != false) { + setSuspectedViolation(other.getSuspectedViolation()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + suspectedViolation_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean suspectedViolation_ ; + /** + * bool suspectedViolation = 1; + * @return The suspectedViolation. + */ + @java.lang.Override + public boolean getSuspectedViolation() { + return suspectedViolation_; + } + /** + * bool suspectedViolation = 1; + * @param value The suspectedViolation to set. + * @return This builder for chaining. + */ + public Builder setSuspectedViolation(boolean value) { + + suspectedViolation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bool suspectedViolation = 1; + * @return This builder for chaining. + */ + public Builder clearSuspectedViolation() { + bitField0_ = (bitField0_ & ~0x00000001); + suspectedViolation_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SCWebSuspectedViolation) + } + + // @@protoc_insertion_point(class_scope:SCWebSuspectedViolation) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SCWebSuspectedViolation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SCWebSuspectedViolationOuterClass.SCWebSuspectedViolation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SCWebSuspectedViolation_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SCWebSuspectedViolation_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\035SCWebSuspectedViolation.proto\"5\n\027SCWeb" + + "SuspectedViolation\022\032\n\022suspectedViolation" + + "\030\001 \001(\010B6\n4tech.ordinaryroad.live.chat.cl" + + "ient.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SCWebSuspectedViolation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SCWebSuspectedViolation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SCWebSuspectedViolation_descriptor, + new java.lang.String[] { "SuspectedViolation", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SimpleUserInfoOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SimpleUserInfoOuterClass.java new file mode 100644 index 0000000..e1b6666 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SimpleUserInfoOuterClass.java @@ -0,0 +1,921 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SimpleUserInfo.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class SimpleUserInfoOuterClass { + private SimpleUserInfoOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SimpleUserInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:SimpleUserInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * string principalId = 1; + * @return The principalId. + */ + java.lang.String getPrincipalId(); + /** + * string principalId = 1; + * @return The bytes for principalId. + */ + com.google.protobuf.ByteString + getPrincipalIdBytes(); + + /** + * string userName = 2; + * @return The userName. + */ + java.lang.String getUserName(); + /** + * string userName = 2; + * @return The bytes for userName. + */ + com.google.protobuf.ByteString + getUserNameBytes(); + + /** + * string headUrl = 3; + * @return The headUrl. + */ + java.lang.String getHeadUrl(); + /** + * string headUrl = 3; + * @return The bytes for headUrl. + */ + com.google.protobuf.ByteString + getHeadUrlBytes(); + } + /** + * Protobuf type {@code SimpleUserInfo} + */ + public static final class SimpleUserInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SimpleUserInfo) + SimpleUserInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use SimpleUserInfo.newBuilder() to construct. + private SimpleUserInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SimpleUserInfo() { + principalId_ = ""; + userName_ = ""; + headUrl_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SimpleUserInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.internal_static_SimpleUserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.internal_static_SimpleUserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder.class); + } + + public static final int PRINCIPALID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object principalId_ = ""; + /** + * string principalId = 1; + * @return The principalId. + */ + @java.lang.Override + public java.lang.String getPrincipalId() { + java.lang.Object ref = principalId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + principalId_ = s; + return s; + } + } + /** + * string principalId = 1; + * @return The bytes for principalId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPrincipalIdBytes() { + java.lang.Object ref = principalId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + principalId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERNAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object userName_ = ""; + /** + * string userName = 2; + * @return The userName. + */ + @java.lang.Override + public java.lang.String getUserName() { + java.lang.Object ref = userName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userName_ = s; + return s; + } + } + /** + * string userName = 2; + * @return The bytes for userName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUserNameBytes() { + java.lang.Object ref = userName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HEADURL_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object headUrl_ = ""; + /** + * string headUrl = 3; + * @return The headUrl. + */ + @java.lang.Override + public java.lang.String getHeadUrl() { + java.lang.Object ref = headUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + headUrl_ = s; + return s; + } + } + /** + * string headUrl = 3; + * @return The bytes for headUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getHeadUrlBytes() { + java.lang.Object ref = headUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + headUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(principalId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, principalId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, userName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(headUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, headUrl_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(principalId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, principalId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, userName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(headUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, headUrl_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo) obj; + + if (!getPrincipalId() + .equals(other.getPrincipalId())) return false; + if (!getUserName() + .equals(other.getUserName())) return false; + if (!getHeadUrl() + .equals(other.getHeadUrl())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PRINCIPALID_FIELD_NUMBER; + hash = (53 * hash) + getPrincipalId().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUserName().hashCode(); + hash = (37 * hash) + HEADURL_FIELD_NUMBER; + hash = (53 * hash) + getHeadUrl().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SimpleUserInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SimpleUserInfo) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.internal_static_SimpleUserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.internal_static_SimpleUserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + principalId_ = ""; + userName_ = ""; + headUrl_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.internal_static_SimpleUserInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.principalId_ = principalId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.userName_ = userName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.headUrl_ = headUrl_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance()) return this; + if (!other.getPrincipalId().isEmpty()) { + principalId_ = other.principalId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUserName().isEmpty()) { + userName_ = other.userName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getHeadUrl().isEmpty()) { + headUrl_ = other.headUrl_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + principalId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + userName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + headUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object principalId_ = ""; + /** + * string principalId = 1; + * @return The principalId. + */ + public java.lang.String getPrincipalId() { + java.lang.Object ref = principalId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + principalId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string principalId = 1; + * @return The bytes for principalId. + */ + public com.google.protobuf.ByteString + getPrincipalIdBytes() { + java.lang.Object ref = principalId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + principalId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string principalId = 1; + * @param value The principalId to set. + * @return This builder for chaining. + */ + public Builder setPrincipalId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + principalId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string principalId = 1; + * @return This builder for chaining. + */ + public Builder clearPrincipalId() { + principalId_ = getDefaultInstance().getPrincipalId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string principalId = 1; + * @param value The bytes for principalId to set. + * @return This builder for chaining. + */ + public Builder setPrincipalIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + principalId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object userName_ = ""; + /** + * string userName = 2; + * @return The userName. + */ + public java.lang.String getUserName() { + java.lang.Object ref = userName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string userName = 2; + * @return The bytes for userName. + */ + public com.google.protobuf.ByteString + getUserNameBytes() { + java.lang.Object ref = userName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string userName = 2; + * @param value The userName to set. + * @return This builder for chaining. + */ + public Builder setUserName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + userName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string userName = 2; + * @return This builder for chaining. + */ + public Builder clearUserName() { + userName_ = getDefaultInstance().getUserName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string userName = 2; + * @param value The bytes for userName to set. + * @return This builder for chaining. + */ + public Builder setUserNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + userName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object headUrl_ = ""; + /** + * string headUrl = 3; + * @return The headUrl. + */ + public java.lang.String getHeadUrl() { + java.lang.Object ref = headUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + headUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string headUrl = 3; + * @return The bytes for headUrl. + */ + public com.google.protobuf.ByteString + getHeadUrlBytes() { + java.lang.Object ref = headUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + headUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string headUrl = 3; + * @param value The headUrl to set. + * @return This builder for chaining. + */ + public Builder setHeadUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + headUrl_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * string headUrl = 3; + * @return This builder for chaining. + */ + public Builder clearHeadUrl() { + headUrl_ = getDefaultInstance().getHeadUrl(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * string headUrl = 3; + * @param value The bytes for headUrl to set. + * @return This builder for chaining. + */ + public Builder setHeadUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + headUrl_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SimpleUserInfo) + } + + // @@protoc_insertion_point(class_scope:SimpleUserInfo) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SimpleUserInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SimpleUserInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SimpleUserInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024SimpleUserInfo.proto\"H\n\016SimpleUserInfo" + + "\022\023\n\013principalId\030\001 \001(\t\022\020\n\010userName\030\002 \001(\t\022" + + "\017\n\007headUrl\030\003 \001(\tB6\n4tech.ordinaryroad.li" + + "ve.chat.client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SimpleUserInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SimpleUserInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SimpleUserInfo_descriptor, + new java.lang.String[] { "PrincipalId", "UserName", "HeadUrl", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SocketMessageOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SocketMessageOuterClass.java new file mode 100644 index 0000000..ded05b9 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/SocketMessageOuterClass.java @@ -0,0 +1,910 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SocketMessage.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +import tech.ordinaryroad.live.chat.client.kuaishou.msg.base.IKuaishouCmdMsg; + +public final class SocketMessageOuterClass { + private SocketMessageOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface SocketMessageOrBuilder extends + // @@protoc_insertion_point(interface_extends:SocketMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * .PayloadType payloadType = 1; + * @return The enum numeric value on the wire for payloadType. + */ + int getPayloadTypeValue(); + /** + * .PayloadType payloadType = 1; + * @return The payloadType. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.PayloadType getPayloadType(); + + /** + * .SocketMessage.CompressionType compressionType = 2; + * @return The enum numeric value on the wire for compressionType. + */ + int getCompressionTypeValue(); + /** + * .SocketMessage.CompressionType compressionType = 2; + * @return The compressionType. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.CompressionType getCompressionType(); + + /** + * bytes payload = 3; + * @return The payload. + */ + com.google.protobuf.ByteString getPayload(); + } + /** + * Protobuf type {@code SocketMessage} + */ + public static final class SocketMessage extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:SocketMessage) + SocketMessageOrBuilder, IKuaishouCmdMsg { + + @Override + public String getCmd() { + return getPayloadType().name(); + } + + @Override + public void setCmd(String cmd) { + // ignore + } + + @Override + public PayloadTypeOuterClass.PayloadType getCmdEnum() { + return getPayloadType(); + } + + private static final long serialVersionUID = 0L; + // Use SocketMessage.newBuilder() to construct. + private SocketMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SocketMessage() { + payloadType_ = 0; + compressionType_ = 0; + payload_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SocketMessage(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.internal_static_SocketMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.internal_static_SocketMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.Builder.class); + } + + /** + * Protobuf enum {@code SocketMessage.CompressionType} + */ + public enum CompressionType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + * NONE = 1; + */ + NONE(1), + /** + * GZIP = 2; + */ + GZIP(2), + /** + * AES = 3; + */ + AES(3), + UNRECOGNIZED(-1), + ; + + /** + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + * NONE = 1; + */ + public static final int NONE_VALUE = 1; + /** + * GZIP = 2; + */ + public static final int GZIP_VALUE = 2; + /** + * AES = 3; + */ + public static final int AES_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CompressionType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static CompressionType forNumber(int value) { + switch (value) { + case 0: return UNKNOWN; + case 1: return NONE; + case 2: return GZIP; + case 3: return AES; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + CompressionType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CompressionType findValueByNumber(int number) { + return CompressionType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.getDescriptor().getEnumTypes().get(0); + } + + private static final CompressionType[] VALUES = values(); + + public static CompressionType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private CompressionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:SocketMessage.CompressionType) + } + + public static final int PAYLOADTYPE_FIELD_NUMBER = 1; + private int payloadType_ = 0; + /** + * .PayloadType payloadType = 1; + * @return The enum numeric value on the wire for payloadType. + */ + @java.lang.Override public int getPayloadTypeValue() { + return payloadType_; + } + /** + * .PayloadType payloadType = 1; + * @return The payloadType. + */ + @java.lang.Override public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.PayloadType getPayloadType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.PayloadType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.PayloadType.forNumber(payloadType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.PayloadType.UNRECOGNIZED : result; + } + + public static final int COMPRESSIONTYPE_FIELD_NUMBER = 2; + private int compressionType_ = 0; + /** + * .SocketMessage.CompressionType compressionType = 2; + * @return The enum numeric value on the wire for compressionType. + */ + @java.lang.Override public int getCompressionTypeValue() { + return compressionType_; + } + /** + * .SocketMessage.CompressionType compressionType = 2; + * @return The compressionType. + */ + @java.lang.Override public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.CompressionType getCompressionType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.CompressionType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.CompressionType.forNumber(compressionType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.CompressionType.UNRECOGNIZED : result; + } + + public static final int PAYLOAD_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes payload = 3; + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (payloadType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.PayloadType.UNKNOWN.getNumber()) { + output.writeEnum(1, payloadType_); + } + if (compressionType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.CompressionType.UNKNOWN.getNumber()) { + output.writeEnum(2, compressionType_); + } + if (!payload_.isEmpty()) { + output.writeBytes(3, payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.PayloadType.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, payloadType_); + } + if (compressionType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.CompressionType.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, compressionType_); + } + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, payload_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage) obj; + + if (payloadType_ != other.payloadType_) return false; + if (compressionType_ != other.compressionType_) return false; + if (!getPayload() + .equals(other.getPayload())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAYLOADTYPE_FIELD_NUMBER; + hash = (53 * hash) + payloadType_; + hash = (37 * hash) + COMPRESSIONTYPE_FIELD_NUMBER; + hash = (53 * hash) + compressionType_; + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SocketMessage} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:SocketMessage) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.internal_static_SocketMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.internal_static_SocketMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + payloadType_ = 0; + compressionType_ = 0; + payload_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.internal_static_SocketMessage_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.payloadType_ = payloadType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.compressionType_ = compressionType_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.payload_ = payload_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.getDefaultInstance()) return this; + if (other.payloadType_ != 0) { + setPayloadTypeValue(other.getPayloadTypeValue()); + } + if (other.compressionType_ != 0) { + setCompressionTypeValue(other.getCompressionTypeValue()); + } + if (other.getPayload() != com.google.protobuf.ByteString.EMPTY) { + setPayload(other.getPayload()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + payloadType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + compressionType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + payload_ = input.readBytes(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int payloadType_ = 0; + /** + * .PayloadType payloadType = 1; + * @return The enum numeric value on the wire for payloadType. + */ + @java.lang.Override public int getPayloadTypeValue() { + return payloadType_; + } + /** + * .PayloadType payloadType = 1; + * @param value The enum numeric value on the wire for payloadType to set. + * @return This builder for chaining. + */ + public Builder setPayloadTypeValue(int value) { + payloadType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .PayloadType payloadType = 1; + * @return The payloadType. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.PayloadType getPayloadType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.PayloadType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.PayloadType.forNumber(payloadType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.PayloadType.UNRECOGNIZED : result; + } + /** + * .PayloadType payloadType = 1; + * @param value The payloadType to set. + * @return This builder for chaining. + */ + public Builder setPayloadType(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.PayloadType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + payloadType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .PayloadType payloadType = 1; + * @return This builder for chaining. + */ + public Builder clearPayloadType() { + bitField0_ = (bitField0_ & ~0x00000001); + payloadType_ = 0; + onChanged(); + return this; + } + + private int compressionType_ = 0; + /** + * .SocketMessage.CompressionType compressionType = 2; + * @return The enum numeric value on the wire for compressionType. + */ + @java.lang.Override public int getCompressionTypeValue() { + return compressionType_; + } + /** + * .SocketMessage.CompressionType compressionType = 2; + * @param value The enum numeric value on the wire for compressionType to set. + * @return This builder for chaining. + */ + public Builder setCompressionTypeValue(int value) { + compressionType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SocketMessage.CompressionType compressionType = 2; + * @return The compressionType. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.CompressionType getCompressionType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.CompressionType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.CompressionType.forNumber(compressionType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.CompressionType.UNRECOGNIZED : result; + } + /** + * .SocketMessage.CompressionType compressionType = 2; + * @param value The compressionType to set. + * @return This builder for chaining. + */ + public Builder setCompressionType(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage.CompressionType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + compressionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .SocketMessage.CompressionType compressionType = 2; + * @return This builder for chaining. + */ + public Builder clearCompressionType() { + bitField0_ = (bitField0_ & ~0x00000002); + compressionType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes payload = 3; + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + /** + * bytes payload = 3; + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + payload_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * bytes payload = 3; + * @return This builder for chaining. + */ + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000004); + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:SocketMessage) + } + + // @@protoc_insertion_point(class_scope:SocketMessage) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SocketMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SocketMessageOuterClass.SocketMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SocketMessage_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_SocketMessage_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\023SocketMessage.proto\032\021PayloadType.proto" + + "\"\271\001\n\rSocketMessage\022!\n\013payloadType\030\001 \001(\0162" + + "\014.PayloadType\0227\n\017compressionType\030\002 \001(\0162\036" + + ".SocketMessage.CompressionType\022\017\n\007payloa" + + "d\030\003 \001(\014\";\n\017CompressionType\022\013\n\007UNKNOWN\020\000\022" + + "\010\n\004NONE\020\001\022\010\n\004GZIP\020\002\022\007\n\003AES\020\003B6\n4tech.ord" + + "inaryroad.live.chat.client.kuaishou.prot" + + "obufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.getDescriptor(), + }); + internal_static_SocketMessage_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SocketMessage_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_SocketMessage_descriptor, + new java.lang.String[] { "PayloadType", "CompressionType", "Payload", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/UserInfoOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/UserInfoOuterClass.java new file mode 100644 index 0000000..f09acea --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/UserInfoOuterClass.java @@ -0,0 +1,2121 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: UserInfo.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class UserInfoOuterClass { + private UserInfoOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface UserInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:UserInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 userId = 1; + * @return The userId. + */ + long getUserId(); + + /** + * string userName = 2; + * @return The userName. + */ + java.lang.String getUserName(); + /** + * string userName = 2; + * @return The bytes for userName. + */ + com.google.protobuf.ByteString + getUserNameBytes(); + + /** + * string userGender = 3; + * @return The userGender. + */ + java.lang.String getUserGender(); + /** + * string userGender = 3; + * @return The bytes for userGender. + */ + com.google.protobuf.ByteString + getUserGenderBytes(); + + /** + * string userText = 4; + * @return The userText. + */ + java.lang.String getUserText(); + /** + * string userText = 4; + * @return The bytes for userText. + */ + com.google.protobuf.ByteString + getUserTextBytes(); + + /** + * repeated .PicUrl headUrls = 5; + */ + java.util.List + getHeadUrlsList(); + /** + * repeated .PicUrl headUrls = 5; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl getHeadUrls(int index); + /** + * repeated .PicUrl headUrls = 5; + */ + int getHeadUrlsCount(); + /** + * repeated .PicUrl headUrls = 5; + */ + java.util.List + getHeadUrlsOrBuilderList(); + /** + * repeated .PicUrl headUrls = 5; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder getHeadUrlsOrBuilder( + int index); + + /** + * bool verified = 6; + * @return The verified. + */ + boolean getVerified(); + + /** + * string sUserId = 7; + * @return The sUserId. + */ + java.lang.String getSUserId(); + /** + * string sUserId = 7; + * @return The bytes for sUserId. + */ + com.google.protobuf.ByteString + getSUserIdBytes(); + + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + java.util.List + getHttpsHeadUrlsList(); + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl getHttpsHeadUrls(int index); + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + int getHttpsHeadUrlsCount(); + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + java.util.List + getHttpsHeadUrlsOrBuilderList(); + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder getHttpsHeadUrlsOrBuilder( + int index); + + /** + * string kwaiId = 9; + * @return The kwaiId. + */ + java.lang.String getKwaiId(); + /** + * string kwaiId = 9; + * @return The bytes for kwaiId. + */ + com.google.protobuf.ByteString + getKwaiIdBytes(); + } + /** + * Protobuf type {@code UserInfo} + */ + public static final class UserInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:UserInfo) + UserInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserInfo.newBuilder() to construct. + private UserInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UserInfo() { + userName_ = ""; + userGender_ = ""; + userText_ = ""; + headUrls_ = java.util.Collections.emptyList(); + sUserId_ = ""; + httpsHeadUrls_ = java.util.Collections.emptyList(); + kwaiId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UserInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.internal_static_UserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.internal_static_UserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo.Builder.class); + } + + public static final int USERID_FIELD_NUMBER = 1; + private long userId_ = 0L; + /** + * uint64 userId = 1; + * @return The userId. + */ + @java.lang.Override + public long getUserId() { + return userId_; + } + + public static final int USERNAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object userName_ = ""; + /** + * string userName = 2; + * @return The userName. + */ + @java.lang.Override + public java.lang.String getUserName() { + java.lang.Object ref = userName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userName_ = s; + return s; + } + } + /** + * string userName = 2; + * @return The bytes for userName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUserNameBytes() { + java.lang.Object ref = userName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERGENDER_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object userGender_ = ""; + /** + * string userGender = 3; + * @return The userGender. + */ + @java.lang.Override + public java.lang.String getUserGender() { + java.lang.Object ref = userGender_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userGender_ = s; + return s; + } + } + /** + * string userGender = 3; + * @return The bytes for userGender. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUserGenderBytes() { + java.lang.Object ref = userGender_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userGender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERTEXT_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object userText_ = ""; + /** + * string userText = 4; + * @return The userText. + */ + @java.lang.Override + public java.lang.String getUserText() { + java.lang.Object ref = userText_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userText_ = s; + return s; + } + } + /** + * string userText = 4; + * @return The bytes for userText. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUserTextBytes() { + java.lang.Object ref = userText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HEADURLS_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private java.util.List headUrls_; + /** + * repeated .PicUrl headUrls = 5; + */ + @java.lang.Override + public java.util.List getHeadUrlsList() { + return headUrls_; + } + /** + * repeated .PicUrl headUrls = 5; + */ + @java.lang.Override + public java.util.List + getHeadUrlsOrBuilderList() { + return headUrls_; + } + /** + * repeated .PicUrl headUrls = 5; + */ + @java.lang.Override + public int getHeadUrlsCount() { + return headUrls_.size(); + } + /** + * repeated .PicUrl headUrls = 5; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl getHeadUrls(int index) { + return headUrls_.get(index); + } + /** + * repeated .PicUrl headUrls = 5; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder getHeadUrlsOrBuilder( + int index) { + return headUrls_.get(index); + } + + public static final int VERIFIED_FIELD_NUMBER = 6; + private boolean verified_ = false; + /** + * bool verified = 6; + * @return The verified. + */ + @java.lang.Override + public boolean getVerified() { + return verified_; + } + + public static final int SUSERID_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object sUserId_ = ""; + /** + * string sUserId = 7; + * @return The sUserId. + */ + @java.lang.Override + public java.lang.String getSUserId() { + java.lang.Object ref = sUserId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sUserId_ = s; + return s; + } + } + /** + * string sUserId = 7; + * @return The bytes for sUserId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSUserIdBytes() { + java.lang.Object ref = sUserId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sUserId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HTTPSHEADURLS_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private java.util.List httpsHeadUrls_; + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + @java.lang.Override + public java.util.List getHttpsHeadUrlsList() { + return httpsHeadUrls_; + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + @java.lang.Override + public java.util.List + getHttpsHeadUrlsOrBuilderList() { + return httpsHeadUrls_; + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + @java.lang.Override + public int getHttpsHeadUrlsCount() { + return httpsHeadUrls_.size(); + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl getHttpsHeadUrls(int index) { + return httpsHeadUrls_.get(index); + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder getHttpsHeadUrlsOrBuilder( + int index) { + return httpsHeadUrls_.get(index); + } + + public static final int KWAIID_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private volatile java.lang.Object kwaiId_ = ""; + /** + * string kwaiId = 9; + * @return The kwaiId. + */ + @java.lang.Override + public java.lang.String getKwaiId() { + java.lang.Object ref = kwaiId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kwaiId_ = s; + return s; + } + } + /** + * string kwaiId = 9; + * @return The bytes for kwaiId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKwaiIdBytes() { + java.lang.Object ref = kwaiId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kwaiId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (userId_ != 0L) { + output.writeUInt64(1, userId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, userName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userGender_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, userGender_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, userText_); + } + for (int i = 0; i < headUrls_.size(); i++) { + output.writeMessage(5, headUrls_.get(i)); + } + if (verified_ != false) { + output.writeBool(6, verified_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sUserId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, sUserId_); + } + for (int i = 0; i < httpsHeadUrls_.size(); i++) { + output.writeMessage(8, httpsHeadUrls_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kwaiId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, kwaiId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (userId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, userId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, userName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userGender_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, userGender_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, userText_); + } + for (int i = 0; i < headUrls_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, headUrls_.get(i)); + } + if (verified_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(6, verified_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sUserId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, sUserId_); + } + for (int i = 0; i < httpsHeadUrls_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, httpsHeadUrls_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kwaiId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, kwaiId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo) obj; + + if (getUserId() + != other.getUserId()) return false; + if (!getUserName() + .equals(other.getUserName())) return false; + if (!getUserGender() + .equals(other.getUserGender())) return false; + if (!getUserText() + .equals(other.getUserText())) return false; + if (!getHeadUrlsList() + .equals(other.getHeadUrlsList())) return false; + if (getVerified() + != other.getVerified()) return false; + if (!getSUserId() + .equals(other.getSUserId())) return false; + if (!getHttpsHeadUrlsList() + .equals(other.getHttpsHeadUrlsList())) return false; + if (!getKwaiId() + .equals(other.getKwaiId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + USERID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getUserId()); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUserName().hashCode(); + hash = (37 * hash) + USERGENDER_FIELD_NUMBER; + hash = (53 * hash) + getUserGender().hashCode(); + hash = (37 * hash) + USERTEXT_FIELD_NUMBER; + hash = (53 * hash) + getUserText().hashCode(); + if (getHeadUrlsCount() > 0) { + hash = (37 * hash) + HEADURLS_FIELD_NUMBER; + hash = (53 * hash) + getHeadUrlsList().hashCode(); + } + hash = (37 * hash) + VERIFIED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getVerified()); + hash = (37 * hash) + SUSERID_FIELD_NUMBER; + hash = (53 * hash) + getSUserId().hashCode(); + if (getHttpsHeadUrlsCount() > 0) { + hash = (37 * hash) + HTTPSHEADURLS_FIELD_NUMBER; + hash = (53 * hash) + getHttpsHeadUrlsList().hashCode(); + } + hash = (37 * hash) + KWAIID_FIELD_NUMBER; + hash = (53 * hash) + getKwaiId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code UserInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:UserInfo) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.internal_static_UserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.internal_static_UserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + userId_ = 0L; + userName_ = ""; + userGender_ = ""; + userText_ = ""; + if (headUrlsBuilder_ == null) { + headUrls_ = java.util.Collections.emptyList(); + } else { + headUrls_ = null; + headUrlsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + verified_ = false; + sUserId_ = ""; + if (httpsHeadUrlsBuilder_ == null) { + httpsHeadUrls_ = java.util.Collections.emptyList(); + } else { + httpsHeadUrls_ = null; + httpsHeadUrlsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + kwaiId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.internal_static_UserInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo result) { + if (headUrlsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + headUrls_ = java.util.Collections.unmodifiableList(headUrls_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.headUrls_ = headUrls_; + } else { + result.headUrls_ = headUrlsBuilder_.build(); + } + if (httpsHeadUrlsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + httpsHeadUrls_ = java.util.Collections.unmodifiableList(httpsHeadUrls_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.httpsHeadUrls_ = httpsHeadUrls_; + } else { + result.httpsHeadUrls_ = httpsHeadUrlsBuilder_.build(); + } + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.userId_ = userId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.userName_ = userName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.userGender_ = userGender_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.userText_ = userText_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.verified_ = verified_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.sUserId_ = sUserId_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.kwaiId_ = kwaiId_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo.getDefaultInstance()) return this; + if (other.getUserId() != 0L) { + setUserId(other.getUserId()); + } + if (!other.getUserName().isEmpty()) { + userName_ = other.userName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getUserGender().isEmpty()) { + userGender_ = other.userGender_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getUserText().isEmpty()) { + userText_ = other.userText_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (headUrlsBuilder_ == null) { + if (!other.headUrls_.isEmpty()) { + if (headUrls_.isEmpty()) { + headUrls_ = other.headUrls_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureHeadUrlsIsMutable(); + headUrls_.addAll(other.headUrls_); + } + onChanged(); + } + } else { + if (!other.headUrls_.isEmpty()) { + if (headUrlsBuilder_.isEmpty()) { + headUrlsBuilder_.dispose(); + headUrlsBuilder_ = null; + headUrls_ = other.headUrls_; + bitField0_ = (bitField0_ & ~0x00000010); + headUrlsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getHeadUrlsFieldBuilder() : null; + } else { + headUrlsBuilder_.addAllMessages(other.headUrls_); + } + } + } + if (other.getVerified() != false) { + setVerified(other.getVerified()); + } + if (!other.getSUserId().isEmpty()) { + sUserId_ = other.sUserId_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (httpsHeadUrlsBuilder_ == null) { + if (!other.httpsHeadUrls_.isEmpty()) { + if (httpsHeadUrls_.isEmpty()) { + httpsHeadUrls_ = other.httpsHeadUrls_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureHttpsHeadUrlsIsMutable(); + httpsHeadUrls_.addAll(other.httpsHeadUrls_); + } + onChanged(); + } + } else { + if (!other.httpsHeadUrls_.isEmpty()) { + if (httpsHeadUrlsBuilder_.isEmpty()) { + httpsHeadUrlsBuilder_.dispose(); + httpsHeadUrlsBuilder_ = null; + httpsHeadUrls_ = other.httpsHeadUrls_; + bitField0_ = (bitField0_ & ~0x00000080); + httpsHeadUrlsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getHttpsHeadUrlsFieldBuilder() : null; + } else { + httpsHeadUrlsBuilder_.addAllMessages(other.httpsHeadUrls_); + } + } + } + if (!other.getKwaiId().isEmpty()) { + kwaiId_ = other.kwaiId_; + bitField0_ |= 0x00000100; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + userId_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + userName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + userGender_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + userText_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl m = + input.readMessage( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.parser(), + extensionRegistry); + if (headUrlsBuilder_ == null) { + ensureHeadUrlsIsMutable(); + headUrls_.add(m); + } else { + headUrlsBuilder_.addMessage(m); + } + break; + } // case 42 + case 48: { + verified_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: { + sUserId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl m = + input.readMessage( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.parser(), + extensionRegistry); + if (httpsHeadUrlsBuilder_ == null) { + ensureHttpsHeadUrlsIsMutable(); + httpsHeadUrls_.add(m); + } else { + httpsHeadUrlsBuilder_.addMessage(m); + } + break; + } // case 66 + case 74: { + kwaiId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long userId_ ; + /** + * uint64 userId = 1; + * @return The userId. + */ + @java.lang.Override + public long getUserId() { + return userId_; + } + /** + * uint64 userId = 1; + * @param value The userId to set. + * @return This builder for chaining. + */ + public Builder setUserId(long value) { + + userId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 userId = 1; + * @return This builder for chaining. + */ + public Builder clearUserId() { + bitField0_ = (bitField0_ & ~0x00000001); + userId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object userName_ = ""; + /** + * string userName = 2; + * @return The userName. + */ + public java.lang.String getUserName() { + java.lang.Object ref = userName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string userName = 2; + * @return The bytes for userName. + */ + public com.google.protobuf.ByteString + getUserNameBytes() { + java.lang.Object ref = userName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string userName = 2; + * @param value The userName to set. + * @return This builder for chaining. + */ + public Builder setUserName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + userName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string userName = 2; + * @return This builder for chaining. + */ + public Builder clearUserName() { + userName_ = getDefaultInstance().getUserName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string userName = 2; + * @param value The bytes for userName to set. + * @return This builder for chaining. + */ + public Builder setUserNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + userName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object userGender_ = ""; + /** + * string userGender = 3; + * @return The userGender. + */ + public java.lang.String getUserGender() { + java.lang.Object ref = userGender_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userGender_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string userGender = 3; + * @return The bytes for userGender. + */ + public com.google.protobuf.ByteString + getUserGenderBytes() { + java.lang.Object ref = userGender_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userGender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string userGender = 3; + * @param value The userGender to set. + * @return This builder for chaining. + */ + public Builder setUserGender( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + userGender_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * string userGender = 3; + * @return This builder for chaining. + */ + public Builder clearUserGender() { + userGender_ = getDefaultInstance().getUserGender(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * string userGender = 3; + * @param value The bytes for userGender to set. + * @return This builder for chaining. + */ + public Builder setUserGenderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + userGender_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object userText_ = ""; + /** + * string userText = 4; + * @return The userText. + */ + public java.lang.String getUserText() { + java.lang.Object ref = userText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string userText = 4; + * @return The bytes for userText. + */ + public com.google.protobuf.ByteString + getUserTextBytes() { + java.lang.Object ref = userText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string userText = 4; + * @param value The userText to set. + * @return This builder for chaining. + */ + public Builder setUserText( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + userText_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * string userText = 4; + * @return This builder for chaining. + */ + public Builder clearUserText() { + userText_ = getDefaultInstance().getUserText(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * string userText = 4; + * @param value The bytes for userText to set. + * @return This builder for chaining. + */ + public Builder setUserTextBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + userText_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.util.List headUrls_ = + java.util.Collections.emptyList(); + private void ensureHeadUrlsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + headUrls_ = new java.util.ArrayList(headUrls_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder> headUrlsBuilder_; + + /** + * repeated .PicUrl headUrls = 5; + */ + public java.util.List getHeadUrlsList() { + if (headUrlsBuilder_ == null) { + return java.util.Collections.unmodifiableList(headUrls_); + } else { + return headUrlsBuilder_.getMessageList(); + } + } + /** + * repeated .PicUrl headUrls = 5; + */ + public int getHeadUrlsCount() { + if (headUrlsBuilder_ == null) { + return headUrls_.size(); + } else { + return headUrlsBuilder_.getCount(); + } + } + /** + * repeated .PicUrl headUrls = 5; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl getHeadUrls(int index) { + if (headUrlsBuilder_ == null) { + return headUrls_.get(index); + } else { + return headUrlsBuilder_.getMessage(index); + } + } + /** + * repeated .PicUrl headUrls = 5; + */ + public Builder setHeadUrls( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl value) { + if (headUrlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHeadUrlsIsMutable(); + headUrls_.set(index, value); + onChanged(); + } else { + headUrlsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .PicUrl headUrls = 5; + */ + public Builder setHeadUrls( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder builderForValue) { + if (headUrlsBuilder_ == null) { + ensureHeadUrlsIsMutable(); + headUrls_.set(index, builderForValue.build()); + onChanged(); + } else { + headUrlsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .PicUrl headUrls = 5; + */ + public Builder addHeadUrls(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl value) { + if (headUrlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHeadUrlsIsMutable(); + headUrls_.add(value); + onChanged(); + } else { + headUrlsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .PicUrl headUrls = 5; + */ + public Builder addHeadUrls( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl value) { + if (headUrlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHeadUrlsIsMutable(); + headUrls_.add(index, value); + onChanged(); + } else { + headUrlsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .PicUrl headUrls = 5; + */ + public Builder addHeadUrls( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder builderForValue) { + if (headUrlsBuilder_ == null) { + ensureHeadUrlsIsMutable(); + headUrls_.add(builderForValue.build()); + onChanged(); + } else { + headUrlsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .PicUrl headUrls = 5; + */ + public Builder addHeadUrls( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder builderForValue) { + if (headUrlsBuilder_ == null) { + ensureHeadUrlsIsMutable(); + headUrls_.add(index, builderForValue.build()); + onChanged(); + } else { + headUrlsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .PicUrl headUrls = 5; + */ + public Builder addAllHeadUrls( + java.lang.Iterable values) { + if (headUrlsBuilder_ == null) { + ensureHeadUrlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, headUrls_); + onChanged(); + } else { + headUrlsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .PicUrl headUrls = 5; + */ + public Builder clearHeadUrls() { + if (headUrlsBuilder_ == null) { + headUrls_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + headUrlsBuilder_.clear(); + } + return this; + } + /** + * repeated .PicUrl headUrls = 5; + */ + public Builder removeHeadUrls(int index) { + if (headUrlsBuilder_ == null) { + ensureHeadUrlsIsMutable(); + headUrls_.remove(index); + onChanged(); + } else { + headUrlsBuilder_.remove(index); + } + return this; + } + /** + * repeated .PicUrl headUrls = 5; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder getHeadUrlsBuilder( + int index) { + return getHeadUrlsFieldBuilder().getBuilder(index); + } + /** + * repeated .PicUrl headUrls = 5; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder getHeadUrlsOrBuilder( + int index) { + if (headUrlsBuilder_ == null) { + return headUrls_.get(index); } else { + return headUrlsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .PicUrl headUrls = 5; + */ + public java.util.List + getHeadUrlsOrBuilderList() { + if (headUrlsBuilder_ != null) { + return headUrlsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(headUrls_); + } + } + /** + * repeated .PicUrl headUrls = 5; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder addHeadUrlsBuilder() { + return getHeadUrlsFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.getDefaultInstance()); + } + /** + * repeated .PicUrl headUrls = 5; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder addHeadUrlsBuilder( + int index) { + return getHeadUrlsFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.getDefaultInstance()); + } + /** + * repeated .PicUrl headUrls = 5; + */ + public java.util.List + getHeadUrlsBuilderList() { + return getHeadUrlsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder> + getHeadUrlsFieldBuilder() { + if (headUrlsBuilder_ == null) { + headUrlsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder>( + headUrls_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + headUrls_ = null; + } + return headUrlsBuilder_; + } + + private boolean verified_ ; + /** + * bool verified = 6; + * @return The verified. + */ + @java.lang.Override + public boolean getVerified() { + return verified_; + } + /** + * bool verified = 6; + * @param value The verified to set. + * @return This builder for chaining. + */ + public Builder setVerified(boolean value) { + + verified_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * bool verified = 6; + * @return This builder for chaining. + */ + public Builder clearVerified() { + bitField0_ = (bitField0_ & ~0x00000020); + verified_ = false; + onChanged(); + return this; + } + + private java.lang.Object sUserId_ = ""; + /** + * string sUserId = 7; + * @return The sUserId. + */ + public java.lang.String getSUserId() { + java.lang.Object ref = sUserId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sUserId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string sUserId = 7; + * @return The bytes for sUserId. + */ + public com.google.protobuf.ByteString + getSUserIdBytes() { + java.lang.Object ref = sUserId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sUserId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string sUserId = 7; + * @param value The sUserId to set. + * @return This builder for chaining. + */ + public Builder setSUserId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + sUserId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * string sUserId = 7; + * @return This builder for chaining. + */ + public Builder clearSUserId() { + sUserId_ = getDefaultInstance().getSUserId(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * string sUserId = 7; + * @param value The bytes for sUserId to set. + * @return This builder for chaining. + */ + public Builder setSUserIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + sUserId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.util.List httpsHeadUrls_ = + java.util.Collections.emptyList(); + private void ensureHttpsHeadUrlsIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + httpsHeadUrls_ = new java.util.ArrayList(httpsHeadUrls_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder> httpsHeadUrlsBuilder_; + + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public java.util.List getHttpsHeadUrlsList() { + if (httpsHeadUrlsBuilder_ == null) { + return java.util.Collections.unmodifiableList(httpsHeadUrls_); + } else { + return httpsHeadUrlsBuilder_.getMessageList(); + } + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public int getHttpsHeadUrlsCount() { + if (httpsHeadUrlsBuilder_ == null) { + return httpsHeadUrls_.size(); + } else { + return httpsHeadUrlsBuilder_.getCount(); + } + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl getHttpsHeadUrls(int index) { + if (httpsHeadUrlsBuilder_ == null) { + return httpsHeadUrls_.get(index); + } else { + return httpsHeadUrlsBuilder_.getMessage(index); + } + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public Builder setHttpsHeadUrls( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl value) { + if (httpsHeadUrlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHttpsHeadUrlsIsMutable(); + httpsHeadUrls_.set(index, value); + onChanged(); + } else { + httpsHeadUrlsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public Builder setHttpsHeadUrls( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder builderForValue) { + if (httpsHeadUrlsBuilder_ == null) { + ensureHttpsHeadUrlsIsMutable(); + httpsHeadUrls_.set(index, builderForValue.build()); + onChanged(); + } else { + httpsHeadUrlsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public Builder addHttpsHeadUrls(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl value) { + if (httpsHeadUrlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHttpsHeadUrlsIsMutable(); + httpsHeadUrls_.add(value); + onChanged(); + } else { + httpsHeadUrlsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public Builder addHttpsHeadUrls( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl value) { + if (httpsHeadUrlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHttpsHeadUrlsIsMutable(); + httpsHeadUrls_.add(index, value); + onChanged(); + } else { + httpsHeadUrlsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public Builder addHttpsHeadUrls( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder builderForValue) { + if (httpsHeadUrlsBuilder_ == null) { + ensureHttpsHeadUrlsIsMutable(); + httpsHeadUrls_.add(builderForValue.build()); + onChanged(); + } else { + httpsHeadUrlsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public Builder addHttpsHeadUrls( + int index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder builderForValue) { + if (httpsHeadUrlsBuilder_ == null) { + ensureHttpsHeadUrlsIsMutable(); + httpsHeadUrls_.add(index, builderForValue.build()); + onChanged(); + } else { + httpsHeadUrlsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public Builder addAllHttpsHeadUrls( + java.lang.Iterable values) { + if (httpsHeadUrlsBuilder_ == null) { + ensureHttpsHeadUrlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, httpsHeadUrls_); + onChanged(); + } else { + httpsHeadUrlsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public Builder clearHttpsHeadUrls() { + if (httpsHeadUrlsBuilder_ == null) { + httpsHeadUrls_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + httpsHeadUrlsBuilder_.clear(); + } + return this; + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public Builder removeHttpsHeadUrls(int index) { + if (httpsHeadUrlsBuilder_ == null) { + ensureHttpsHeadUrlsIsMutable(); + httpsHeadUrls_.remove(index); + onChanged(); + } else { + httpsHeadUrlsBuilder_.remove(index); + } + return this; + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder getHttpsHeadUrlsBuilder( + int index) { + return getHttpsHeadUrlsFieldBuilder().getBuilder(index); + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder getHttpsHeadUrlsOrBuilder( + int index) { + if (httpsHeadUrlsBuilder_ == null) { + return httpsHeadUrls_.get(index); } else { + return httpsHeadUrlsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public java.util.List + getHttpsHeadUrlsOrBuilderList() { + if (httpsHeadUrlsBuilder_ != null) { + return httpsHeadUrlsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(httpsHeadUrls_); + } + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder addHttpsHeadUrlsBuilder() { + return getHttpsHeadUrlsFieldBuilder().addBuilder( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.getDefaultInstance()); + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder addHttpsHeadUrlsBuilder( + int index) { + return getHttpsHeadUrlsFieldBuilder().addBuilder( + index, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.getDefaultInstance()); + } + /** + * repeated .PicUrl httpsHeadUrls = 8; + */ + public java.util.List + getHttpsHeadUrlsBuilderList() { + return getHttpsHeadUrlsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder> + getHttpsHeadUrlsFieldBuilder() { + if (httpsHeadUrlsBuilder_ == null) { + httpsHeadUrlsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrl.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.PicUrlOrBuilder>( + httpsHeadUrls_, + ((bitField0_ & 0x00000080) != 0), + getParentForChildren(), + isClean()); + httpsHeadUrls_ = null; + } + return httpsHeadUrlsBuilder_; + } + + private java.lang.Object kwaiId_ = ""; + /** + * string kwaiId = 9; + * @return The kwaiId. + */ + public java.lang.String getKwaiId() { + java.lang.Object ref = kwaiId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kwaiId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string kwaiId = 9; + * @return The bytes for kwaiId. + */ + public com.google.protobuf.ByteString + getKwaiIdBytes() { + java.lang.Object ref = kwaiId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kwaiId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string kwaiId = 9; + * @param value The kwaiId to set. + * @return This builder for chaining. + */ + public Builder setKwaiId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + kwaiId_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * string kwaiId = 9; + * @return This builder for chaining. + */ + public Builder clearKwaiId() { + kwaiId_ = getDefaultInstance().getKwaiId(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * string kwaiId = 9; + * @param value The bytes for kwaiId to set. + * @return This builder for chaining. + */ + public Builder setKwaiIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + kwaiId_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:UserInfo) + } + + // @@protoc_insertion_point(class_scope:UserInfo) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.UserInfoOuterClass.UserInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_UserInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_UserInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\016UserInfo.proto\032\014PicUrl.proto\"\300\001\n\010UserI" + + "nfo\022\016\n\006userId\030\001 \001(\004\022\020\n\010userName\030\002 \001(\t\022\022\n" + + "\nuserGender\030\003 \001(\t\022\020\n\010userText\030\004 \001(\t\022\031\n\010h" + + "eadUrls\030\005 \003(\0132\007.PicUrl\022\020\n\010verified\030\006 \001(\010" + + "\022\017\n\007sUserId\030\007 \001(\t\022\036\n\rhttpsHeadUrls\030\010 \003(\013" + + "2\007.PicUrl\022\016\n\006kwaiId\030\t \001(\tB6\n4tech.ordina" + + "ryroad.live.chat.client.kuaishou.protobu" + + "fb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.getDescriptor(), + }); + internal_static_UserInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_UserInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_UserInfo_descriptor, + new java.lang.String[] { "UserId", "UserName", "UserGender", "UserText", "HeadUrls", "Verified", "SUserId", "HttpsHeadUrls", "KwaiId", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PicUrlOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebComboCommentFeedOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebComboCommentFeedOuterClass.java new file mode 100644 index 0000000..49a905a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebComboCommentFeedOuterClass.java @@ -0,0 +1,846 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: WebComboCommentFeed.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class WebComboCommentFeedOuterClass { + private WebComboCommentFeedOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface WebComboCommentFeedOrBuilder extends + // @@protoc_insertion_point(interface_extends:WebComboCommentFeed) + com.google.protobuf.MessageOrBuilder { + + /** + * string id = 1; + * @return The id. + */ + java.lang.String getId(); + /** + * string id = 1; + * @return The bytes for id. + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + * string content = 2; + * @return The content. + */ + java.lang.String getContent(); + /** + * string content = 2; + * @return The bytes for content. + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + * uint32 comboCount = 3; + * @return The comboCount. + */ + int getComboCount(); + } + /** + * Protobuf type {@code WebComboCommentFeed} + */ + public static final class WebComboCommentFeed extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:WebComboCommentFeed) + WebComboCommentFeedOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebComboCommentFeed.newBuilder() to construct. + private WebComboCommentFeed(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WebComboCommentFeed() { + id_ = ""; + content_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new WebComboCommentFeed(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.internal_static_WebComboCommentFeed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.internal_static_WebComboCommentFeed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + /** + * string content = 2; + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 2; + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMBOCOUNT_FIELD_NUMBER = 3; + private int comboCount_ = 0; + /** + * uint32 comboCount = 3; + * @return The comboCount. + */ + @java.lang.Override + public int getComboCount() { + return comboCount_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, content_); + } + if (comboCount_ != 0) { + output.writeUInt32(3, comboCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, content_); + } + if (comboCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, comboCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed) obj; + + if (!getId() + .equals(other.getId())) return false; + if (!getContent() + .equals(other.getContent())) return false; + if (getComboCount() + != other.getComboCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + COMBOCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getComboCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code WebComboCommentFeed} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:WebComboCommentFeed) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.internal_static_WebComboCommentFeed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.internal_static_WebComboCommentFeed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + content_ = ""; + comboCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.internal_static_WebComboCommentFeed_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.content_ = content_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.comboCount_ = comboCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getComboCount() != 0) { + setComboCount(other.getComboCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + comboCount_ = input.readUInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string id = 1; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object content_ = ""; + /** + * string content = 2; + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 2; + * @return The bytes for content. + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 2; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + content_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string content = 2; + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string content = 2; + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int comboCount_ ; + /** + * uint32 comboCount = 3; + * @return The comboCount. + */ + @java.lang.Override + public int getComboCount() { + return comboCount_; + } + /** + * uint32 comboCount = 3; + * @param value The comboCount to set. + * @return This builder for chaining. + */ + public Builder setComboCount(int value) { + + comboCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint32 comboCount = 3; + * @return This builder for chaining. + */ + public Builder clearComboCount() { + bitField0_ = (bitField0_ & ~0x00000004); + comboCount_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:WebComboCommentFeed) + } + + // @@protoc_insertion_point(class_scope:WebComboCommentFeed) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WebComboCommentFeed parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebComboCommentFeedOuterClass.WebComboCommentFeed getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_WebComboCommentFeed_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_WebComboCommentFeed_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\031WebComboCommentFeed.proto\"F\n\023WebComboC" + + "ommentFeed\022\n\n\002id\030\001 \001(\t\022\017\n\007content\030\002 \001(\t\022" + + "\022\n\ncomboCount\030\003 \001(\rB6\n4tech.ordinaryroad" + + ".live.chat.client.kuaishou.protobufb\006pro" + + "to3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_WebComboCommentFeed_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_WebComboCommentFeed_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_WebComboCommentFeed_descriptor, + new java.lang.String[] { "Id", "Content", "ComboCount", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebCommentFeedOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebCommentFeedOuterClass.java new file mode 100644 index 0000000..efa9870 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebCommentFeedOuterClass.java @@ -0,0 +1,1651 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: WebCommentFeed.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class WebCommentFeedOuterClass { + private WebCommentFeedOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface WebCommentFeedOrBuilder extends + // @@protoc_insertion_point(interface_extends:WebCommentFeed) + com.google.protobuf.MessageOrBuilder { + + /** + * string id = 1; + * @return The id. + */ + java.lang.String getId(); + /** + * string id = 1; + * @return The bytes for id. + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser(); + /** + * .SimpleUserInfo user = 2; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder(); + + /** + * string content = 3; + * @return The content. + */ + java.lang.String getContent(); + /** + * string content = 3; + * @return The bytes for content. + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + * string deviceHash = 4; + * @return The deviceHash. + */ + java.lang.String getDeviceHash(); + /** + * string deviceHash = 4; + * @return The bytes for deviceHash. + */ + com.google.protobuf.ByteString + getDeviceHashBytes(); + + /** + * uint64 sortRank = 5; + * @return The sortRank. + */ + long getSortRank(); + + /** + * string color = 6; + * @return The color. + */ + java.lang.String getColor(); + /** + * string color = 6; + * @return The bytes for color. + */ + com.google.protobuf.ByteString + getColorBytes(); + + /** + * .WebCommentFeedShowType showType = 7; + * @return The enum numeric value on the wire for showType. + */ + int getShowTypeValue(); + /** + * .WebCommentFeedShowType showType = 7; + * @return The showType. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.WebCommentFeedShowType getShowType(); + + /** + * .LiveAudienceState senderState = 8; + * @return Whether the senderState field is set. + */ + boolean hasSenderState(); + /** + * .LiveAudienceState senderState = 8; + * @return The senderState. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState getSenderState(); + /** + * .LiveAudienceState senderState = 8; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceStateOrBuilder getSenderStateOrBuilder(); + } + /** + * Protobuf type {@code WebCommentFeed} + */ + public static final class WebCommentFeed extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:WebCommentFeed) + WebCommentFeedOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebCommentFeed.newBuilder() to construct. + private WebCommentFeed(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WebCommentFeed() { + id_ = ""; + content_ = ""; + deviceHash_ = ""; + color_ = ""; + showType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new WebCommentFeed(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.internal_static_WebCommentFeed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.internal_static_WebCommentFeed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_FIELD_NUMBER = 2; + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo user_; + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser() { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + /** + * .SimpleUserInfo user = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder() { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + + public static final int CONTENT_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + /** + * string content = 3; + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 3; + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEVICEHASH_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object deviceHash_ = ""; + /** + * string deviceHash = 4; + * @return The deviceHash. + */ + @java.lang.Override + public java.lang.String getDeviceHash() { + java.lang.Object ref = deviceHash_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceHash_ = s; + return s; + } + } + /** + * string deviceHash = 4; + * @return The bytes for deviceHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeviceHashBytes() { + java.lang.Object ref = deviceHash_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceHash_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SORTRANK_FIELD_NUMBER = 5; + private long sortRank_ = 0L; + /** + * uint64 sortRank = 5; + * @return The sortRank. + */ + @java.lang.Override + public long getSortRank() { + return sortRank_; + } + + public static final int COLOR_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object color_ = ""; + /** + * string color = 6; + * @return The color. + */ + @java.lang.Override + public java.lang.String getColor() { + java.lang.Object ref = color_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + color_ = s; + return s; + } + } + /** + * string color = 6; + * @return The bytes for color. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getColorBytes() { + java.lang.Object ref = color_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + color_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SHOWTYPE_FIELD_NUMBER = 7; + private int showType_ = 0; + /** + * .WebCommentFeedShowType showType = 7; + * @return The enum numeric value on the wire for showType. + */ + @java.lang.Override public int getShowTypeValue() { + return showType_; + } + /** + * .WebCommentFeedShowType showType = 7; + * @return The showType. + */ + @java.lang.Override public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.WebCommentFeedShowType getShowType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.WebCommentFeedShowType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.WebCommentFeedShowType.forNumber(showType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.WebCommentFeedShowType.UNRECOGNIZED : result; + } + + public static final int SENDERSTATE_FIELD_NUMBER = 8; + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState senderState_; + /** + * .LiveAudienceState senderState = 8; + * @return Whether the senderState field is set. + */ + @java.lang.Override + public boolean hasSenderState() { + return senderState_ != null; + } + /** + * .LiveAudienceState senderState = 8; + * @return The senderState. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState getSenderState() { + return senderState_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.getDefaultInstance() : senderState_; + } + /** + * .LiveAudienceState senderState = 8; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceStateOrBuilder getSenderStateOrBuilder() { + return senderState_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.getDefaultInstance() : senderState_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (user_ != null) { + output.writeMessage(2, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceHash_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, deviceHash_); + } + if (sortRank_ != 0L) { + output.writeUInt64(5, sortRank_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(color_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, color_); + } + if (showType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.WebCommentFeedShowType.FEED_SHOW_UNKNOWN.getNumber()) { + output.writeEnum(7, showType_); + } + if (senderState_ != null) { + output.writeMessage(8, getSenderState()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUser()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceHash_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, deviceHash_); + } + if (sortRank_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(5, sortRank_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(color_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, color_); + } + if (showType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.WebCommentFeedShowType.FEED_SHOW_UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(7, showType_); + } + if (senderState_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getSenderState()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed) obj; + + if (!getId() + .equals(other.getId())) return false; + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser() + .equals(other.getUser())) return false; + } + if (!getContent() + .equals(other.getContent())) return false; + if (!getDeviceHash() + .equals(other.getDeviceHash())) return false; + if (getSortRank() + != other.getSortRank()) return false; + if (!getColor() + .equals(other.getColor())) return false; + if (showType_ != other.showType_) return false; + if (hasSenderState() != other.hasSenderState()) return false; + if (hasSenderState()) { + if (!getSenderState() + .equals(other.getSenderState())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + DEVICEHASH_FIELD_NUMBER; + hash = (53 * hash) + getDeviceHash().hashCode(); + hash = (37 * hash) + SORTRANK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSortRank()); + hash = (37 * hash) + COLOR_FIELD_NUMBER; + hash = (53 * hash) + getColor().hashCode(); + hash = (37 * hash) + SHOWTYPE_FIELD_NUMBER; + hash = (53 * hash) + showType_; + if (hasSenderState()) { + hash = (37 * hash) + SENDERSTATE_FIELD_NUMBER; + hash = (53 * hash) + getSenderState().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code WebCommentFeed} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:WebCommentFeed) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.internal_static_WebCommentFeed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.internal_static_WebCommentFeed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + content_ = ""; + deviceHash_ = ""; + sortRank_ = 0L; + color_ = ""; + showType_ = 0; + senderState_ = null; + if (senderStateBuilder_ != null) { + senderStateBuilder_.dispose(); + senderStateBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.internal_static_WebCommentFeed_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.user_ = userBuilder_ == null + ? user_ + : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.content_ = content_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.deviceHash_ = deviceHash_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.sortRank_ = sortRank_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.color_ = color_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.showType_ = showType_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.senderState_ = senderStateBuilder_ == null + ? senderState_ + : senderStateBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getDeviceHash().isEmpty()) { + deviceHash_ = other.deviceHash_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getSortRank() != 0L) { + setSortRank(other.getSortRank()); + } + if (!other.getColor().isEmpty()) { + color_ = other.color_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.showType_ != 0) { + setShowTypeValue(other.getShowTypeValue()); + } + if (other.hasSenderState()) { + mergeSenderState(other.getSenderState()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getUserFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + deviceHash_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: { + sortRank_ = input.readUInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: { + color_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: { + showType_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 66: { + input.readMessage( + getSenderStateFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string id = 1; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo user_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder> userBuilder_; + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser() { + if (userBuilder_ == null) { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder setUser(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder setUser( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder mergeUser(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + user_ != null && + user_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000002); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder getUserBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * .SimpleUserInfo user = 2; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + } + /** + * .SimpleUserInfo user = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + + private java.lang.Object content_ = ""; + /** + * string content = 3; + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 3; + * @return The bytes for content. + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 3; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + content_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * string content = 3; + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * string content = 3; + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object deviceHash_ = ""; + /** + * string deviceHash = 4; + * @return The deviceHash. + */ + public java.lang.String getDeviceHash() { + java.lang.Object ref = deviceHash_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceHash_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string deviceHash = 4; + * @return The bytes for deviceHash. + */ + public com.google.protobuf.ByteString + getDeviceHashBytes() { + java.lang.Object ref = deviceHash_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceHash_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string deviceHash = 4; + * @param value The deviceHash to set. + * @return This builder for chaining. + */ + public Builder setDeviceHash( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + deviceHash_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * string deviceHash = 4; + * @return This builder for chaining. + */ + public Builder clearDeviceHash() { + deviceHash_ = getDefaultInstance().getDeviceHash(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * string deviceHash = 4; + * @param value The bytes for deviceHash to set. + * @return This builder for chaining. + */ + public Builder setDeviceHashBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + deviceHash_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private long sortRank_ ; + /** + * uint64 sortRank = 5; + * @return The sortRank. + */ + @java.lang.Override + public long getSortRank() { + return sortRank_; + } + /** + * uint64 sortRank = 5; + * @param value The sortRank to set. + * @return This builder for chaining. + */ + public Builder setSortRank(long value) { + + sortRank_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * uint64 sortRank = 5; + * @return This builder for chaining. + */ + public Builder clearSortRank() { + bitField0_ = (bitField0_ & ~0x00000010); + sortRank_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object color_ = ""; + /** + * string color = 6; + * @return The color. + */ + public java.lang.String getColor() { + java.lang.Object ref = color_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + color_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string color = 6; + * @return The bytes for color. + */ + public com.google.protobuf.ByteString + getColorBytes() { + java.lang.Object ref = color_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + color_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string color = 6; + * @param value The color to set. + * @return This builder for chaining. + */ + public Builder setColor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + color_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * string color = 6; + * @return This builder for chaining. + */ + public Builder clearColor() { + color_ = getDefaultInstance().getColor(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * string color = 6; + * @param value The bytes for color to set. + * @return This builder for chaining. + */ + public Builder setColorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + color_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private int showType_ = 0; + /** + * .WebCommentFeedShowType showType = 7; + * @return The enum numeric value on the wire for showType. + */ + @java.lang.Override public int getShowTypeValue() { + return showType_; + } + /** + * .WebCommentFeedShowType showType = 7; + * @param value The enum numeric value on the wire for showType to set. + * @return This builder for chaining. + */ + public Builder setShowTypeValue(int value) { + showType_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .WebCommentFeedShowType showType = 7; + * @return The showType. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.WebCommentFeedShowType getShowType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.WebCommentFeedShowType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.WebCommentFeedShowType.forNumber(showType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.WebCommentFeedShowType.UNRECOGNIZED : result; + } + /** + * .WebCommentFeedShowType showType = 7; + * @param value The showType to set. + * @return This builder for chaining. + */ + public Builder setShowType(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.WebCommentFeedShowType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + showType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .WebCommentFeedShowType showType = 7; + * @return This builder for chaining. + */ + public Builder clearShowType() { + bitField0_ = (bitField0_ & ~0x00000040); + showType_ = 0; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState senderState_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceStateOrBuilder> senderStateBuilder_; + /** + * .LiveAudienceState senderState = 8; + * @return Whether the senderState field is set. + */ + public boolean hasSenderState() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * .LiveAudienceState senderState = 8; + * @return The senderState. + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState getSenderState() { + if (senderStateBuilder_ == null) { + return senderState_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.getDefaultInstance() : senderState_; + } else { + return senderStateBuilder_.getMessage(); + } + } + /** + * .LiveAudienceState senderState = 8; + */ + public Builder setSenderState(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState value) { + if (senderStateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + senderState_ = value; + } else { + senderStateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * .LiveAudienceState senderState = 8; + */ + public Builder setSenderState( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.Builder builderForValue) { + if (senderStateBuilder_ == null) { + senderState_ = builderForValue.build(); + } else { + senderStateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * .LiveAudienceState senderState = 8; + */ + public Builder mergeSenderState(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState value) { + if (senderStateBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) && + senderState_ != null && + senderState_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.getDefaultInstance()) { + getSenderStateBuilder().mergeFrom(value); + } else { + senderState_ = value; + } + } else { + senderStateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * .LiveAudienceState senderState = 8; + */ + public Builder clearSenderState() { + bitField0_ = (bitField0_ & ~0x00000080); + senderState_ = null; + if (senderStateBuilder_ != null) { + senderStateBuilder_.dispose(); + senderStateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .LiveAudienceState senderState = 8; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.Builder getSenderStateBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getSenderStateFieldBuilder().getBuilder(); + } + /** + * .LiveAudienceState senderState = 8; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceStateOrBuilder getSenderStateOrBuilder() { + if (senderStateBuilder_ != null) { + return senderStateBuilder_.getMessageOrBuilder(); + } else { + return senderState_ == null ? + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.getDefaultInstance() : senderState_; + } + } + /** + * .LiveAudienceState senderState = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceStateOrBuilder> + getSenderStateFieldBuilder() { + if (senderStateBuilder_ == null) { + senderStateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceState.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.LiveAudienceStateOrBuilder>( + getSenderState(), + getParentForChildren(), + isClean()); + senderState_ = null; + } + return senderStateBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:WebCommentFeed) + } + + // @@protoc_insertion_point(class_scope:WebCommentFeed) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WebCommentFeed parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedOuterClass.WebCommentFeed getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_WebCommentFeed_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_WebCommentFeed_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024WebCommentFeed.proto\032\024SimpleUserInfo.p" + + "roto\032\034WebCommentFeedShowType.proto\032\027Live" + + "AudienceState.proto\"\325\001\n\016WebCommentFeed\022\n" + + "\n\002id\030\001 \001(\t\022\035\n\004user\030\002 \001(\0132\017.SimpleUserInf" + + "o\022\017\n\007content\030\003 \001(\t\022\022\n\ndeviceHash\030\004 \001(\t\022\020" + + "\n\010sortRank\030\005 \001(\004\022\r\n\005color\030\006 \001(\t\022)\n\010showT" + + "ype\030\007 \001(\0162\027.WebCommentFeedShowType\022\'\n\013se" + + "nderState\030\010 \001(\0132\022.LiveAudienceStateB6\n4t" + + "ech.ordinaryroad.live.chat.client.kuaish" + + "ou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.getDescriptor(), + }); + internal_static_WebCommentFeed_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_WebCommentFeed_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_WebCommentFeed_descriptor, + new java.lang.String[] { "Id", "User", "Content", "DeviceHash", "SortRank", "Color", "ShowType", "SenderState", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.LiveAudienceStateOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebCommentFeedShowTypeOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebCommentFeedShowTypeOuterClass.java new file mode 100644 index 0000000..74cc938 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebCommentFeedShowTypeOuterClass.java @@ -0,0 +1,180 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: WebCommentFeedShowType.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class WebCommentFeedShowTypeOuterClass { + private WebCommentFeedShowTypeOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code WebCommentFeedShowType} + */ + public enum WebCommentFeedShowType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * FEED_SHOW_UNKNOWN = 0; + */ + FEED_SHOW_UNKNOWN(0), + /** + * FEED_SHOW_NORMAL = 1; + */ + FEED_SHOW_NORMAL(1), + /** + * FEED_HIDDEN = 2; + */ + FEED_HIDDEN(2), + UNRECOGNIZED(-1), + ; + + /** + * FEED_SHOW_UNKNOWN = 0; + */ + public static final int FEED_SHOW_UNKNOWN_VALUE = 0; + /** + * FEED_SHOW_NORMAL = 1; + */ + public static final int FEED_SHOW_NORMAL_VALUE = 1; + /** + * FEED_HIDDEN = 2; + */ + public static final int FEED_HIDDEN_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static WebCommentFeedShowType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static WebCommentFeedShowType forNumber(int value) { + switch (value) { + case 0: return FEED_SHOW_UNKNOWN; + case 1: return FEED_SHOW_NORMAL; + case 2: return FEED_HIDDEN; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + WebCommentFeedShowType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public WebCommentFeedShowType findValueByNumber(int number) { + return WebCommentFeedShowType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebCommentFeedShowTypeOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final WebCommentFeedShowType[] VALUES = values(); + + public static WebCommentFeedShowType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private WebCommentFeedShowType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:WebCommentFeedShowType) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\034WebCommentFeedShowType.proto*V\n\026WebCom" + + "mentFeedShowType\022\025\n\021FEED_SHOW_UNKNOWN\020\000\022" + + "\024\n\020FEED_SHOW_NORMAL\020\001\022\017\n\013FEED_HIDDEN\020\002B6" + + "\n4tech.ordinaryroad.live.chat.client.kua" + + "ishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebGiftFeedOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebGiftFeedOuterClass.java new file mode 100644 index 0000000..4e94afd --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebGiftFeedOuterClass.java @@ -0,0 +1,2305 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: WebGiftFeed.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class WebGiftFeedOuterClass { + private WebGiftFeedOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface WebGiftFeedOrBuilder extends + // @@protoc_insertion_point(interface_extends:WebGiftFeed) + com.google.protobuf.MessageOrBuilder { + + /** + * string id = 1; + * @return The id. + */ + java.lang.String getId(); + /** + * string id = 1; + * @return The bytes for id. + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser(); + /** + * .SimpleUserInfo user = 2; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder(); + + /** + * uint64 time = 3; + * @return The time. + */ + long getTime(); + + /** + * uint32 intGiftId = 4; + * @return The intGiftId. + */ + int getIntGiftId(); + + /** + * uint64 sortRank = 5; + * @return The sortRank. + */ + long getSortRank(); + + /** + * string mergeKey = 6; + * @return The mergeKey. + */ + java.lang.String getMergeKey(); + /** + * string mergeKey = 6; + * @return The bytes for mergeKey. + */ + com.google.protobuf.ByteString + getMergeKeyBytes(); + + /** + * uint32 batchSize = 7; + * @return The batchSize. + */ + int getBatchSize(); + + /** + * uint32 comboCount = 8; + * @return The comboCount. + */ + int getComboCount(); + + /** + * uint32 rank = 9; + * @return The rank. + */ + int getRank(); + + /** + * uint64 expireDuration = 10; + * @return The expireDuration. + */ + long getExpireDuration(); + + /** + * uint64 clientTimestamp = 11; + * @return The clientTimestamp. + */ + long getClientTimestamp(); + + /** + * uint64 slotDisplayDuration = 12; + * @return The slotDisplayDuration. + */ + long getSlotDisplayDuration(); + + /** + * uint32 starLevel = 13; + * @return The starLevel. + */ + int getStarLevel(); + + /** + * .WebGiftFeed.StyleType styleType = 14; + * @return The enum numeric value on the wire for styleType. + */ + int getStyleTypeValue(); + /** + * .WebGiftFeed.StyleType styleType = 14; + * @return The styleType. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.StyleType getStyleType(); + + /** + * .WebLiveAssistantType liveAssistantType = 15; + * @return The enum numeric value on the wire for liveAssistantType. + */ + int getLiveAssistantTypeValue(); + /** + * .WebLiveAssistantType liveAssistantType = 15; + * @return The liveAssistantType. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType getLiveAssistantType(); + + /** + * string deviceHash = 16; + * @return The deviceHash. + */ + java.lang.String getDeviceHash(); + /** + * string deviceHash = 16; + * @return The bytes for deviceHash. + */ + com.google.protobuf.ByteString + getDeviceHashBytes(); + + /** + * bool danmakuDisplay = 17; + * @return The danmakuDisplay. + */ + boolean getDanmakuDisplay(); + } + /** + * Protobuf type {@code WebGiftFeed} + */ + public static final class WebGiftFeed extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:WebGiftFeed) + WebGiftFeedOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebGiftFeed.newBuilder() to construct. + private WebGiftFeed(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WebGiftFeed() { + id_ = ""; + mergeKey_ = ""; + styleType_ = 0; + liveAssistantType_ = 0; + deviceHash_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new WebGiftFeed(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.internal_static_WebGiftFeed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.internal_static_WebGiftFeed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.Builder.class); + } + + /** + * Protobuf enum {@code WebGiftFeed.StyleType} + */ + public enum StyleType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN_STYLE = 0; + */ + UNKNOWN_STYLE(0), + /** + * BATCH_STAR_0 = 1; + */ + BATCH_STAR_0(1), + /** + * BATCH_STAR_1 = 2; + */ + BATCH_STAR_1(2), + /** + * BATCH_STAR_2 = 3; + */ + BATCH_STAR_2(3), + /** + * BATCH_STAR_3 = 4; + */ + BATCH_STAR_3(4), + /** + * BATCH_STAR_4 = 5; + */ + BATCH_STAR_4(5), + /** + * BATCH_STAR_5 = 6; + */ + BATCH_STAR_5(6), + /** + * BATCH_STAR_6 = 7; + */ + BATCH_STAR_6(7), + UNRECOGNIZED(-1), + ; + + /** + * UNKNOWN_STYLE = 0; + */ + public static final int UNKNOWN_STYLE_VALUE = 0; + /** + * BATCH_STAR_0 = 1; + */ + public static final int BATCH_STAR_0_VALUE = 1; + /** + * BATCH_STAR_1 = 2; + */ + public static final int BATCH_STAR_1_VALUE = 2; + /** + * BATCH_STAR_2 = 3; + */ + public static final int BATCH_STAR_2_VALUE = 3; + /** + * BATCH_STAR_3 = 4; + */ + public static final int BATCH_STAR_3_VALUE = 4; + /** + * BATCH_STAR_4 = 5; + */ + public static final int BATCH_STAR_4_VALUE = 5; + /** + * BATCH_STAR_5 = 6; + */ + public static final int BATCH_STAR_5_VALUE = 6; + /** + * BATCH_STAR_6 = 7; + */ + public static final int BATCH_STAR_6_VALUE = 7; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StyleType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static StyleType forNumber(int value) { + switch (value) { + case 0: return UNKNOWN_STYLE; + case 1: return BATCH_STAR_0; + case 2: return BATCH_STAR_1; + case 3: return BATCH_STAR_2; + case 4: return BATCH_STAR_3; + case 5: return BATCH_STAR_4; + case 6: return BATCH_STAR_5; + case 7: return BATCH_STAR_6; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + StyleType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public StyleType findValueByNumber(int number) { + return StyleType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.getDescriptor().getEnumTypes().get(0); + } + + private static final StyleType[] VALUES = values(); + + public static StyleType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private StyleType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:WebGiftFeed.StyleType) + } + + public static final int ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_FIELD_NUMBER = 2; + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo user_; + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser() { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + /** + * .SimpleUserInfo user = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder() { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + + public static final int TIME_FIELD_NUMBER = 3; + private long time_ = 0L; + /** + * uint64 time = 3; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + + public static final int INTGIFTID_FIELD_NUMBER = 4; + private int intGiftId_ = 0; + /** + * uint32 intGiftId = 4; + * @return The intGiftId. + */ + @java.lang.Override + public int getIntGiftId() { + return intGiftId_; + } + + public static final int SORTRANK_FIELD_NUMBER = 5; + private long sortRank_ = 0L; + /** + * uint64 sortRank = 5; + * @return The sortRank. + */ + @java.lang.Override + public long getSortRank() { + return sortRank_; + } + + public static final int MERGEKEY_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object mergeKey_ = ""; + /** + * string mergeKey = 6; + * @return The mergeKey. + */ + @java.lang.Override + public java.lang.String getMergeKey() { + java.lang.Object ref = mergeKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mergeKey_ = s; + return s; + } + } + /** + * string mergeKey = 6; + * @return The bytes for mergeKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMergeKeyBytes() { + java.lang.Object ref = mergeKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mergeKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BATCHSIZE_FIELD_NUMBER = 7; + private int batchSize_ = 0; + /** + * uint32 batchSize = 7; + * @return The batchSize. + */ + @java.lang.Override + public int getBatchSize() { + return batchSize_; + } + + public static final int COMBOCOUNT_FIELD_NUMBER = 8; + private int comboCount_ = 0; + /** + * uint32 comboCount = 8; + * @return The comboCount. + */ + @java.lang.Override + public int getComboCount() { + return comboCount_; + } + + public static final int RANK_FIELD_NUMBER = 9; + private int rank_ = 0; + /** + * uint32 rank = 9; + * @return The rank. + */ + @java.lang.Override + public int getRank() { + return rank_; + } + + public static final int EXPIREDURATION_FIELD_NUMBER = 10; + private long expireDuration_ = 0L; + /** + * uint64 expireDuration = 10; + * @return The expireDuration. + */ + @java.lang.Override + public long getExpireDuration() { + return expireDuration_; + } + + public static final int CLIENTTIMESTAMP_FIELD_NUMBER = 11; + private long clientTimestamp_ = 0L; + /** + * uint64 clientTimestamp = 11; + * @return The clientTimestamp. + */ + @java.lang.Override + public long getClientTimestamp() { + return clientTimestamp_; + } + + public static final int SLOTDISPLAYDURATION_FIELD_NUMBER = 12; + private long slotDisplayDuration_ = 0L; + /** + * uint64 slotDisplayDuration = 12; + * @return The slotDisplayDuration. + */ + @java.lang.Override + public long getSlotDisplayDuration() { + return slotDisplayDuration_; + } + + public static final int STARLEVEL_FIELD_NUMBER = 13; + private int starLevel_ = 0; + /** + * uint32 starLevel = 13; + * @return The starLevel. + */ + @java.lang.Override + public int getStarLevel() { + return starLevel_; + } + + public static final int STYLETYPE_FIELD_NUMBER = 14; + private int styleType_ = 0; + /** + * .WebGiftFeed.StyleType styleType = 14; + * @return The enum numeric value on the wire for styleType. + */ + @java.lang.Override public int getStyleTypeValue() { + return styleType_; + } + /** + * .WebGiftFeed.StyleType styleType = 14; + * @return The styleType. + */ + @java.lang.Override public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.StyleType getStyleType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.StyleType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.StyleType.forNumber(styleType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.StyleType.UNRECOGNIZED : result; + } + + public static final int LIVEASSISTANTTYPE_FIELD_NUMBER = 15; + private int liveAssistantType_ = 0; + /** + * .WebLiveAssistantType liveAssistantType = 15; + * @return The enum numeric value on the wire for liveAssistantType. + */ + @java.lang.Override public int getLiveAssistantTypeValue() { + return liveAssistantType_; + } + /** + * .WebLiveAssistantType liveAssistantType = 15; + * @return The liveAssistantType. + */ + @java.lang.Override public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType getLiveAssistantType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.forNumber(liveAssistantType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.UNRECOGNIZED : result; + } + + public static final int DEVICEHASH_FIELD_NUMBER = 16; + @SuppressWarnings("serial") + private volatile java.lang.Object deviceHash_ = ""; + /** + * string deviceHash = 16; + * @return The deviceHash. + */ + @java.lang.Override + public java.lang.String getDeviceHash() { + java.lang.Object ref = deviceHash_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceHash_ = s; + return s; + } + } + /** + * string deviceHash = 16; + * @return The bytes for deviceHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeviceHashBytes() { + java.lang.Object ref = deviceHash_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceHash_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DANMAKUDISPLAY_FIELD_NUMBER = 17; + private boolean danmakuDisplay_ = false; + /** + * bool danmakuDisplay = 17; + * @return The danmakuDisplay. + */ + @java.lang.Override + public boolean getDanmakuDisplay() { + return danmakuDisplay_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (user_ != null) { + output.writeMessage(2, getUser()); + } + if (time_ != 0L) { + output.writeUInt64(3, time_); + } + if (intGiftId_ != 0) { + output.writeUInt32(4, intGiftId_); + } + if (sortRank_ != 0L) { + output.writeUInt64(5, sortRank_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mergeKey_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, mergeKey_); + } + if (batchSize_ != 0) { + output.writeUInt32(7, batchSize_); + } + if (comboCount_ != 0) { + output.writeUInt32(8, comboCount_); + } + if (rank_ != 0) { + output.writeUInt32(9, rank_); + } + if (expireDuration_ != 0L) { + output.writeUInt64(10, expireDuration_); + } + if (clientTimestamp_ != 0L) { + output.writeUInt64(11, clientTimestamp_); + } + if (slotDisplayDuration_ != 0L) { + output.writeUInt64(12, slotDisplayDuration_); + } + if (starLevel_ != 0) { + output.writeUInt32(13, starLevel_); + } + if (styleType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.StyleType.UNKNOWN_STYLE.getNumber()) { + output.writeEnum(14, styleType_); + } + if (liveAssistantType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.UNKNOWN_ASSISTANT_TYPE.getNumber()) { + output.writeEnum(15, liveAssistantType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceHash_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, deviceHash_); + } + if (danmakuDisplay_ != false) { + output.writeBool(17, danmakuDisplay_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUser()); + } + if (time_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, time_); + } + if (intGiftId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, intGiftId_); + } + if (sortRank_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(5, sortRank_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mergeKey_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, mergeKey_); + } + if (batchSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(7, batchSize_); + } + if (comboCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(8, comboCount_); + } + if (rank_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(9, rank_); + } + if (expireDuration_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(10, expireDuration_); + } + if (clientTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(11, clientTimestamp_); + } + if (slotDisplayDuration_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(12, slotDisplayDuration_); + } + if (starLevel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(13, starLevel_); + } + if (styleType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.StyleType.UNKNOWN_STYLE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(14, styleType_); + } + if (liveAssistantType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.UNKNOWN_ASSISTANT_TYPE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(15, liveAssistantType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceHash_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, deviceHash_); + } + if (danmakuDisplay_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(17, danmakuDisplay_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed) obj; + + if (!getId() + .equals(other.getId())) return false; + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser() + .equals(other.getUser())) return false; + } + if (getTime() + != other.getTime()) return false; + if (getIntGiftId() + != other.getIntGiftId()) return false; + if (getSortRank() + != other.getSortRank()) return false; + if (!getMergeKey() + .equals(other.getMergeKey())) return false; + if (getBatchSize() + != other.getBatchSize()) return false; + if (getComboCount() + != other.getComboCount()) return false; + if (getRank() + != other.getRank()) return false; + if (getExpireDuration() + != other.getExpireDuration()) return false; + if (getClientTimestamp() + != other.getClientTimestamp()) return false; + if (getSlotDisplayDuration() + != other.getSlotDisplayDuration()) return false; + if (getStarLevel() + != other.getStarLevel()) return false; + if (styleType_ != other.styleType_) return false; + if (liveAssistantType_ != other.liveAssistantType_) return false; + if (!getDeviceHash() + .equals(other.getDeviceHash())) return false; + if (getDanmakuDisplay() + != other.getDanmakuDisplay()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTime()); + hash = (37 * hash) + INTGIFTID_FIELD_NUMBER; + hash = (53 * hash) + getIntGiftId(); + hash = (37 * hash) + SORTRANK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSortRank()); + hash = (37 * hash) + MERGEKEY_FIELD_NUMBER; + hash = (53 * hash) + getMergeKey().hashCode(); + hash = (37 * hash) + BATCHSIZE_FIELD_NUMBER; + hash = (53 * hash) + getBatchSize(); + hash = (37 * hash) + COMBOCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getComboCount(); + hash = (37 * hash) + RANK_FIELD_NUMBER; + hash = (53 * hash) + getRank(); + hash = (37 * hash) + EXPIREDURATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getExpireDuration()); + hash = (37 * hash) + CLIENTTIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getClientTimestamp()); + hash = (37 * hash) + SLOTDISPLAYDURATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSlotDisplayDuration()); + hash = (37 * hash) + STARLEVEL_FIELD_NUMBER; + hash = (53 * hash) + getStarLevel(); + hash = (37 * hash) + STYLETYPE_FIELD_NUMBER; + hash = (53 * hash) + styleType_; + hash = (37 * hash) + LIVEASSISTANTTYPE_FIELD_NUMBER; + hash = (53 * hash) + liveAssistantType_; + hash = (37 * hash) + DEVICEHASH_FIELD_NUMBER; + hash = (53 * hash) + getDeviceHash().hashCode(); + hash = (37 * hash) + DANMAKUDISPLAY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDanmakuDisplay()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code WebGiftFeed} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:WebGiftFeed) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.internal_static_WebGiftFeed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.internal_static_WebGiftFeed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + time_ = 0L; + intGiftId_ = 0; + sortRank_ = 0L; + mergeKey_ = ""; + batchSize_ = 0; + comboCount_ = 0; + rank_ = 0; + expireDuration_ = 0L; + clientTimestamp_ = 0L; + slotDisplayDuration_ = 0L; + starLevel_ = 0; + styleType_ = 0; + liveAssistantType_ = 0; + deviceHash_ = ""; + danmakuDisplay_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.internal_static_WebGiftFeed_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.user_ = userBuilder_ == null + ? user_ + : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.time_ = time_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.intGiftId_ = intGiftId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.sortRank_ = sortRank_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.mergeKey_ = mergeKey_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.batchSize_ = batchSize_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.comboCount_ = comboCount_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.rank_ = rank_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.expireDuration_ = expireDuration_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.clientTimestamp_ = clientTimestamp_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.slotDisplayDuration_ = slotDisplayDuration_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.starLevel_ = starLevel_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.styleType_ = styleType_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.liveAssistantType_ = liveAssistantType_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.deviceHash_ = deviceHash_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.danmakuDisplay_ = danmakuDisplay_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (other.getTime() != 0L) { + setTime(other.getTime()); + } + if (other.getIntGiftId() != 0) { + setIntGiftId(other.getIntGiftId()); + } + if (other.getSortRank() != 0L) { + setSortRank(other.getSortRank()); + } + if (!other.getMergeKey().isEmpty()) { + mergeKey_ = other.mergeKey_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.getBatchSize() != 0) { + setBatchSize(other.getBatchSize()); + } + if (other.getComboCount() != 0) { + setComboCount(other.getComboCount()); + } + if (other.getRank() != 0) { + setRank(other.getRank()); + } + if (other.getExpireDuration() != 0L) { + setExpireDuration(other.getExpireDuration()); + } + if (other.getClientTimestamp() != 0L) { + setClientTimestamp(other.getClientTimestamp()); + } + if (other.getSlotDisplayDuration() != 0L) { + setSlotDisplayDuration(other.getSlotDisplayDuration()); + } + if (other.getStarLevel() != 0) { + setStarLevel(other.getStarLevel()); + } + if (other.styleType_ != 0) { + setStyleTypeValue(other.getStyleTypeValue()); + } + if (other.liveAssistantType_ != 0) { + setLiveAssistantTypeValue(other.getLiveAssistantTypeValue()); + } + if (!other.getDeviceHash().isEmpty()) { + deviceHash_ = other.deviceHash_; + bitField0_ |= 0x00008000; + onChanged(); + } + if (other.getDanmakuDisplay() != false) { + setDanmakuDisplay(other.getDanmakuDisplay()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getUserFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + time_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + intGiftId_ = input.readUInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + sortRank_ = input.readUInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: { + mergeKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: { + batchSize_ = input.readUInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + comboCount_ = input.readUInt32(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + rank_ = input.readUInt32(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: { + expireDuration_ = input.readUInt64(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: { + clientTimestamp_ = input.readUInt64(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 96: { + slotDisplayDuration_ = input.readUInt64(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 104: { + starLevel_ = input.readUInt32(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 112: { + styleType_ = input.readEnum(); + bitField0_ |= 0x00002000; + break; + } // case 112 + case 120: { + liveAssistantType_ = input.readEnum(); + bitField0_ |= 0x00004000; + break; + } // case 120 + case 130: { + deviceHash_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 130 + case 136: { + danmakuDisplay_ = input.readBool(); + bitField0_ |= 0x00010000; + break; + } // case 136 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string id = 1; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo user_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder> userBuilder_; + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser() { + if (userBuilder_ == null) { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder setUser(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder setUser( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder mergeUser(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + user_ != null && + user_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000002); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder getUserBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * .SimpleUserInfo user = 2; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + } + /** + * .SimpleUserInfo user = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + + private long time_ ; + /** + * uint64 time = 3; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + /** + * uint64 time = 3; + * @param value The time to set. + * @return This builder for chaining. + */ + public Builder setTime(long value) { + + time_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 time = 3; + * @return This builder for chaining. + */ + public Builder clearTime() { + bitField0_ = (bitField0_ & ~0x00000004); + time_ = 0L; + onChanged(); + return this; + } + + private int intGiftId_ ; + /** + * uint32 intGiftId = 4; + * @return The intGiftId. + */ + @java.lang.Override + public int getIntGiftId() { + return intGiftId_; + } + /** + * uint32 intGiftId = 4; + * @param value The intGiftId to set. + * @return This builder for chaining. + */ + public Builder setIntGiftId(int value) { + + intGiftId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint32 intGiftId = 4; + * @return This builder for chaining. + */ + public Builder clearIntGiftId() { + bitField0_ = (bitField0_ & ~0x00000008); + intGiftId_ = 0; + onChanged(); + return this; + } + + private long sortRank_ ; + /** + * uint64 sortRank = 5; + * @return The sortRank. + */ + @java.lang.Override + public long getSortRank() { + return sortRank_; + } + /** + * uint64 sortRank = 5; + * @param value The sortRank to set. + * @return This builder for chaining. + */ + public Builder setSortRank(long value) { + + sortRank_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * uint64 sortRank = 5; + * @return This builder for chaining. + */ + public Builder clearSortRank() { + bitField0_ = (bitField0_ & ~0x00000010); + sortRank_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object mergeKey_ = ""; + /** + * string mergeKey = 6; + * @return The mergeKey. + */ + public java.lang.String getMergeKey() { + java.lang.Object ref = mergeKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mergeKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string mergeKey = 6; + * @return The bytes for mergeKey. + */ + public com.google.protobuf.ByteString + getMergeKeyBytes() { + java.lang.Object ref = mergeKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mergeKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string mergeKey = 6; + * @param value The mergeKey to set. + * @return This builder for chaining. + */ + public Builder setMergeKey( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + mergeKey_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * string mergeKey = 6; + * @return This builder for chaining. + */ + public Builder clearMergeKey() { + mergeKey_ = getDefaultInstance().getMergeKey(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * string mergeKey = 6; + * @param value The bytes for mergeKey to set. + * @return This builder for chaining. + */ + public Builder setMergeKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + mergeKey_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private int batchSize_ ; + /** + * uint32 batchSize = 7; + * @return The batchSize. + */ + @java.lang.Override + public int getBatchSize() { + return batchSize_; + } + /** + * uint32 batchSize = 7; + * @param value The batchSize to set. + * @return This builder for chaining. + */ + public Builder setBatchSize(int value) { + + batchSize_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * uint32 batchSize = 7; + * @return This builder for chaining. + */ + public Builder clearBatchSize() { + bitField0_ = (bitField0_ & ~0x00000040); + batchSize_ = 0; + onChanged(); + return this; + } + + private int comboCount_ ; + /** + * uint32 comboCount = 8; + * @return The comboCount. + */ + @java.lang.Override + public int getComboCount() { + return comboCount_; + } + /** + * uint32 comboCount = 8; + * @param value The comboCount to set. + * @return This builder for chaining. + */ + public Builder setComboCount(int value) { + + comboCount_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * uint32 comboCount = 8; + * @return This builder for chaining. + */ + public Builder clearComboCount() { + bitField0_ = (bitField0_ & ~0x00000080); + comboCount_ = 0; + onChanged(); + return this; + } + + private int rank_ ; + /** + * uint32 rank = 9; + * @return The rank. + */ + @java.lang.Override + public int getRank() { + return rank_; + } + /** + * uint32 rank = 9; + * @param value The rank to set. + * @return This builder for chaining. + */ + public Builder setRank(int value) { + + rank_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * uint32 rank = 9; + * @return This builder for chaining. + */ + public Builder clearRank() { + bitField0_ = (bitField0_ & ~0x00000100); + rank_ = 0; + onChanged(); + return this; + } + + private long expireDuration_ ; + /** + * uint64 expireDuration = 10; + * @return The expireDuration. + */ + @java.lang.Override + public long getExpireDuration() { + return expireDuration_; + } + /** + * uint64 expireDuration = 10; + * @param value The expireDuration to set. + * @return This builder for chaining. + */ + public Builder setExpireDuration(long value) { + + expireDuration_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * uint64 expireDuration = 10; + * @return This builder for chaining. + */ + public Builder clearExpireDuration() { + bitField0_ = (bitField0_ & ~0x00000200); + expireDuration_ = 0L; + onChanged(); + return this; + } + + private long clientTimestamp_ ; + /** + * uint64 clientTimestamp = 11; + * @return The clientTimestamp. + */ + @java.lang.Override + public long getClientTimestamp() { + return clientTimestamp_; + } + /** + * uint64 clientTimestamp = 11; + * @param value The clientTimestamp to set. + * @return This builder for chaining. + */ + public Builder setClientTimestamp(long value) { + + clientTimestamp_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * uint64 clientTimestamp = 11; + * @return This builder for chaining. + */ + public Builder clearClientTimestamp() { + bitField0_ = (bitField0_ & ~0x00000400); + clientTimestamp_ = 0L; + onChanged(); + return this; + } + + private long slotDisplayDuration_ ; + /** + * uint64 slotDisplayDuration = 12; + * @return The slotDisplayDuration. + */ + @java.lang.Override + public long getSlotDisplayDuration() { + return slotDisplayDuration_; + } + /** + * uint64 slotDisplayDuration = 12; + * @param value The slotDisplayDuration to set. + * @return This builder for chaining. + */ + public Builder setSlotDisplayDuration(long value) { + + slotDisplayDuration_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * uint64 slotDisplayDuration = 12; + * @return This builder for chaining. + */ + public Builder clearSlotDisplayDuration() { + bitField0_ = (bitField0_ & ~0x00000800); + slotDisplayDuration_ = 0L; + onChanged(); + return this; + } + + private int starLevel_ ; + /** + * uint32 starLevel = 13; + * @return The starLevel. + */ + @java.lang.Override + public int getStarLevel() { + return starLevel_; + } + /** + * uint32 starLevel = 13; + * @param value The starLevel to set. + * @return This builder for chaining. + */ + public Builder setStarLevel(int value) { + + starLevel_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * uint32 starLevel = 13; + * @return This builder for chaining. + */ + public Builder clearStarLevel() { + bitField0_ = (bitField0_ & ~0x00001000); + starLevel_ = 0; + onChanged(); + return this; + } + + private int styleType_ = 0; + /** + * .WebGiftFeed.StyleType styleType = 14; + * @return The enum numeric value on the wire for styleType. + */ + @java.lang.Override public int getStyleTypeValue() { + return styleType_; + } + /** + * .WebGiftFeed.StyleType styleType = 14; + * @param value The enum numeric value on the wire for styleType to set. + * @return This builder for chaining. + */ + public Builder setStyleTypeValue(int value) { + styleType_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * .WebGiftFeed.StyleType styleType = 14; + * @return The styleType. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.StyleType getStyleType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.StyleType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.StyleType.forNumber(styleType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.StyleType.UNRECOGNIZED : result; + } + /** + * .WebGiftFeed.StyleType styleType = 14; + * @param value The styleType to set. + * @return This builder for chaining. + */ + public Builder setStyleType(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed.StyleType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00002000; + styleType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .WebGiftFeed.StyleType styleType = 14; + * @return This builder for chaining. + */ + public Builder clearStyleType() { + bitField0_ = (bitField0_ & ~0x00002000); + styleType_ = 0; + onChanged(); + return this; + } + + private int liveAssistantType_ = 0; + /** + * .WebLiveAssistantType liveAssistantType = 15; + * @return The enum numeric value on the wire for liveAssistantType. + */ + @java.lang.Override public int getLiveAssistantTypeValue() { + return liveAssistantType_; + } + /** + * .WebLiveAssistantType liveAssistantType = 15; + * @param value The enum numeric value on the wire for liveAssistantType to set. + * @return This builder for chaining. + */ + public Builder setLiveAssistantTypeValue(int value) { + liveAssistantType_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * .WebLiveAssistantType liveAssistantType = 15; + * @return The liveAssistantType. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType getLiveAssistantType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.forNumber(liveAssistantType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.UNRECOGNIZED : result; + } + /** + * .WebLiveAssistantType liveAssistantType = 15; + * @param value The liveAssistantType to set. + * @return This builder for chaining. + */ + public Builder setLiveAssistantType(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00004000; + liveAssistantType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .WebLiveAssistantType liveAssistantType = 15; + * @return This builder for chaining. + */ + public Builder clearLiveAssistantType() { + bitField0_ = (bitField0_ & ~0x00004000); + liveAssistantType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object deviceHash_ = ""; + /** + * string deviceHash = 16; + * @return The deviceHash. + */ + public java.lang.String getDeviceHash() { + java.lang.Object ref = deviceHash_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceHash_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string deviceHash = 16; + * @return The bytes for deviceHash. + */ + public com.google.protobuf.ByteString + getDeviceHashBytes() { + java.lang.Object ref = deviceHash_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceHash_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string deviceHash = 16; + * @param value The deviceHash to set. + * @return This builder for chaining. + */ + public Builder setDeviceHash( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + deviceHash_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * string deviceHash = 16; + * @return This builder for chaining. + */ + public Builder clearDeviceHash() { + deviceHash_ = getDefaultInstance().getDeviceHash(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + /** + * string deviceHash = 16; + * @param value The bytes for deviceHash to set. + * @return This builder for chaining. + */ + public Builder setDeviceHashBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + deviceHash_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private boolean danmakuDisplay_ ; + /** + * bool danmakuDisplay = 17; + * @return The danmakuDisplay. + */ + @java.lang.Override + public boolean getDanmakuDisplay() { + return danmakuDisplay_; + } + /** + * bool danmakuDisplay = 17; + * @param value The danmakuDisplay to set. + * @return This builder for chaining. + */ + public Builder setDanmakuDisplay(boolean value) { + + danmakuDisplay_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * bool danmakuDisplay = 17; + * @return This builder for chaining. + */ + public Builder clearDanmakuDisplay() { + bitField0_ = (bitField0_ & ~0x00010000); + danmakuDisplay_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:WebGiftFeed) + } + + // @@protoc_insertion_point(class_scope:WebGiftFeed) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WebGiftFeed parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass.WebGiftFeed getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_WebGiftFeed_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_WebGiftFeed_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\021WebGiftFeed.proto\032\024SimpleUserInfo.prot" + + "o\032\032WebLiveAssistantType.proto\"\273\004\n\013WebGif" + + "tFeed\022\n\n\002id\030\001 \001(\t\022\035\n\004user\030\002 \001(\0132\017.Simple" + + "UserInfo\022\014\n\004time\030\003 \001(\004\022\021\n\tintGiftId\030\004 \001(" + + "\r\022\020\n\010sortRank\030\005 \001(\004\022\020\n\010mergeKey\030\006 \001(\t\022\021\n" + + "\tbatchSize\030\007 \001(\r\022\022\n\ncomboCount\030\010 \001(\r\022\014\n\004" + + "rank\030\t \001(\r\022\026\n\016expireDuration\030\n \001(\004\022\027\n\017cl" + + "ientTimestamp\030\013 \001(\004\022\033\n\023slotDisplayDurati" + + "on\030\014 \001(\004\022\021\n\tstarLevel\030\r \001(\r\022)\n\tstyleType" + + "\030\016 \001(\0162\026.WebGiftFeed.StyleType\0220\n\021liveAs" + + "sistantType\030\017 \001(\0162\025.WebLiveAssistantType" + + "\022\022\n\ndeviceHash\030\020 \001(\t\022\026\n\016danmakuDisplay\030\021" + + " \001(\010\"\234\001\n\tStyleType\022\021\n\rUNKNOWN_STYLE\020\000\022\020\n" + + "\014BATCH_STAR_0\020\001\022\020\n\014BATCH_STAR_1\020\002\022\020\n\014BAT" + + "CH_STAR_2\020\003\022\020\n\014BATCH_STAR_3\020\004\022\020\n\014BATCH_S" + + "TAR_4\020\005\022\020\n\014BATCH_STAR_5\020\006\022\020\n\014BATCH_STAR_" + + "6\020\007B6\n4tech.ordinaryroad.live.chat.clien" + + "t.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.getDescriptor(), + }); + internal_static_WebGiftFeed_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_WebGiftFeed_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_WebGiftFeed_descriptor, + new java.lang.String[] { "Id", "User", "Time", "IntGiftId", "SortRank", "MergeKey", "BatchSize", "ComboCount", "Rank", "ExpireDuration", "ClientTimestamp", "SlotDisplayDuration", "StarLevel", "StyleType", "LiveAssistantType", "DeviceHash", "DanmakuDisplay", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebLikeFeedOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebLikeFeedOuterClass.java new file mode 100644 index 0000000..67eff24 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebLikeFeedOuterClass.java @@ -0,0 +1,1046 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: WebLikeFeed.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class WebLikeFeedOuterClass { + private WebLikeFeedOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface WebLikeFeedOrBuilder extends + // @@protoc_insertion_point(interface_extends:WebLikeFeed) + com.google.protobuf.MessageOrBuilder { + + /** + * string id = 1; + * @return The id. + */ + java.lang.String getId(); + /** + * string id = 1; + * @return The bytes for id. + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser(); + /** + * .SimpleUserInfo user = 2; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder(); + + /** + * uint64 sortRank = 3; + * @return The sortRank. + */ + long getSortRank(); + + /** + * string deviceHash = 4; + * @return The deviceHash. + */ + java.lang.String getDeviceHash(); + /** + * string deviceHash = 4; + * @return The bytes for deviceHash. + */ + com.google.protobuf.ByteString + getDeviceHashBytes(); + } + /** + * Protobuf type {@code WebLikeFeed} + */ + public static final class WebLikeFeed extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:WebLikeFeed) + WebLikeFeedOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebLikeFeed.newBuilder() to construct. + private WebLikeFeed(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WebLikeFeed() { + id_ = ""; + deviceHash_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new WebLikeFeed(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.internal_static_WebLikeFeed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.internal_static_WebLikeFeed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_FIELD_NUMBER = 2; + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo user_; + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser() { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + /** + * .SimpleUserInfo user = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder() { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + + public static final int SORTRANK_FIELD_NUMBER = 3; + private long sortRank_ = 0L; + /** + * uint64 sortRank = 3; + * @return The sortRank. + */ + @java.lang.Override + public long getSortRank() { + return sortRank_; + } + + public static final int DEVICEHASH_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object deviceHash_ = ""; + /** + * string deviceHash = 4; + * @return The deviceHash. + */ + @java.lang.Override + public java.lang.String getDeviceHash() { + java.lang.Object ref = deviceHash_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceHash_ = s; + return s; + } + } + /** + * string deviceHash = 4; + * @return The bytes for deviceHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeviceHashBytes() { + java.lang.Object ref = deviceHash_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceHash_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (user_ != null) { + output.writeMessage(2, getUser()); + } + if (sortRank_ != 0L) { + output.writeUInt64(3, sortRank_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceHash_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, deviceHash_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUser()); + } + if (sortRank_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, sortRank_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceHash_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, deviceHash_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed) obj; + + if (!getId() + .equals(other.getId())) return false; + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser() + .equals(other.getUser())) return false; + } + if (getSortRank() + != other.getSortRank()) return false; + if (!getDeviceHash() + .equals(other.getDeviceHash())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + SORTRANK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSortRank()); + hash = (37 * hash) + DEVICEHASH_FIELD_NUMBER; + hash = (53 * hash) + getDeviceHash().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code WebLikeFeed} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:WebLikeFeed) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.internal_static_WebLikeFeed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.internal_static_WebLikeFeed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + sortRank_ = 0L; + deviceHash_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.internal_static_WebLikeFeed_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.user_ = userBuilder_ == null + ? user_ + : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sortRank_ = sortRank_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.deviceHash_ = deviceHash_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (other.getSortRank() != 0L) { + setSortRank(other.getSortRank()); + } + if (!other.getDeviceHash().isEmpty()) { + deviceHash_ = other.deviceHash_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getUserFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + sortRank_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + deviceHash_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string id = 1; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo user_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder> userBuilder_; + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser() { + if (userBuilder_ == null) { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder setUser(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder setUser( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder mergeUser(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + user_ != null && + user_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000002); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder getUserBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * .SimpleUserInfo user = 2; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + } + /** + * .SimpleUserInfo user = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + + private long sortRank_ ; + /** + * uint64 sortRank = 3; + * @return The sortRank. + */ + @java.lang.Override + public long getSortRank() { + return sortRank_; + } + /** + * uint64 sortRank = 3; + * @param value The sortRank to set. + * @return This builder for chaining. + */ + public Builder setSortRank(long value) { + + sortRank_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 sortRank = 3; + * @return This builder for chaining. + */ + public Builder clearSortRank() { + bitField0_ = (bitField0_ & ~0x00000004); + sortRank_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object deviceHash_ = ""; + /** + * string deviceHash = 4; + * @return The deviceHash. + */ + public java.lang.String getDeviceHash() { + java.lang.Object ref = deviceHash_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceHash_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string deviceHash = 4; + * @return The bytes for deviceHash. + */ + public com.google.protobuf.ByteString + getDeviceHashBytes() { + java.lang.Object ref = deviceHash_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceHash_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string deviceHash = 4; + * @param value The deviceHash to set. + * @return This builder for chaining. + */ + public Builder setDeviceHash( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + deviceHash_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * string deviceHash = 4; + * @return This builder for chaining. + */ + public Builder clearDeviceHash() { + deviceHash_ = getDefaultInstance().getDeviceHash(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * string deviceHash = 4; + * @param value The bytes for deviceHash to set. + * @return This builder for chaining. + */ + public Builder setDeviceHashBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + deviceHash_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:WebLikeFeed) + } + + // @@protoc_insertion_point(class_scope:WebLikeFeed) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WebLikeFeed parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLikeFeedOuterClass.WebLikeFeed getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_WebLikeFeed_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_WebLikeFeed_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\021WebLikeFeed.proto\032\024SimpleUserInfo.prot" + + "o\"^\n\013WebLikeFeed\022\n\n\002id\030\001 \001(\t\022\035\n\004user\030\002 \001" + + "(\0132\017.SimpleUserInfo\022\020\n\010sortRank\030\003 \001(\004\022\022\n" + + "\ndeviceHash\030\004 \001(\tB6\n4tech.ordinaryroad.l" + + "ive.chat.client.kuaishou.protobufb\006proto" + + "3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.getDescriptor(), + }); + internal_static_WebLikeFeed_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_WebLikeFeed_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_WebLikeFeed_descriptor, + new java.lang.String[] { "Id", "User", "SortRank", "DeviceHash", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebLiveAssistantTypeOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebLiveAssistantTypeOuterClass.java new file mode 100644 index 0000000..066422c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebLiveAssistantTypeOuterClass.java @@ -0,0 +1,180 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: WebLiveAssistantType.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class WebLiveAssistantTypeOuterClass { + private WebLiveAssistantTypeOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code WebLiveAssistantType} + */ + public enum WebLiveAssistantType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN_ASSISTANT_TYPE = 0; + */ + UNKNOWN_ASSISTANT_TYPE(0), + /** + * SUPER = 1; + */ + SUPER(1), + /** + * JUNIOR = 2; + */ + JUNIOR(2), + UNRECOGNIZED(-1), + ; + + /** + * UNKNOWN_ASSISTANT_TYPE = 0; + */ + public static final int UNKNOWN_ASSISTANT_TYPE_VALUE = 0; + /** + * SUPER = 1; + */ + public static final int SUPER_VALUE = 1; + /** + * JUNIOR = 2; + */ + public static final int JUNIOR_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static WebLiveAssistantType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static WebLiveAssistantType forNumber(int value) { + switch (value) { + case 0: return UNKNOWN_ASSISTANT_TYPE; + case 1: return SUPER; + case 2: return JUNIOR; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + WebLiveAssistantType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public WebLiveAssistantType findValueByNumber(int number) { + return WebLiveAssistantType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final WebLiveAssistantType[] VALUES = values(); + + public static WebLiveAssistantType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private WebLiveAssistantType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:WebLiveAssistantType) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\032WebLiveAssistantType.proto*I\n\024WebLiveA" + + "ssistantType\022\032\n\026UNKNOWN_ASSISTANT_TYPE\020\000" + + "\022\t\n\005SUPER\020\001\022\n\n\006JUNIOR\020\002B6\n4tech.ordinary" + + "road.live.chat.client.kuaishou.protobufb" + + "\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebPauseTypeOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebPauseTypeOuterClass.java new file mode 100644 index 0000000..28c8879 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebPauseTypeOuterClass.java @@ -0,0 +1,179 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: WebPauseType.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class WebPauseTypeOuterClass { + private WebPauseTypeOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code WebPauseType} + */ + public enum WebPauseType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN_PAUSE_TYPE = 0; + */ + UNKNOWN_PAUSE_TYPE(0), + /** + * TELEPHONE = 1; + */ + TELEPHONE(1), + /** + * SHARE = 2; + */ + SHARE(2), + UNRECOGNIZED(-1), + ; + + /** + * UNKNOWN_PAUSE_TYPE = 0; + */ + public static final int UNKNOWN_PAUSE_TYPE_VALUE = 0; + /** + * TELEPHONE = 1; + */ + public static final int TELEPHONE_VALUE = 1; + /** + * SHARE = 2; + */ + public static final int SHARE_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static WebPauseType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static WebPauseType forNumber(int value) { + switch (value) { + case 0: return UNKNOWN_PAUSE_TYPE; + case 1: return TELEPHONE; + case 2: return SHARE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + WebPauseType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public WebPauseType findValueByNumber(int number) { + return WebPauseType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebPauseTypeOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final WebPauseType[] VALUES = values(); + + public static WebPauseType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private WebPauseType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:WebPauseType) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\022WebPauseType.proto*@\n\014WebPauseType\022\026\n\022" + + "UNKNOWN_PAUSE_TYPE\020\000\022\r\n\tTELEPHONE\020\001\022\t\n\005S" + + "HARE\020\002B6\n4tech.ordinaryroad.live.chat.cl" + + "ient.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebRedPackCoverTypeOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebRedPackCoverTypeOuterClass.java new file mode 100644 index 0000000..6b03df2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebRedPackCoverTypeOuterClass.java @@ -0,0 +1,180 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: WebRedPackCoverType.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class WebRedPackCoverTypeOuterClass { + private WebRedPackCoverTypeOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code WebRedPackCoverType} + */ + public enum WebRedPackCoverType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN_COVER_TYPE = 0; + */ + UNKNOWN_COVER_TYPE(0), + /** + * NORMAL_COVER = 1; + */ + NORMAL_COVER(1), + /** + * PRETTY_COVER = 2; + */ + PRETTY_COVER(2), + UNRECOGNIZED(-1), + ; + + /** + * UNKNOWN_COVER_TYPE = 0; + */ + public static final int UNKNOWN_COVER_TYPE_VALUE = 0; + /** + * NORMAL_COVER = 1; + */ + public static final int NORMAL_COVER_VALUE = 1; + /** + * PRETTY_COVER = 2; + */ + public static final int PRETTY_COVER_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static WebRedPackCoverType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static WebRedPackCoverType forNumber(int value) { + switch (value) { + case 0: return UNKNOWN_COVER_TYPE; + case 1: return NORMAL_COVER; + case 2: return PRETTY_COVER; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + WebRedPackCoverType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public WebRedPackCoverType findValueByNumber(int number) { + return WebRedPackCoverType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final WebRedPackCoverType[] VALUES = values(); + + public static WebRedPackCoverType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private WebRedPackCoverType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:WebRedPackCoverType) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\031WebRedPackCoverType.proto*Q\n\023WebRedPac" + + "kCoverType\022\026\n\022UNKNOWN_COVER_TYPE\020\000\022\020\n\014NO" + + "RMAL_COVER\020\001\022\020\n\014PRETTY_COVER\020\002B6\n4tech.o" + + "rdinaryroad.live.chat.client.kuaishou.pr" + + "otobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebRedPackInfoOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebRedPackInfoOuterClass.java new file mode 100644 index 0000000..72ffc45 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebRedPackInfoOuterClass.java @@ -0,0 +1,1522 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: WebRedPackInfo.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class WebRedPackInfoOuterClass { + private WebRedPackInfoOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface WebRedPackInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:WebRedPackInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * string id = 1; + * @return The id. + */ + java.lang.String getId(); + /** + * string id = 1; + * @return The bytes for id. + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + * .SimpleUserInfo author = 2; + * @return Whether the author field is set. + */ + boolean hasAuthor(); + /** + * .SimpleUserInfo author = 2; + * @return The author. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getAuthor(); + /** + * .SimpleUserInfo author = 2; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getAuthorOrBuilder(); + + /** + * uint64 balance = 3; + * @return The balance. + */ + long getBalance(); + + /** + * uint64 openTime = 4; + * @return The openTime. + */ + long getOpenTime(); + + /** + * uint64 currentTime = 5; + * @return The currentTime. + */ + long getCurrentTime(); + + /** + * string grabToken = 6; + * @return The grabToken. + */ + java.lang.String getGrabToken(); + /** + * string grabToken = 6; + * @return The bytes for grabToken. + */ + com.google.protobuf.ByteString + getGrabTokenBytes(); + + /** + * bool needSendRequest = 7; + * @return The needSendRequest. + */ + boolean getNeedSendRequest(); + + /** + * uint64 requestDelayMillis = 8; + * @return The requestDelayMillis. + */ + long getRequestDelayMillis(); + + /** + * uint64 luckiestDelayMillis = 9; + * @return The luckiestDelayMillis. + */ + long getLuckiestDelayMillis(); + + /** + * .WebRedPackCoverType coverType = 10; + * @return The enum numeric value on the wire for coverType. + */ + int getCoverTypeValue(); + /** + * .WebRedPackCoverType coverType = 10; + * @return The coverType. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.WebRedPackCoverType getCoverType(); + } + /** + * Protobuf type {@code WebRedPackInfo} + */ + public static final class WebRedPackInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:WebRedPackInfo) + WebRedPackInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebRedPackInfo.newBuilder() to construct. + private WebRedPackInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WebRedPackInfo() { + id_ = ""; + grabToken_ = ""; + coverType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new WebRedPackInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.internal_static_WebRedPackInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.internal_static_WebRedPackInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTHOR_FIELD_NUMBER = 2; + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo author_; + /** + * .SimpleUserInfo author = 2; + * @return Whether the author field is set. + */ + @java.lang.Override + public boolean hasAuthor() { + return author_ != null; + } + /** + * .SimpleUserInfo author = 2; + * @return The author. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getAuthor() { + return author_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : author_; + } + /** + * .SimpleUserInfo author = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getAuthorOrBuilder() { + return author_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : author_; + } + + public static final int BALANCE_FIELD_NUMBER = 3; + private long balance_ = 0L; + /** + * uint64 balance = 3; + * @return The balance. + */ + @java.lang.Override + public long getBalance() { + return balance_; + } + + public static final int OPENTIME_FIELD_NUMBER = 4; + private long openTime_ = 0L; + /** + * uint64 openTime = 4; + * @return The openTime. + */ + @java.lang.Override + public long getOpenTime() { + return openTime_; + } + + public static final int CURRENTTIME_FIELD_NUMBER = 5; + private long currentTime_ = 0L; + /** + * uint64 currentTime = 5; + * @return The currentTime. + */ + @java.lang.Override + public long getCurrentTime() { + return currentTime_; + } + + public static final int GRABTOKEN_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object grabToken_ = ""; + /** + * string grabToken = 6; + * @return The grabToken. + */ + @java.lang.Override + public java.lang.String getGrabToken() { + java.lang.Object ref = grabToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + grabToken_ = s; + return s; + } + } + /** + * string grabToken = 6; + * @return The bytes for grabToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGrabTokenBytes() { + java.lang.Object ref = grabToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + grabToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEEDSENDREQUEST_FIELD_NUMBER = 7; + private boolean needSendRequest_ = false; + /** + * bool needSendRequest = 7; + * @return The needSendRequest. + */ + @java.lang.Override + public boolean getNeedSendRequest() { + return needSendRequest_; + } + + public static final int REQUESTDELAYMILLIS_FIELD_NUMBER = 8; + private long requestDelayMillis_ = 0L; + /** + * uint64 requestDelayMillis = 8; + * @return The requestDelayMillis. + */ + @java.lang.Override + public long getRequestDelayMillis() { + return requestDelayMillis_; + } + + public static final int LUCKIESTDELAYMILLIS_FIELD_NUMBER = 9; + private long luckiestDelayMillis_ = 0L; + /** + * uint64 luckiestDelayMillis = 9; + * @return The luckiestDelayMillis. + */ + @java.lang.Override + public long getLuckiestDelayMillis() { + return luckiestDelayMillis_; + } + + public static final int COVERTYPE_FIELD_NUMBER = 10; + private int coverType_ = 0; + /** + * .WebRedPackCoverType coverType = 10; + * @return The enum numeric value on the wire for coverType. + */ + @java.lang.Override public int getCoverTypeValue() { + return coverType_; + } + /** + * .WebRedPackCoverType coverType = 10; + * @return The coverType. + */ + @java.lang.Override public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.WebRedPackCoverType getCoverType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.WebRedPackCoverType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.WebRedPackCoverType.forNumber(coverType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.WebRedPackCoverType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (author_ != null) { + output.writeMessage(2, getAuthor()); + } + if (balance_ != 0L) { + output.writeUInt64(3, balance_); + } + if (openTime_ != 0L) { + output.writeUInt64(4, openTime_); + } + if (currentTime_ != 0L) { + output.writeUInt64(5, currentTime_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(grabToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, grabToken_); + } + if (needSendRequest_ != false) { + output.writeBool(7, needSendRequest_); + } + if (requestDelayMillis_ != 0L) { + output.writeUInt64(8, requestDelayMillis_); + } + if (luckiestDelayMillis_ != 0L) { + output.writeUInt64(9, luckiestDelayMillis_); + } + if (coverType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.WebRedPackCoverType.UNKNOWN_COVER_TYPE.getNumber()) { + output.writeEnum(10, coverType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (author_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getAuthor()); + } + if (balance_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, balance_); + } + if (openTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, openTime_); + } + if (currentTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(5, currentTime_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(grabToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, grabToken_); + } + if (needSendRequest_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, needSendRequest_); + } + if (requestDelayMillis_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(8, requestDelayMillis_); + } + if (luckiestDelayMillis_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(9, luckiestDelayMillis_); + } + if (coverType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.WebRedPackCoverType.UNKNOWN_COVER_TYPE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(10, coverType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo) obj; + + if (!getId() + .equals(other.getId())) return false; + if (hasAuthor() != other.hasAuthor()) return false; + if (hasAuthor()) { + if (!getAuthor() + .equals(other.getAuthor())) return false; + } + if (getBalance() + != other.getBalance()) return false; + if (getOpenTime() + != other.getOpenTime()) return false; + if (getCurrentTime() + != other.getCurrentTime()) return false; + if (!getGrabToken() + .equals(other.getGrabToken())) return false; + if (getNeedSendRequest() + != other.getNeedSendRequest()) return false; + if (getRequestDelayMillis() + != other.getRequestDelayMillis()) return false; + if (getLuckiestDelayMillis() + != other.getLuckiestDelayMillis()) return false; + if (coverType_ != other.coverType_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasAuthor()) { + hash = (37 * hash) + AUTHOR_FIELD_NUMBER; + hash = (53 * hash) + getAuthor().hashCode(); + } + hash = (37 * hash) + BALANCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBalance()); + hash = (37 * hash) + OPENTIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOpenTime()); + hash = (37 * hash) + CURRENTTIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCurrentTime()); + hash = (37 * hash) + GRABTOKEN_FIELD_NUMBER; + hash = (53 * hash) + getGrabToken().hashCode(); + hash = (37 * hash) + NEEDSENDREQUEST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getNeedSendRequest()); + hash = (37 * hash) + REQUESTDELAYMILLIS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRequestDelayMillis()); + hash = (37 * hash) + LUCKIESTDELAYMILLIS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLuckiestDelayMillis()); + hash = (37 * hash) + COVERTYPE_FIELD_NUMBER; + hash = (53 * hash) + coverType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code WebRedPackInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:WebRedPackInfo) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.internal_static_WebRedPackInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.internal_static_WebRedPackInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + author_ = null; + if (authorBuilder_ != null) { + authorBuilder_.dispose(); + authorBuilder_ = null; + } + balance_ = 0L; + openTime_ = 0L; + currentTime_ = 0L; + grabToken_ = ""; + needSendRequest_ = false; + requestDelayMillis_ = 0L; + luckiestDelayMillis_ = 0L; + coverType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.internal_static_WebRedPackInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.author_ = authorBuilder_ == null + ? author_ + : authorBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.balance_ = balance_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.openTime_ = openTime_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.currentTime_ = currentTime_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.grabToken_ = grabToken_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.needSendRequest_ = needSendRequest_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.requestDelayMillis_ = requestDelayMillis_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.luckiestDelayMillis_ = luckiestDelayMillis_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.coverType_ = coverType_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasAuthor()) { + mergeAuthor(other.getAuthor()); + } + if (other.getBalance() != 0L) { + setBalance(other.getBalance()); + } + if (other.getOpenTime() != 0L) { + setOpenTime(other.getOpenTime()); + } + if (other.getCurrentTime() != 0L) { + setCurrentTime(other.getCurrentTime()); + } + if (!other.getGrabToken().isEmpty()) { + grabToken_ = other.grabToken_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.getNeedSendRequest() != false) { + setNeedSendRequest(other.getNeedSendRequest()); + } + if (other.getRequestDelayMillis() != 0L) { + setRequestDelayMillis(other.getRequestDelayMillis()); + } + if (other.getLuckiestDelayMillis() != 0L) { + setLuckiestDelayMillis(other.getLuckiestDelayMillis()); + } + if (other.coverType_ != 0) { + setCoverTypeValue(other.getCoverTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getAuthorFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + balance_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + openTime_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + currentTime_ = input.readUInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: { + grabToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: { + needSendRequest_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + requestDelayMillis_ = input.readUInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + luckiestDelayMillis_ = input.readUInt64(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: { + coverType_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 80 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string id = 1; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo author_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder> authorBuilder_; + /** + * .SimpleUserInfo author = 2; + * @return Whether the author field is set. + */ + public boolean hasAuthor() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .SimpleUserInfo author = 2; + * @return The author. + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getAuthor() { + if (authorBuilder_ == null) { + return author_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : author_; + } else { + return authorBuilder_.getMessage(); + } + } + /** + * .SimpleUserInfo author = 2; + */ + public Builder setAuthor(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo value) { + if (authorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + author_ = value; + } else { + authorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo author = 2; + */ + public Builder setAuthor( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder builderForValue) { + if (authorBuilder_ == null) { + author_ = builderForValue.build(); + } else { + authorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo author = 2; + */ + public Builder mergeAuthor(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo value) { + if (authorBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + author_ != null && + author_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance()) { + getAuthorBuilder().mergeFrom(value); + } else { + author_ = value; + } + } else { + authorBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo author = 2; + */ + public Builder clearAuthor() { + bitField0_ = (bitField0_ & ~0x00000002); + author_ = null; + if (authorBuilder_ != null) { + authorBuilder_.dispose(); + authorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SimpleUserInfo author = 2; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder getAuthorBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getAuthorFieldBuilder().getBuilder(); + } + /** + * .SimpleUserInfo author = 2; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getAuthorOrBuilder() { + if (authorBuilder_ != null) { + return authorBuilder_.getMessageOrBuilder(); + } else { + return author_ == null ? + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : author_; + } + } + /** + * .SimpleUserInfo author = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder> + getAuthorFieldBuilder() { + if (authorBuilder_ == null) { + authorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder>( + getAuthor(), + getParentForChildren(), + isClean()); + author_ = null; + } + return authorBuilder_; + } + + private long balance_ ; + /** + * uint64 balance = 3; + * @return The balance. + */ + @java.lang.Override + public long getBalance() { + return balance_; + } + /** + * uint64 balance = 3; + * @param value The balance to set. + * @return This builder for chaining. + */ + public Builder setBalance(long value) { + + balance_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 balance = 3; + * @return This builder for chaining. + */ + public Builder clearBalance() { + bitField0_ = (bitField0_ & ~0x00000004); + balance_ = 0L; + onChanged(); + return this; + } + + private long openTime_ ; + /** + * uint64 openTime = 4; + * @return The openTime. + */ + @java.lang.Override + public long getOpenTime() { + return openTime_; + } + /** + * uint64 openTime = 4; + * @param value The openTime to set. + * @return This builder for chaining. + */ + public Builder setOpenTime(long value) { + + openTime_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint64 openTime = 4; + * @return This builder for chaining. + */ + public Builder clearOpenTime() { + bitField0_ = (bitField0_ & ~0x00000008); + openTime_ = 0L; + onChanged(); + return this; + } + + private long currentTime_ ; + /** + * uint64 currentTime = 5; + * @return The currentTime. + */ + @java.lang.Override + public long getCurrentTime() { + return currentTime_; + } + /** + * uint64 currentTime = 5; + * @param value The currentTime to set. + * @return This builder for chaining. + */ + public Builder setCurrentTime(long value) { + + currentTime_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * uint64 currentTime = 5; + * @return This builder for chaining. + */ + public Builder clearCurrentTime() { + bitField0_ = (bitField0_ & ~0x00000010); + currentTime_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object grabToken_ = ""; + /** + * string grabToken = 6; + * @return The grabToken. + */ + public java.lang.String getGrabToken() { + java.lang.Object ref = grabToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + grabToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string grabToken = 6; + * @return The bytes for grabToken. + */ + public com.google.protobuf.ByteString + getGrabTokenBytes() { + java.lang.Object ref = grabToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + grabToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string grabToken = 6; + * @param value The grabToken to set. + * @return This builder for chaining. + */ + public Builder setGrabToken( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + grabToken_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * string grabToken = 6; + * @return This builder for chaining. + */ + public Builder clearGrabToken() { + grabToken_ = getDefaultInstance().getGrabToken(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * string grabToken = 6; + * @param value The bytes for grabToken to set. + * @return This builder for chaining. + */ + public Builder setGrabTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + grabToken_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private boolean needSendRequest_ ; + /** + * bool needSendRequest = 7; + * @return The needSendRequest. + */ + @java.lang.Override + public boolean getNeedSendRequest() { + return needSendRequest_; + } + /** + * bool needSendRequest = 7; + * @param value The needSendRequest to set. + * @return This builder for chaining. + */ + public Builder setNeedSendRequest(boolean value) { + + needSendRequest_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * bool needSendRequest = 7; + * @return This builder for chaining. + */ + public Builder clearNeedSendRequest() { + bitField0_ = (bitField0_ & ~0x00000040); + needSendRequest_ = false; + onChanged(); + return this; + } + + private long requestDelayMillis_ ; + /** + * uint64 requestDelayMillis = 8; + * @return The requestDelayMillis. + */ + @java.lang.Override + public long getRequestDelayMillis() { + return requestDelayMillis_; + } + /** + * uint64 requestDelayMillis = 8; + * @param value The requestDelayMillis to set. + * @return This builder for chaining. + */ + public Builder setRequestDelayMillis(long value) { + + requestDelayMillis_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * uint64 requestDelayMillis = 8; + * @return This builder for chaining. + */ + public Builder clearRequestDelayMillis() { + bitField0_ = (bitField0_ & ~0x00000080); + requestDelayMillis_ = 0L; + onChanged(); + return this; + } + + private long luckiestDelayMillis_ ; + /** + * uint64 luckiestDelayMillis = 9; + * @return The luckiestDelayMillis. + */ + @java.lang.Override + public long getLuckiestDelayMillis() { + return luckiestDelayMillis_; + } + /** + * uint64 luckiestDelayMillis = 9; + * @param value The luckiestDelayMillis to set. + * @return This builder for chaining. + */ + public Builder setLuckiestDelayMillis(long value) { + + luckiestDelayMillis_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * uint64 luckiestDelayMillis = 9; + * @return This builder for chaining. + */ + public Builder clearLuckiestDelayMillis() { + bitField0_ = (bitField0_ & ~0x00000100); + luckiestDelayMillis_ = 0L; + onChanged(); + return this; + } + + private int coverType_ = 0; + /** + * .WebRedPackCoverType coverType = 10; + * @return The enum numeric value on the wire for coverType. + */ + @java.lang.Override public int getCoverTypeValue() { + return coverType_; + } + /** + * .WebRedPackCoverType coverType = 10; + * @param value The enum numeric value on the wire for coverType to set. + * @return This builder for chaining. + */ + public Builder setCoverTypeValue(int value) { + coverType_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .WebRedPackCoverType coverType = 10; + * @return The coverType. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.WebRedPackCoverType getCoverType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.WebRedPackCoverType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.WebRedPackCoverType.forNumber(coverType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.WebRedPackCoverType.UNRECOGNIZED : result; + } + /** + * .WebRedPackCoverType coverType = 10; + * @param value The coverType to set. + * @return This builder for chaining. + */ + public Builder setCoverType(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.WebRedPackCoverType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + coverType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .WebRedPackCoverType coverType = 10; + * @return This builder for chaining. + */ + public Builder clearCoverType() { + bitField0_ = (bitField0_ & ~0x00000200); + coverType_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:WebRedPackInfo) + } + + // @@protoc_insertion_point(class_scope:WebRedPackInfo) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WebRedPackInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackInfoOuterClass.WebRedPackInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_WebRedPackInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_WebRedPackInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024WebRedPackInfo.proto\032\024SimpleUserInfo.p" + + "roto\032\031WebRedPackCoverType.proto\"\203\002\n\016WebR" + + "edPackInfo\022\n\n\002id\030\001 \001(\t\022\037\n\006author\030\002 \001(\0132\017" + + ".SimpleUserInfo\022\017\n\007balance\030\003 \001(\004\022\020\n\010open" + + "Time\030\004 \001(\004\022\023\n\013currentTime\030\005 \001(\004\022\021\n\tgrabT" + + "oken\030\006 \001(\t\022\027\n\017needSendRequest\030\007 \001(\010\022\032\n\022r" + + "equestDelayMillis\030\010 \001(\004\022\033\n\023luckiestDelay" + + "Millis\030\t \001(\004\022\'\n\tcoverType\030\n \001(\0162\024.WebRed" + + "PackCoverTypeB6\n4tech.ordinaryroad.live." + + "chat.client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.getDescriptor(), + }); + internal_static_WebRedPackInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_WebRedPackInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_WebRedPackInfo_descriptor, + new java.lang.String[] { "Id", "Author", "Balance", "OpenTime", "CurrentTime", "GrabToken", "NeedSendRequest", "RequestDelayMillis", "LuckiestDelayMillis", "CoverType", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebRedPackCoverTypeOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebShareFeedOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebShareFeedOuterClass.java new file mode 100644 index 0000000..97d7817 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebShareFeedOuterClass.java @@ -0,0 +1,1301 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: WebShareFeed.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class WebShareFeedOuterClass { + private WebShareFeedOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface WebShareFeedOrBuilder extends + // @@protoc_insertion_point(interface_extends:WebShareFeed) + com.google.protobuf.MessageOrBuilder { + + /** + * string id = 1; + * @return The id. + */ + java.lang.String getId(); + /** + * string id = 1; + * @return The bytes for id. + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser(); + /** + * .SimpleUserInfo user = 2; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder(); + + /** + * uint64 time = 3; + * @return The time. + */ + long getTime(); + + /** + * uint32 thirdPartyPlatform = 4; + * @return The thirdPartyPlatform. + */ + int getThirdPartyPlatform(); + + /** + * uint64 sortRank = 5; + * @return The sortRank. + */ + long getSortRank(); + + /** + * .WebLiveAssistantType liveAssistantType = 6; + * @return The enum numeric value on the wire for liveAssistantType. + */ + int getLiveAssistantTypeValue(); + /** + * .WebLiveAssistantType liveAssistantType = 6; + * @return The liveAssistantType. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType getLiveAssistantType(); + + /** + * string deviceHash = 7; + * @return The deviceHash. + */ + java.lang.String getDeviceHash(); + /** + * string deviceHash = 7; + * @return The bytes for deviceHash. + */ + com.google.protobuf.ByteString + getDeviceHashBytes(); + } + /** + * Protobuf type {@code WebShareFeed} + */ + public static final class WebShareFeed extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:WebShareFeed) + WebShareFeedOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebShareFeed.newBuilder() to construct. + private WebShareFeed(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WebShareFeed() { + id_ = ""; + liveAssistantType_ = 0; + deviceHash_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new WebShareFeed(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.internal_static_WebShareFeed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.internal_static_WebShareFeed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_FIELD_NUMBER = 2; + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo user_; + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser() { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + /** + * .SimpleUserInfo user = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder() { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + + public static final int TIME_FIELD_NUMBER = 3; + private long time_ = 0L; + /** + * uint64 time = 3; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + + public static final int THIRDPARTYPLATFORM_FIELD_NUMBER = 4; + private int thirdPartyPlatform_ = 0; + /** + * uint32 thirdPartyPlatform = 4; + * @return The thirdPartyPlatform. + */ + @java.lang.Override + public int getThirdPartyPlatform() { + return thirdPartyPlatform_; + } + + public static final int SORTRANK_FIELD_NUMBER = 5; + private long sortRank_ = 0L; + /** + * uint64 sortRank = 5; + * @return The sortRank. + */ + @java.lang.Override + public long getSortRank() { + return sortRank_; + } + + public static final int LIVEASSISTANTTYPE_FIELD_NUMBER = 6; + private int liveAssistantType_ = 0; + /** + * .WebLiveAssistantType liveAssistantType = 6; + * @return The enum numeric value on the wire for liveAssistantType. + */ + @java.lang.Override public int getLiveAssistantTypeValue() { + return liveAssistantType_; + } + /** + * .WebLiveAssistantType liveAssistantType = 6; + * @return The liveAssistantType. + */ + @java.lang.Override public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType getLiveAssistantType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.forNumber(liveAssistantType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.UNRECOGNIZED : result; + } + + public static final int DEVICEHASH_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object deviceHash_ = ""; + /** + * string deviceHash = 7; + * @return The deviceHash. + */ + @java.lang.Override + public java.lang.String getDeviceHash() { + java.lang.Object ref = deviceHash_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceHash_ = s; + return s; + } + } + /** + * string deviceHash = 7; + * @return The bytes for deviceHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeviceHashBytes() { + java.lang.Object ref = deviceHash_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceHash_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (user_ != null) { + output.writeMessage(2, getUser()); + } + if (time_ != 0L) { + output.writeUInt64(3, time_); + } + if (thirdPartyPlatform_ != 0) { + output.writeUInt32(4, thirdPartyPlatform_); + } + if (sortRank_ != 0L) { + output.writeUInt64(5, sortRank_); + } + if (liveAssistantType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.UNKNOWN_ASSISTANT_TYPE.getNumber()) { + output.writeEnum(6, liveAssistantType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceHash_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, deviceHash_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUser()); + } + if (time_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, time_); + } + if (thirdPartyPlatform_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, thirdPartyPlatform_); + } + if (sortRank_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(5, sortRank_); + } + if (liveAssistantType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.UNKNOWN_ASSISTANT_TYPE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(6, liveAssistantType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceHash_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, deviceHash_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed) obj; + + if (!getId() + .equals(other.getId())) return false; + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser() + .equals(other.getUser())) return false; + } + if (getTime() + != other.getTime()) return false; + if (getThirdPartyPlatform() + != other.getThirdPartyPlatform()) return false; + if (getSortRank() + != other.getSortRank()) return false; + if (liveAssistantType_ != other.liveAssistantType_) return false; + if (!getDeviceHash() + .equals(other.getDeviceHash())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTime()); + hash = (37 * hash) + THIRDPARTYPLATFORM_FIELD_NUMBER; + hash = (53 * hash) + getThirdPartyPlatform(); + hash = (37 * hash) + SORTRANK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSortRank()); + hash = (37 * hash) + LIVEASSISTANTTYPE_FIELD_NUMBER; + hash = (53 * hash) + liveAssistantType_; + hash = (37 * hash) + DEVICEHASH_FIELD_NUMBER; + hash = (53 * hash) + getDeviceHash().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code WebShareFeed} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:WebShareFeed) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.internal_static_WebShareFeed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.internal_static_WebShareFeed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + time_ = 0L; + thirdPartyPlatform_ = 0; + sortRank_ = 0L; + liveAssistantType_ = 0; + deviceHash_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.internal_static_WebShareFeed_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.user_ = userBuilder_ == null + ? user_ + : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.time_ = time_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.thirdPartyPlatform_ = thirdPartyPlatform_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.sortRank_ = sortRank_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.liveAssistantType_ = liveAssistantType_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.deviceHash_ = deviceHash_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (other.getTime() != 0L) { + setTime(other.getTime()); + } + if (other.getThirdPartyPlatform() != 0) { + setThirdPartyPlatform(other.getThirdPartyPlatform()); + } + if (other.getSortRank() != 0L) { + setSortRank(other.getSortRank()); + } + if (other.liveAssistantType_ != 0) { + setLiveAssistantTypeValue(other.getLiveAssistantTypeValue()); + } + if (!other.getDeviceHash().isEmpty()) { + deviceHash_ = other.deviceHash_; + bitField0_ |= 0x00000040; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getUserFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + time_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + thirdPartyPlatform_ = input.readUInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + sortRank_ = input.readUInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + liveAssistantType_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: { + deviceHash_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string id = 1; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo user_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder> userBuilder_; + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser() { + if (userBuilder_ == null) { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder setUser(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder setUser( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder mergeUser(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + user_ != null && + user_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000002); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder getUserBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * .SimpleUserInfo user = 2; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + } + /** + * .SimpleUserInfo user = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + + private long time_ ; + /** + * uint64 time = 3; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + /** + * uint64 time = 3; + * @param value The time to set. + * @return This builder for chaining. + */ + public Builder setTime(long value) { + + time_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 time = 3; + * @return This builder for chaining. + */ + public Builder clearTime() { + bitField0_ = (bitField0_ & ~0x00000004); + time_ = 0L; + onChanged(); + return this; + } + + private int thirdPartyPlatform_ ; + /** + * uint32 thirdPartyPlatform = 4; + * @return The thirdPartyPlatform. + */ + @java.lang.Override + public int getThirdPartyPlatform() { + return thirdPartyPlatform_; + } + /** + * uint32 thirdPartyPlatform = 4; + * @param value The thirdPartyPlatform to set. + * @return This builder for chaining. + */ + public Builder setThirdPartyPlatform(int value) { + + thirdPartyPlatform_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * uint32 thirdPartyPlatform = 4; + * @return This builder for chaining. + */ + public Builder clearThirdPartyPlatform() { + bitField0_ = (bitField0_ & ~0x00000008); + thirdPartyPlatform_ = 0; + onChanged(); + return this; + } + + private long sortRank_ ; + /** + * uint64 sortRank = 5; + * @return The sortRank. + */ + @java.lang.Override + public long getSortRank() { + return sortRank_; + } + /** + * uint64 sortRank = 5; + * @param value The sortRank to set. + * @return This builder for chaining. + */ + public Builder setSortRank(long value) { + + sortRank_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * uint64 sortRank = 5; + * @return This builder for chaining. + */ + public Builder clearSortRank() { + bitField0_ = (bitField0_ & ~0x00000010); + sortRank_ = 0L; + onChanged(); + return this; + } + + private int liveAssistantType_ = 0; + /** + * .WebLiveAssistantType liveAssistantType = 6; + * @return The enum numeric value on the wire for liveAssistantType. + */ + @java.lang.Override public int getLiveAssistantTypeValue() { + return liveAssistantType_; + } + /** + * .WebLiveAssistantType liveAssistantType = 6; + * @param value The enum numeric value on the wire for liveAssistantType to set. + * @return This builder for chaining. + */ + public Builder setLiveAssistantTypeValue(int value) { + liveAssistantType_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * .WebLiveAssistantType liveAssistantType = 6; + * @return The liveAssistantType. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType getLiveAssistantType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.forNumber(liveAssistantType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.UNRECOGNIZED : result; + } + /** + * .WebLiveAssistantType liveAssistantType = 6; + * @param value The liveAssistantType to set. + * @return This builder for chaining. + */ + public Builder setLiveAssistantType(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + liveAssistantType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .WebLiveAssistantType liveAssistantType = 6; + * @return This builder for chaining. + */ + public Builder clearLiveAssistantType() { + bitField0_ = (bitField0_ & ~0x00000020); + liveAssistantType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object deviceHash_ = ""; + /** + * string deviceHash = 7; + * @return The deviceHash. + */ + public java.lang.String getDeviceHash() { + java.lang.Object ref = deviceHash_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceHash_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string deviceHash = 7; + * @return The bytes for deviceHash. + */ + public com.google.protobuf.ByteString + getDeviceHashBytes() { + java.lang.Object ref = deviceHash_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceHash_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string deviceHash = 7; + * @param value The deviceHash to set. + * @return This builder for chaining. + */ + public Builder setDeviceHash( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + deviceHash_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * string deviceHash = 7; + * @return This builder for chaining. + */ + public Builder clearDeviceHash() { + deviceHash_ = getDefaultInstance().getDeviceHash(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * string deviceHash = 7; + * @param value The bytes for deviceHash to set. + * @return This builder for chaining. + */ + public Builder setDeviceHashBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + deviceHash_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:WebShareFeed) + } + + // @@protoc_insertion_point(class_scope:WebShareFeed) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WebShareFeed parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebShareFeedOuterClass.WebShareFeed getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_WebShareFeed_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_WebShareFeed_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\022WebShareFeed.proto\032\024SimpleUserInfo.pro" + + "to\032\032WebLiveAssistantType.proto\"\273\001\n\014WebSh" + + "areFeed\022\n\n\002id\030\001 \001(\t\022\035\n\004user\030\002 \001(\0132\017.Simp" + + "leUserInfo\022\014\n\004time\030\003 \001(\004\022\032\n\022thirdPartyPl" + + "atform\030\004 \001(\r\022\020\n\010sortRank\030\005 \001(\004\0220\n\021liveAs" + + "sistantType\030\006 \001(\0162\025.WebLiveAssistantType" + + "\022\022\n\ndeviceHash\030\007 \001(\tB6\n4tech.ordinaryroa" + + "d.live.chat.client.kuaishou.protobufb\006pr" + + "oto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.getDescriptor(), + }); + internal_static_WebShareFeed_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_WebShareFeed_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_WebShareFeed_descriptor, + new java.lang.String[] { "Id", "User", "Time", "ThirdPartyPlatform", "SortRank", "LiveAssistantType", "DeviceHash", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebSystemNoticeFeedOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebSystemNoticeFeedOuterClass.java new file mode 100644 index 0000000..b633443 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebSystemNoticeFeedOuterClass.java @@ -0,0 +1,1427 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: WebSystemNoticeFeed.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class WebSystemNoticeFeedOuterClass { + private WebSystemNoticeFeedOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface WebSystemNoticeFeedOrBuilder extends + // @@protoc_insertion_point(interface_extends:WebSystemNoticeFeed) + com.google.protobuf.MessageOrBuilder { + + /** + * string id = 1; + * @return The id. + */ + java.lang.String getId(); + /** + * string id = 1; + * @return The bytes for id. + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser(); + /** + * .SimpleUserInfo user = 2; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder(); + + /** + * uint64 time = 3; + * @return The time. + */ + long getTime(); + + /** + * string content = 4; + * @return The content. + */ + java.lang.String getContent(); + /** + * string content = 4; + * @return The bytes for content. + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + * uint64 displayDuration = 5; + * @return The displayDuration. + */ + long getDisplayDuration(); + + /** + * uint64 sortRank = 6; + * @return The sortRank. + */ + long getSortRank(); + + /** + * .WebSystemNoticeFeed.DisplayType displayType = 7; + * @return The enum numeric value on the wire for displayType. + */ + int getDisplayTypeValue(); + /** + * .WebSystemNoticeFeed.DisplayType displayType = 7; + * @return The displayType. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.DisplayType getDisplayType(); + } + /** + * Protobuf type {@code WebSystemNoticeFeed} + */ + public static final class WebSystemNoticeFeed extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:WebSystemNoticeFeed) + WebSystemNoticeFeedOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebSystemNoticeFeed.newBuilder() to construct. + private WebSystemNoticeFeed(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WebSystemNoticeFeed() { + id_ = ""; + content_ = ""; + displayType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new WebSystemNoticeFeed(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.internal_static_WebSystemNoticeFeed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.internal_static_WebSystemNoticeFeed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.Builder.class); + } + + /** + * Protobuf enum {@code WebSystemNoticeFeed.DisplayType} + */ + public enum DisplayType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN_DISPLAY_TYPE = 0; + */ + UNKNOWN_DISPLAY_TYPE(0), + /** + * COMMENT = 1; + */ + COMMENT(1), + /** + * ALERT = 2; + */ + ALERT(2), + /** + * TOAST = 3; + */ + TOAST(3), + UNRECOGNIZED(-1), + ; + + /** + * UNKNOWN_DISPLAY_TYPE = 0; + */ + public static final int UNKNOWN_DISPLAY_TYPE_VALUE = 0; + /** + * COMMENT = 1; + */ + public static final int COMMENT_VALUE = 1; + /** + * ALERT = 2; + */ + public static final int ALERT_VALUE = 2; + /** + * TOAST = 3; + */ + public static final int TOAST_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DisplayType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static DisplayType forNumber(int value) { + switch (value) { + case 0: return UNKNOWN_DISPLAY_TYPE; + case 1: return COMMENT; + case 2: return ALERT; + case 3: return TOAST; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + DisplayType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DisplayType findValueByNumber(int number) { + return DisplayType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.getDescriptor().getEnumTypes().get(0); + } + + private static final DisplayType[] VALUES = values(); + + public static DisplayType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private DisplayType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:WebSystemNoticeFeed.DisplayType) + } + + public static final int ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_FIELD_NUMBER = 2; + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo user_; + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser() { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + /** + * .SimpleUserInfo user = 2; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder() { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + + public static final int TIME_FIELD_NUMBER = 3; + private long time_ = 0L; + /** + * uint64 time = 3; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + + public static final int CONTENT_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + /** + * string content = 4; + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 4; + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAYDURATION_FIELD_NUMBER = 5; + private long displayDuration_ = 0L; + /** + * uint64 displayDuration = 5; + * @return The displayDuration. + */ + @java.lang.Override + public long getDisplayDuration() { + return displayDuration_; + } + + public static final int SORTRANK_FIELD_NUMBER = 6; + private long sortRank_ = 0L; + /** + * uint64 sortRank = 6; + * @return The sortRank. + */ + @java.lang.Override + public long getSortRank() { + return sortRank_; + } + + public static final int DISPLAYTYPE_FIELD_NUMBER = 7; + private int displayType_ = 0; + /** + * .WebSystemNoticeFeed.DisplayType displayType = 7; + * @return The enum numeric value on the wire for displayType. + */ + @java.lang.Override public int getDisplayTypeValue() { + return displayType_; + } + /** + * .WebSystemNoticeFeed.DisplayType displayType = 7; + * @return The displayType. + */ + @java.lang.Override public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.DisplayType getDisplayType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.DisplayType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.DisplayType.forNumber(displayType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.DisplayType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (user_ != null) { + output.writeMessage(2, getUser()); + } + if (time_ != 0L) { + output.writeUInt64(3, time_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, content_); + } + if (displayDuration_ != 0L) { + output.writeUInt64(5, displayDuration_); + } + if (sortRank_ != 0L) { + output.writeUInt64(6, sortRank_); + } + if (displayType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.DisplayType.UNKNOWN_DISPLAY_TYPE.getNumber()) { + output.writeEnum(7, displayType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUser()); + } + if (time_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, time_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, content_); + } + if (displayDuration_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(5, displayDuration_); + } + if (sortRank_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(6, sortRank_); + } + if (displayType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.DisplayType.UNKNOWN_DISPLAY_TYPE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(7, displayType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed) obj; + + if (!getId() + .equals(other.getId())) return false; + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser() + .equals(other.getUser())) return false; + } + if (getTime() + != other.getTime()) return false; + if (!getContent() + .equals(other.getContent())) return false; + if (getDisplayDuration() + != other.getDisplayDuration()) return false; + if (getSortRank() + != other.getSortRank()) return false; + if (displayType_ != other.displayType_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTime()); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + DISPLAYDURATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDisplayDuration()); + hash = (37 * hash) + SORTRANK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSortRank()); + hash = (37 * hash) + DISPLAYTYPE_FIELD_NUMBER; + hash = (53 * hash) + displayType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code WebSystemNoticeFeed} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:WebSystemNoticeFeed) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.internal_static_WebSystemNoticeFeed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.internal_static_WebSystemNoticeFeed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + time_ = 0L; + content_ = ""; + displayDuration_ = 0L; + sortRank_ = 0L; + displayType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.internal_static_WebSystemNoticeFeed_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.user_ = userBuilder_ == null + ? user_ + : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.time_ = time_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.content_ = content_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.displayDuration_ = displayDuration_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.sortRank_ = sortRank_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.displayType_ = displayType_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (other.getTime() != 0L) { + setTime(other.getTime()); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getDisplayDuration() != 0L) { + setDisplayDuration(other.getDisplayDuration()); + } + if (other.getSortRank() != 0L) { + setSortRank(other.getSortRank()); + } + if (other.displayType_ != 0) { + setDisplayTypeValue(other.getDisplayTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getUserFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + time_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: { + displayDuration_ = input.readUInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + sortRank_ = input.readUInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + displayType_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string id = 1; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo user_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder> userBuilder_; + /** + * .SimpleUserInfo user = 2; + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .SimpleUserInfo user = 2; + * @return The user. + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser() { + if (userBuilder_ == null) { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder setUser(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder setUser( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder mergeUser(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + user_ != null && + user_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000002); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 2; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder getUserBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * .SimpleUserInfo user = 2; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + } + /** + * .SimpleUserInfo user = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + + private long time_ ; + /** + * uint64 time = 3; + * @return The time. + */ + @java.lang.Override + public long getTime() { + return time_; + } + /** + * uint64 time = 3; + * @param value The time to set. + * @return This builder for chaining. + */ + public Builder setTime(long value) { + + time_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 time = 3; + * @return This builder for chaining. + */ + public Builder clearTime() { + bitField0_ = (bitField0_ & ~0x00000004); + time_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object content_ = ""; + /** + * string content = 4; + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 4; + * @return The bytes for content. + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 4; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + content_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * string content = 4; + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * string content = 4; + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private long displayDuration_ ; + /** + * uint64 displayDuration = 5; + * @return The displayDuration. + */ + @java.lang.Override + public long getDisplayDuration() { + return displayDuration_; + } + /** + * uint64 displayDuration = 5; + * @param value The displayDuration to set. + * @return This builder for chaining. + */ + public Builder setDisplayDuration(long value) { + + displayDuration_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * uint64 displayDuration = 5; + * @return This builder for chaining. + */ + public Builder clearDisplayDuration() { + bitField0_ = (bitField0_ & ~0x00000010); + displayDuration_ = 0L; + onChanged(); + return this; + } + + private long sortRank_ ; + /** + * uint64 sortRank = 6; + * @return The sortRank. + */ + @java.lang.Override + public long getSortRank() { + return sortRank_; + } + /** + * uint64 sortRank = 6; + * @param value The sortRank to set. + * @return This builder for chaining. + */ + public Builder setSortRank(long value) { + + sortRank_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * uint64 sortRank = 6; + * @return This builder for chaining. + */ + public Builder clearSortRank() { + bitField0_ = (bitField0_ & ~0x00000020); + sortRank_ = 0L; + onChanged(); + return this; + } + + private int displayType_ = 0; + /** + * .WebSystemNoticeFeed.DisplayType displayType = 7; + * @return The enum numeric value on the wire for displayType. + */ + @java.lang.Override public int getDisplayTypeValue() { + return displayType_; + } + /** + * .WebSystemNoticeFeed.DisplayType displayType = 7; + * @param value The enum numeric value on the wire for displayType to set. + * @return This builder for chaining. + */ + public Builder setDisplayTypeValue(int value) { + displayType_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .WebSystemNoticeFeed.DisplayType displayType = 7; + * @return The displayType. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.DisplayType getDisplayType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.DisplayType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.DisplayType.forNumber(displayType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.DisplayType.UNRECOGNIZED : result; + } + /** + * .WebSystemNoticeFeed.DisplayType displayType = 7; + * @param value The displayType to set. + * @return This builder for chaining. + */ + public Builder setDisplayType(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed.DisplayType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + displayType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .WebSystemNoticeFeed.DisplayType displayType = 7; + * @return This builder for chaining. + */ + public Builder clearDisplayType() { + bitField0_ = (bitField0_ & ~0x00000040); + displayType_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:WebSystemNoticeFeed) + } + + // @@protoc_insertion_point(class_scope:WebSystemNoticeFeed) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WebSystemNoticeFeed parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebSystemNoticeFeedOuterClass.WebSystemNoticeFeed getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_WebSystemNoticeFeed_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_WebSystemNoticeFeed_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\031WebSystemNoticeFeed.proto\032\024SimpleUserI" + + "nfo.proto\"\215\002\n\023WebSystemNoticeFeed\022\n\n\002id\030" + + "\001 \001(\t\022\035\n\004user\030\002 \001(\0132\017.SimpleUserInfo\022\014\n\004" + + "time\030\003 \001(\004\022\017\n\007content\030\004 \001(\t\022\027\n\017displayDu" + + "ration\030\005 \001(\004\022\020\n\010sortRank\030\006 \001(\004\0225\n\013displa" + + "yType\030\007 \001(\0162 .WebSystemNoticeFeed.Displa" + + "yType\"J\n\013DisplayType\022\030\n\024UNKNOWN_DISPLAY_" + + "TYPE\020\000\022\013\n\007COMMENT\020\001\022\t\n\005ALERT\020\002\022\t\n\005TOAST\020" + + "\003B6\n4tech.ordinaryroad.live.chat.client." + + "kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.getDescriptor(), + }); + internal_static_WebSystemNoticeFeed_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_WebSystemNoticeFeed_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_WebSystemNoticeFeed_descriptor, + new java.lang.String[] { "Id", "User", "Time", "Content", "DisplayDuration", "SortRank", "DisplayType", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebUserPauseTypeOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebUserPauseTypeOuterClass.java new file mode 100644 index 0000000..e86bfab --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebUserPauseTypeOuterClass.java @@ -0,0 +1,170 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: WebUserPauseType.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class WebUserPauseTypeOuterClass { + private WebUserPauseTypeOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code WebUserPauseType} + */ + public enum WebUserPauseType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN_USER_PAUSE_TYPE = 0; + */ + UNKNOWN_USER_PAUSE_TYPE(0), + /** + * BACKGROUND = 1; + */ + BACKGROUND(1), + UNRECOGNIZED(-1), + ; + + /** + * UNKNOWN_USER_PAUSE_TYPE = 0; + */ + public static final int UNKNOWN_USER_PAUSE_TYPE_VALUE = 0; + /** + * BACKGROUND = 1; + */ + public static final int BACKGROUND_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static WebUserPauseType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static WebUserPauseType forNumber(int value) { + switch (value) { + case 0: return UNKNOWN_USER_PAUSE_TYPE; + case 1: return BACKGROUND; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + WebUserPauseType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public WebUserPauseType findValueByNumber(int number) { + return WebUserPauseType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebUserPauseTypeOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final WebUserPauseType[] VALUES = values(); + + public static WebUserPauseType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private WebUserPauseType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:WebUserPauseType) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026WebUserPauseType.proto*?\n\020WebUserPause" + + "Type\022\033\n\027UNKNOWN_USER_PAUSE_TYPE\020\000\022\016\n\nBAC" + + "KGROUND\020\001B6\n4tech.ordinaryroad.live.chat" + + ".client.kuaishou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebWatchingUserInfoOuterClass.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebWatchingUserInfoOuterClass.java new file mode 100644 index 0000000..15e9bb2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/java/tech/ordinaryroad/live/chat/client/kuaishou/protobuf/WebWatchingUserInfoOuterClass.java @@ -0,0 +1,1080 @@ +/* + * MIT License + * + * Copyright (c) 2023 OrdinaryRoad + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: WebWatchingUserInfo.proto + +package tech.ordinaryroad.live.chat.client.kuaishou.protobuf; + +public final class WebWatchingUserInfoOuterClass { + private WebWatchingUserInfoOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface WebWatchingUserInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:WebWatchingUserInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * .SimpleUserInfo user = 1; + * @return Whether the user field is set. + */ + boolean hasUser(); + /** + * .SimpleUserInfo user = 1; + * @return The user. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser(); + /** + * .SimpleUserInfo user = 1; + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder(); + + /** + * bool offline = 2; + * @return The offline. + */ + boolean getOffline(); + + /** + * bool tuhao = 3; + * @return The tuhao. + */ + boolean getTuhao(); + + /** + * .WebLiveAssistantType liveAssistantType = 4; + * @return The enum numeric value on the wire for liveAssistantType. + */ + int getLiveAssistantTypeValue(); + /** + * .WebLiveAssistantType liveAssistantType = 4; + * @return The liveAssistantType. + */ + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType getLiveAssistantType(); + + /** + * string displayKsCoin = 5; + * @return The displayKsCoin. + */ + java.lang.String getDisplayKsCoin(); + /** + * string displayKsCoin = 5; + * @return The bytes for displayKsCoin. + */ + com.google.protobuf.ByteString + getDisplayKsCoinBytes(); + } + /** + * Protobuf type {@code WebWatchingUserInfo} + */ + public static final class WebWatchingUserInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:WebWatchingUserInfo) + WebWatchingUserInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebWatchingUserInfo.newBuilder() to construct. + private WebWatchingUserInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WebWatchingUserInfo() { + liveAssistantType_ = 0; + displayKsCoin_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new WebWatchingUserInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.internal_static_WebWatchingUserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.internal_static_WebWatchingUserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.Builder.class); + } + + public static final int USER_FIELD_NUMBER = 1; + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo user_; + /** + * .SimpleUserInfo user = 1; + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + /** + * .SimpleUserInfo user = 1; + * @return The user. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser() { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + /** + * .SimpleUserInfo user = 1; + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder() { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + + public static final int OFFLINE_FIELD_NUMBER = 2; + private boolean offline_ = false; + /** + * bool offline = 2; + * @return The offline. + */ + @java.lang.Override + public boolean getOffline() { + return offline_; + } + + public static final int TUHAO_FIELD_NUMBER = 3; + private boolean tuhao_ = false; + /** + * bool tuhao = 3; + * @return The tuhao. + */ + @java.lang.Override + public boolean getTuhao() { + return tuhao_; + } + + public static final int LIVEASSISTANTTYPE_FIELD_NUMBER = 4; + private int liveAssistantType_ = 0; + /** + * .WebLiveAssistantType liveAssistantType = 4; + * @return The enum numeric value on the wire for liveAssistantType. + */ + @java.lang.Override public int getLiveAssistantTypeValue() { + return liveAssistantType_; + } + /** + * .WebLiveAssistantType liveAssistantType = 4; + * @return The liveAssistantType. + */ + @java.lang.Override public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType getLiveAssistantType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.forNumber(liveAssistantType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.UNRECOGNIZED : result; + } + + public static final int DISPLAYKSCOIN_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object displayKsCoin_ = ""; + /** + * string displayKsCoin = 5; + * @return The displayKsCoin. + */ + @java.lang.Override + public java.lang.String getDisplayKsCoin() { + java.lang.Object ref = displayKsCoin_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayKsCoin_ = s; + return s; + } + } + /** + * string displayKsCoin = 5; + * @return The bytes for displayKsCoin. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDisplayKsCoinBytes() { + java.lang.Object ref = displayKsCoin_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayKsCoin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (user_ != null) { + output.writeMessage(1, getUser()); + } + if (offline_ != false) { + output.writeBool(2, offline_); + } + if (tuhao_ != false) { + output.writeBool(3, tuhao_); + } + if (liveAssistantType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.UNKNOWN_ASSISTANT_TYPE.getNumber()) { + output.writeEnum(4, liveAssistantType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayKsCoin_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayKsCoin_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getUser()); + } + if (offline_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, offline_); + } + if (tuhao_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, tuhao_); + } + if (liveAssistantType_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.UNKNOWN_ASSISTANT_TYPE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, liveAssistantType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayKsCoin_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayKsCoin_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo)) { + return super.equals(obj); + } + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo other = (tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo) obj; + + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser() + .equals(other.getUser())) return false; + } + if (getOffline() + != other.getOffline()) return false; + if (getTuhao() + != other.getTuhao()) return false; + if (liveAssistantType_ != other.liveAssistantType_) return false; + if (!getDisplayKsCoin() + .equals(other.getDisplayKsCoin())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (37 * hash) + OFFLINE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getOffline()); + hash = (37 * hash) + TUHAO_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getTuhao()); + hash = (37 * hash) + LIVEASSISTANTTYPE_FIELD_NUMBER; + hash = (53 * hash) + liveAssistantType_; + hash = (37 * hash) + DISPLAYKSCOIN_FIELD_NUMBER; + hash = (53 * hash) + getDisplayKsCoin().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code WebWatchingUserInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:WebWatchingUserInfo) + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.internal_static_WebWatchingUserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.internal_static_WebWatchingUserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.class, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.Builder.class); + } + + // Construct using tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + offline_ = false; + tuhao_ = false; + liveAssistantType_ = 0; + displayKsCoin_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.internal_static_WebWatchingUserInfo_descriptor; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo getDefaultInstanceForType() { + return tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.getDefaultInstance(); + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo build() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo buildPartial() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo result = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.user_ = userBuilder_ == null + ? user_ + : userBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.offline_ = offline_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.tuhao_ = tuhao_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.liveAssistantType_ = liveAssistantType_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.displayKsCoin_ = displayKsCoin_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo) { + return mergeFrom((tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo other) { + if (other == tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo.getDefaultInstance()) return this; + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (other.getOffline() != false) { + setOffline(other.getOffline()); + } + if (other.getTuhao() != false) { + setTuhao(other.getTuhao()); + } + if (other.liveAssistantType_ != 0) { + setLiveAssistantTypeValue(other.getLiveAssistantTypeValue()); + } + if (!other.getDisplayKsCoin().isEmpty()) { + displayKsCoin_ = other.displayKsCoin_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getUserFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + offline_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + tuhao_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + liveAssistantType_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + displayKsCoin_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo user_; + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder> userBuilder_; + /** + * .SimpleUserInfo user = 1; + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .SimpleUserInfo user = 1; + * @return The user. + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo getUser() { + if (userBuilder_ == null) { + return user_ == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + /** + * .SimpleUserInfo user = 1; + */ + public Builder setUser(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 1; + */ + public Builder setUser( + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 1; + */ + public Builder mergeUser(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + user_ != null && + user_ != tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 1; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000001); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SimpleUserInfo user = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder getUserBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + /** + * .SimpleUserInfo user = 1; + */ + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.getDefaultInstance() : user_; + } + } + /** + * .SimpleUserInfo user = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfo.Builder, tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.SimpleUserInfoOrBuilder>( + getUser(), + getParentForChildren(), + isClean()); + user_ = null; + } + return userBuilder_; + } + + private boolean offline_ ; + /** + * bool offline = 2; + * @return The offline. + */ + @java.lang.Override + public boolean getOffline() { + return offline_; + } + /** + * bool offline = 2; + * @param value The offline to set. + * @return This builder for chaining. + */ + public Builder setOffline(boolean value) { + + offline_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * bool offline = 2; + * @return This builder for chaining. + */ + public Builder clearOffline() { + bitField0_ = (bitField0_ & ~0x00000002); + offline_ = false; + onChanged(); + return this; + } + + private boolean tuhao_ ; + /** + * bool tuhao = 3; + * @return The tuhao. + */ + @java.lang.Override + public boolean getTuhao() { + return tuhao_; + } + /** + * bool tuhao = 3; + * @param value The tuhao to set. + * @return This builder for chaining. + */ + public Builder setTuhao(boolean value) { + + tuhao_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * bool tuhao = 3; + * @return This builder for chaining. + */ + public Builder clearTuhao() { + bitField0_ = (bitField0_ & ~0x00000004); + tuhao_ = false; + onChanged(); + return this; + } + + private int liveAssistantType_ = 0; + /** + * .WebLiveAssistantType liveAssistantType = 4; + * @return The enum numeric value on the wire for liveAssistantType. + */ + @java.lang.Override public int getLiveAssistantTypeValue() { + return liveAssistantType_; + } + /** + * .WebLiveAssistantType liveAssistantType = 4; + * @param value The enum numeric value on the wire for liveAssistantType to set. + * @return This builder for chaining. + */ + public Builder setLiveAssistantTypeValue(int value) { + liveAssistantType_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .WebLiveAssistantType liveAssistantType = 4; + * @return The liveAssistantType. + */ + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType getLiveAssistantType() { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType result = tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.forNumber(liveAssistantType_); + return result == null ? tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType.UNRECOGNIZED : result; + } + /** + * .WebLiveAssistantType liveAssistantType = 4; + * @param value The liveAssistantType to set. + * @return This builder for chaining. + */ + public Builder setLiveAssistantType(tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.WebLiveAssistantType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + liveAssistantType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .WebLiveAssistantType liveAssistantType = 4; + * @return This builder for chaining. + */ + public Builder clearLiveAssistantType() { + bitField0_ = (bitField0_ & ~0x00000008); + liveAssistantType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object displayKsCoin_ = ""; + /** + * string displayKsCoin = 5; + * @return The displayKsCoin. + */ + public java.lang.String getDisplayKsCoin() { + java.lang.Object ref = displayKsCoin_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayKsCoin_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string displayKsCoin = 5; + * @return The bytes for displayKsCoin. + */ + public com.google.protobuf.ByteString + getDisplayKsCoinBytes() { + java.lang.Object ref = displayKsCoin_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayKsCoin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string displayKsCoin = 5; + * @param value The displayKsCoin to set. + * @return This builder for chaining. + */ + public Builder setDisplayKsCoin( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + displayKsCoin_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * string displayKsCoin = 5; + * @return This builder for chaining. + */ + public Builder clearDisplayKsCoin() { + displayKsCoin_ = getDefaultInstance().getDisplayKsCoin(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * string displayKsCoin = 5; + * @param value The bytes for displayKsCoin to set. + * @return This builder for chaining. + */ + public Builder setDisplayKsCoinBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + displayKsCoin_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:WebWatchingUserInfo) + } + + // @@protoc_insertion_point(class_scope:WebWatchingUserInfo) + private static final tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo(); + } + + public static tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WebWatchingUserInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebWatchingUserInfoOuterClass.WebWatchingUserInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_WebWatchingUserInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_WebWatchingUserInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\031WebWatchingUserInfo.proto\032\024SimpleUserI" + + "nfo.proto\032\032WebLiveAssistantType.proto\"\235\001" + + "\n\023WebWatchingUserInfo\022\035\n\004user\030\001 \001(\0132\017.Si" + + "mpleUserInfo\022\017\n\007offline\030\002 \001(\010\022\r\n\005tuhao\030\003" + + " \001(\010\0220\n\021liveAssistantType\030\004 \001(\0162\025.WebLiv" + + "eAssistantType\022\025\n\rdisplayKsCoin\030\005 \001(\tB6\n" + + "4tech.ordinaryroad.live.chat.client.kuai" + + "shou.protobufb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.getDescriptor(), + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.getDescriptor(), + }); + internal_static_WebWatchingUserInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_WebWatchingUserInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_WebWatchingUserInfo_descriptor, + new java.lang.String[] { "User", "Offline", "Tuhao", "LiveAssistantType", "DisplayKsCoin", }); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.SimpleUserInfoOuterClass.getDescriptor(); + tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebLiveAssistantTypeOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/AuditAudienceMask.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/AuditAudienceMask.proto new file mode 100644 index 0000000..8ffa40c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/AuditAudienceMask.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +import "LiveCdnNodeView.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message AuditAudienceMask { + repeated LiveCdnNodeView iconCdnNodeView = 1; + string title = 2; + string detail = 3; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSError.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSError.proto new file mode 100644 index 0000000..0e179c2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSError.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message CSError { + uint32 code = 1; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSHeartbeat.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSHeartbeat.proto new file mode 100644 index 0000000..0b37909 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSHeartbeat.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message CSHeartbeat { + uint64 timestamp = 1; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSPing.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSPing.proto new file mode 100644 index 0000000..a7b66fb --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSPing.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +import "ClientId.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message CSPing { + string echoData = 1; + ClientId clientId = 2; + string deviceId = 3; + string appVer = 4; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebEnterRoom.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebEnterRoom.proto new file mode 100644 index 0000000..3b88423 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebEnterRoom.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message CSWebEnterRoom { + string token = 1; + string liveStreamId = 2; + uint32 reconnectCount = 3; + uint32 lastErrorCode = 4; + string expTag = 5; + string attach = 6; + string pageId = 7; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebError.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebError.proto new file mode 100644 index 0000000..e49d4d4 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebError.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message CSWebError { + uint32 code = 1; + string msg = 2; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebHeartbeat.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebHeartbeat.proto new file mode 100644 index 0000000..bde6248 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebHeartbeat.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message CSWebHeartbeat { + uint64 timestamp = 1; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebUserExit.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebUserExit.proto new file mode 100644 index 0000000..348f3aa --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebUserExit.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message CSWebUserExit { + uint64 time = 1; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebUserPause.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebUserPause.proto new file mode 100644 index 0000000..5987e01 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/CSWebUserPause.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +import "WebUserPauseType.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message CSWebUserPause { + uint64 time = 1; + WebUserPauseType pauseType = 2; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ClientId.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ClientId.proto new file mode 100644 index 0000000..5ec34ad --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ClientId.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +enum ClientId { + NONE = 0; + IPHONE = 1; + ANDROID = 2; + WEB = 3; + PC = 6; + IPHONE_LIVE_MATE = 8; + ANDROID_LIVE_MATE = 9; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ConfigSwitchItem.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ConfigSwitchItem.proto new file mode 100644 index 0000000..efb3507 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ConfigSwitchItem.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +import "ConfigSwitchType.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message ConfigSwitchItem { + ConfigSwitchType configSwitchType = 1; + bool value = 2; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ConfigSwitchType.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ConfigSwitchType.proto new file mode 100644 index 0000000..3fa75b8 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/ConfigSwitchType.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +enum ConfigSwitchType { + UNKNOWN = 0; + HIDE_BARRAGE = 1; + HIDE_SPECIAL_EFFECT = 2; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/GzoneNameplate.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/GzoneNameplate.proto new file mode 100644 index 0000000..b8212e7 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/GzoneNameplate.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +import "PicUrl.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message GzoneNameplate { + int64 id = 1; + string name = 2; + repeated PicUrl urls = 3; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveAudienceState.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveAudienceState.proto new file mode 100644 index 0000000..79c0636 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveAudienceState.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +import "GzoneNameplate.proto"; +import "LiveFansGroupState.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message LiveAudienceState { + bool isFromFansTop = 1; + bool isKoi = 2; + AssistantType assistantType = 3; + uint32 fansGroupIntimacyLevel = 4; + GzoneNameplate nameplate = 5; + LiveFansGroupState liveFansGroupState = 6; + uint32 wealthGrade = 7; + string badgeKey = 8; + +enum AssistantType { + UNKNOWN_ASSISTANT_TYPE = 0; + SUPER = 1; + JUNIOR = 2; +} +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveCdnNodeView.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveCdnNodeView.proto new file mode 100644 index 0000000..495eb9e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveCdnNodeView.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message LiveCdnNodeView { + string cdn = 1; + string url = 2; + bool freeTraffic = 3; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveFansGroupState.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveFansGroupState.proto new file mode 100644 index 0000000..107d4fd --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/LiveFansGroupState.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message LiveFansGroupState { + uint32 intimacyLevel = 1; + uint32 enterRoomSpecialEffect = 2; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PSHostInfo.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PSHostInfo.proto new file mode 100644 index 0000000..1eb3042 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PSHostInfo.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message PSHostInfo { + string ip = 1; + int32 port = 2; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PayloadType.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PayloadType.proto new file mode 100644 index 0000000..05eafc2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PayloadType.proto @@ -0,0 +1,65 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +enum PayloadType { + UNKNOWN = 0; + CS_HEARTBEAT = 1; + CS_ERROR = 3; + CS_PING = 4; + PS_HOST_INFO = 51; + SC_HEARTBEAT_ACK = 101; + SC_ECHO = 102; + SC_ERROR = 103; + SC_PING_ACK = 104; + SC_INFO = 105; + CS_ENTER_ROOM = 200; + CS_USER_PAUSE = 201; + CS_USER_EXIT = 202; + CS_AUTHOR_PUSH_TRAFFIC_ZERO = 203; + CS_HORSE_RACING = 204; + CS_RACE_LOSE = 205; + CS_VOIP_SIGNAL = 206; + SC_ENTER_ROOM_ACK = 300; + SC_AUTHOR_PAUSE = 301; + SC_AUTHOR_RESUME = 302; + SC_AUTHOR_PUSH_TRAFFIC_ZERO = 303; + SC_AUTHOR_HEARTBEAT_MISS = 304; + SC_PIP_STARTED = 305; + SC_PIP_ENDED = 306; + SC_HORSE_RACING_ACK = 307; + SC_VOIP_SIGNAL = 308; + SC_FEED_PUSH = 310; + SC_ASSISTANT_STATUS = 311; + SC_REFRESH_WALLET = 312; + SC_LIVE_CHAT_CALL = 320; + SC_LIVE_CHAT_CALL_ACCEPTED = 321; + SC_LIVE_CHAT_CALL_REJECTED = 322; + SC_LIVE_CHAT_READY = 323; + SC_LIVE_CHAT_GUEST_END = 324; + SC_LIVE_CHAT_ENDED = 325; + SC_RENDERING_MAGIC_FACE_DISABLE = 326; + SC_RENDERING_MAGIC_FACE_ENABLE = 327; + SC_RED_PACK_FEED = 330; + SC_LIVE_WATCHING_LIST = 340; + SC_LIVE_QUIZ_QUESTION_ASKED = 350; + SC_LIVE_QUIZ_QUESTION_REVIEWED = 351; + SC_LIVE_QUIZ_SYNC = 352; + SC_LIVE_QUIZ_ENDED = 353; + SC_LIVE_QUIZ_WINNERS = 354; + SC_SUSPECTED_VIOLATION = 355; + SC_SHOP_OPENED = 360; + SC_SHOP_CLOSED = 361; + SC_GUESS_OPENED = 370; + SC_GUESS_CLOSED = 371; + SC_PK_INVITATION = 380; + SC_PK_STATISTIC = 381; + SC_RIDDLE_OPENED = 390; + SC_RIDDLE_CLOESED = 391; + SC_RIDE_CHANGED = 412; + SC_BET_CHANGED = 441; + SC_BET_CLOSED = 442; + SC_LIVE_SPECIAL_ACCOUNT_CONFIG_STATE = 645; + SC_LIVE_WARNING_MASK_STATUS_CHANGED_AUDIENCE = 758; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PicUrl.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PicUrl.proto new file mode 100644 index 0000000..891fea7 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/PicUrl.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message PicUrl { + string cdn = 1; + string url = 2; + string urlPattern = 3; + string ip = 4; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCEcho.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCEcho.proto new file mode 100644 index 0000000..6682ba6 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCEcho.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCEcho { + string content = 1; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCError.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCError.proto new file mode 100644 index 0000000..c901028 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCError.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCError { + uint32 code = 1; + string msg = 2; + uint32 subCode = 3; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCHeartbeatAck.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCHeartbeatAck.proto new file mode 100644 index 0000000..9242e93 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCHeartbeatAck.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCHeartbeatAck { + uint64 timestamp = 1; + uint64 clientTimestamp = 2; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCInfo.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCInfo.proto new file mode 100644 index 0000000..3099f77 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCInfo.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCInfo { + uint32 code = 1; + string msg = 2; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCLiveWarningMaskStatusChangedAudience.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCLiveWarningMaskStatusChangedAudience.proto new file mode 100644 index 0000000..ebceb65 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCLiveWarningMaskStatusChangedAudience.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +import "AuditAudienceMask.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCLiveWarningMaskStatusChangedAudience { + bool displayMask = 1; + AuditAudienceMask warningMask = 2; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCPingAck.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCPingAck.proto new file mode 100644 index 0000000..202a86a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCPingAck.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCPingAck { + string echoData = 1; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebAuthorPause.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebAuthorPause.proto new file mode 100644 index 0000000..7beb4e6 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebAuthorPause.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +import "WebPauseType.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebAuthorPause { + uint64 time = 1; + WebPauseType pauseType = 2; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebAuthorResume.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebAuthorResume.proto new file mode 100644 index 0000000..fdeae3a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebAuthorResume.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebAuthorResume { + uint64 time = 1; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebBetChanged.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebBetChanged.proto new file mode 100644 index 0000000..a8b58cb --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebBetChanged.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebBetChanged { + uint64 maxDelayMillis = 1; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebBetClosed.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebBetClosed.proto new file mode 100644 index 0000000..dec4c1d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebBetClosed.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebBetClosed { + uint64 maxDelayMillis = 1; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebCurrentRedPackFeed.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebCurrentRedPackFeed.proto new file mode 100644 index 0000000..64b9a41 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebCurrentRedPackFeed.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +import "WebRedPackInfo.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebCurrentRedPackFeed { + repeated WebRedPackInfo redPack = 1; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebEnterRoomAck.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebEnterRoomAck.proto new file mode 100644 index 0000000..8885071 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebEnterRoomAck.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebEnterRoomAck { + uint64 minReconnectMs = 1; + uint64 maxReconnectMs = 2; + uint64 heartbeatIntervalMs = 3; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebError.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebError.proto new file mode 100644 index 0000000..7bc8644 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebError.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebError { + uint32 code = 1; + string msg = 2; + uint32 subCode = 3; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebFeedPush.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebFeedPush.proto new file mode 100644 index 0000000..c7c41d1 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebFeedPush.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +import "WebCommentFeed.proto"; +import "WebComboCommentFeed.proto"; +import "WebLikeFeed.proto"; +import "WebGiftFeed.proto"; +import "WebSystemNoticeFeed.proto"; +import "WebShareFeed.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebFeedPush { + string displayWatchingCount = 1; + string displayLikeCount = 2; + uint64 pendingLikeCount = 3; + uint64 pushInterval = 4; + repeated WebCommentFeed commentFeeds = 5; + string commentCursor = 6; + repeated WebComboCommentFeed comboCommentFeed = 7; + repeated WebLikeFeed likeFeeds = 8; + repeated WebGiftFeed giftFeeds = 9; + string giftCursor = 10; + repeated WebSystemNoticeFeed systemNoticeFeeds = 11; + repeated WebShareFeed shareFeeds = 12; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebGuessClosed.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebGuessClosed.proto new file mode 100644 index 0000000..53e3f63 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebGuessClosed.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebGuessClosed { + uint64 time = 1; + string guessId = 2; + uint64 displayMaxDelayMillis = 3; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebGuessOpened.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebGuessOpened.proto new file mode 100644 index 0000000..d46f065 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebGuessOpened.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebGuessOpened { + uint64 time = 1; + string guessId = 2; + uint64 submitDeadline = 3; + uint64 displayMaxDelayMillis = 4; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebHeartbeatAck.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebHeartbeatAck.proto new file mode 100644 index 0000000..6a6e32b --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebHeartbeatAck.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebHeartbeatAck { + uint64 timestamp = 1; + uint64 clientTimestamp = 2; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebLiveSpecialAccountConfigState.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebLiveSpecialAccountConfigState.proto new file mode 100644 index 0000000..bd2b5fe --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebLiveSpecialAccountConfigState.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +import "ConfigSwitchItem.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebLiveSpecialAccountConfigState { + repeated ConfigSwitchItem configSwitchItem = 1; + uint64 timestamp = 2; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebLiveWatchingUsers.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebLiveWatchingUsers.proto new file mode 100644 index 0000000..c838173 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebLiveWatchingUsers.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +import "WebWatchingUserInfo.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebLiveWatchingUsers { + repeated WebWatchingUserInfo watchingUser = 1; + string displayWatchingCount = 2; + uint64 pendingDuration = 3; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebPipEnded.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebPipEnded.proto new file mode 100644 index 0000000..1fb073d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebPipEnded.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebPipEnded { + uint64 time = 1; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebPipStarted.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebPipStarted.proto new file mode 100644 index 0000000..5693a3d --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebPipStarted.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebPipStarted { + uint64 time = 1; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebRefreshWallet.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebRefreshWallet.proto new file mode 100644 index 0000000..f51c539 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebRefreshWallet.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebRefreshWallet { + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebRideChanged.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebRideChanged.proto new file mode 100644 index 0000000..2c31e7b --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebRideChanged.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebRideChanged { + string rideId = 1; + uint32 requestMaxDelayMillis = 2; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebSuspectedViolation.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebSuspectedViolation.proto new file mode 100644 index 0000000..a254104 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SCWebSuspectedViolation.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SCWebSuspectedViolation { + bool suspectedViolation = 1; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SimpleUserInfo.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SimpleUserInfo.proto new file mode 100644 index 0000000..cff3fea --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SimpleUserInfo.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SimpleUserInfo { + string principalId = 1; + string userName = 2; + string headUrl = 3; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SocketMessage.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SocketMessage.proto new file mode 100644 index 0000000..f75cfed --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/SocketMessage.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +import "PayloadType.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message SocketMessage { + PayloadType payloadType = 1; + CompressionType compressionType = 2; + bytes payload = 3; + +enum CompressionType { + UNKNOWN = 0; + NONE = 1; + GZIP = 2; + AES = 3; +} +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/UserInfo.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/UserInfo.proto new file mode 100644 index 0000000..5609492 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/UserInfo.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +import "PicUrl.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message UserInfo { + uint64 userId = 1; + string userName = 2; + string userGender = 3; + string userText = 4; + repeated PicUrl headUrls = 5; + bool verified = 6; + string sUserId = 7; + repeated PicUrl httpsHeadUrls = 8; + string kwaiId = 9; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebComboCommentFeed.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebComboCommentFeed.proto new file mode 100644 index 0000000..1ee68ca --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebComboCommentFeed.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message WebComboCommentFeed { + string id = 1; + string content = 2; + uint32 comboCount = 3; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebCommentFeed.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebCommentFeed.proto new file mode 100644 index 0000000..19c776b --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebCommentFeed.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +import "SimpleUserInfo.proto"; +import "WebCommentFeedShowType.proto"; +import "LiveAudienceState.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message WebCommentFeed { + string id = 1; + SimpleUserInfo user = 2; + string content = 3; + string deviceHash = 4; + uint64 sortRank = 5; + string color = 6; + WebCommentFeedShowType showType = 7; + LiveAudienceState senderState = 8; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebCommentFeedShowType.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebCommentFeedShowType.proto new file mode 100644 index 0000000..7f11ee4 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebCommentFeedShowType.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +enum WebCommentFeedShowType { + FEED_SHOW_UNKNOWN = 0; + FEED_SHOW_NORMAL = 1; + FEED_HIDDEN = 2; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebGiftFeed.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebGiftFeed.proto new file mode 100644 index 0000000..0ff3c6c --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebGiftFeed.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +import "SimpleUserInfo.proto"; +import "WebLiveAssistantType.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message WebGiftFeed { + string id = 1; + SimpleUserInfo user = 2; + uint64 time = 3; + uint32 intGiftId = 4; + uint64 sortRank = 5; + string mergeKey = 6; + uint32 batchSize = 7; + uint32 comboCount = 8; + uint32 rank = 9; + uint64 expireDuration = 10; + uint64 clientTimestamp = 11; + uint64 slotDisplayDuration = 12; + uint32 starLevel = 13; + StyleType styleType = 14; + WebLiveAssistantType liveAssistantType = 15; + string deviceHash = 16; + bool danmakuDisplay = 17; + +enum StyleType { + UNKNOWN_STYLE = 0; + BATCH_STAR_0 = 1; + BATCH_STAR_1 = 2; + BATCH_STAR_2 = 3; + BATCH_STAR_3 = 4; + BATCH_STAR_4 = 5; + BATCH_STAR_5 = 6; + BATCH_STAR_6 = 7; +} +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebLikeFeed.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebLikeFeed.proto new file mode 100644 index 0000000..ebcd99e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebLikeFeed.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +import "SimpleUserInfo.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message WebLikeFeed { + string id = 1; + SimpleUserInfo user = 2; + uint64 sortRank = 3; + string deviceHash = 4; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebLiveAssistantType.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebLiveAssistantType.proto new file mode 100644 index 0000000..dc7c85f --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebLiveAssistantType.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +enum WebLiveAssistantType { + UNKNOWN_ASSISTANT_TYPE = 0; + SUPER = 1; + JUNIOR = 2; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebPauseType.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebPauseType.proto new file mode 100644 index 0000000..c190e09 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebPauseType.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +enum WebPauseType { + UNKNOWN_PAUSE_TYPE = 0; + TELEPHONE = 1; + SHARE = 2; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebRedPackCoverType.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebRedPackCoverType.proto new file mode 100644 index 0000000..25bc6a5 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebRedPackCoverType.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +enum WebRedPackCoverType { + UNKNOWN_COVER_TYPE = 0; + NORMAL_COVER = 1; + PRETTY_COVER = 2; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebRedPackInfo.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebRedPackInfo.proto new file mode 100644 index 0000000..c99aac4 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebRedPackInfo.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +import "SimpleUserInfo.proto"; +import "WebRedPackCoverType.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message WebRedPackInfo { + string id = 1; + SimpleUserInfo author = 2; + uint64 balance = 3; + uint64 openTime = 4; + uint64 currentTime = 5; + string grabToken = 6; + bool needSendRequest = 7; + uint64 requestDelayMillis = 8; + uint64 luckiestDelayMillis = 9; + WebRedPackCoverType coverType = 10; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebShareFeed.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebShareFeed.proto new file mode 100644 index 0000000..9e829a3 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebShareFeed.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +import "SimpleUserInfo.proto"; +import "WebLiveAssistantType.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message WebShareFeed { + string id = 1; + SimpleUserInfo user = 2; + uint64 time = 3; + uint32 thirdPartyPlatform = 4; + uint64 sortRank = 5; + WebLiveAssistantType liveAssistantType = 6; + string deviceHash = 7; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebSystemNoticeFeed.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebSystemNoticeFeed.proto new file mode 100644 index 0000000..a6a5ae2 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebSystemNoticeFeed.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +import "SimpleUserInfo.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message WebSystemNoticeFeed { + string id = 1; + SimpleUserInfo user = 2; + uint64 time = 3; + string content = 4; + uint64 displayDuration = 5; + uint64 sortRank = 6; + DisplayType displayType = 7; + +enum DisplayType { + UNKNOWN_DISPLAY_TYPE = 0; + COMMENT = 1; + ALERT = 2; + TOAST = 3; +} +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebUserPauseType.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebUserPauseType.proto new file mode 100644 index 0000000..9f3d284 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebUserPauseType.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +enum WebUserPauseType { + UNKNOWN_USER_PAUSE_TYPE = 0; + BACKGROUND = 1; +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebWatchingUserInfo.proto b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebWatchingUserInfo.proto new file mode 100644 index 0000000..ad6a10a --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/main/resources/proto/WebWatchingUserInfo.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +import "SimpleUserInfo.proto"; +import "WebLiveAssistantType.proto"; + +option java_package = "tech.ordinaryroad.live.chat.client.kuaishou.protobuf"; + +message WebWatchingUserInfo { + SimpleUserInfo user = 1; + bool offline = 2; + bool tuhao = 3; + WebLiveAssistantType liveAssistantType = 4; + string displayKsCoin = 5; + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/test/java/tech/ordinaryroad/live/chat/client/kuaishou/api/KuaishouApisTest.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/test/java/tech/ordinaryroad/live/chat/client/kuaishou/api/KuaishouApisTest.java new file mode 100644 index 0000000..db2fa9e --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/test/java/tech/ordinaryroad/live/chat/client/kuaishou/api/KuaishouApisTest.java @@ -0,0 +1,40 @@ +package tech.ordinaryroad.live.chat.client.kuaishou.api; + +import org.junit.jupiter.api.Test; + +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +/** + * @author mjz + * @date 2024/1/6 + */ +class KuaishouApisTest { + + @Test + void allgifts() { + Map allgifts = KuaishouApis.allgifts(); + assertNotEquals(0, allgifts.size()); + } + + @Test + void getGiftInfoById() { + KuaishouApis.GiftInfo giftInfoById = KuaishouApis.getGiftInfoById("1"); + assertEquals("荧光棒", giftInfoById.getGiftName()); + + } + + @Test + void sendComment() { + System.out.println(KuaishouApis.sendComment(System.getenv("cookie"), + "3x6pb6bcmjrarvs", + KuaishouApis.SendCommentRequest + .builder() + .liveStreamId("XKLoBv2mAEo") + .content("666666a") + .build() + )); + } +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/test/java/tech/ordinaryroad/live/chat/client/kuaishou/client/KuaishouLiveChatClientTest.java b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/test/java/tech/ordinaryroad/live/chat/client/kuaishou/client/KuaishouLiveChatClientTest.java new file mode 100644 index 0000000..ad94357 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/live-chat-client-kuaishou/src/test/java/tech/ordinaryroad/live/chat/client/kuaishou/client/KuaishouLiveChatClientTest.java @@ -0,0 +1,206 @@ +package tech.ordinaryroad.live.chat.client.kuaishou.client; + +import cn.hutool.core.thread.ThreadUtil; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Test; +import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg; +import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg; +import tech.ordinaryroad.live.chat.client.commons.client.enums.ClientStatusEnums; +import tech.ordinaryroad.live.chat.client.kuaishou.config.KuaishouLiveChatClientConfig; +import tech.ordinaryroad.live.chat.client.kuaishou.listener.IKuaishouMsgListener; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.KuaishouDanmuMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.KuaishouGiftMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.msg.KuaishouLikeMsg; +import tech.ordinaryroad.live.chat.client.kuaishou.netty.handler.KuaishouBinaryFrameHandler; +import tech.ordinaryroad.live.chat.client.kuaishou.protobuf.PayloadTypeOuterClass; +import tech.ordinaryroad.live.chat.client.kuaishou.protobuf.WebGiftFeedOuterClass; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author mjz + * @date 2024/1/5 + */ +@Slf4j +class KuaishouLiveChatClientTest { + + Map> map = new HashMap<>(); + + static Object lock = new Object(); + KuaishouLiveChatClient client; + + @Test + void example() throws InterruptedException { + String cookie = System.getenv("cookie"); +// String cookie =""; + log.error("cookie: {}", cookie); + KuaishouLiveChatClientConfig config = KuaishouLiveChatClientConfig.builder() + // TODO 浏览器Cookie + .cookie(cookie) + .roomId("3xpbyu443usqwau") + .roomId("DX204317461") + .roomId("xzx11234") + .roomId("N-ik-T8-20") + .roomId("3x9f7e3t3fsr74k") + .roomId("3xiqpb2riusznvq") + .roomId("QQ2027379716") + .roomId("xiannvwan1008") + // 祁天道 + .roomId("t8888888") + .roomId("by529529") + // 大师2 + .roomId("3x6pb6bcmjrarvs") + .roomId("3xbyfeffjhky7b2") + // 月神 + .roomId("YUE99999") + .roomId("mengyu980726") + // 大师1 + .roomId("3xkz5pb2kx3q4u6") + .build(); + + client = new KuaishouLiveChatClient(config, new IKuaishouMsgListener() { + @Override + public void onMsg(IMsg msg) { + // log.debug("收到{}消息 {}", msg.getClass(), msg); + } + + @Override + public void onCmdMsg(PayloadTypeOuterClass.PayloadType cmd, ICmdMsg cmdMsg) { + // log.debug("收到CMD消息{} {}", cmd, cmdMsg); + } + + @Override + public void onOtherCmdMsg(PayloadTypeOuterClass.PayloadType cmd, ICmdMsg cmdMsg) { + log.debug("收到其他CMD消息 {}", cmd); + } + + @Override + public void onUnknownCmd(String cmdString, IMsg msg) { + log.debug("收到未知CMD消息 {}", cmdString); + } + + @Override + public void onDanmuMsg(KuaishouBinaryFrameHandler binaryFrameHandler, KuaishouDanmuMsg msg) { + log.info("{} 收到弹幕 [{}] {}({}):{}", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), msg.getContent()); + } + + @Override + public void onGiftMsg(KuaishouBinaryFrameHandler binaryFrameHandler, KuaishouGiftMsg msg) { + String mergeKey = msg.getMsg().getMergeKey(); + map.computeIfAbsent(mergeKey, s -> new ArrayList<>()).add(msg.getMsg()); + + log.info("{} 收到礼物 [{}] {}({}) {} {}({})x{}({}) mergeKey:{},comboCount:{}, batchSize:{}", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), "赠送", msg.getGiftName(), msg.getGiftId(), msg.getGiftCount(), msg.getGiftPrice(), msg.getMsg().getMergeKey(), msg.getMsg().getComboCount(), msg.getMsg().getBatchSize()); + } + }); + + client.addStatusChangeListener(new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + ClientStatusEnums newValue = (ClientStatusEnums) evt.getNewValue(); + if (newValue == ClientStatusEnums.CONNECTED) { + // 连接成功5秒后发送弹幕 + ThreadUtil.execAsync(() -> { + ThreadUtil.sleep(10000); + client.sendDanmu("666666", new Runnable() { + @Override + public void run() { + log.warn("弹幕发送成功"); + } + }); + }); + } + } + }); + + client.connect(); + + // 防止测试时直接退出 + while (true) { + synchronized (lock) { + lock.wait(); + } + } + } + + @Test + void clickLike() throws Exception { + String cookie = System.getenv("cookie"); +// String cookie =""; + log.error("cookie: {}", cookie); + KuaishouLiveChatClientConfig config = KuaishouLiveChatClientConfig.builder() + .cookie(cookie) + .roomId("K6866676") + .roomId("xinsang_") + .roomId("lollaopu") + .roomId("YTC2844073618") + .build(); + + client = new KuaishouLiveChatClient(config, new IKuaishouMsgListener() { + @Override + public void onMsg(IMsg msg) { +// log.debug("收到{}消息 {}", msg.getClass(), msg); + } + + @Override + public void onCmdMsg(PayloadTypeOuterClass.PayloadType cmd, ICmdMsg cmdMsg) { +// log.debug("收到CMD消息{} {}", cmd, cmdMsg); + } + + @Override + public void onOtherCmdMsg(PayloadTypeOuterClass.PayloadType cmd, ICmdMsg cmdMsg) { +// log.debug("收到其他CMD消息 {}", cmd); + } + + @Override + public void onUnknownCmd(String cmdString, IMsg msg) { +// log.debug("收到未知CMD消息 {}", cmdString); + } + + @Override + public void onDanmuMsg(KuaishouBinaryFrameHandler binaryFrameHandler, KuaishouDanmuMsg msg) { + log.info("{} 收到弹幕 [{}] {}({}):{}", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), msg.getContent()); + } + + @Override + public void onGiftMsg(KuaishouBinaryFrameHandler binaryFrameHandler, KuaishouGiftMsg msg) { + log.info("{} 收到礼物 [{}] {}({}) {} {}({})x{}({})", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid(), "赠送", msg.getGiftName(), msg.getGiftId(), msg.getGiftCount(), msg.getGiftPrice()); + } + + @Override + public void onLikeMsg(KuaishouBinaryFrameHandler binaryFrameHandler, KuaishouLikeMsg msg) { + log.info("{} 收到点赞 [{}] {}({})", binaryFrameHandler.getRoomId(), msg.getBadgeLevel() != 0 ? msg.getBadgeLevel() + msg.getBadgeName() : "", msg.getUsername(), msg.getUid()); + } + }); + + client.addStatusChangeListener(evt -> { + ClientStatusEnums newValue = (ClientStatusEnums) evt.getNewValue(); + if (newValue == ClientStatusEnums.CONNECTED) { + // 连接成功10秒后发送弹幕 + ThreadUtil.execAsync(() -> { + ThreadUtil.sleep(10000); + client.sendDanmu("6666a", () -> { + log.warn("弹幕发送成功"); + client.clickLike(13, () -> { + log.warn("为直播间点赞成功"); + }); + }); + }); + } + }); + + client.connect(); + + // 防止测试时直接退出 + while (true) { + synchronized (lock) { + lock.wait(); + } + } + } + +} \ No newline at end of file diff --git a/aibidding-modules/aibidding-live/live-chat-clients/pom.xml b/aibidding-modules/aibidding-live/live-chat-clients/pom.xml new file mode 100644 index 0000000..157d841 --- /dev/null +++ b/aibidding-modules/aibidding-live/live-chat-clients/pom.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 4.0.0 + + org.ruoyi + aibidding-live + ${revision} + ../pom.xml + + + pom + + live-chat-clients + live-chat-client + + + live-chat-client-bilibili + live-chat-client-douyu + live-chat-client-huya + live-chat-client-douyin + live-chat-client-kuaishou + + diff --git a/aibidding-modules/aibidding-live/pom.xml b/aibidding-modules/aibidding-live/pom.xml new file mode 100644 index 0000000..2cbc35f --- /dev/null +++ b/aibidding-modules/aibidding-live/pom.xml @@ -0,0 +1,177 @@ + + + org.ruoyi + aibidding-modules + ${revision} + ../pom.xml + + pom + 4.0.0 + aibidding-live + + + AI直播 + + + + live-chat-client-commons + live-chat-client-servers + live-chat-clients + + + + 8 + 8 + UTF-8 + 3.2.1 + 3.5.0 + 3.1.0 + 1.6.13 + + 1.13.0 + 2.16.0 + 5.8.24 + 4.1.104.Final + 1.4.12 + 1.18.30 + 5.10.1 + 3.25.1 + 1.7.3 + + + + + + org.ruoyi + live-chat-client-commons-base + 1.0.0 + + + + org.ruoyi + live-chat-client-commons-util + 1.0.0 + + + + org.ruoyi + live-chat-client-commons-client + 1.0.0 + + + + org.ruoyi + live-chat-client-servers-netty + 1.0.0 + + + + org.ruoyi + live-chat-client-servers-netty-client + 1.0.0 + + + + org.ruoyi + live-chat-client-bilibili + 1.0.0 + + + + org.ruoyi + live-chat-client-douyu + 1.0.0 + + + + org.ruoyi + live-chat-client-huya + 1.0.0 + + + + org.ruoyi + live-chat-client-douyin + 1.0.0 + + + + org.ruoyi + live-chat-client-kuaishou + 1.0.0 + + + + com.aayushatharva.brotli4j + brotli4j + ${brotli4j.version} + + + + com.google.protobuf + protobuf-java-util + ${protobuf-java-util.version} + + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind.version} + + + + cn.hutool + hutool-all + ${hutool-all.version} + + + + io.netty + netty-all + ${netty-all.version} + + + + com.tencent.tars + tars-core + ${tars-core.version} + + + + ch.qos.logback + logback-classic + ${logback-classic.version} + + + + org.projectlombok + lombok + ${lombok.version} + compile + + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + + + + + org.projectlombok + lombok + provided + + + + com.squareup.okhttp3 + okhttp + 4.10.0 + + + + diff --git a/aibidding-modules/aibidding-system/pom.xml b/aibidding-modules/aibidding-system/pom.xml new file mode 100644 index 0000000..2f50d5d --- /dev/null +++ b/aibidding-modules/aibidding-system/pom.xml @@ -0,0 +1,130 @@ + + + + org.ruoyi + aibidding-modules + ${revision} + ../pom.xml + + 4.0.0 + + aibidding-system + + + system系统模块 + + + + 4.5.14 + + + + + + org.ruoyi + aibidding-common-core + + + + org.ruoyi + aibidding-common-doc + + + + org.ruoyi + aibidding-common-mybatis + + + + org.ruoyi + aibidding-common-translation + + + + + org.ruoyi + aibidding-common-oss + + + + org.ruoyi + aibidding-common-log + + + + + org.ruoyi + aibidding-common-excel + + + + + org.ruoyi + aibidding-common-sms + + + + org.ruoyi + aibidding-common-tenant + + + + org.ruoyi + aibidding-common-security + + + + org.ruoyi + aibidding-common-web + + + + org.ruoyi + aibidding-common-idempotent + + + + org.ruoyi + aibidding-common-sensitive + + + + + org.ruoyi + aibidding-common-chat + + + + org.ruoyi + aibidding-common-wechat + + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + 2.15.2 + + + + org.apache.httpcomponents + httpmime + ${httpclient.version} + + + + + org.ruoyi + aibidding-common-pay + + + io.github.ollama4j + ollama4j + 1.0.79 + compile + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/builder/AbstractBuilder.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/builder/AbstractBuilder.java new file mode 100644 index 0000000..63c4749 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/builder/AbstractBuilder.java @@ -0,0 +1,16 @@ +package org.aibidding.system.builder; + +import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Binary Wang + */ +public abstract class AbstractBuilder { + protected final Logger logger = LoggerFactory.getLogger(getClass()); + + public abstract WxCpXmlOutMessage build(String content, WxCpXmlMessage wxMessage, WxCpService service); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/builder/ImageBuilder.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/builder/ImageBuilder.java new file mode 100644 index 0000000..5976229 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/builder/ImageBuilder.java @@ -0,0 +1,25 @@ +package org.aibidding.system.builder; + +import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutImageMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage; + + +/** + * @author Binary Wang + */ +public class ImageBuilder extends AbstractBuilder { + + @Override + public WxCpXmlOutMessage build(String content, WxCpXmlMessage wxMessage, + WxCpService service) { + + WxCpXmlOutImageMessage m = WxCpXmlOutMessage.IMAGE().mediaId(content) + .fromUser(wxMessage.getToUserName()).toUser(wxMessage.getFromUserName()) + .build(); + + return m; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/builder/TextBuilder.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/builder/TextBuilder.java new file mode 100644 index 0000000..94ddeb2 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/builder/TextBuilder.java @@ -0,0 +1,22 @@ +package org.aibidding.system.builder; + +import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutTextMessage; + +/** + * @author Binary Wang + */ +public class TextBuilder extends AbstractBuilder { + + @Override + public WxCpXmlOutMessage build(String content, WxCpXmlMessage wxMessage, + WxCpService service) { + WxCpXmlOutTextMessage m = WxCpXmlOutMessage.TEXT().content(content) + .fromUser(wxMessage.getToUserName()).toUser(wxMessage.getFromUserName()) + .build(); + return m; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/GptConfig.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/GptConfig.java new file mode 100644 index 0000000..fd9387e --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/GptConfig.java @@ -0,0 +1,31 @@ +package org.aibidding.system.cofing; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * gpt配置 + * + * @author ashinnotfound + * @date 2023/03/04 + */ +@Data +@Component +@ConfigurationProperties("gpt") +public class GptConfig { + private String baseUrl; + private String model; + private Integer maxToken; + private Double temperature; + private List basicPrompt; + private List apiKey; + private Long ofSeconds; + private String imageQuality; + private String imageStyle; + private String audioModel; + private String audioVoice; + private Double audioSpeed; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/OkHttpConfig.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/OkHttpConfig.java new file mode 100644 index 0000000..1426fa2 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/OkHttpConfig.java @@ -0,0 +1,49 @@ +package org.aibidding.system.cofing; + +import jakarta.annotation.PostConstruct; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.utils.OkHttpUtil; +import org.aibidding.system.domain.bo.SysModelBo; +import org.aibidding.system.domain.vo.SysModelVo; +import org.aibidding.system.service.ISysModelService; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Component +@RequiredArgsConstructor +public class OkHttpConfig { + + private final ISysModelService sysModelService; + private final Map okHttpUtilMap = new HashMap<>(); + @Getter + private String generate; + + @PostConstruct + public void init() { + initializeOkHttpUtil("suno"); + initializeOkHttpUtil("luma"); + initializeOkHttpUtil("ppt"); + } + + private void initializeOkHttpUtil(String modelName) { + SysModelBo sysModelBo = new SysModelBo(); + sysModelBo.setModelName(modelName); + List sysModelList = sysModelService.queryList(sysModelBo); + if (!sysModelList.isEmpty()) { + SysModelVo model = sysModelList.get(0); + OkHttpUtil okHttpUtil = new OkHttpUtil(); + okHttpUtil.setApiHost(model.getApiHost()); + okHttpUtil.setApiKey(model.getApiKey()); + generate = String.valueOf(model.getModelPrice()); + okHttpUtilMap.put(modelName, okHttpUtil); + } + } + + public OkHttpUtil getOkHttpUtil(String modelName) { + return okHttpUtilMap.get(modelName); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/QqConfig.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/QqConfig.java new file mode 100644 index 0000000..7c83020 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/QqConfig.java @@ -0,0 +1,21 @@ +package org.aibidding.system.cofing; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * qq配置 + * + * @author ashinnotfound + * @date 2023/03/04 + */ +@Data +@Component +@ConfigurationProperties("qq") +public class QqConfig { + private Boolean enable; + private Long account; + private Boolean acceptNewFriend; + private Boolean acceptNewGroup; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/WxCpConfiguration.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/WxCpConfiguration.java new file mode 100644 index 0000000..7295a0a --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/WxCpConfiguration.java @@ -0,0 +1,130 @@ +package org.aibidding.system.cofing; + + +import com.google.common.collect.Maps; +import jakarta.annotation.PostConstruct; +import lombok.val; +import me.chanjar.weixin.common.api.WxConsts; +import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl; +import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl; +import me.chanjar.weixin.cp.constant.WxCpConsts; +import me.chanjar.weixin.cp.message.WxCpMessageRouter; +import org.aibidding.system.handler.wxcp.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Configuration; +import me.chanjar.weixin.cp.api.WxCpService; + +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 单实例配置 + * + * @author Binary Wang + */ +@Configuration +@EnableConfigurationProperties(WxCpProperties.class) +public class WxCpConfiguration { + private LogHandler logHandler; + private NullHandler nullHandler; + private LocationHandler locationHandler; + private MenuHandler menuHandler; + private MsgHandler msgHandler; + private UnsubscribeHandler unsubscribeHandler; + private SubscribeHandler subscribeHandler; + + private WxCpProperties properties; + + private static Map routers = Maps.newHashMap(); + private static Map cpServices = Maps.newHashMap(); + + @Autowired + public WxCpConfiguration(LogHandler logHandler, NullHandler nullHandler, LocationHandler locationHandler, + MenuHandler menuHandler, MsgHandler msgHandler, UnsubscribeHandler unsubscribeHandler, + SubscribeHandler subscribeHandler, WxCpProperties properties) { + this.logHandler = logHandler; + this.nullHandler = nullHandler; + this.locationHandler = locationHandler; + this.menuHandler = menuHandler; + this.msgHandler = msgHandler; + this.unsubscribeHandler = unsubscribeHandler; + this.subscribeHandler = subscribeHandler; + this.properties = properties; + } + + + public static Map getRouters() { + return routers; + } + + public static WxCpService getCpService(Integer agentId) { + return cpServices.get(agentId); + } + + @PostConstruct + public void initServices() { + cpServices = this.properties.getAppConfigs().stream().map(a -> { + val configStorage = new WxCpDefaultConfigImpl(); + configStorage.setCorpId(this.properties.getCorpId()); + configStorage.setAgentId(a.getAgentId()); + configStorage.setCorpSecret(a.getSecret()); + configStorage.setToken(a.getToken()); + configStorage.setAesKey(a.getAesKey()); + val service = new WxCpServiceImpl(); + service.setWxCpConfigStorage(configStorage); + routers.put(a.getAgentId(), this.newRouter(service)); + return service; + }).collect(Collectors.toMap(service -> service.getWxCpConfigStorage().getAgentId(), a -> a)); + } + + private WxCpMessageRouter newRouter(WxCpService wxCpService) { + final val newRouter = new WxCpMessageRouter(wxCpService); + + // 记录所有事件的日志 (异步执行) + newRouter.rule().handler(this.logHandler).next(); + + // 自定义菜单事件 + newRouter.rule().async(false).msgType(WxConsts.XmlMsgType.EVENT) + .event(WxConsts.MenuButtonType.CLICK).handler(this.menuHandler).end(); + + // 点击菜单链接事件(这里使用了一个空的处理器,可以根据自己需要进行扩展) + newRouter.rule().async(false).msgType(WxConsts.XmlMsgType.EVENT) + .event(WxConsts.MenuButtonType.VIEW).handler(this.nullHandler).end(); + + // 关注事件 + newRouter.rule().async(false).msgType(WxConsts.XmlMsgType.EVENT) + .event(WxConsts.EventType.SUBSCRIBE).handler(this.subscribeHandler) + .end(); + + // 取消关注事件 + newRouter.rule().async(false).msgType(WxConsts.XmlMsgType.EVENT) + .event(WxConsts.EventType.UNSUBSCRIBE) + .handler(this.unsubscribeHandler).end(); + + // 上报地理位置事件 + newRouter.rule().async(false).msgType(WxConsts.XmlMsgType.EVENT) + .event(WxConsts.EventType.LOCATION).handler(this.locationHandler) + .end(); + + // 接收地理位置消息 + newRouter.rule().async(false).msgType(WxConsts.XmlMsgType.LOCATION) + .handler(this.locationHandler).end(); + + // 扫码事件(这里使用了一个空的处理器,可以根据自己需要进行扩展) + newRouter.rule().async(false).msgType(WxConsts.XmlMsgType.EVENT) + .event(WxConsts.EventType.SCAN).handler(this.nullHandler).end(); + + newRouter.rule().async(false).msgType(WxConsts.XmlMsgType.EVENT) + .event(WxCpConsts.EventType.CHANGE_CONTACT).handler(new ContactChangeHandler()).end(); + + newRouter.rule().async(false).msgType(WxConsts.XmlMsgType.EVENT) + .event(WxCpConsts.EventType.ENTER_AGENT).handler(new EnterAgentHandler()).end(); + + // 默认 + newRouter.rule().async(false).handler(this.msgHandler).end(); + + return newRouter; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/WxCpProperties.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/WxCpProperties.java new file mode 100644 index 0000000..1841b92 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/WxCpProperties.java @@ -0,0 +1,48 @@ +package org.aibidding.system.cofing; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.util.List; + +/** + * @author Binary Wang + */ +@Data +@ConfigurationProperties(prefix = "wechat.cp") +public class WxCpProperties { + /** + * 设置企业微信的corpId + */ + private String corpId; + + private List appConfigs; + + @Getter + @Setter + public static class AppConfig { + /** + * 设置企业微信应用的AgentId + */ + private Integer agentId; + + /** + * 设置企业微信应用的Secret + */ + private String secret; + + /** + * 设置企业微信应用的token + */ + private String token; + + /** + * 设置企业微信应用的EncodingAESKey + */ + private String aesKey; + + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/WxMaConfiguration.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/WxMaConfiguration.java new file mode 100644 index 0000000..61f8ebb --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/WxMaConfiguration.java @@ -0,0 +1,132 @@ +package org.aibidding.system.cofing; + +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; +import cn.binarywang.wx.miniapp.bean.WxMaKefuMessage; +import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage; +import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl; +import cn.binarywang.wx.miniapp.message.WxMaMessageHandler; +import cn.binarywang.wx.miniapp.message.WxMaMessageRouter; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.common.bean.result.WxMediaUploadResult; +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.common.error.WxRuntimeException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.io.File; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author Admin + */ +@Slf4j +@Configuration +@EnableConfigurationProperties(WxMaProperties.class) +public class WxMaConfiguration { + private final WxMaProperties properties; + + @Autowired + public WxMaConfiguration(WxMaProperties properties) { + this.properties = properties; + } + + @Bean + public WxMaService wxMaService() { + List configs = this.properties.getConfigs(); + if (configs == null) { + throw new WxRuntimeException("大哥,拜托先看下项目首页的说明(readme文件),添加下相关配置,注意别配错了!"); + } + WxMaService maService = new WxMaServiceImpl(); + maService.setMultiConfigs( + configs.stream() + .map(a -> { + WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl(); +// WxMaDefaultConfigImpl config = new WxMaRedisConfigImpl(new JedisPool()); + // 使用上面的配置时,需要同时引入jedis-lock的依赖,否则会报类无法找到的异常 + config.setAppid(a.getAppid()); + config.setSecret(a.getSecret()); + config.setToken(a.getToken()); + config.setAesKey(a.getAesKey()); + config.setMsgDataFormat(a.getMsgDataFormat()); + return config; + }).collect(Collectors.toMap(WxMaDefaultConfigImpl::getAppid, a -> a, (o, n) -> o))); + return maService; + } + + @Bean + public WxMaMessageRouter wxMaMessageRouter(WxMaService wxMaService) { + final WxMaMessageRouter router = new WxMaMessageRouter(wxMaService); + router + .rule().handler(logHandler).next() + .rule().async(false).content("订阅消息").handler(subscribeMsgHandler).end() + .rule().async(false).content("文本").handler(textHandler).end() + .rule().async(false).content("图片").handler(picHandler).end() + .rule().async(false).content("二维码").handler(qrcodeHandler).end(); + return router; + } + + private final WxMaMessageHandler subscribeMsgHandler = (wxMessage, context, service, sessionManager) -> { + service.getMsgService().sendSubscribeMsg(WxMaSubscribeMessage.builder() + .templateId("此处更换为自己的模板id") + .data(Lists.newArrayList( + new WxMaSubscribeMessage.MsgData("keyword1", "339208499"))) + .toUser(wxMessage.getFromUser()) + .build()); + return null; + }; + + private final WxMaMessageHandler logHandler = (wxMessage, context, service, sessionManager) -> { + log.info("收到消息:" + wxMessage.toString()); + service.getMsgService().sendKefuMsg(WxMaKefuMessage.newTextBuilder().content("收到信息为:" + wxMessage.toJson()) + .toUser(wxMessage.getFromUser()).build()); + return null; + }; + + private final WxMaMessageHandler textHandler = (wxMessage, context, service, sessionManager) -> { + service.getMsgService().sendKefuMsg(WxMaKefuMessage.newTextBuilder().content("回复文本消息") + .toUser(wxMessage.getFromUser()).build()); + return null; + }; + + private final WxMaMessageHandler picHandler = (wxMessage, context, service, sessionManager) -> { + try { + WxMediaUploadResult uploadResult = service.getMediaService() + .uploadMedia("image", "png", + ClassLoader.getSystemResourceAsStream("tmp.png")); + service.getMsgService().sendKefuMsg( + WxMaKefuMessage + .newImageBuilder() + .mediaId(uploadResult.getMediaId()) + .toUser(wxMessage.getFromUser()) + .build()); + } catch (WxErrorException e) { + e.printStackTrace(); + } + + return null; + }; + + private final WxMaMessageHandler qrcodeHandler = (wxMessage, context, service, sessionManager) -> { + try { + final File file = service.getQrcodeService().createQrcode("123", 430); + WxMediaUploadResult uploadResult = service.getMediaService().uploadMedia("image", file); + service.getMsgService().sendKefuMsg( + WxMaKefuMessage + .newImageBuilder() + .mediaId(uploadResult.getMediaId()) + .toUser(wxMessage.getFromUser()) + .build()); + } catch (WxErrorException e) { + e.printStackTrace(); + } + + return null; + }; + +} + diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/WxMaProperties.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/WxMaProperties.java new file mode 100644 index 0000000..a1fc1cc --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/cofing/WxMaProperties.java @@ -0,0 +1,52 @@ +package org.aibidding.system.cofing; + +/** + * 微信小程序属性配置类 + * + * @author: wangle + * @date: 2023/5/18 + */ + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.util.List; + +/** + * @author Binary Wang + */ +@Data +@ConfigurationProperties(prefix = "wx.miniapp") +public class WxMaProperties { + + private List configs; + + @Data + public static class Config { + /** + * 设置微信小程序的appid + */ + private String appid; + + /** + * 设置微信小程序的Secret + */ + private String secret; + + /** + * 设置微信小程序消息服务器配置的token + */ + private String token; + + /** + * 设置微信小程序消息服务器配置的EncodingAESKey + */ + private String aesKey; + + /** + * 消息格式,XML或者JSON + */ + private String msgDataFormat; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/monitor/CacheController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/monitor/CacheController.java new file mode 100644 index 0000000..6c559f6 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/monitor/CacheController.java @@ -0,0 +1,55 @@ +package org.aibidding.system.controller.monitor; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.system.domain.vo.CacheListInfoVo; +import lombok.RequiredArgsConstructor; +import org.redisson.spring.data.connection.RedissonConnectionFactory; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.*; + +/** + * 缓存监控 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@RestController +@RequestMapping("/monitor/cache") +public class CacheController { + + private final RedissonConnectionFactory connectionFactory; + + /** + * 获取缓存监控列表 + */ + @SaCheckPermission("monitor:cache:list") + @GetMapping() + public R getInfo() throws Exception { + RedisConnection connection = connectionFactory.getConnection(); + Properties commandStats = connection.commands().info("commandstats"); + + List> pieList = new ArrayList<>(); + if (commandStats != null) { + commandStats.stringPropertyNames().forEach(key -> { + Map data = new HashMap<>(2); + String property = commandStats.getProperty(key); + data.put("name", StringUtils.removeStart(key, "cmdstat_")); + data.put("value", StringUtils.substringBetween(property, "calls=", ",usec")); + pieList.add(data); + }); + } + + CacheListInfoVo infoVo = new CacheListInfoVo(); + infoVo.setInfo(connection.commands().info()); + infoVo.setDbSize(connection.commands().dbSize()); + infoVo.setCommandStats(pieList); + return R.ok(infoVo); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/monitor/SysLogininforController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/monitor/SysLogininforController.java new file mode 100644 index 0000000..8170805 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/monitor/SysLogininforController.java @@ -0,0 +1,89 @@ +package org.aibidding.system.controller.monitor; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.aibidding.common.core.constant.GlobalConstants; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.redis.utils.RedisUtils; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysLogininforBo; +import org.aibidding.system.domain.vo.SysLogininforVo; +import org.aibidding.system.service.ISysLogininforService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 系统访问记录 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/monitor/logininfor") +public class SysLogininforController extends BaseController { + + private final ISysLogininforService logininforService; + + /** + * 获取系统访问记录列表 + */ + @SaCheckPermission("monitor:logininfor:list") + @GetMapping("/list") + public TableDataInfo list(SysLogininforBo logininfor, PageQuery pageQuery) { + return logininforService.selectPageLogininforList(logininfor, pageQuery); + } + + /** + * 导出系统访问记录列表 + */ + @Log(title = "登录日志", businessType = BusinessType.EXPORT) + @SaCheckPermission("monitor:logininfor:export") + @PostMapping("/export") + public void export(SysLogininforBo logininfor, HttpServletResponse response) { + List list = logininforService.selectLogininforList(logininfor); + ExcelUtil.exportExcel(list, "登录日志", SysLogininforVo.class, response); + } + + /** + * 批量删除登录日志 + * @param infoIds 日志ids + */ + @SaCheckPermission("monitor:logininfor:remove") + @Log(title = "登录日志", businessType = BusinessType.DELETE) + @DeleteMapping("/{infoIds}") + public R remove(@PathVariable Long[] infoIds) { + return toAjax(logininforService.deleteLogininforByIds(infoIds)); + } + + /** + * 清理系统访问记录 + */ + @SaCheckPermission("monitor:logininfor:remove") + @Log(title = "登录日志", businessType = BusinessType.CLEAN) + @DeleteMapping("/clean") + public R clean() { + logininforService.cleanLogininfor(); + return R.ok(); + } + + @SaCheckPermission("monitor:logininfor:unlock") + @Log(title = "账户解锁", businessType = BusinessType.OTHER) + @GetMapping("/unlock/{userName}") + public R unlock(@PathVariable("userName") String userName) { + String loginName = GlobalConstants.PWD_ERR_CNT_KEY + userName; + if (RedisUtils.hasKey(loginName)) { + RedisUtils.deleteObject(loginName); + } + return R.ok(); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/monitor/SysOperlogController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/monitor/SysOperlogController.java new file mode 100644 index 0000000..559e286 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/monitor/SysOperlogController.java @@ -0,0 +1,75 @@ +package org.aibidding.system.controller.monitor; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysOperLogBo; +import org.aibidding.system.domain.vo.SysOperLogVo; +import org.aibidding.system.service.ISysOperLogService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 操作日志记录 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/monitor/operlog") +public class SysOperlogController extends BaseController { + + private final ISysOperLogService operLogService; + + /** + * 获取操作日志记录列表 + */ + @SaCheckPermission("monitor:operlog:list") + @GetMapping("/list") + public TableDataInfo list(SysOperLogBo operLog, PageQuery pageQuery) { + return operLogService.selectPageOperLogList(operLog, pageQuery); + } + + /** + * 导出操作日志记录列表 + */ + @Log(title = "操作日志", businessType = BusinessType.EXPORT) + @SaCheckPermission("monitor:operlog:export") + @PostMapping("/export") + public void export(SysOperLogBo operLog, HttpServletResponse response) { + List list = operLogService.selectOperLogList(operLog); + ExcelUtil.exportExcel(list, "操作日志", SysOperLogVo.class, response); + } + + /** + * 批量删除操作日志记录 + * @param operIds 日志ids + */ + @Log(title = "操作日志", businessType = BusinessType.DELETE) + @SaCheckPermission("monitor:operlog:remove") + @DeleteMapping("/{operIds}") + public R remove(@PathVariable Long[] operIds) { + return toAjax(operLogService.deleteOperLogByIds(operIds)); + } + + /** + * 清理操作日志记录 + */ + @Log(title = "操作日志", businessType = BusinessType.CLEAN) + @SaCheckPermission("monitor:operlog:remove") + @DeleteMapping("/clean") + public R clean() { + operLogService.cleanOperLog(); + return R.ok(); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/monitor/SysUserOnlineController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/monitor/SysUserOnlineController.java new file mode 100644 index 0000000..a1b1a75 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/monitor/SysUserOnlineController.java @@ -0,0 +1,90 @@ +package org.aibidding.system.controller.monitor; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.exception.NotLoginException; +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.bean.BeanUtil; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.constant.CacheConstants; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.domain.dto.UserOnlineDTO; +import org.aibidding.common.core.utils.StreamUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.redis.utils.RedisUtils; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.SysUserOnline; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * 在线用户监控 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@RestController +@RequestMapping("/monitor/online") +public class SysUserOnlineController extends BaseController { + + /** + * 获取在线用户监控列表 + * + * @param ipaddr IP地址 + * @param userName 用户名 + */ + @SaCheckPermission("monitor:online:list") + @GetMapping("/list") + public TableDataInfo list(String ipaddr, String userName) { + // 获取所有未过期的 token + List keys = StpUtil.searchTokenValue("", 0, -1, false); + List userOnlineDTOList = new ArrayList<>(); + for (String key : keys) { + String token = StringUtils.substringAfterLast(key, ":"); + // 如果已经过期则跳过 + if (StpUtil.stpLogic.getTokenActivityTimeoutByToken(token) < -1) { + continue; + } + userOnlineDTOList.add(RedisUtils.getCacheObject(CacheConstants.ONLINE_TOKEN_KEY + token)); + } + if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) { + userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline -> + StringUtils.equals(ipaddr, userOnline.getIpaddr()) && + StringUtils.equals(userName, userOnline.getUserName()) + ); + } else if (StringUtils.isNotEmpty(ipaddr)) { + userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline -> + StringUtils.equals(ipaddr, userOnline.getIpaddr()) + ); + } else if (StringUtils.isNotEmpty(userName)) { + userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline -> + StringUtils.equals(userName, userOnline.getUserName()) + ); + } + Collections.reverse(userOnlineDTOList); + userOnlineDTOList.removeAll(Collections.singleton(null)); + List userOnlineList = BeanUtil.copyToList(userOnlineDTOList, SysUserOnline.class); + return TableDataInfo.build(userOnlineList); + } + + /** + * 强退用户 + * + * @param tokenId token值 + */ + @SaCheckPermission("monitor:online:forceLogout") + @Log(title = "在线用户", businessType = BusinessType.FORCE) + @DeleteMapping("/{tokenId}") + public R forceLogout(@PathVariable String tokenId) { + try { + StpUtil.kickoutByTokenValue(tokenId); + } catch (NotLoginException ignored) { + } + return R.ok(); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatConfigController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatConfigController.java new file mode 100644 index 0000000..d3f7c51 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatConfigController.java @@ -0,0 +1,108 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.service.ConfigService; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.ChatConfigBo; +import org.aibidding.system.domain.vo.ChatConfigVo; +import org.aibidding.system.service.IChatConfigService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 对话配置信息 + * + * @author Lion Li + * @date 2024-04-13 + */ +@RequiredArgsConstructor +@RestController +@RequestMapping("/chat/config") +public class ChatConfigController extends BaseController { + + private final IChatConfigService chatConfigService; + + private final ConfigService configService; + + /** + * 查询配置信息列表 + */ + @GetMapping("/list") + @SaCheckPermission("system:config:list") + public R> list(ChatConfigBo bo) { + return R.ok(chatConfigService.queryList(bo)); + } + + /** + * 获取对话配置信详细信息 + * + * @param id 主键 + */ + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(chatConfigService.queryById(id)); + } + + /** + * 根据参数键名查询系统参数值 + * + * @param configKey 参数Key + */ + @GetMapping(value = "/configKey/{configKey}") + public R getConfigKey(@PathVariable String configKey) { + return R.ok(configService.getConfigValue("sys",configKey)); + } + + /** + * 查询系统参数 + * + */ + @GetMapping(value = "/sysConfigKey") + public R> getSysConfigKey() { + return R.ok(chatConfigService.getSysConfigValue("sys")); + } + + /** + * 新增对话配置信息 + */ + @PostMapping("/add") + public R add(@RequestBody List boList) { + for (ChatConfigBo chatConfigBo : boList) { + if(chatConfigBo.getId() == null){ + chatConfigService.insertByBo(chatConfigBo); + }else { + chatConfigService.updateByBo(chatConfigBo); + } + } + return toAjax(true); + } + + /** + * 修改对话配置信息 + */ + @PutMapping("/edit") + public R edit(@Validated(EditGroup.class) @RequestBody ChatConfigBo bo) { + return toAjax(chatConfigService.updateByBo(bo)); + } + + /** + * 删除对话配置信息 + * + * @param ids 主键串 + */ + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(chatConfigService.deleteWithValidByIds(List.of(ids), true)); + } + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatGptsController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatGptsController.java new file mode 100644 index 0000000..9b37dd3 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatGptsController.java @@ -0,0 +1,105 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.ChatGptsBo; +import org.aibidding.system.domain.vo.ChatGptsVo; +import org.aibidding.system.service.IChatGptsService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * gpts管理 + * + * @author Lion Li + * @date 2024-07-09 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/gpts") +public class ChatGptsController extends BaseController { + + private final IChatGptsService chatGptsService; + + /** + * 查询gpts管理列表 + */ + @GetMapping("/list") + public TableDataInfo list(ChatGptsBo bo, PageQuery pageQuery) { + return chatGptsService.queryPageList(bo, pageQuery); + } + + /** + * 导出gpts管理列表 + */ + @SaCheckPermission("system:gpts:export") + @Log(title = "gpts管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(ChatGptsBo bo, HttpServletResponse response) { + List list = chatGptsService.queryList(bo); + ExcelUtil.exportExcel(list, "gpts管理", ChatGptsVo.class, response); + } + + /** + * 获取gpts管理详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("system:gpts:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(chatGptsService.queryById(id)); + } + + /** + * 新增gpts管理 + */ + @SaCheckPermission("system:gpts:add") + @Log(title = "gpts管理", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody ChatGptsBo bo) { + return toAjax(chatGptsService.insertByBo(bo)); + } + + /** + * 修改gpts管理 + */ + @SaCheckPermission("system:gpts:edit") + @Log(title = "gpts管理", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody ChatGptsBo bo) { + return toAjax(chatGptsService.updateByBo(bo)); + } + + /** + * 删除gpts管理 + * + * @param ids 主键串 + */ + @SaCheckPermission("system:gpts:remove") + @Log(title = "gpts管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(chatGptsService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatMessageController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatMessageController.java new file mode 100644 index 0000000..a4e0c08 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatMessageController.java @@ -0,0 +1,120 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.ChatMessageBo; +import org.aibidding.system.domain.vo.ChatMessageVo; +import org.aibidding.system.service.IChatMessageService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 聊天消息 + * + * @author Lion Li + * @date 2024-04-16 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/message") +public class ChatMessageController extends BaseController { + + private final IChatMessageService chatMessageService; + + /** + * 查询聊天消息列表 + */ + @SaCheckPermission("system:message:list") + @GetMapping("/list") + public TableDataInfo list(ChatMessageBo bo, PageQuery pageQuery) { + pageQuery.setOrderByColumn("createTime"); + pageQuery.setIsAsc("desc"); + return chatMessageService.queryPageList(bo, pageQuery); + } + + /** + * 查询我的聊天消息列表 + */ + @GetMapping("/listByUser") + public R> listByUser(ChatMessageBo bo, PageQuery pageQuery) { + bo.setUserId(LoginHelper.getUserId()); + pageQuery.setOrderByColumn("createTime"); + pageQuery.setIsAsc("desc"); + return R.ok(chatMessageService.queryPageList(bo, pageQuery)); + } + + /** + * 导出聊天消息列表 + */ + @SaCheckPermission("system:message:export") + @Log(title = "聊天消息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(ChatMessageBo bo, HttpServletResponse response) { + List list = chatMessageService.queryList(bo); + ExcelUtil.exportExcel(list, "聊天消息", ChatMessageVo.class, response); + } + + /** + * 获取聊天消息详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("system:message:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(chatMessageService.queryById(id)); + } + + /** + * 新增聊天消息 + */ + @SaCheckPermission("system:message:add") + @Log(title = "聊天消息", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody ChatMessageBo bo) { + return toAjax(chatMessageService.insertByBo(bo)); + } + + /** + * 修改聊天消息 + */ + @SaCheckPermission("system:message:edit") + @Log(title = "聊天消息", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody ChatMessageBo bo) { + return toAjax(chatMessageService.updateByBo(bo)); + } + + /** + * 删除聊天消息 + * + * @param ids 主键串 + */ + @SaCheckPermission("system:message:remove") + @Log(title = "聊天消息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(chatMessageService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatStoreController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatStoreController.java new file mode 100644 index 0000000..7c067d7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatStoreController.java @@ -0,0 +1,41 @@ +package org.aibidding.system.controller.system; + +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.ChatAppStoreBo; +import org.aibidding.system.domain.vo.ChatAppStoreVo; +import org.aibidding.system.service.IChatAppStoreService; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 应用商店 + * + * @author Lion Li + * @date 2024-03-19 + */ +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/store") +public class ChatStoreController extends BaseController { + + private final IChatAppStoreService appStoreService; + + /** + * 应用商店 + */ + @GetMapping("/appList") + public R> appList(ChatAppStoreBo bo) { + return R.ok(appStoreService.queryList(bo)); + } + + /** + * 收藏应用 + */ + @PostMapping("/copyApp") + public R copyApp() { + return R.ok(); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatVisitorUsageController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatVisitorUsageController.java new file mode 100644 index 0000000..16595a2 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatVisitorUsageController.java @@ -0,0 +1,106 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.ChatVisitorUsageBo; +import org.aibidding.system.domain.vo.ChatVisitorUsageVo; +import org.aibidding.system.service.IChatVisitorUsageService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 访客管理 + * + * @author Lion Li + * @date 2024-07-14 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/visitorUsage") +public class ChatVisitorUsageController extends BaseController { + + private final IChatVisitorUsageService chatVisitorUsageService; + + /** + * 查询访客管理列表 + */ + @SaCheckPermission("system:visitorUsage:list") + @GetMapping("/list") + public TableDataInfo list(ChatVisitorUsageBo bo, PageQuery pageQuery) { + return chatVisitorUsageService.queryPageList(bo, pageQuery); + } + + /** + * 导出访客管理列表 + */ + @SaCheckPermission("system:visitorUsage:export") + @Log(title = "访客管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(ChatVisitorUsageBo bo, HttpServletResponse response) { + List list = chatVisitorUsageService.queryList(bo); + ExcelUtil.exportExcel(list, "访客管理", ChatVisitorUsageVo.class, response); + } + + /** + * 获取访客管理详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("system:visitorUsage:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(chatVisitorUsageService.queryById(id)); + } + + /** + * 新增访客管理 + */ + @SaCheckPermission("system:visitorUsage:add") + @Log(title = "访客管理", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody ChatVisitorUsageBo bo) { + return toAjax(chatVisitorUsageService.insertByBo(bo)); + } + + /** + * 修改访客管理 + */ + @SaCheckPermission("system:visitorUsage:edit") + @Log(title = "访客管理", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody ChatVisitorUsageBo bo) { + return toAjax(chatVisitorUsageService.updateByBo(bo)); + } + + /** + * 删除访客管理 + * + * @param ids 主键串 + */ + @SaCheckPermission("system:visitorUsage:remove") + @Log(title = "访客管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(chatVisitorUsageService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatVoucherController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatVoucherController.java new file mode 100644 index 0000000..4d6491a --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/ChatVoucherController.java @@ -0,0 +1,123 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.common.wechat.web.utils.UUIDShortUtil; +import org.aibidding.system.domain.bo.ChatVoucherBo; +import org.aibidding.system.domain.vo.ChatVoucherVo; +import org.aibidding.system.service.IChatVoucherService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 用户兑换记录 + * + * @author Lion Li + * @date 2024-05-03 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/voucher") +public class ChatVoucherController extends BaseController { + + private final IChatVoucherService chatVoucherService; + + /** + * 查询用户兑换记录列表 + */ + @SaCheckPermission("system:voucher:list") + @GetMapping("/list") + public TableDataInfo list(ChatVoucherBo bo, PageQuery pageQuery) { + return chatVoucherService.queryPageList(bo, pageQuery); + } + + /** + * 导出用户兑换记录列表 + */ + @SaCheckPermission("system:voucher:export") + @Log(title = "用户兑换记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(ChatVoucherBo bo, HttpServletResponse response) { + List list = chatVoucherService.queryList(bo); + ExcelUtil.exportExcel(list, "用户兑换记录", ChatVoucherVo.class, response); + } + + /** + * 获取用户兑换记录详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("system:voucher:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(chatVoucherService.queryById(id)); + } + + /** + * 新增用户兑换记录 + */ + @SaCheckPermission("system:voucher:add") + @Log(title = "用户兑换记录", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody ChatVoucherBo bo) { + bo.setCode(UUIDShortUtil.generateShortUuid()); + return toAjax(chatVoucherService.insertByBo(bo)); + } + + /** + * 兑换卡密 + * + * @param bo 卡密信息 + * @return 是否兑换成功 + */ + @PostMapping("/redeem") + public R redeem(@RequestBody ChatVoucherBo bo) { + if(chatVoucherService.redeem(bo)){ + return R.ok("兑换成功!"); + }else { + return R.fail("兑换失败,请联系管理员!"); + } + } + + /** + * 修改用户兑换记录 + */ + @SaCheckPermission("system:voucher:edit") + @Log(title = "用户兑换记录", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody ChatVoucherBo bo) { + return toAjax(chatVoucherService.updateByBo(bo)); + } + + /** + * 删除用户兑换记录 + * + * @param ids 主键串 + */ + @SaCheckPermission("system:voucher:remove") + @Log(title = "用户兑换记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(chatVoucherService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/PayController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/PayController.java new file mode 100644 index 0000000..2d0bfb4 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/PayController.java @@ -0,0 +1,333 @@ +package org.aibidding.system.controller.system; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.extra.qrcode.QrCodeUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse; +import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; +import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult; +import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest; +import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; +import com.github.binarywang.wxpay.exception.WxPayException; +import com.github.binarywang.wxpay.service.WxPayService; +import com.stripe.Stripe; +import com.stripe.exception.StripeException; +import com.stripe.model.Event; +import com.stripe.model.Price; +import com.stripe.model.Product; +import com.stripe.model.checkout.Session; +import com.stripe.net.Webhook; +import com.stripe.param.checkout.SessionCreateParams; +import jakarta.servlet.http.HttpServletRequest; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.config.PayConfig; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.exception.base.BaseException; +import org.aibidding.common.core.service.ConfigService; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.oss.core.OssClient; +import org.aibidding.common.oss.entity.UploadResult; +import org.aibidding.common.oss.factory.OssFactory; +import org.aibidding.common.response.PayResponse; +import org.aibidding.common.service.PayService; +import org.aibidding.common.utils.MD5Util; +import org.aibidding.system.domain.bo.PaymentOrdersBo; +import org.aibidding.system.domain.bo.SysUserBo; +import org.aibidding.system.domain.request.OrderRequest; +import org.aibidding.system.domain.vo.PaymentOrdersVo; +import org.aibidding.system.domain.vo.SysUserVo; +import org.aibidding.system.service.IPaymentOrdersService; +import org.aibidding.system.service.ISysUserService; +import org.springframework.web.bind.annotation.*; + +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +@RequiredArgsConstructor +@RestController +@RequestMapping("/pay") +@Slf4j +public class PayController { + + private final PayService payService; + + private final ISysUserService userService; + + private final IPaymentOrdersService paymentOrdersService; + + private final PayConfig payConfig; + + private final WxPayService wxService; + + private final ConfigService configService; + + /** + * 获取支付二维码 + * + * @Date 2023/7/3 + * @return void + **/ + @PostMapping("/payUrl") + public R payUrl(@RequestBody OrderRequest orderRequest) { + PaymentOrdersBo payOrder = paymentOrdersService.createPayOrder(orderRequest); + PaymentOrdersVo paymentOrdersVo = new PaymentOrdersVo(); + if(!Boolean.parseBoolean(getKey("enabled"))){ + String payUrl = payService.getPayUrl(payOrder.getOrderNo(), orderRequest.getName(), Double.parseDouble(orderRequest.getMoney()), "192.168.1.6"); + byte[] bytes = QrCodeUtil.generatePng(payUrl, 300, 300); + OssClient storage = OssFactory.instance(); + UploadResult upload=storage.upload(bytes, storage.getPath("qrCode",".png"), "image/png"); + BeanUtil.copyProperties(payOrder,paymentOrdersVo); + paymentOrdersVo.setUrl(upload.getUrl()); + }else { + WxPayUnifiedOrderRequest request = new WxPayUnifiedOrderRequest(); + request.setTradeType("NATIVE"); + request.setBody(orderRequest.getName()); + request.setOutTradeNo(payOrder.getOrderNo()); + request.setTotalFee(BaseWxPayRequest.yuanToFen(orderRequest.getMoney())); + request.setSpbillCreateIp("127.0.0.1"); + request.setNotifyUrl(getKey("notifyUrl")); + request.setProductId(payOrder.getId().toString()); + try { + WxPayNativeOrderResult order = wxService.createOrder(request); + byte[] bytes = QrCodeUtil.generatePng(order.getCodeUrl(), 300, 300); + OssClient storage = OssFactory.instance(); + UploadResult upload = storage.upload(bytes, storage.getPath("qrCode",".png"), "image/png"); + BeanUtil.copyProperties(payOrder,paymentOrdersVo); + paymentOrdersVo.setUrl(upload.getUrl()); + } catch (WxPayException e) { + throw new BaseException("获取微信支付二维码发生错误:{}"+e.getMessage()); + } + } + return R.ok(paymentOrdersVo); + } + + /** + * 回调通知地址 + * + * @Date 2023/7/3 + * @param + * @return void + **/ + @GetMapping("/notifyUrl") + public String notifyUrl(PayResponse payResponse) { + // 校验签名 + String mdString = "money=" + payResponse.getMoney() + "&name=" + payResponse.getName() + + "&out_trade_no=" + payResponse.getOut_trade_no() + "&pid=" + payConfig.getPid() + + "&trade_no=" + payResponse.getTrade_no() + "&trade_status=" + payResponse.getTrade_status() + + "&type=" + payResponse.getType() + payConfig.getKey(); + String sign = MD5Util.GetMD5Code(mdString); + if(!sign.equals(payResponse.getSign())){ + throw new BaseException("校验签名失败!"); + } + double money = Double.parseDouble(payResponse.getMoney()); + log.info("支付订单号{}",payResponse); + PaymentOrdersBo paymentOrdersBo = new PaymentOrdersBo(); + paymentOrdersBo.setOrderNo(payResponse.getOut_trade_no()); + List paymentOrdersList = paymentOrdersService.queryList(paymentOrdersBo); + if (CollectionUtil.isEmpty(paymentOrdersList)){ + throw new BaseException("订单不存在!"); + } + // 订单状态修改为已支付 + PaymentOrdersVo paymentOrdersVo = paymentOrdersList.get(0); + paymentOrdersVo.setPaymentStatus("2"); + paymentOrdersVo.setPaymentMethod(payResponse.getType()); + BeanUtil.copyProperties(paymentOrdersVo,paymentOrdersBo); + paymentOrdersService.updateByBo(paymentOrdersBo); + + SysUserVo sysUserVo = userService.selectUserById(paymentOrdersVo.getUserId()); + sysUserVo.setUserBalance(sysUserVo.getUserBalance() + money); + SysUserBo sysUserBo = new SysUserBo(); + BeanUtil.copyProperties(sysUserVo,sysUserBo); + // 设置为付费用户 + sysUserBo.setUserGrade("1"); + userService.updateUser(sysUserBo); + return "success"; + } + + /** + * 跳转通知地址 + * + * @Date 2023/7/3 + * @param + * @return void + **/ + @GetMapping("/return_url") + public void returnUrl() { + log.info("return_url==========="); + } + + + @PostMapping("/notify/wxOrder") + public String parseOrderNotifyResult(@RequestBody String xmlData) throws WxPayException { + WxPayOrderNotifyResult notifyResult = this.wxService.parseOrderNotifyResult(xmlData); + // TODO 根据自己业务场景需要构造返回对象 + PaymentOrdersBo paymentOrdersBo = new PaymentOrdersBo(); + paymentOrdersBo.setOrderNo(notifyResult.getOutTradeNo()); + List paymentOrdersList = paymentOrdersService.queryList(paymentOrdersBo); + PaymentOrdersVo paymentOrdersVo = paymentOrdersList.get(0); + paymentOrdersVo.setPaymentStatus("2"); + paymentOrdersVo.setPaymentMethod("wx"); + BeanUtil.copyProperties(paymentOrdersVo,paymentOrdersBo); + paymentOrdersService.updateByBo(paymentOrdersBo); + SysUserVo sysUserVo = userService.selectUserById(paymentOrdersVo.getUserId()); + sysUserVo.setUserBalance(sysUserVo.getUserBalance() + convertCentsToYuan(notifyResult.getTotalFee())); + SysUserBo sysUserBo = new SysUserBo(); + BeanUtil.copyProperties(sysUserVo,sysUserBo); + // 设置为付费用户 + sysUserBo.setUserGrade("1"); + userService.updateUser(sysUserBo); + return WxPayNotifyResponse.success("success"); + } + + /** + * 将分转换为元,并保留精度。 + * + * @param cents 分的金额,类型为Integer + * @return 转换后的元金额,类型为double + */ + public static double convertCentsToYuan(Integer cents) { + // 处理空输入 + if (cents == null) { + throw new IllegalArgumentException("输入的分金额不能为空"); + } + + // 100分 = 1元 + BigDecimal centsBigDecimal = new BigDecimal(cents); + BigDecimal yuan = centsBigDecimal.divide(new BigDecimal(100), 2, RoundingMode.HALF_UP); + // 转换为double并返回 + return yuan.doubleValue(); + } + + /** + * 获取订单信息 + * + */ + @PostMapping("/orderInfo") + public R orderInfo(@RequestBody OrderRequest orderRequest) { + if(StringUtils.isEmpty(orderRequest.getOrderNo())){ + throw new BaseException("订单号不能为空!"); + } + PaymentOrdersBo paymentOrdersBo = new PaymentOrdersBo(); + paymentOrdersBo.setOrderNo(orderRequest.getOrderNo()); + List paymentOrdersList = paymentOrdersService.queryList(paymentOrdersBo); + if (CollectionUtil.isEmpty(paymentOrdersList)){ + throw new BaseException("订单不存在!"); + } + PaymentOrdersVo paymentOrdersVo = paymentOrdersList.get(0); + return R.ok(paymentOrdersVo); + } + + // 获取支付链接 +// static { +// Stripe.apiKey = "sk_test_51PMMj2KcfX4oNioqXkoKpScTsgmR55xQki2tg8MEZJYc0gjhYV85t2FzDasE06eqZb0sqyYhOp3UXhcGGQLWI4A9008aq8SOnb"; +// } + + /** + * 去支付 + * 1、创建产品 + * 2、设置价格 + * 3、创建支付信息 得到url + * @return + */ + @PostMapping("/stripePay") + public String pay(@RequestBody OrderRequest orderRequest) throws StripeException { + + String enabled = configService.getConfigValue("stripe", "enabled"); + if(!Boolean.parseBoolean(enabled)){ + String prompt = configService.getConfigValue("stripe", "prompt"); + throw new BaseException(prompt); + } + + // 获取支付链接 + Stripe.apiKey = configService.getConfigValue("stripe", "key"); + + // 获取金额字符串并解析为 double + double moneyDouble = Double.parseDouble(orderRequest.getMoney()); + + // 将金额转换为以分为单位的整数 + int randMoney = (int) (moneyDouble * 100); + + Map params = new HashMap<>(); + params.put("name", orderRequest.getName()); + Product product = Product.create(params); + + Map recurring = new HashMap<>(); + recurring.put("interval", "month"); + Map params2 = new HashMap<>(); + params2.put("unit_amount", randMoney); + params2.put("currency", "usd"); + params2.put("recurring", recurring); + params2.put("product", product.getId()); + Price price = Price.create(params2); + + // 创建支付订单 + PaymentOrdersBo payOrder = paymentOrdersService.createPayOrder(orderRequest); + + //创建支付信息 得到url + SessionCreateParams params3 = SessionCreateParams.builder() + .setMode(SessionCreateParams.Mode.SUBSCRIPTION) + .setSuccessUrl(configService.getConfigValue("stripe", "success")) + .setCancelUrl(configService.getConfigValue("stripe", "cancel")) + .addLineItem( + SessionCreateParams.LineItem.builder() + .setQuantity(1L) + .setPrice(price.getId()) + .build()).putMetadata("orderId", payOrder.getOrderNo()) + .build(); + Session session = Session.create(params3); + return session.getUrl(); + } + + /** + * 支付回调 + * + */ + @PostMapping("/stripe_events") + public R stripeEvent(HttpServletRequest request) { + try { + String endpointSecret = configService.getConfigValue("stripe", "secret");//webhook秘钥签名 + InputStream inputStream = request.getInputStream(); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + byte[] buffer = new byte[1024*4]; + int n = 0; + while (-1 != (n = inputStream.read(buffer))) { + output.write(buffer, 0, n); + } + byte[] bytes = output.toByteArray(); + String payload = new String(bytes, "UTF-8"); + String sigHeader = request.getHeader("Stripe-Signature"); + Event event = Webhook.constructEvent(payload, sigHeader, endpointSecret);//验签,并获取事件 + if("checkout.session.completed".equals(event.getType())){ + // 解析 JSON 字符串为 JSONObject + JSONObject jsonObject = JSONUtil.parseObj(event); + // 获取 metadata 对象 + JSONObject metadata = jsonObject.getJSONObject("data") + .getJSONObject("object") + .getJSONObject("metadata"); + + OrderRequest orderRequest = new OrderRequest(); + orderRequest.setPayType("stripe"); + orderRequest.setOrderNo(metadata.getStr("orderId")); + paymentOrdersService.updatePayOrder(orderRequest); + } + } catch (Exception e) { + System.out.println("stripe异步通知(webhook事件)"+e); + } + return R.ok(); + } + + public String getKey(String key) { + return configService.getConfigValue("weixin", key); + } + +} + diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/PaymentOrdersController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/PaymentOrdersController.java new file mode 100644 index 0000000..428e7c2 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/PaymentOrdersController.java @@ -0,0 +1,108 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.PaymentOrdersBo; +import org.aibidding.system.domain.vo.PaymentOrdersVo; +import org.aibidding.system.service.IPaymentOrdersService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 支付订单 + * + * @author Lion Li + * @date 2024-04-16 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/orders") +public class PaymentOrdersController extends BaseController { + + private final IPaymentOrdersService paymentOrdersService; + + /** + * 查询支付订单列表 + */ + @SaCheckPermission("system:orders:list") + @GetMapping("/list") + public TableDataInfo list(PaymentOrdersBo bo, PageQuery pageQuery) { + pageQuery.setOrderByColumn("createTime"); + pageQuery.setIsAsc("desc"); + return paymentOrdersService.queryPageList(bo, pageQuery); + } + + /** + * 导出支付订单列表 + */ + @SaCheckPermission("system:orders:export") + @Log(title = "支付订单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(PaymentOrdersBo bo, HttpServletResponse response) { + List list = paymentOrdersService.queryList(bo); + ExcelUtil.exportExcel(list, "支付订单", PaymentOrdersVo.class, response); + } + + /** + * 获取支付订单详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("system:orders:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(paymentOrdersService.queryById(id)); + } + + /** + * 新增支付订单 + */ + @SaCheckPermission("system:orders:add") + @Log(title = "支付订单", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody PaymentOrdersBo bo) { + return toAjax(paymentOrdersService.insertByBo(bo)); + } + + /** + * 修改支付订单 + */ + @SaCheckPermission("system:orders:edit") + @Log(title = "支付订单", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody PaymentOrdersBo bo) { + return toAjax(paymentOrdersService.updateByBo(bo)); + } + + /** + * 删除支付订单 + * + * @param ids 主键串 + */ + @SaCheckPermission("system:orders:remove") + @Log(title = "支付订单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(paymentOrdersService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysConfigController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysConfigController.java new file mode 100644 index 0000000..de7861c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysConfigController.java @@ -0,0 +1,137 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysConfigBo; +import org.aibidding.system.domain.vo.SysConfigVo; +import org.aibidding.system.service.ISysConfigService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 参数配置 信息操作处理 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/config") +public class SysConfigController extends BaseController { + + private final ISysConfigService configService; + + /** + * 获取参数配置列表 + */ + @SaCheckPermission("system:config:list") + @GetMapping("/list") + public TableDataInfo list(SysConfigBo config, PageQuery pageQuery) { + return configService.selectPageConfigList(config, pageQuery); + } + + /** + * 导出参数配置列表 + */ + @Log(title = "参数管理", businessType = BusinessType.EXPORT) + @SaCheckPermission("system:config:export") + @PostMapping("/export") + public void export(SysConfigBo config, HttpServletResponse response) { + List list = configService.selectConfigList(config); + ExcelUtil.exportExcel(list, "参数数据", SysConfigVo.class, response); + } + + /** + * 根据参数编号获取详细信息 + * + * @param configId 参数ID + */ + @SaCheckPermission("system:config:query") + @GetMapping(value = "/{configId}") + public R getInfo(@PathVariable Long configId) { + return R.ok(configService.selectConfigById(configId)); + } + + /** + * 根据参数键名查询参数值 + * + * @param configKey 参数Key + */ + @GetMapping(value = "/configKey/{configKey}") + public R getConfigKey(@PathVariable String configKey) { + return R.ok(configService.selectConfigByKey(configKey)); + } + + /** + * 新增参数配置 + */ + @SaCheckPermission("system:config:add") + @Log(title = "参数管理", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysConfigBo config) { + if (!configService.checkConfigKeyUnique(config)) { + return R.fail("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); + } + configService.insertConfig(config); + return R.ok(); + } + + /** + * 修改参数配置 + */ + @SaCheckPermission("system:config:edit") + @Log(title = "参数管理", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysConfigBo config) { + if (!configService.checkConfigKeyUnique(config)) { + return R.fail("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); + } + configService.updateConfig(config); + return R.ok(); + } + + /** + * 根据参数键名修改参数配置 + */ + @SaCheckPermission("system:config:edit") + @Log(title = "参数管理", businessType = BusinessType.UPDATE) + @PutMapping("/updateByKey") + public R updateByKey(@RequestBody SysConfigBo config) { + configService.updateConfig(config); + return R.ok(); + } + + /** + * 删除参数配置 + * + * @param configIds 参数ID串 + */ + @SaCheckPermission("system:config:remove") + @Log(title = "参数管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{configIds}") + public R remove(@PathVariable Long[] configIds) { + configService.deleteConfigByIds(configIds); + return R.ok(); + } + + /** + * 刷新参数缓存 + */ + @SaCheckPermission("system:config:remove") + @Log(title = "参数管理", businessType = BusinessType.CLEAN) + @DeleteMapping("/refreshCache") + public R refreshCache() { + configService.resetConfigCache(); + return R.ok(); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysDeptController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysDeptController.java new file mode 100644 index 0000000..ec8d385 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysDeptController.java @@ -0,0 +1,120 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.convert.Convert; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysDeptBo; +import org.aibidding.system.domain.vo.SysDeptVo; +import org.aibidding.system.service.ISysDeptService; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 部门信息 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/dept") +public class SysDeptController extends BaseController { + + private final ISysDeptService deptService; + + /** + * 获取部门列表 + */ + @SaCheckPermission("system:dept:list") + @GetMapping("/list") + public R> list(SysDeptBo dept) { + List depts = deptService.selectDeptList(dept); + return R.ok(depts); + } + + /** + * 查询部门列表(排除节点) + * + * @param deptId 部门ID + */ + @SaCheckPermission("system:dept:list") + @GetMapping("/list/exclude/{deptId}") + public R> excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) { + List depts = deptService.selectDeptList(new SysDeptBo()); + depts.removeIf(d -> d.getDeptId().equals(deptId) + || StringUtils.splitList(d.getAncestors()).contains(Convert.toStr(deptId))); + return R.ok(depts); + } + + /** + * 根据部门编号获取详细信息 + * + * @param deptId 部门ID + */ + @SaCheckPermission("system:dept:query") + @GetMapping(value = "/{deptId}") + public R getInfo(@PathVariable Long deptId) { + deptService.checkDeptDataScope(deptId); + return R.ok(deptService.selectDeptById(deptId)); + } + + /** + * 新增部门 + */ + @SaCheckPermission("system:dept:add") + @Log(title = "部门管理", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysDeptBo dept) { + if (!deptService.checkDeptNameUnique(dept)) { + return R.fail("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); + } + return toAjax(deptService.insertDept(dept)); + } + + /** + * 修改部门 + */ + @SaCheckPermission("system:dept:edit") + @Log(title = "部门管理", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysDeptBo dept) { + Long deptId = dept.getDeptId(); + deptService.checkDeptDataScope(deptId); + if (!deptService.checkDeptNameUnique(dept)) { + return R.fail("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); + } else if (dept.getParentId().equals(deptId)) { + return R.fail("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); + } else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) + && deptService.selectNormalChildrenDeptById(deptId) > 0) { + return R.fail("该部门包含未停用的子部门!"); + } + return toAjax(deptService.updateDept(dept)); + } + + /** + * 删除部门 + * + * @param deptId 部门ID + */ + @SaCheckPermission("system:dept:remove") + @Log(title = "部门管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{deptId}") + public R remove(@PathVariable Long deptId) { + if (deptService.hasChildByDeptId(deptId)) { + return R.warn("存在下级部门,不允许删除"); + } + if (deptService.checkDeptExistUser(deptId)) { + return R.warn("部门存在用户,不允许删除"); + } + deptService.checkDeptDataScope(deptId); + return toAjax(deptService.deleteDeptById(deptId)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysDictDataController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysDictDataController.java new file mode 100644 index 0000000..1041059 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysDictDataController.java @@ -0,0 +1,117 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysDictDataBo; +import org.aibidding.system.domain.vo.SysDictDataVo; +import org.aibidding.system.service.ISysDictDataService; +import org.aibidding.system.service.ISysDictTypeService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + +/** + * 数据字典信息 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/dict/data") +public class SysDictDataController extends BaseController { + + private final ISysDictDataService dictDataService; + private final ISysDictTypeService dictTypeService; + + /** + * 查询字典数据列表 + */ + @SaCheckPermission("system:dict:list") + @GetMapping("/list") + public TableDataInfo list(SysDictDataBo dictData, PageQuery pageQuery) { + return dictDataService.selectPageDictDataList(dictData, pageQuery); + } + + /** + * 导出字典数据列表 + */ + @Log(title = "字典数据", businessType = BusinessType.EXPORT) + @SaCheckPermission("system:dict:export") + @PostMapping("/export") + public void export(SysDictDataBo dictData, HttpServletResponse response) { + List list = dictDataService.selectDictDataList(dictData); + ExcelUtil.exportExcel(list, "字典数据", SysDictDataVo.class, response); + } + + /** + * 查询字典数据详细 + * + * @param dictCode 字典code + */ + @SaCheckPermission("system:dict:query") + @GetMapping(value = "/{dictCode}") + public R getInfo(@PathVariable Long dictCode) { + return R.ok(dictDataService.selectDictDataById(dictCode)); + } + + /** + * 根据字典类型查询字典数据信息 + * + * @param dictType 字典类型 + */ + @GetMapping(value = "/type/{dictType}") + public R> dictType(@PathVariable String dictType) { + List data = dictTypeService.selectDictDataByType(dictType); + if (ObjectUtil.isNull(data)) { + data = new ArrayList<>(); + } + return R.ok(data); + } + + /** + * 新增字典类型 + */ + @SaCheckPermission("system:dict:add") + @Log(title = "字典数据", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysDictDataBo dict) { + dictDataService.insertDictData(dict); + return R.ok(); + } + + /** + * 修改保存字典类型 + */ + @SaCheckPermission("system:dict:edit") + @Log(title = "字典数据", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysDictDataBo dict) { + dictDataService.updateDictData(dict); + return R.ok(); + } + + /** + * 删除字典类型 + * + * @param dictCodes 字典code串 + */ + @SaCheckPermission("system:dict:remove") + @Log(title = "字典类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{dictCodes}") + public R remove(@PathVariable Long[] dictCodes) { + dictDataService.deleteDictDataByIds(dictCodes); + return R.ok(); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysDictTypeController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysDictTypeController.java new file mode 100644 index 0000000..c4b8106 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysDictTypeController.java @@ -0,0 +1,125 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysDictTypeBo; +import org.aibidding.system.domain.vo.SysDictTypeVo; +import org.aibidding.system.service.ISysDictTypeService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 数据字典信息 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/dict/type") +public class SysDictTypeController extends BaseController { + + private final ISysDictTypeService dictTypeService; + + /** + * 查询字典类型列表 + */ + @SaCheckPermission("system:dict:list") + @GetMapping("/list") + public TableDataInfo list(SysDictTypeBo dictType, PageQuery pageQuery) { + return dictTypeService.selectPageDictTypeList(dictType, pageQuery); + } + + /** + * 导出字典类型列表 + */ + @Log(title = "字典类型", businessType = BusinessType.EXPORT) + @SaCheckPermission("system:dict:export") + @PostMapping("/export") + public void export(SysDictTypeBo dictType, HttpServletResponse response) { + List list = dictTypeService.selectDictTypeList(dictType); + ExcelUtil.exportExcel(list, "字典类型", SysDictTypeVo.class, response); + } + + /** + * 查询字典类型详细 + * + * @param dictId 字典ID + */ + @SaCheckPermission("system:dict:query") + @GetMapping(value = "/{dictId}") + public R getInfo(@PathVariable Long dictId) { + return R.ok(dictTypeService.selectDictTypeById(dictId)); + } + + /** + * 新增字典类型 + */ + @SaCheckPermission("system:dict:add") + @Log(title = "字典类型", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysDictTypeBo dict) { + if (!dictTypeService.checkDictTypeUnique(dict)) { + return R.fail("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); + } + dictTypeService.insertDictType(dict); + return R.ok(); + } + + /** + * 修改字典类型 + */ + @SaCheckPermission("system:dict:edit") + @Log(title = "字典类型", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysDictTypeBo dict) { + if (!dictTypeService.checkDictTypeUnique(dict)) { + return R.fail("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); + } + dictTypeService.updateDictType(dict); + return R.ok(); + } + + /** + * 删除字典类型 + * + * @param dictIds 字典ID串 + */ + @SaCheckPermission("system:dict:remove") + @Log(title = "字典类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{dictIds}") + public R remove(@PathVariable Long[] dictIds) { + dictTypeService.deleteDictTypeByIds(dictIds); + return R.ok(); + } + + /** + * 刷新字典缓存 + */ + @SaCheckPermission("system:dict:remove") + @Log(title = "字典类型", businessType = BusinessType.CLEAN) + @DeleteMapping("/refreshCache") + public R refreshCache() { + dictTypeService.resetDictCache(); + return R.ok(); + } + + /** + * 获取字典选择框列表 + */ + @GetMapping("/optionselect") + public R> optionselect() { + List dictTypes = dictTypeService.selectDictTypeAll(); + return R.ok(dictTypes); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysMenuController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysMenuController.java new file mode 100644 index 0000000..15c9935 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysMenuController.java @@ -0,0 +1,183 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaCheckRole; +import cn.dev33.satoken.annotation.SaMode; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.constant.TenantConstants; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.SysMenu; +import org.aibidding.system.domain.bo.SysMenuBo; +import org.aibidding.system.domain.vo.MenuTreeSelectVo; +import org.aibidding.system.domain.vo.RouterVo; +import org.aibidding.system.domain.vo.SysMenuVo; +import org.aibidding.system.service.ISysMenuService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 菜单信息 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/menu") +public class SysMenuController extends BaseController { + + private final ISysMenuService menuService; + + /** + * 获取路由信息 + * + * @return 路由信息 + */ + @GetMapping("/getRouters") + public R> getRouters() { + List menus = menuService.selectMenuTreeByUserId(LoginHelper.getUserId()); + return R.ok(menuService.buildMenus(menus)); + } + + /** + * 获取菜单列表 + */ + @SaCheckRole(value = { + TenantConstants.SUPER_ADMIN_ROLE_KEY, + TenantConstants.TENANT_ADMIN_ROLE_KEY + }, mode = SaMode.OR) + @SaCheckPermission("system:menu:list") + @GetMapping("/list") + public R> list(SysMenuBo menu) { + List menus = menuService.selectMenuList(menu, LoginHelper.getUserId()); + return R.ok(menus); + } + + /** + * 根据菜单编号获取详细信息 + * + * @param menuId 菜单ID + */ + @SaCheckRole(value = { + TenantConstants.SUPER_ADMIN_ROLE_KEY, + TenantConstants.TENANT_ADMIN_ROLE_KEY + }, mode = SaMode.OR) + @SaCheckPermission("system:menu:query") + @GetMapping(value = "/{menuId}") + public R getInfo(@PathVariable Long menuId) { + return R.ok(menuService.selectMenuById(menuId)); + } + + /** + * 获取菜单下拉树列表 + */ + @SaCheckRole(value = { + TenantConstants.SUPER_ADMIN_ROLE_KEY, + TenantConstants.TENANT_ADMIN_ROLE_KEY + }, mode = SaMode.OR) + @SaCheckPermission("system:menu:query") + @GetMapping("/treeselect") + public R treeselect(SysMenuBo menu) { + List menus = menuService.selectMenuList(menu, LoginHelper.getUserId()); + MenuTreeSelectVo selectVo = new MenuTreeSelectVo(); + selectVo.setMenus(menuService.buildMenuTreeSelect(menus)); + return R.ok(selectVo); + } + + /** + * 加载对应角色菜单列表树 + * + * @param roleId 角色ID + */ + @SaCheckRole(value = { + TenantConstants.SUPER_ADMIN_ROLE_KEY, + TenantConstants.TENANT_ADMIN_ROLE_KEY + }, mode = SaMode.OR) + @SaCheckPermission("system:menu:query") + @GetMapping(value = "/roleMenuTreeselect/{roleId}") + public R roleMenuTreeselect(@PathVariable("roleId") Long roleId) { + List menus = menuService.selectMenuList(LoginHelper.getUserId()); + MenuTreeSelectVo selectVo = new MenuTreeSelectVo(); + selectVo.setCheckedKeys(menuService.selectMenuListByRoleId(roleId)); + selectVo.setMenus(menuService.buildMenuTreeSelect(menus)); + return R.ok(selectVo); + } + + /** + * 加载对应租户套餐菜单列表树 + * + * @param packageId 租户套餐ID + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:menu:query") + @GetMapping(value = "/tenantPackageMenuTreeselect/{packageId}") + public R tenantPackageMenuTreeselect(@PathVariable("packageId") Long packageId) { + List menus = menuService.selectMenuList(LoginHelper.getUserId()); + MenuTreeSelectVo selectVo = new MenuTreeSelectVo(); + selectVo.setCheckedKeys(menuService.selectMenuListByPackageId(packageId)); + selectVo.setMenus(menuService.buildMenuTreeSelect(menus)); + return R.ok(selectVo); + } + + /** + * 新增菜单 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:menu:add") + @Log(title = "菜单管理", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysMenuBo menu) { + if (!menuService.checkMenuNameUnique(menu)) { + return R.fail("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); + } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { + return R.fail("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); + } + return toAjax(menuService.insertMenu(menu)); + } + + /** + * 修改菜单 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:menu:edit") + @Log(title = "菜单管理", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysMenuBo menu) { + if (!menuService.checkMenuNameUnique(menu)) { + return R.fail("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); + } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { + return R.fail("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); + } else if (menu.getMenuId().equals(menu.getParentId())) { + return R.fail("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); + } + return toAjax(menuService.updateMenu(menu)); + } + + /** + * 删除菜单 + * + * @param menuId 菜单ID + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:menu:remove") + @Log(title = "菜单管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{menuId}") + public R remove(@PathVariable("menuId") Long menuId) { + if (menuService.hasChildByMenuId(menuId)) { + return R.warn("存在子菜单,不允许删除"); + } + if (menuService.checkMenuExistRole(menuId)) { + return R.warn("菜单已分配,不允许删除"); + } + return toAjax(menuService.deleteMenuById(menuId)); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysModelController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysModelController.java new file mode 100644 index 0000000..b9dbe1f --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysModelController.java @@ -0,0 +1,150 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.stp.StpUtil; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysModelBo; +import org.aibidding.system.domain.bo.SysPackagePlanBo; +import org.aibidding.system.domain.vo.SysModelVo; +import org.aibidding.system.domain.vo.SysPackagePlanVo; +import org.aibidding.system.domain.vo.SysUserVo; +import org.aibidding.system.service.ISysModelService; +import org.aibidding.system.service.ISysPackagePlanService; +import org.aibidding.system.service.ISysUserService; +import org.aibidding.system.util.DesensitizationUtil; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 系统模型 + * + * @author Lion Li + * @date 2024-04-04 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/model") +public class SysModelController extends BaseController { + + private final ISysModelService sysModelService; + + private final ISysPackagePlanService sysPackagePlanService; + + private final ISysUserService userService; + + /** + * 查询系统模型列表 - 全部 + */ + @GetMapping("/list") + public TableDataInfo list(SysModelBo bo, PageQuery pageQuery) { + return sysModelService.queryPageList(bo, pageQuery); + } + + /** + * 查询系统模型列表 + */ + @GetMapping("/modelList") + public R> modelList(SysModelBo bo) { + bo.setModelShow("0"); + List sysModelVos = sysModelService.queryList(bo); + SysPackagePlanBo sysPackagePlanBo = new SysPackagePlanBo(); + if (StpUtil.isLogin()) { + Long userId = LoginHelper.getLoginUser().getUserId(); + SysUserVo sysUserVo = userService.selectUserById(userId); + if ("0".equals(sysUserVo.getUserGrade())){ + sysPackagePlanBo.setName("Free"); + SysPackagePlanVo sysPackagePlanVo = sysPackagePlanService.queryList(sysPackagePlanBo).get(0); + List array = new ArrayList<>(Arrays.asList(sysPackagePlanVo.getPlanDetail().split(","))); + sysModelVos.removeIf(model -> !array.contains(model.getModelName())); + } + }else { + sysPackagePlanBo.setName("Visitor"); + SysPackagePlanVo sysPackagePlanVo = sysPackagePlanService.queryList(sysPackagePlanBo).get(0); + List array = new ArrayList<>(Arrays.asList(sysPackagePlanVo.getPlanDetail().split(","))); + sysModelVos.removeIf(model -> !array.contains(model.getModelName())); + } + sysModelVos.stream().map(vo -> { + String maskedApiHost = DesensitizationUtil.maskData(vo.getApiHost()); + String maskedApiKey = DesensitizationUtil.maskData(vo.getApiKey()); + vo.setApiHost(maskedApiHost); + vo.setApiKey(maskedApiKey); + return vo; + }) + .collect(Collectors.toList()); + return R.ok(sysModelVos); + } + + /** + * 导出系统模型列表 + */ + @Log(title = "系统模型", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(SysModelBo bo, HttpServletResponse response) { + List list = sysModelService.queryList(bo); + ExcelUtil.exportExcel(list, "系统模型", SysModelVo.class, response); + } + + /** + * 获取系统模型详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("system:model:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(sysModelService.queryById(id)); + } + + /** + * 新增系统模型 + */ + @Log(title = "系统模型", businessType = BusinessType.INSERT) + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody SysModelBo bo) { + return toAjax(sysModelService.insertByBo(bo)); + } + + /** + * 修改系统模型 + */ + @Log(title = "系统模型", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody SysModelBo bo) { + return toAjax(sysModelService.updateByBo(bo)); + } + + /** + * 删除系统模型 + * + * @param ids 主键串 + */ + @SaCheckPermission("system:model:remove") + @Log(title = "系统模型", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(sysModelService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysNoticeController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysNoticeController.java new file mode 100644 index 0000000..8dfa1fc --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysNoticeController.java @@ -0,0 +1,90 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.SysNotice; +import org.aibidding.system.domain.bo.SysNoticeBo; +import org.aibidding.system.domain.vo.SysNoticeVo; +import org.aibidding.system.service.ISysNoticeService; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * 公告 信息操作处理 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/notice") +public class SysNoticeController extends BaseController { + + private final ISysNoticeService noticeService; + + /** + * 获取公告列表 + */ + @GetMapping("/list") + public TableDataInfo list(SysNoticeBo notice, PageQuery pageQuery) { + //公告类型(1通知 2公告) + notice.setNoticeType("2"); + return noticeService.selectPageNoticeList(notice, pageQuery); + } + + /** + * 获取通知信息 + */ + @GetMapping("/getNotice") + public R getNotice(SysNoticeBo notice) { + return R.ok(noticeService.getNotice(notice)); + } + + /** + * 根据通知公告编号获取详细信息 + * + * @param noticeId 公告ID + */ + @SaCheckPermission("system:notice:query") + @GetMapping(value = "/{noticeId}") + public R getInfo(@PathVariable Long noticeId) { + return R.ok(noticeService.selectNoticeById(noticeId)); + } + + /** + * 新增通知公告 + */ + @SaCheckPermission("system:notice:add") + @Log(title = "通知公告", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysNoticeBo notice) { + return toAjax(noticeService.insertNotice(notice)); + } + + /** + * 修改通知公告 + */ + @Log(title = "通知公告", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysNoticeBo notice) { + return toAjax(noticeService.updateNotice(notice)); + } + + /** + * 删除通知公告 + * + * @param noticeIds 公告ID串 + */ + @SaCheckPermission("system:notice:remove") + @Log(title = "通知公告", businessType = BusinessType.DELETE) + @DeleteMapping("/{noticeIds}") + public R remove(@PathVariable Long[] noticeIds) { + return toAjax(noticeService.deleteNoticeByIds(noticeIds)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysNoticeStateController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysNoticeStateController.java new file mode 100644 index 0000000..d9efac8 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysNoticeStateController.java @@ -0,0 +1,98 @@ +package org.aibidding.system.controller.system; + +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysNoticeStateBo; +import org.aibidding.system.domain.vo.SysNoticeStateVo; +import org.aibidding.system.service.ISysNoticeStateService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 用户阅读状态 + * + * @author Lion Li + * @date 2024-05-11 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/noticeState") +public class SysNoticeStateController extends BaseController { + + private final ISysNoticeStateService sysNoticeStateService; + + /** + * 查询用户阅读状态列表 + */ + @GetMapping("/list") + public TableDataInfo list(SysNoticeStateBo bo, PageQuery pageQuery) { + return sysNoticeStateService.queryPageList(bo, pageQuery); + } + + /** + * 导出用户阅读状态列表 + */ + @Log(title = "用户阅读状态", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(SysNoticeStateBo bo, HttpServletResponse response) { + List list = sysNoticeStateService.queryList(bo); + ExcelUtil.exportExcel(list, "用户阅读状态", SysNoticeStateVo.class, response); + } + + /** + * 获取用户阅读状态详细信息 + * + * @param id 主键 + */ + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(sysNoticeStateService.queryById(id)); + } + + /** + * 新增用户阅读状态 + */ + @Log(title = "用户阅读状态", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody SysNoticeStateBo bo) { + return toAjax(sysNoticeStateService.insertByBo(bo)); + } + + /** + * 修改用户阅读状态 + */ + @PutMapping() + public R edit(@RequestBody SysNoticeStateBo bo) { + bo.setUserId(LoginHelper.getUserId()); + return toAjax(sysNoticeStateService.updateByBo(bo)); + } + + /** + * 删除用户阅读状态 + * + * @param ids 主键串 + */ + @Log(title = "用户阅读状态", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(sysNoticeStateService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysOssConfigController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysOssConfigController.java new file mode 100644 index 0000000..5fc9e11 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysOssConfigController.java @@ -0,0 +1,105 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.core.validate.QueryGroup; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysOssConfigBo; +import org.aibidding.system.domain.vo.SysOssConfigVo; +import org.aibidding.system.service.ISysOssConfigService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 对象存储配置 + * + * @author Lion Li + * @author 孤舟烟雨 + * @date 2021-08-13 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/resource/oss/config") +public class SysOssConfigController extends BaseController { + + private final ISysOssConfigService ossConfigService; + + /** + * 查询对象存储配置列表 + */ + @SaCheckPermission("system:oss:list") + @GetMapping("/list") + public TableDataInfo list(@Validated(QueryGroup.class) SysOssConfigBo bo, PageQuery pageQuery) { + return ossConfigService.queryPageList(bo, pageQuery); + } + + /** + * 获取对象存储配置详细信息 + * + * @param ossConfigId OSS配置ID + */ + @SaCheckPermission("system:oss:query") + @GetMapping("/{ossConfigId}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long ossConfigId) { + return R.ok(ossConfigService.queryById(ossConfigId)); + } + + /** + * 新增对象存储配置 + */ + @SaCheckPermission("system:oss:add") + @Log(title = "对象存储配置", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody SysOssConfigBo bo) { + return toAjax(ossConfigService.insertByBo(bo)); + } + + /** + * 修改对象存储配置 + */ + @SaCheckPermission("system:oss:edit") + @Log(title = "对象存储配置", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody SysOssConfigBo bo) { + return toAjax(ossConfigService.updateByBo(bo)); + } + + /** + * 删除对象存储配置 + * + * @param ossConfigIds OSS配置ID串 + */ + @SaCheckPermission("system:oss:remove") + @Log(title = "对象存储配置", businessType = BusinessType.DELETE) + @DeleteMapping("/{ossConfigIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ossConfigIds) { + return toAjax(ossConfigService.deleteWithValidByIds(List.of(ossConfigIds), true)); + } + + /** + * 状态修改 + */ + @SaCheckPermission("system:oss:edit") + @Log(title = "对象存储状态修改", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public R changeStatus(@RequestBody SysOssConfigBo bo) { + return toAjax(ossConfigService.updateOssConfigStatus(bo)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysOssController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysOssController.java new file mode 100644 index 0000000..d3c9409 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysOssController.java @@ -0,0 +1,108 @@ +package org.aibidding.system.controller.system; + + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.QueryGroup; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysOssBo; +import org.aibidding.system.domain.vo.SysOssUploadVo; +import org.aibidding.system.domain.vo.SysOssVo; +import org.aibidding.system.service.ISysOssService; +import org.springframework.http.MediaType; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +/** + * 文件上传 控制层 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/resource/oss") +public class SysOssController extends BaseController { + + private final ISysOssService ossService; + + /** + * 查询OSS对象存储列表 + */ + @SaCheckPermission("system:oss:list") + @GetMapping("/list") + public TableDataInfo list(@Validated(QueryGroup.class) SysOssBo bo, PageQuery pageQuery) { + return ossService.queryPageList(bo, pageQuery); + } + + /** + * 查询OSS对象基于id串 + * + * @param ossIds OSS对象ID串 + */ + @SaCheckPermission("system:oss:list") + @GetMapping("/listByIds/{ossIds}") + public R> listByIds(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ossIds) { + List list = ossService.listByIds(Arrays.asList(ossIds)); + return R.ok(list); + } + + /** + * 上传OSS对象存储 + * + * @param file 文件 + */ + @SaCheckPermission("system:oss:upload") + @Log(title = "OSS对象存储", businessType = BusinessType.INSERT) + @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public R upload(@RequestPart("file") MultipartFile file) { + if (ObjectUtil.isNull(file)) { + return R.fail("上传文件不能为空"); + } + SysOssVo oss = ossService.upload(file); + SysOssUploadVo uploadVo = new SysOssUploadVo(); + uploadVo.setUrl(oss.getUrl()); + uploadVo.setFileName(oss.getOriginalName()); + uploadVo.setOssId(oss.getOssId().toString()); + return R.ok(uploadVo); + } + + /** + * 下载OSS对象 + * + * @param ossId OSS对象ID + */ + @SaCheckPermission("system:oss:download") + @GetMapping("/download/{ossId}") + public void download(@PathVariable Long ossId, HttpServletResponse response) throws IOException { + ossService.download(ossId, response); + } + + /** + * 删除OSS对象存储 + * + * @param ossIds OSS对象ID串 + */ + @SaCheckPermission("system:oss:remove") + @Log(title = "OSS对象存储", businessType = BusinessType.DELETE) + @DeleteMapping("/{ossIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ossIds) { + return toAjax(ossService.deleteWithValidByIds(List.of(ossIds), true)); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysPackagePlanController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysPackagePlanController.java new file mode 100644 index 0000000..4bb6301 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysPackagePlanController.java @@ -0,0 +1,114 @@ +package org.aibidding.system.controller.system; + +import java.util.List; + +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; + +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.log.enums.BusinessType; + +import org.aibidding.system.domain.vo.SysPackagePlanVo; +import org.aibidding.system.domain.bo.SysPackagePlanBo; +import org.aibidding.system.service.ISysPackagePlanService; +import org.aibidding.common.mybatis.core.page.TableDataInfo; + +/** + * 套餐管理 + * + * @author Lion Li + * @date 2024-05-05 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/packagePlan") +public class SysPackagePlanController extends BaseController { + + private final ISysPackagePlanService sysPackagePlanService; + + /** + * 查询套餐管理列表 + */ + @GetMapping("/list") + public TableDataInfo list(SysPackagePlanBo bo, PageQuery pageQuery) { + return sysPackagePlanService.queryPageList(bo, pageQuery); + } + + @GetMapping("/listPlan") + public R> listPlan() { + return R.ok(sysPackagePlanService.queryList(new SysPackagePlanBo())); + } + + /** + * 导出套餐管理列表 + */ + @SaCheckPermission("system:packagePlan:export") + @Log(title = "套餐管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(SysPackagePlanBo bo, HttpServletResponse response) { + List list = sysPackagePlanService.queryList(bo); + ExcelUtil.exportExcel(list, "套餐管理", SysPackagePlanVo.class, response); + } + + /** + * 获取套餐管理详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("system:packagePlan:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(sysPackagePlanService.queryById(id)); + } + + + + + /** + * 新增套餐管理 + */ + @SaCheckPermission("system:packagePlan:add") + @Log(title = "套餐管理", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody SysPackagePlanBo bo) { + return toAjax(sysPackagePlanService.insertByBo(bo)); + } + + /** + * 修改套餐管理 + */ + @SaCheckPermission("system:packagePlan:edit") + @Log(title = "套餐管理", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody SysPackagePlanBo bo) { + return toAjax(sysPackagePlanService.updateByBo(bo)); + } + + /** + * 删除套餐管理 + * + * @param ids 主键串 + */ + @SaCheckPermission("system:packagePlan:remove") + @Log(title = "套餐管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(sysPackagePlanService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysPostController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysPostController.java new file mode 100644 index 0000000..07b39c7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysPostController.java @@ -0,0 +1,115 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysPostBo; +import org.aibidding.system.domain.vo.SysPostVo; +import org.aibidding.system.service.ISysPostService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 岗位信息操作处理 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/post") +public class SysPostController extends BaseController { + + private final ISysPostService postService; + + /** + * 获取岗位列表 + */ + @SaCheckPermission("system:post:list") + @GetMapping("/list") + public TableDataInfo list(SysPostBo post, PageQuery pageQuery) { + return postService.selectPagePostList(post, pageQuery); + } + + /** + * 导出岗位列表 + */ + @Log(title = "岗位管理", businessType = BusinessType.EXPORT) + @SaCheckPermission("system:post:export") + @PostMapping("/export") + public void export(SysPostBo post, HttpServletResponse response) { + List list = postService.selectPostList(post); + ExcelUtil.exportExcel(list, "岗位数据", SysPostVo.class, response); + } + + /** + * 根据岗位编号获取详细信息 + * + * @param postId 岗位ID + */ + @SaCheckPermission("system:post:query") + @GetMapping(value = "/{postId}") + public R getInfo(@PathVariable Long postId) { + return R.ok(postService.selectPostById(postId)); + } + + /** + * 新增岗位 + */ + @SaCheckPermission("system:post:add") + @Log(title = "岗位管理", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysPostBo post) { + if (!postService.checkPostNameUnique(post)) { + return R.fail("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); + } else if (!postService.checkPostCodeUnique(post)) { + return R.fail("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); + } + return toAjax(postService.insertPost(post)); + } + + /** + * 修改岗位 + */ + @SaCheckPermission("system:post:edit") + @Log(title = "岗位管理", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysPostBo post) { + if (!postService.checkPostNameUnique(post)) { + return R.fail("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); + } else if (!postService.checkPostCodeUnique(post)) { + return R.fail("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); + } + return toAjax(postService.updatePost(post)); + } + + /** + * 删除岗位 + * + * @param postIds 岗位ID串 + */ + @SaCheckPermission("system:post:remove") + @Log(title = "岗位管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{postIds}") + public R remove(@PathVariable Long[] postIds) { + return toAjax(postService.deletePostByIds(postIds)); + } + + /** + * 获取岗位选择框列表 + */ + @GetMapping("/optionselect") + public R> optionselect() { + List posts = postService.selectPostAll(); + return R.ok(posts); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysProfileController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysProfileController.java new file mode 100644 index 0000000..2bc9bc7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysProfileController.java @@ -0,0 +1,121 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.secure.BCrypt; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.io.FileUtil; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.core.utils.file.MimeTypeUtils; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysUserBo; +import org.aibidding.system.domain.bo.SysUserPasswordBo; +import org.aibidding.system.domain.bo.SysUserProfileBo; +import org.aibidding.system.domain.vo.AvatarVo; +import org.aibidding.system.domain.vo.ProfileVo; +import org.aibidding.system.domain.vo.SysOssVo; +import org.aibidding.system.domain.vo.SysUserVo; +import org.aibidding.system.service.ISysOssService; +import org.aibidding.system.service.ISysUserService; +import org.springframework.http.MediaType; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.Arrays; + +/** + * 个人信息 业务处理 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/user/profile") +public class SysProfileController extends BaseController { + + private final ISysUserService userService; + private final ISysOssService ossService; + + /** + * 个人信息 + */ + @GetMapping + public R profile() { + SysUserVo user = userService.selectUserById(LoginHelper.getUserId()); + ProfileVo profileVo = new ProfileVo(); + profileVo.setUser(user); + profileVo.setRoleGroup(userService.selectUserRoleGroup(user.getUserName())); + profileVo.setPostGroup(userService.selectUserPostGroup(user.getUserName())); + return R.ok(profileVo); + } + + /** + * 修改用户 + */ + @Log(title = "个人信息", businessType = BusinessType.UPDATE) + @PutMapping + public R updateProfile(@RequestBody SysUserProfileBo profile) { + SysUserBo user = BeanUtil.toBean(profile, SysUserBo.class); + if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { + return R.fail("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); + } + if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { + return R.fail("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); + } + user.setUserId(LoginHelper.getUserId()); + if (userService.updateUserProfile(user) > 0) { + return R.ok(); + } + return R.fail("修改个人信息异常,请联系管理员"); + } + + /** + * 重置密码 + */ + @Log(title = "个人信息", businessType = BusinessType.UPDATE) + @PutMapping("/updatePwd") + public R updatePwd(@Validated @RequestBody SysUserPasswordBo bo) { + SysUserVo user = userService.selectUserById(LoginHelper.getUserId()); + String password = user.getPassword(); + if (!BCrypt.checkpw(bo.getOldPassword(), password)) { + return R.fail("修改密码失败,旧密码错误"); + } + if (BCrypt.checkpw(bo.getNewPassword(), password)) { + return R.fail("新密码不能与旧密码相同"); + } + + if (userService.resetUserPwd(user.getUserId(), BCrypt.hashpw(bo.getNewPassword())) > 0) { + return R.ok(); + } + return R.fail("修改密码异常,请联系管理员"); + } + + /** + * 头像上传 + * + * @param avatarfile 用户头像 + */ + @Log(title = "用户头像", businessType = BusinessType.UPDATE) + @PostMapping(value = "/avatar", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public R avatar(@RequestPart("avatarfile") MultipartFile avatarfile) { + if (!avatarfile.isEmpty()) { + String extension = FileUtil.extName(avatarfile.getOriginalFilename()); + if (!StringUtils.equalsAnyIgnoreCase(extension, MimeTypeUtils.IMAGE_EXTENSION)) { + return R.fail("文件格式不正确,请上传" + Arrays.toString(MimeTypeUtils.IMAGE_EXTENSION) + "格式"); + } + SysOssVo oss = ossService.upload(avatarfile); + String avatar = oss.getUrl(); + if (userService.updateUserAvatar(LoginHelper.getUserId(), oss.getUrl())) { + AvatarVo avatarVo = new AvatarVo(); + avatarVo.setImgUrl(avatar); + return R.ok(avatarVo); + } + } + return R.fail("上传图片异常,请联系管理员"); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysRoleController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysRoleController.java new file mode 100644 index 0000000..e5682b3 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysRoleController.java @@ -0,0 +1,226 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.SysUserRole; +import org.aibidding.system.domain.bo.SysDeptBo; +import org.aibidding.system.domain.bo.SysRoleBo; +import org.aibidding.system.domain.bo.SysUserBo; +import org.aibidding.system.domain.vo.DeptTreeSelectVo; +import org.aibidding.system.domain.vo.SysRoleVo; +import org.aibidding.system.domain.vo.SysUserVo; +import org.aibidding.system.service.ISysDeptService; +import org.aibidding.system.service.ISysRoleService; +import org.aibidding.system.service.ISysUserService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 角色信息 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/role") +public class SysRoleController extends BaseController { + + private final ISysRoleService roleService; + private final ISysUserService userService; + private final ISysDeptService deptService; + + /** + * 获取角色信息列表 + */ + @SaCheckPermission("system:role:list") + @GetMapping("/list") + public TableDataInfo list(SysRoleBo role, PageQuery pageQuery) { + return roleService.selectPageRoleList(role, pageQuery); + } + + /** + * 导出角色信息列表 + */ + @Log(title = "角色管理", businessType = BusinessType.EXPORT) + @SaCheckPermission("system:role:export") + @PostMapping("/export") + public void export(SysRoleBo role, HttpServletResponse response) { + List list = roleService.selectRoleList(role); + ExcelUtil.exportExcel(list, "角色数据", SysRoleVo.class, response); + } + + /** + * 根据角色编号获取详细信息 + * + * @param roleId 角色ID + */ + @SaCheckPermission("system:role:query") + @GetMapping(value = "/{roleId}") + public R getInfo(@PathVariable Long roleId) { + roleService.checkRoleDataScope(roleId); + return R.ok(roleService.selectRoleById(roleId)); + } + + /** + * 新增角色 + */ + @SaCheckPermission("system:role:add") + @Log(title = "角色管理", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysRoleBo role) { + if (!roleService.checkRoleNameUnique(role)) { + return R.fail("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); + } else if (!roleService.checkRoleKeyUnique(role)) { + return R.fail("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); + } + return toAjax(roleService.insertRole(role)); + + } + + /** + * 修改保存角色 + */ + @SaCheckPermission("system:role:edit") + @Log(title = "角色管理", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysRoleBo role) { + roleService.checkRoleAllowed(role.getRoleId()); + roleService.checkRoleDataScope(role.getRoleId()); + if (!roleService.checkRoleNameUnique(role)) { + return R.fail("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); + } else if (!roleService.checkRoleKeyUnique(role)) { + return R.fail("修改角色'" + role.getRoleName() + "'失败,角色权限已存在"); + } + + if (roleService.updateRole(role) > 0) { + roleService.cleanOnlineUserByRole(role.getRoleId()); + return R.ok(); + } + return R.fail("修改角色'" + role.getRoleName() + "'失败,请联系管理员"); + } + + /** + * 修改保存数据权限 + */ + @SaCheckPermission("system:role:edit") + @Log(title = "角色管理", businessType = BusinessType.UPDATE) + @PutMapping("/dataScope") + public R dataScope(@RequestBody SysRoleBo role) { + roleService.checkRoleAllowed(role.getRoleId()); + roleService.checkRoleDataScope(role.getRoleId()); + return toAjax(roleService.authDataScope(role)); + } + + /** + * 状态修改 + */ + @SaCheckPermission("system:role:edit") + @Log(title = "角色管理", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public R changeStatus(@RequestBody SysRoleBo role) { + roleService.checkRoleAllowed(role.getRoleId()); + roleService.checkRoleDataScope(role.getRoleId()); + return toAjax(roleService.updateRoleStatus(role.getRoleId(), role.getStatus())); + } + + /** + * 删除角色 + * + * @param roleIds 角色ID串 + */ + @SaCheckPermission("system:role:remove") + @Log(title = "角色管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{roleIds}") + public R remove(@PathVariable Long[] roleIds) { + return toAjax(roleService.deleteRoleByIds(roleIds)); + } + + /** + * 获取角色选择框列表 + */ + @SaCheckPermission("system:role:query") + @GetMapping("/optionselect") + public R> optionselect() { + return R.ok(roleService.selectRoleAll()); + } + + /** + * 查询已分配用户角色列表 + */ + @SaCheckPermission("system:role:list") + @GetMapping("/authUser/allocatedList") + public TableDataInfo allocatedList(SysUserBo user, PageQuery pageQuery) { + return userService.selectAllocatedList(user, pageQuery); + } + + /** + * 查询未分配用户角色列表 + */ + @SaCheckPermission("system:role:list") + @GetMapping("/authUser/unallocatedList") + public TableDataInfo unallocatedList(SysUserBo user, PageQuery pageQuery) { + return userService.selectUnallocatedList(user, pageQuery); + } + + /** + * 取消授权用户 + */ + @SaCheckPermission("system:role:edit") + @Log(title = "角色管理", businessType = BusinessType.GRANT) + @PutMapping("/authUser/cancel") + public R cancelAuthUser(@RequestBody SysUserRole userRole) { + return toAjax(roleService.deleteAuthUser(userRole)); + } + + /** + * 批量取消授权用户 + * + * @param roleId 角色ID + * @param userIds 用户ID串 + */ + @SaCheckPermission("system:role:edit") + @Log(title = "角色管理", businessType = BusinessType.GRANT) + @PutMapping("/authUser/cancelAll") + public R cancelAuthUserAll(Long roleId, Long[] userIds) { + return toAjax(roleService.deleteAuthUsers(roleId, userIds)); + } + + /** + * 批量选择用户授权 + * + * @param roleId 角色ID + * @param userIds 用户ID串 + */ + @SaCheckPermission("system:role:edit") + @Log(title = "角色管理", businessType = BusinessType.GRANT) + @PutMapping("/authUser/selectAll") + public R selectAuthUserAll(Long roleId, Long[] userIds) { + roleService.checkRoleDataScope(roleId); + return toAjax(roleService.insertAuthUsers(roleId, userIds)); + } + + /** + * 获取对应角色部门树列表 + * + * @param roleId 角色ID + */ + @SaCheckPermission("system:role:list") + @GetMapping(value = "/deptTree/{roleId}") + public R roleDeptTreeselect(@PathVariable("roleId") Long roleId) { + DeptTreeSelectVo selectVo = new DeptTreeSelectVo(); + selectVo.setCheckedKeys(deptService.selectDeptListByRoleId(roleId)); + selectVo.setDepts(deptService.selectDeptTreeList(new SysDeptBo())); + return R.ok(selectVo); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysTenantController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysTenantController.java new file mode 100644 index 0000000..9f7bffb --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysTenantController.java @@ -0,0 +1,174 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaCheckRole; +import com.baomidou.lock.annotation.Lock4j; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.constant.TenantConstants; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.tenant.helper.TenantHelper; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysTenantBo; +import org.aibidding.system.domain.vo.SysTenantVo; +import org.aibidding.system.service.ISysTenantService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 租户管理 + * + * @author Michelle.Chung + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/tenant") +public class SysTenantController extends BaseController { + + private final ISysTenantService tenantService; + + /** + * 查询租户列表 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenant:list") + @GetMapping("/list") + public TableDataInfo list(SysTenantBo bo, PageQuery pageQuery) { + return tenantService.queryPageList(bo, pageQuery); + } + + /** + * 导出租户列表 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenant:export") + @Log(title = "租户", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(SysTenantBo bo, HttpServletResponse response) { + List list = tenantService.queryList(bo); + ExcelUtil.exportExcel(list, "租户", SysTenantVo.class, response); + } + + /** + * 获取租户详细信息 + * + * @param id 主键 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenant:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(tenantService.queryById(id)); + } + + /** + * 新增租户 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenant:add") + @Log(title = "租户", businessType = BusinessType.INSERT) + @Lock4j + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody SysTenantBo bo) { + if (!tenantService.checkCompanyNameUnique(bo)) { + return R.fail("新增租户'" + bo.getCompanyName() + "'失败,企业名称已存在"); + } + return toAjax(TenantHelper.ignore(() -> tenantService.insertByBo(bo))); + } + + /** + * 修改租户 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenant:edit") + @Log(title = "租户", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody SysTenantBo bo) { + tenantService.checkTenantAllowed(bo.getTenantId()); + if (!tenantService.checkCompanyNameUnique(bo)) { + return R.fail("修改租户'" + bo.getCompanyName() + "'失败,公司名称已存在"); + } + return toAjax(tenantService.updateByBo(bo)); + } + + /** + * 状态修改 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenant:edit") + @Log(title = "租户", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public R changeStatus(@RequestBody SysTenantBo bo) { + tenantService.checkTenantAllowed(bo.getTenantId()); + return toAjax(tenantService.updateTenantStatus(bo)); + } + + /** + * 删除租户 + * + * @param ids 主键串 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenant:remove") + @Log(title = "租户", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(tenantService.deleteWithValidByIds(List.of(ids), true)); + } + + /** + * 动态切换租户 + * + * @param tenantId 租户ID + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @GetMapping("/dynamic/{tenantId}") + public R dynamicTenant(@NotBlank(message = "租户ID不能为空") @PathVariable String tenantId) { + TenantHelper.setDynamic(tenantId); + return R.ok(); + } + + /** + * 清除动态租户 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @GetMapping("/dynamic/clear") + public R dynamicClear() { + TenantHelper.clearDynamic(); + return R.ok(); + } + + + /** + * 同步租户套餐 + * + * @param tenantId 租户id + * @param packageId 套餐id + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenant:edit") + @Log(title = "租户", businessType = BusinessType.UPDATE) + @GetMapping("/syncTenantPackage") + public R syncTenantPackage(@NotBlank(message = "租户ID不能为空") String tenantId, @NotBlank(message = "套餐ID不能为空") String packageId) { + return toAjax(TenantHelper.ignore(() -> tenantService.syncTenantPackage(tenantId, packageId))); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysTenantPackageController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysTenantPackageController.java new file mode 100644 index 0000000..011bd12 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysTenantPackageController.java @@ -0,0 +1,134 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaCheckRole; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.constant.TenantConstants; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysTenantPackageBo; +import org.aibidding.system.domain.vo.SysTenantPackageVo; +import org.aibidding.system.service.ISysTenantPackageService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 租户套餐管理 + * + * @author Michelle.Chung + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/tenant/package") +public class SysTenantPackageController extends BaseController { + + private final ISysTenantPackageService tenantPackageService; + + /** + * 查询租户套餐列表 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenantPackage:list") + @GetMapping("/list") + public TableDataInfo list(SysTenantPackageBo bo, PageQuery pageQuery) { + return tenantPackageService.queryPageList(bo, pageQuery); + } + + /** + * 查询租户套餐下拉选列表 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenantPackage:list") + @GetMapping("/selectList") + public R> selectList() { + return R.ok(tenantPackageService.selectList()); + } + + /** + * 导出租户套餐列表 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenantPackage:export") + @Log(title = "租户套餐", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(SysTenantPackageBo bo, HttpServletResponse response) { + List list = tenantPackageService.queryList(bo); + ExcelUtil.exportExcel(list, "租户套餐", SysTenantPackageVo.class, response); + } + + /** + * 获取租户套餐详细信息 + * + * @param packageId 主键 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenantPackage:query") + @GetMapping("/{packageId}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long packageId) { + return R.ok(tenantPackageService.queryById(packageId)); + } + + /** + * 新增租户套餐 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenantPackage:add") + @Log(title = "租户套餐", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody SysTenantPackageBo bo) { + return toAjax(tenantPackageService.insertByBo(bo)); + } + + /** + * 修改租户套餐 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenantPackage:edit") + @Log(title = "租户套餐", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody SysTenantPackageBo bo) { + return toAjax(tenantPackageService.updateByBo(bo)); + } + + /** + * 状态修改 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenantPackage:edit") + @Log(title = "租户套餐", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public R changeStatus(@RequestBody SysTenantPackageBo bo) { + return toAjax(tenantPackageService.updatePackageStatus(bo)); + } + + /** + * 删除租户套餐 + * + * @param packageIds 主键串 + */ + @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) + @SaCheckPermission("system:tenantPackage:remove") + @Log(title = "租户套餐", businessType = BusinessType.DELETE) + @DeleteMapping("/{packageIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] packageIds) { + return toAjax(tenantPackageService.deleteWithValidByIds(List.of(packageIds), true)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysUserController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysUserController.java new file mode 100644 index 0000000..e0ee39b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysUserController.java @@ -0,0 +1,324 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.secure.BCrypt; +import cn.hutool.core.lang.tree.Tree; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ObjectUtil; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StreamUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.excel.core.ExcelResult; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.common.tenant.helper.TenantHelper; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysDeptBo; +import org.aibidding.system.domain.bo.SysUserBo; +import org.aibidding.system.domain.request.UserRequest; +import org.aibidding.system.domain.vo.*; +import org.aibidding.system.listener.SysUserImportListener; +import org.aibidding.system.service.*; +import org.springframework.http.MediaType; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 用户信息 + * + * @author Lion Li + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/user") +public class SysUserController extends BaseController { + + private final ISysUserService userService; + private final ISysRoleService roleService; + private final ISysPostService postService; + private final ISysDeptService deptService; + private final ISysTenantService tenantService; + private final ISysOssService ossService; + /** + * 获取用户列表 + */ + @SaCheckPermission("system:user:list") + @GetMapping("/list") + public TableDataInfo list(SysUserBo user, PageQuery pageQuery) { + return userService.selectPageUserList(user, pageQuery); + } + + /** + * 获取用户列表 + */ + @GetMapping("/getUserOption") + public R> getUserOption() { + List sysUserVos = userService.selectUserList(new SysUserBo()); + List collect = sysUserVos.stream() + .map(this::convertToUserOptionVo) + .collect(Collectors.toList()); + return R.ok(collect); + } + + private SysUserOptionVo convertToUserOptionVo(SysUserVo sysUserVo) { + SysUserOptionVo sysUserOptionVo = new SysUserOptionVo(); + sysUserOptionVo.setUserId(sysUserVo.getUserId()); + sysUserOptionVo.setName(sysUserVo.getNickName()); + return sysUserOptionVo; + } + + /** + * 导出用户列表 + */ + @Log(title = "用户管理", businessType = BusinessType.EXPORT) + @SaCheckPermission("system:user:export") + @PostMapping("/export") + public void export(SysUserBo user, HttpServletResponse response) { + List list = userService.selectUserList(user); + List listVo = MapstructUtils.convert(list, SysUserExportVo.class); + ExcelUtil.exportExcel(listVo, "用户数据", SysUserExportVo.class, response); + } + + /** + * 导入数据 + * + * @param file 导入文件 + * @param updateSupport 是否更新已存在数据 + */ + @Log(title = "用户管理", businessType = BusinessType.IMPORT) + @SaCheckPermission("system:user:import") + @PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public R importData(@RequestPart("file") MultipartFile file, boolean updateSupport) throws Exception { + ExcelResult result = ExcelUtil.importExcel(file.getInputStream(), SysUserImportVo.class, new SysUserImportListener(updateSupport)); + return R.ok(result.getAnalysis()); + } + + /** + * 获取导入模板 + */ + @PostMapping("/importTemplate") + public void importTemplate(HttpServletResponse response) { + ExcelUtil.exportExcel(new ArrayList<>(), "用户数据", SysUserImportVo.class, response); + } + + /** + * 获取用户信息 + * + * @return 用户信息 + */ + @GetMapping("/getInfo") + public R getInfo() { + UserInfoVo userInfoVo = new UserInfoVo(); + LoginUser loginUser = LoginHelper.getLoginUser(); + if (TenantHelper.isEnable() && LoginHelper.isSuperAdmin()) { + // 超级管理员 如果重新加载用户信息需清除动态租户 + TenantHelper.clearDynamic(); + } + SysUserVo user = userService.selectUserById(loginUser.getUserId()); + userInfoVo.setUser(user); + userInfoVo.setPermissions(loginUser.getMenuPermission()); + userInfoVo.setRoles(loginUser.getRolePermission()); + return R.ok(userInfoVo); + } + + /** + * 根据用户编号获取详细信息 + * + * @param userId 用户ID + */ + @SaCheckPermission("system:user:query") + @GetMapping(value = {"/", "/{userId}"}) + public R getInfo(@PathVariable(value = "userId", required = false) Long userId) { + userService.checkUserDataScope(userId); + SysUserInfoVo userInfoVo = new SysUserInfoVo(); + List roles = roleService.selectRoleAll(); + userInfoVo.setRoles(LoginHelper.isSuperAdmin(userId) ? roles : StreamUtils.filter(roles, r -> !r.isSuperAdmin())); + userInfoVo.setPosts(postService.selectPostAll()); + if (ObjectUtil.isNotNull(userId)) { + SysUserVo sysUser = userService.selectUserById(userId); + userInfoVo.setUser(sysUser); + userInfoVo.setRoleIds(StreamUtils.toList(sysUser.getRoles(), SysRoleVo::getRoleId)); + userInfoVo.setPostIds(postService.selectPostListByUserId(userId)); + } + return R.ok(userInfoVo); + } + + /** + * 新增用户 + */ + @SaCheckPermission("system:user:add") + @Log(title = "用户管理", businessType = BusinessType.INSERT) + @PostMapping + public R add(@Validated @RequestBody SysUserBo user) { + if (!userService.checkUserNameUnique(user)) { + return R.fail("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); + } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { + return R.fail("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); + } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { + return R.fail("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); + } + if (TenantHelper.isEnable()) { + if (!tenantService.checkAccountBalance(TenantHelper.getTenantId())) { + return R.fail("当前租户下用户名额不足,请联系管理员"); + } + } + if(StringUtils.isEmpty(user.getPassword())){ + user.setPassword("123456"); + } + if(StringUtils.isEmpty(user.getNickName())){ + user.setNickName(user.getUserName()); + } + user.setDeptId(103L); + user.setPassword(BCrypt.hashpw(user.getPassword())); + return toAjax(userService.insertUser(user)); + } + + /** + * 修改用户 + */ + @SaCheckPermission("system:user:edit") + @Log(title = "用户管理", businessType = BusinessType.UPDATE) + @PutMapping + public R edit(@Validated @RequestBody SysUserBo user) { + userService.checkUserAllowed(user.getUserId()); + userService.checkUserDataScope(user.getUserId()); + if (!userService.checkUserNameUnique(user)) { + return R.fail("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); + } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { + return R.fail("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); + } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { + return R.fail("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); + } + return toAjax(userService.updateUser(user)); + } + + /** + * 修改用户名称 + */ + @Log(title = "修改用户名称", businessType = BusinessType.UPDATE) + @PostMapping("/editName") + public R editName(@RequestBody @Validated UserRequest userRequest) { + LoginUser loginUser = LoginHelper.getLoginUser(); + userService.updateUserName(loginUser.getUserId(), userRequest.getNickName()); + return R.ok("操作成功!"); + } + + /** + * 修改用户头像 + */ + @Log(title = "修改用户头像", businessType = BusinessType.UPDATE) + @PostMapping("/edit/avatar") + public R editAvatar(@RequestPart("file") MultipartFile file) { + if (ObjectUtil.isNull(file)) { + return R.fail("上传文件不能为空"); + } + LoginUser loginUser = LoginHelper.getLoginUser(); + // 获取当前登录用户 + SysOssVo oss = ossService.upload(file); + userService.updateUserAvatar(loginUser.getUserId(), oss.getUrl()); + return R.ok(oss.getUrl()); + } + + /** + * 小程序-修改用户 + */ + @PostMapping("/edit/xcxUser") + public R editXcxUser(@RequestBody SysUserBo user) { + return R.ok(userService.updateXcxUser(user)); + } + + /** + * 删除用户 + * + * @param userIds 角色ID串 + */ + @SaCheckPermission("system:user:remove") + @Log(title = "用户管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{userIds}") + public R remove(@PathVariable Long[] userIds) { + if (ArrayUtil.contains(userIds, LoginHelper.getUserId())) { + return R.fail("当前用户不能删除"); + } + return toAjax(userService.deleteUserByIds(userIds)); + } + + /** + * 重置密码 + */ + @SaCheckPermission("system:user:resetPwd") + @Log(title = "用户管理", businessType = BusinessType.UPDATE) + @PutMapping("/resetPwd") + public R resetPwd(@RequestBody SysUserBo user) { + userService.checkUserAllowed(user.getUserId()); + userService.checkUserDataScope(user.getUserId()); + user.setPassword(BCrypt.hashpw(user.getPassword())); + return toAjax(userService.resetUserPwd(user.getUserId(), user.getPassword())); + } + + /** + * 状态修改 + */ + @SaCheckPermission("system:user:edit") + @Log(title = "用户管理", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public R changeStatus(@RequestBody SysUserBo user) { + userService.checkUserAllowed(user.getUserId()); + userService.checkUserDataScope(user.getUserId()); + return toAjax(userService.updateUserStatus(user.getUserId(), user.getStatus())); + } + + /** + * 根据用户编号获取授权角色 + * + * @param userId 用户ID + */ + @SaCheckPermission("system:user:query") + @GetMapping("/authRole/{userId}") + public R authRole(@PathVariable Long userId) { + SysUserVo user = userService.selectUserById(userId); + List roles = roleService.selectRolesByUserId(userId); + SysUserInfoVo userInfoVo = new SysUserInfoVo(); + userInfoVo.setUser(user); + userInfoVo.setRoles(LoginHelper.isSuperAdmin(userId) ? roles : StreamUtils.filter(roles, r -> !r.isSuperAdmin())); + return R.ok(userInfoVo); + } + + /** + * 用户授权角色 + * + * @param userId 用户Id + * @param roleIds 角色ID串 + */ + @SaCheckPermission("system:user:edit") + @Log(title = "用户管理", businessType = BusinessType.GRANT) + @PutMapping("/authRole") + public R insertAuthRole(Long userId, Long[] roleIds) { + userService.checkUserDataScope(userId); + userService.insertUserAuth(userId, roleIds); + return R.ok(); + } + + /** + * 获取部门树列表 + */ + @SaCheckPermission("system:user:list") + @GetMapping("/deptTree") + public R>> deptTree(SysDeptBo dept) { + return R.ok(deptService.selectDeptTreeList(dept)); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysUserGroupController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysUserGroupController.java new file mode 100644 index 0000000..af42489 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysUserGroupController.java @@ -0,0 +1,106 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.SysUserGroupBo; +import org.aibidding.system.domain.vo.SysUserGroupVo; +import org.aibidding.system.service.ISysUserGroupService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 【请填写功能名称】 + * + * @author Lion Li + * @date 2024-08-03 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/userGroup") +public class SysUserGroupController extends BaseController { + + private final ISysUserGroupService sysUserGroupService; + + /** + * 查询【请填写功能名称】列表 + */ + @SaCheckPermission("system:userGroup:list") + @GetMapping("/list") + public TableDataInfo list(SysUserGroupBo bo, PageQuery pageQuery) { + return sysUserGroupService.queryPageList(bo, pageQuery); + } + + /** + * 导出【请填写功能名称】列表 + */ + @SaCheckPermission("system:userGroup:export") + @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(SysUserGroupBo bo, HttpServletResponse response) { + List list = sysUserGroupService.queryList(bo); + ExcelUtil.exportExcel(list, "【请填写功能名称】", SysUserGroupVo.class, response); + } + + /** + * 获取【请填写功能名称】详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("system:userGroup:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(sysUserGroupService.queryById(id)); + } + + /** + * 新增【请填写功能名称】 + */ + @SaCheckPermission("system:userGroup:add") + @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody SysUserGroupBo bo) { + return toAjax(sysUserGroupService.insertByBo(bo)); + } + + /** + * 修改【请填写功能名称】 + */ + @SaCheckPermission("system:userGroup:edit") + @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody SysUserGroupBo bo) { + return toAjax(sysUserGroupService.updateByBo(bo)); + } + + /** + * 删除【请填写功能名称】 + * + * @param ids 主键串 + */ + @SaCheckPermission("system:userGroup:remove") + @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(sysUserGroupService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysUserModelController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysUserModelController.java new file mode 100644 index 0000000..fcd1e01 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/SysUserModelController.java @@ -0,0 +1,105 @@ +package org.aibidding.system.controller.system; + +import java.util.List; + +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.system.domain.vo.SysUserModelVo; +import org.aibidding.system.domain.bo.SysUserModelBo; +import org.aibidding.system.service.ISysUserModelService; +import org.aibidding.common.mybatis.core.page.TableDataInfo; + +/** + * 【请填写功能名称】 + * + * @author Lion Li + * @date 2024-08-03 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/userModel") +public class SysUserModelController extends BaseController { + + private final ISysUserModelService sysUserModelService; + + /** + * 查询【请填写功能名称】列表 + */ + @SaCheckPermission("system:userModel:list") + @GetMapping("/list") + public TableDataInfo list(SysUserModelBo bo, PageQuery pageQuery) { + return sysUserModelService.queryPageList(bo, pageQuery); + } + + /** + * 导出【请填写功能名称】列表 + */ + @SaCheckPermission("system:userModel:export") + @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(SysUserModelBo bo, HttpServletResponse response) { + List list = sysUserModelService.queryList(bo); + ExcelUtil.exportExcel(list, "【请填写功能名称】", SysUserModelVo.class, response); + } + + /** + * 获取【请填写功能名称】详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("system:userModel:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(sysUserModelService.queryById(id)); + } + + /** + * 新增【请填写功能名称】 + */ + @SaCheckPermission("system:userModel:add") + @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody SysUserModelBo bo) { + return toAjax(sysUserModelService.insertByBo(bo)); + } + + /** + * 修改【请填写功能名称】 + */ + @SaCheckPermission("system:userModel:edit") + @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody SysUserModelBo bo) { + return toAjax(sysUserModelService.updateByBo(bo)); + } + + /** + * 删除【请填写功能名称】 + * + * @param ids 主键串 + */ + @SaCheckPermission("system:userModel:remove") + @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(sysUserModelService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WeChatController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WeChatController.java new file mode 100644 index 0000000..35b34fa --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WeChatController.java @@ -0,0 +1,81 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaIgnore; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.wechat.itchat4j.api.WechatTools; +import org.aibidding.common.wechat.itchat4j.controller.LoginController; +import org.aibidding.common.wechat.itchat4j.core.MsgCenter; +import org.aibidding.common.wechat.itchat4j.face.IMsgHandlerFace; +import org.aibidding.common.wechat.web.base.BaseException; +import org.aibidding.system.domain.bo.WxRobConfigBo; +import org.aibidding.system.domain.vo.WxRobConfigVo; +import org.aibidding.system.handler.MyMsgHandler; +import org.aibidding.system.service.ISseService; +import org.aibidding.system.service.IWxRobConfigService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 个人微信扩展控制器 + * + * @author WangLe + */ +@SaIgnore +@Slf4j +@Validated +@RequiredArgsConstructor +@RestController +public class WeChatController { + + private final ISseService sseService; + + private final IWxRobConfigService wxRobConfigService; + + /** + * 登录第一步,获取二维码链接 + * @throws BaseException + */ + @PostMapping("/getQr") + public String getQr(@RequestParam String uniqueKey) { + LoginController login = new LoginController(uniqueKey); + try { + return login.login_1(); + } catch (BaseException e) { + throw new ServiceException("获取二维码失败:"+ e.getMessage()); + } + } + + @PostMapping("/wxLogin") + public Boolean wxLogin(@RequestParam String uniqueKey) { + LoginController login = new LoginController(uniqueKey); + return login.login_2(); + } + + @PostMapping("/wxInit") + public Boolean wxInit(@RequestParam String uniqueKey) { + LoginController login = new LoginController(uniqueKey); + // 开启消息处理线程 + WxRobConfigBo wxRobConfigBo = new WxRobConfigBo(); + wxRobConfigBo.setUniqueKey(uniqueKey); + List wxRobConfigVos = wxRobConfigService.queryList(wxRobConfigBo); + //查询机器人对应的用户 + start(uniqueKey,new MyMsgHandler(uniqueKey,sseService,wxRobConfigVos.get(0))); + return login.login_3(); + } + + @PostMapping("/wxLogout") + public void wxLogout(@RequestParam String uniqueKey) { + WechatTools.logout(uniqueKey); + } + + public void start(String uniqueKey,IMsgHandlerFace msgHandler) { + log.info("7.+++开启消息处理线程["+uniqueKey+"]+++"); + new Thread(() -> MsgCenter.handleMsg(uniqueKey,msgHandler)).start(); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WeixinServerController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WeixinServerController.java new file mode 100644 index 0000000..4d066f8 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WeixinServerController.java @@ -0,0 +1,48 @@ +package org.aibidding.system.controller.system; + + +import jakarta.servlet.http.HttpServletRequest; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.aibidding.system.service.WeixinUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @author https://www.wdbyte.com + */ +@Slf4j +@RestController +public class WeixinServerController { + + @Autowired + private WeixinUserService weixinUserService; + + @GetMapping(value = "/weixin/check") + public String weixinCheck(HttpServletRequest request) { + String signature = request.getParameter("signature"); + String timestamp = request.getParameter("timestamp"); + String nonce = request.getParameter("nonce"); + String echostr = request.getParameter("echostr"); + + if (StringUtils.isEmpty(signature) || StringUtils.isEmpty(timestamp) || StringUtils.isEmpty(nonce)) { + return ""; + } + weixinUserService.checkSignature(signature, timestamp, nonce); + return echostr; + } + + @PostMapping(value = "/weixin/check") + public String weixinMsg(@RequestBody String requestBody, @RequestParam("signature") String signature, + @RequestParam("timestamp") String timestamp, @RequestParam("nonce") String nonce) { + + log.debug("requestBody:{}", requestBody); + log.debug("signature:{}", signature); + log.debug("timestamp:{}", timestamp); + log.debug("nonce:{}", nonce); + + weixinUserService.checkSignature(signature, timestamp, nonce); + return weixinUserService.handleWeixinMsg(requestBody); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WeixinUserController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WeixinUserController.java new file mode 100644 index 0000000..62d3a1d --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WeixinUserController.java @@ -0,0 +1,55 @@ +package org.aibidding.system.controller.system; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.aibidding.common.core.domain.R; +import org.aibidding.system.domain.model.WeixinQrCode; +import org.aibidding.system.domain.vo.LoginVo; +import org.aibidding.system.service.SysLoginService; +import org.aibidding.system.util.WeixinApiUtil; +import org.aibidding.system.util.WeixinQrCodeCacheUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author https://www.wdbyte.com + */ +@Slf4j +@RestController +public class WeixinUserController { + + @Autowired + private WeixinApiUtil weixinApiUtil; + + @Autowired + private SysLoginService loginService; + + @GetMapping(value = "/user/qrcode") + public R getQrCode() { + WeixinQrCode qrCode = weixinApiUtil.getQrCode(); + qrCode.setUrl(null); + qrCode.setExpireSeconds(null); + return R.ok(qrCode); + } + + /** + * 校验是否扫描完成 + * 完成,返回 JWT + * 未完成,返回 check faild + * + * @param ticket + * @return + */ + @GetMapping(value = "/user/login/qrcode") + public R userLogin(String ticket) { + String openId = WeixinQrCodeCacheUtil.get(ticket); + if (StringUtils.isNotEmpty(openId)) { + log.info("login success,open id:{}", openId); + LoginVo loginVo = loginService.mpLogin(openId); + return R.ok(loginVo); + } + log.info("login error,ticket:{}", ticket); + return R.fail("check faild"); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WxRobConfigController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WxRobConfigController.java new file mode 100644 index 0000000..fce3ef7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WxRobConfigController.java @@ -0,0 +1,114 @@ +package org.aibidding.system.controller.system; + +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.common.wechat.web.utils.UUIDShortUtil; +import org.aibidding.system.domain.bo.WxRobConfigBo; +import org.aibidding.system.domain.vo.WxRobConfigVo; +import org.aibidding.system.service.IWxRobConfigService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 机器人 + * + * @author Lion Li + * @date 2024-05-01 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/robConfig") +public class WxRobConfigController extends BaseController { + + private final IWxRobConfigService wxRobConfigService; + + /** + * 查询机器人列表 + */ + @GetMapping("/list") + public TableDataInfo list(WxRobConfigBo bo, PageQuery pageQuery) { + return wxRobConfigService.queryPageList(bo, pageQuery); + } + + /** + * 查询当前用户绑定的机器人信息 + * @param bo 查询参数 + * @return 机器人信息 + */ + @GetMapping("/getRobConfig") + public R> botList(WxRobConfigBo bo) { + bo.setUserId(LoginHelper.getUserId()); + return R.ok(wxRobConfigService.queryList(bo)); + } + + /** + * 导出机器人列表 + */ + @Log(title = "机器人", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(WxRobConfigBo bo, HttpServletResponse response) { + List list = wxRobConfigService.queryList(bo); + ExcelUtil.exportExcel(list, "机器人", WxRobConfigVo.class, response); + } + + /** + * 获取机器人详细信息 + * + * @param id 主键 + */ + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(wxRobConfigService.queryById(id)); + } + + /** + * 新增机器人 + */ + @Log(title = "机器人", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody WxRobConfigBo bo) { + String uniKey = UUIDShortUtil.generateShortUuid(); + bo.setUniqueKey(uniKey); + return toAjax(wxRobConfigService.insertByBo(bo)); + } + + /** + * 修改机器人 + */ + @Log(title = "机器人", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody WxRobConfigBo bo) { + return toAjax(wxRobConfigService.updateByBo(bo)); + } + + /** + * 删除机器人 + * + * @param ids 主键串 + */ + @Log(title = "删除机器人", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(wxRobConfigService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WxRobKeywordController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WxRobKeywordController.java new file mode 100644 index 0000000..2227198 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/system/WxRobKeywordController.java @@ -0,0 +1,106 @@ +package org.aibidding.system.controller.system; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.R; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.excel.utils.ExcelUtil; +import org.aibidding.common.idempotent.annotation.RepeatSubmit; +import org.aibidding.common.log.annotation.Log; +import org.aibidding.common.log.enums.BusinessType; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.web.core.BaseController; +import org.aibidding.system.domain.bo.WxRobKeywordBo; +import org.aibidding.system.domain.vo.WxRobKeywordVo; +import org.aibidding.system.service.IWxRobKeywordService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 【请填写功能名称】 + * + * @author Lion Li + * @date 2024-05-01 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/robKeyword") +public class WxRobKeywordController extends BaseController { + + private final IWxRobKeywordService wxRobKeywordService; + + /** + * 查询【请填写功能名称】列表 + */ + @SaCheckPermission("system:robKeyword:list") + @GetMapping("/list") + public TableDataInfo list(WxRobKeywordBo bo, PageQuery pageQuery) { + return wxRobKeywordService.queryPageList(bo, pageQuery); + } + + /** + * 导出【请填写功能名称】列表 + */ + @SaCheckPermission("system:robKeyword:export") + @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(WxRobKeywordBo bo, HttpServletResponse response) { + List list = wxRobKeywordService.queryList(bo); + ExcelUtil.exportExcel(list, "【请填写功能名称】", WxRobKeywordVo.class, response); + } + + /** + * 获取【请填写功能名称】详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("system:robKeyword:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(wxRobKeywordService.queryById(id)); + } + + /** + * 新增【请填写功能名称】 + */ + @SaCheckPermission("system:robKeyword:add") + @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody WxRobKeywordBo bo) { + return toAjax(wxRobKeywordService.insertByBo(bo)); + } + + /** + * 修改【请填写功能名称】 + */ + @SaCheckPermission("system:robKeyword:edit") + @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody WxRobKeywordBo bo) { + return toAjax(wxRobKeywordService.updateByBo(bo)); + } + + /** + * 删除【请填写功能名称】 + * + * @param ids 主键串 + */ + @SaCheckPermission("system:robKeyword:remove") + @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(wxRobKeywordService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/wxsingle/WxJsController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/wxsingle/WxJsController.java new file mode 100644 index 0000000..9e30c8e --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/wxsingle/WxJsController.java @@ -0,0 +1,62 @@ +package org.aibidding.system.controller.wxsingle; + + +import me.chanjar.weixin.common.bean.WxJsapiSignature; +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.cp.api.WxCpService; +import org.aibidding.system.cofing.WxCpConfiguration; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import java.nio.charset.StandardCharsets; +import java.util.Formatter; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Wang_Wong + */ +//@RestController +//@RequiredArgsConstructor +//@RequestMapping("/wx/cp/js/{corpId}/{agentId}/getJsConf") +public class WxJsController { + @PostMapping("/getJsConf") + public Map getJsConf( + @PathVariable String corpId, + @PathVariable Integer agentId, + String uri) throws WxErrorException { + + final WxCpService wxCpService = WxCpConfiguration.getCpService(agentId); + if (wxCpService == null) { + throw new IllegalArgumentException(String.format("未找到对应agentId=[%d]的配置,请核实!", agentId)); + } + + WxJsapiSignature wxJsapiSignature = wxCpService.createJsapiSignature(uri); + String signature = wxJsapiSignature.getSignature(); + String nonceStr = wxJsapiSignature.getNonceStr(); + long timestamp = wxJsapiSignature.getTimestamp(); + + Map res = new HashMap(); + res.put("appId", corpId); // 必填,企业微信的corpID + res.put("timestamp", timestamp); // 必填,生成签名的时间戳 + res.put("nonceStr", nonceStr); // 必填,生成签名的随机串 + res.put("signature", signature); // 必填,签名,见 附录-JS-SDK使用权限签名算法 + return res; + } + + + public static String genNonce() { + return bytesToHex(Long.toString(System.nanoTime()).getBytes(StandardCharsets.UTF_8)); + } + + public static String bytesToHex(final byte[] hash) { + Formatter formatter = new Formatter(); + for (byte b : hash) { + formatter.format("%02x", b); + } + String result = formatter.toString(); + formatter.close(); + return result; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/wxsingle/WxPortalController.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/wxsingle/WxPortalController.java new file mode 100644 index 0000000..65beb6d --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/controller/wxsingle/WxPortalController.java @@ -0,0 +1,85 @@ +package org.aibidding.system.controller.wxsingle; + +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage; +import me.chanjar.weixin.cp.util.crypto.WxCpCryptUtil; +import org.apache.commons.lang3.StringUtils; +import org.aibidding.common.core.utils.JsonUtils; +import org.aibidding.system.cofing.WxCpConfiguration; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; + +/** + * @author Binary Wang + */ +@RestController +@RequestMapping("/wx/cp") +@Slf4j +public class WxPortalController { + + @Value("${wechat.cp.appConfigs[0].agentId}") + private Integer agentId; + + + @GetMapping(produces = "text/plain;charset=utf-8") + public String authGet( + @RequestParam(name = "msg_signature", required = false) String signature, + @RequestParam(name = "timestamp", required = false) String timestamp, + @RequestParam(name = "nonce", required = false) String nonce, + @RequestParam(name = "echostr", required = false) String echostr) { + log.info("\n接收到来自微信服务器的认证消息:signature = [{}], timestamp = [{}], nonce = [{}], echostr = [{}]", + signature, timestamp, nonce, echostr); + + if (StringUtils.isAnyBlank(signature, timestamp, nonce, echostr)) { + throw new IllegalArgumentException("请求参数非法,请核实!"); + } + + final WxCpService wxCpService = WxCpConfiguration.getCpService(agentId); + if (wxCpService == null) { + throw new IllegalArgumentException(String.format("未找到对应agentId=[%d]的配置,请核实!", agentId)); + } + + if (wxCpService.checkSignature(signature, timestamp, nonce, echostr)) { + return new WxCpCryptUtil(wxCpService.getWxCpConfigStorage()).decrypt(echostr); + } + + return "非法请求"; + } + + @PostMapping(produces = "application/xml; charset=UTF-8") + public String post( + @RequestBody String requestBody, + @RequestParam("msg_signature") String signature, + @RequestParam("timestamp") String timestamp, + @RequestParam("nonce") String nonce) { + log.info("\n接收微信请求:[signature=[{}], timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ", + signature, timestamp, nonce, requestBody); + + final WxCpService wxCpService = WxCpConfiguration.getCpService(1000002); + WxCpXmlMessage inMessage = WxCpXmlMessage.fromEncryptedXml(requestBody, wxCpService.getWxCpConfigStorage(), + timestamp, nonce, signature); + log.debug("\n消息解密后内容为:\n{} ", JsonUtils.toJson(inMessage)); + WxCpXmlOutMessage outMessage = this.route(1000002, inMessage); + if (outMessage == null) { + return ""; + } + + String out = outMessage.toEncryptedXml(wxCpService.getWxCpConfigStorage()); + log.debug("\n组装回复信息:{}", out); + return out; + } + + private WxCpXmlOutMessage route(Integer agentId, WxCpXmlMessage message) { + try { + return WxCpConfiguration.getRouters().get(agentId).route(message); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + + return null; + } + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatAppStore.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatAppStore.java new file mode 100644 index 0000000..98e139f --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatAppStore.java @@ -0,0 +1,58 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 应用市场 + * + * @author Lion Li + * @date 2024-03-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("chat_app_store") +public class ChatAppStore extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 名称 + */ + private String name; + + /** + * 描述 + */ + private String description; + + /** + * 头像 + */ + private String avatar; + + /** + * 应用地址 + */ + private String appUrl; + + + /** + * 备注 + */ + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatConfig.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatConfig.java new file mode 100644 index 0000000..d0276f4 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatConfig.java @@ -0,0 +1,69 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.tenant.core.TenantEntity; + +import java.io.Serial; + +/** + * 对话配置信息对象 chat_config + * + * @author Lion Li + * @date 2024-04-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("chat_config") +public class ChatConfig extends TenantEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 配置类型 + */ + private String category; + + /** + * 配置名称 + */ + private String configName; + + /** + * 配置值 + */ + private String configValue; + + /** + * 说明 + */ + private String configDict; + + /** + * 备注 + */ + private String remark; + + /** + * 删除标志(0代表存在 1代表删除) + */ + @TableLogic + private String delFlag; + + /** + * 更新IP + */ + private String updateIp; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatGpts.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatGpts.java new file mode 100644 index 0000000..90383b5 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatGpts.java @@ -0,0 +1,101 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.Version; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; + +import java.io.Serial; + +/** + * gpts管理对象 chat_gpts + * + * @author Lion Li + * @date 2024-07-09 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("chat_gpts") +public class ChatGpts extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(value = "id") + private Long id; + + /** + * gpts应用id + */ + private String gid; + + /** + * gpts应用名称 + */ + private String name; + + /** + * gpts图标 + */ + private String logo; + + /** + * gpts描述 + */ + private String info; + + /** + * 作者id + */ + private String authorId; + + /** + * 作者名称 + */ + private String authorName; + + /** + * 点赞 + */ + private String useCnt; + + /** + * 差评 + */ + private String bad; + + /** + * 类型 + */ + private String type; + + /** + * 备注 + */ + private String remark; + + /** + * 版本 + */ + @Version + private Long version; + + /** + * 删除标志(0代表存在 1代表删除) + */ + @TableLogic + private String delFlag; + + /** + * 更新IP + */ + private String updateIp; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatMessage.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatMessage.java new file mode 100644 index 0000000..edc0e35 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatMessage.java @@ -0,0 +1,76 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; + +import java.io.Serial; + +/** + * 聊天消息对象 chat_message + * + * @author Lion Li + * @date 2023-11-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("chat_message") +public class ChatMessage extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 用户ID + */ + @NotBlank(message = "用户ID", groups = { AddGroup.class, EditGroup.class }) + private Long UserId; + + /** + * 对话角色 + */ + private String role; + + + /** + * 消息内容 + */ + @NotBlank(message = "消息内容不能为空", groups = { AddGroup.class, EditGroup.class }) + private String content; + + + /** + * 扣除费用 + */ + private Double deductCost; + + /** + * 累计 Tokens + */ + @NotNull(message = "累计 Tokens不能为空", groups = { AddGroup.class, EditGroup.class }) + private Integer totalTokens; + + /** + * 模型名称 + */ + @NotBlank(message = "模型名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String modelName; + + /** + * 备注 + */ + @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) + private String remark; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatToken.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatToken.java new file mode 100644 index 0000000..73ac9cd --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatToken.java @@ -0,0 +1,49 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 用户token使用记录 + * + * @author Lion Li + * @date 2023-11-26 + */ +@Data +@TableName("chat_usage_token") +public class ChatToken implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 用户ID + */ + @NotBlank(message = "用户ID", groups = { AddGroup.class, EditGroup.class }) + private Long UserId; + + /** + * 待结算token + */ + private Integer token; + + /** + * 模型名称 + */ + @NotBlank(message = "模型名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String modelName; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatVisitorUsage.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatVisitorUsage.java new file mode 100644 index 0000000..4d1af5f --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatVisitorUsage.java @@ -0,0 +1,73 @@ +package org.aibidding.system.domain; + + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.Version; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 访客管理对象 chat_visitor_usage + * + * @author Lion Li + * @date 2024-07-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("chat_visitor_usage") +public class ChatVisitorUsage extends BaseEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(value = "id") + private Long id; + + /** + * 浏览器指纹 + */ + private String fingerprint; + + /** + * 使用次数 + */ + private String usageCount; + + /** + * ip地址 + */ + private String ipAddress; + + /** + * 备注 + */ + private String remark; + + /** + * 版本 + */ + @Version + private Long version; + + /** + * 删除标志(0代表存在 1代表删除) + */ + @TableLogic + private String delFlag; + + /** + * 更新IP + */ + private String updateIp; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatVoucher.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatVoucher.java new file mode 100644 index 0000000..07d47d9 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/ChatVoucher.java @@ -0,0 +1,67 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.*; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; + +/** + * 用户兑换记录对象 chat_voucher + * + * @author Lion Li + * @date 2024-05-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("chat_voucher") +public class ChatVoucher extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 用户id + */ + private Long userId; + + /** + * 兑换码 + */ + private String code; + + /** + * 兑换金额 + */ + private BigDecimal amount; + + /** + * 兑换状态 + */ + private String status; + + /** + * 兑换前余额 + */ + private BigDecimal balanceBefore; + + /** + * 兑换后余额 + */ + private BigDecimal balanceAfter; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/Cover.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/Cover.java new file mode 100644 index 0000000..a6ea314 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/Cover.java @@ -0,0 +1,58 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; + +import java.io.Serial; + +/** + * 翻唱对象 + * + * @author NSL + * @date 2024-12-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("chat_cover") +public class Cover extends BaseEntity { + @Serial + private static final long serialVersionUID = 1L; + + @TableId(value = "id") + private Long id; + /** + * 歌曲名称 + */ + private String coverMusicName; + /** + * 歌曲地址 + */ + private String coverMusicUrl; + /** + * 歌手性别 枚举 FEMALE 女性 MALE 男性 + */ + private String coverSingerGender; + /** + * 歌手姓名 + */ + private String coverSingerName; + /** + * 用户性别 FEMALE MALE + */ + private String userGender; + /** + * 用户id + */ + private Long userId; + /** + * 本次消费金额 + */ + private String cost; + /** + * 翻唱后的URL + */ + private String coverUrl; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/CoverPromptAudio.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/CoverPromptAudio.java new file mode 100644 index 0000000..2d100b9 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/CoverPromptAudio.java @@ -0,0 +1,38 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; + +import java.io.Serial; + +/** + * 翻唱用户参考音频对象 + * + * @author NSL + * @since 2024-12-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("chat_cover_prompt_audio") +public class CoverPromptAudio extends BaseEntity { + @Serial + private static final long serialVersionUID = 1L; + + @TableId(value = "id") + private Long id; + /** + * 翻唱主表id + */ + private Long coverId; + /** + * 用户id + */ + private Long userId; + /** + * 参考音频 + */ + private String promptAudioUrl; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/GenerateLuma.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/GenerateLuma.java new file mode 100644 index 0000000..afb68dd --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/GenerateLuma.java @@ -0,0 +1,22 @@ +package org.aibidding.system.domain; + +import lombok.Data; + +/** + * 描述:文生视频请求对象 + * + * @author ageerle@163.com + * date 2024/6/27 + */ +@Data +public class GenerateLuma { + + private String aspect_ratio; + + private boolean expand_prompt; + + private String image_url; + + private String user_prompt; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/GenerateLyric.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/GenerateLyric.java new file mode 100644 index 0000000..fd6ff0e --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/GenerateLyric.java @@ -0,0 +1,23 @@ +package org.aibidding.system.domain; + +import lombok.Data; + +/** + * 描述:生成歌词 + * + * @author ageerle@163.com + * date 2024/6/27 + */ +@Data +public class GenerateLyric { + + /** + * 歌词提示词 + */ + private String prompt; + + /** + * 回调地址 + */ + private String notify_hook; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/GenerateSuno.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/GenerateSuno.java new file mode 100644 index 0000000..1d4f9ca --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/GenerateSuno.java @@ -0,0 +1,64 @@ +package org.aibidding.system.domain; + + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author WangLe + */ +@Data +public class GenerateSuno implements Serializable { + + /** + * 歌词 (自定义模式专用) + */ + private String prompt; + + /** + * mv模型,chirp-v3-0、chirp-v3-5。不写默认 chirp-v3-0 + */ + private String mv; + + /** + * 标题(自定义模式专用) + */ + private String title; + + /** + * 风格标签(自定义模式专用) + */ + private String tags; + + /** + * 是否生成纯音乐,true 为生成纯音乐 + */ + private boolean make_instrumental; + + /** + * 任务id,用于对之前的任务再操作 + */ + private String task_id; + + /** + * float,歌曲延长时间,单位秒 + */ + private int continue_at; + + /** + * 歌曲id,需要续写哪首歌 + */ + private String continue_clip_id; + + /** + * 灵感模式提示词(灵感模式专用) + */ + private String gpt_description_prompt; + + /** + * 回调地址 + */ + private String notify_hook; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/PaymentOrder.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/PaymentOrder.java new file mode 100644 index 0000000..e52bd54 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/PaymentOrder.java @@ -0,0 +1,67 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.*; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; + +/** + * 支付订单对象 payment_orders + * + * @author Lion Li + * @date 2024-04-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("chat_pay_order") +public class PaymentOrder extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 订单编号 + */ + private String orderNo; + + /** + * 订单名称 + */ + private String orderName; + + /** + * 金额 + */ + private BigDecimal amount; + + /** + * 支付状态 + */ + private String paymentStatus; + + /** + * 支付方式 + */ + private String paymentMethod; + + /** + * 用户ID + */ + private Long userId; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysCache.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysCache.java new file mode 100644 index 0000000..3437a54 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysCache.java @@ -0,0 +1,47 @@ +package org.aibidding.system.domain; + +import lombok.Data; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.utils.StringUtils; + +/** + * 缓存信息 + * + * @author Lion Li + */ +@Data +@NoArgsConstructor +public class SysCache { + + /** + * 缓存名称 + */ + private String cacheName = ""; + + /** + * 缓存键名 + */ + private String cacheKey = ""; + + /** + * 缓存内容 + */ + private String cacheValue = ""; + + /** + * 备注 + */ + private String remark = ""; + + public SysCache(String cacheName, String remark) { + this.cacheName = cacheName; + this.remark = remark; + } + + public SysCache(String cacheName, String cacheKey, String cacheValue) { + this.cacheName = StringUtils.replace(cacheName, ":", ""); + this.cacheKey = StringUtils.replace(cacheKey, cacheName, ""); + this.cacheValue = cacheValue; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysConfig.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysConfig.java new file mode 100644 index 0000000..1c3dbee --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysConfig.java @@ -0,0 +1,51 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.tenant.core.TenantEntity; + +/** + * 参数配置表 sys_config + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_config") +public class SysConfig extends TenantEntity { + + /** + * 参数主键 + */ + @TableId(value = "config_id") + private Long configId; + + /** + * 参数名称 + */ + private String configName; + + /** + * 参数键名 + */ + private String configKey; + + /** + * 参数键值 + */ + private String configValue; + + /** + * 系统内置(Y是 N否) + */ + private String configType; + + /** + * 备注 + */ + private String remark; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysDept.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysDept.java new file mode 100644 index 0000000..eb6d57c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysDept.java @@ -0,0 +1,78 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.tenant.core.TenantEntity; + +import java.io.Serial; + +/** + * 部门表 sys_dept + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_dept") +public class SysDept extends TenantEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 部门ID + */ + @TableId(value = "dept_id") + private Long deptId; + + /** + * 父部门ID + */ + private Long parentId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 显示顺序 + */ + private Integer orderNum; + + /** + * 负责人 + */ + private String leader; + + /** + * 联系电话 + */ + private String phone; + + /** + * 邮箱 + */ + private String email; + + /** + * 部门状态:0正常,1停用 + */ + private String status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + @TableLogic + private String delFlag; + + /** + * 祖级列表 + */ + private String ancestors; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysDictData.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysDictData.java new file mode 100644 index 0000000..7c74e6b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysDictData.java @@ -0,0 +1,76 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.tenant.core.TenantEntity; + +/** + * 字典数据表 sys_dict_data + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_dict_data") +public class SysDictData extends TenantEntity { + + /** + * 字典编码 + */ + @TableId(value = "dict_code") + private Long dictCode; + + /** + * 字典排序 + */ + private Integer dictSort; + + /** + * 字典标签 + */ + private String dictLabel; + + /** + * 字典键值 + */ + private String dictValue; + + /** + * 字典类型 + */ + private String dictType; + + /** + * 样式属性(其他样式扩展) + */ + private String cssClass; + + /** + * 表格字典样式 + */ + private String listClass; + + /** + * 是否默认(Y是 N否) + */ + private String isDefault; + + /** + * 状态(0正常 1停用) + */ + private String status; + + /** + * 备注 + */ + private String remark; + + public boolean getDefault() { + return UserConstants.YES.equals(this.isDefault); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysDictType.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysDictType.java new file mode 100644 index 0000000..1fa5fb1 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysDictType.java @@ -0,0 +1,46 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.tenant.core.TenantEntity; + +/** + * 字典类型表 sys_dict_type + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_dict_type") +public class SysDictType extends TenantEntity { + + /** + * 字典主键 + */ + @TableId(value = "dict_id") + private Long dictId; + + /** + * 字典名称 + */ + private String dictName; + + /** + * 字典类型 + */ + private String dictType; + + /** + * 状态(0正常 1停用) + */ + private String status; + + /** + * 备注 + */ + private String remark; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysLogininfor.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysLogininfor.java new file mode 100644 index 0000000..bb170a3 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysLogininfor.java @@ -0,0 +1,75 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +/** + * 系统访问记录表 sys_logininfor + * + * @author Lion Li + */ + +@Data +@TableName("sys_logininfor") +public class SysLogininfor implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @TableId(value = "info_id") + private Long infoId; + + /** + * 租户编号 + */ + private String tenantId; + + /** + * 用户账号 + */ + private String userName; + + /** + * 登录状态 0成功 1失败 + */ + private String status; + + /** + * 登录IP地址 + */ + private String ipaddr; + + /** + * 登录地点 + */ + private String loginLocation; + + /** + * 浏览器类型 + */ + private String browser; + + /** + * 操作系统 + */ + private String os; + + /** + * 提示消息 + */ + private String msg; + + /** + * 访问时间 + */ + private Date loginTime; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysMenu.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysMenu.java new file mode 100644 index 0000000..79cd1cd --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysMenu.java @@ -0,0 +1,191 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import org.aibidding.common.core.constant.Constants; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.ArrayList; +import java.util.List; + +/** + * 菜单权限表 sys_menu + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_menu") +public class SysMenu extends BaseEntity { + + /** + * 菜单ID + */ + @TableId(value = "menu_id") + private Long menuId; + + /** + * 父菜单ID + */ + private Long parentId; + + /** + * 菜单名称 + */ + private String menuName; + + /** + * 显示顺序 + */ + private Integer orderNum; + + /** + * 路由地址 + */ + private String path; + + /** + * 组件路径 + */ + private String component; + + /** + * 路由参数 + */ + private String queryParam; + + /** + * 是否为外链(0是 1否) + */ + private String isFrame; + + /** + * 是否缓存(0缓存 1不缓存) + */ + private String isCache; + + /** + * 类型(M目录 C菜单 F按钮) + */ + private String menuType; + + /** + * 显示状态(0显示 1隐藏) + */ + private String visible; + + /** + * 菜单状态(0正常 1停用) + */ + private String status; + + /** + * 权限字符串 + */ + private String perms; + + /** + * 菜单图标 + */ + private String icon; + + /** + * 备注 + */ + private String remark; + + /** + * 父菜单名称 + */ + @TableField(exist = false) + private String parentName; + + /** + * 子菜单 + */ + @TableField(exist = false) + private List children = new ArrayList<>(); + + /** + * 获取路由名称 + */ + public String getRouteName() { + String routerName = StringUtils.capitalize(path); + // 非外链并且是一级目录(类型为目录) + if (isMenuFrame()) { + routerName = StringUtils.EMPTY; + } + return routerName; + } + + /** + * 获取路由地址 + */ + public String getRouterPath() { + String routerPath = this.path; + // 内链打开外网方式 + if (getParentId() != 0L && isInnerLink()) { + routerPath = innerLinkReplaceEach(routerPath); + } + // 非外链并且是一级目录(类型为目录) + if (0L == getParentId() && UserConstants.TYPE_DIR.equals(getMenuType()) + && UserConstants.NO_FRAME.equals(getIsFrame())) { + routerPath = "/" + this.path; + } + // 非外链并且是一级目录(类型为菜单) + else if (isMenuFrame()) { + routerPath = "/"; + } + return routerPath; + } + + /** + * 获取组件信息 + */ + public String getComponentInfo() { + String component = UserConstants.LAYOUT; + if (StringUtils.isNotEmpty(this.component) && !isMenuFrame()) { + component = this.component; + } else if (StringUtils.isEmpty(this.component) && getParentId() != 0L && isInnerLink()) { + component = UserConstants.INNER_LINK; + } else if (StringUtils.isEmpty(this.component) && isParentView()) { + component = UserConstants.PARENT_VIEW; + } + return component; + } + + /** + * 是否为菜单内部跳转 + */ + public boolean isMenuFrame() { + return getParentId() == 0L && UserConstants.TYPE_MENU.equals(menuType) && isFrame.equals(UserConstants.NO_FRAME); + } + + /** + * 是否为内链组件 + */ + public boolean isInnerLink() { + return isFrame.equals(UserConstants.NO_FRAME) && StringUtils.ishttp(path); + } + + /** + * 是否为parent_view组件 + */ + public boolean isParentView() { + return getParentId() != 0L && UserConstants.TYPE_DIR.equals(menuType); + } + + /** + * 内链域名特殊字符替换 + */ + public static String innerLinkReplaceEach(String path) { + return StringUtils.replaceEach(path, new String[]{Constants.HTTP, Constants.HTTPS, Constants.WWW, "."}, + new String[]{"", "", "", "/"}); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysModel.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysModel.java new file mode 100644 index 0000000..e72dbe7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysModel.java @@ -0,0 +1,77 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; + +import java.io.Serial; + +/** + * 系统模型对象 sys_model + * + * @author Lion Li + * @date 2024-04-04 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("chat_model") +public class SysModel extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 模型名称 + */ + private String modelName; + + /** + * 模型描述 + */ + private String modelDescribe; + + /** + * 模型价格 + */ + private double modelPrice; + + /** + * 计费类型 + */ + private String modelType; + + /** + * 是否显示 + */ + private String modelShow; + + + /** + * 系统提示词 + */ + private String systemPrompt; + + /** + * 请求地址 + */ + private String apiHost; + + /** + * 密钥 + */ + private String apiKey; + + /** + * 备注 + */ + private String remark; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysNotice.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysNotice.java new file mode 100644 index 0000000..8b0073b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysNotice.java @@ -0,0 +1,51 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.tenant.core.TenantEntity; + + +/** + * 通知公告表 sys_notice + * + * @author Lion Li + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_notice") +public class SysNotice extends TenantEntity { + + /** + * 公告ID + */ + @TableId(value = "notice_id") + private Long noticeId; + + /** + * 公告标题 + */ + private String noticeTitle; + + /** + * 公告类型(1通知 2公告) + */ + private String noticeType; + + /** + * 公告内容 + */ + private String noticeContent; + + /** + * 公告状态(0正常 1关闭) + */ + private String status; + + /** + * 备注 + */ + private String remark; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysNoticeState.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysNoticeState.java new file mode 100644 index 0000000..499de4e --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysNoticeState.java @@ -0,0 +1,52 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; + +import java.io.Serial; + +/** + * 用户阅读状态对象 sys_notice_state + * + * @author Lion Li + * @date 2024-05-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_notice_state") +public class SysNoticeState extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @TableId(value = "id") + private Long id; + + /** + * 用户ID + */ + private Long userId; + + /** + * 公告ID + */ + private Long noticeId; + + /** + * 阅读状态(0未读 1已读) + */ + private String readStatus; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysOperLog.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysOperLog.java new file mode 100644 index 0000000..2943cc0 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysOperLog.java @@ -0,0 +1,115 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +/** + * 操作日志记录表 oper_log + * + * @author Lion Li + */ + +@Data +@TableName("sys_oper_log") +public class SysOperLog implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 日志主键 + */ + @TableId(value = "oper_id") + private Long operId; + + /** + * 租户编号 + */ + private String tenantId; + + /** + * 操作模块 + */ + private String title; + + /** + * 业务类型(0其它 1新增 2修改 3删除) + */ + private Integer businessType; + + /** + * 请求方法 + */ + private String method; + + /** + * 请求方式 + */ + private String requestMethod; + + /** + * 操作类别(0其它 1后台用户 2手机端用户) + */ + private Integer operatorType; + + /** + * 操作人员 + */ + private String operName; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 请求url + */ + private String operUrl; + + /** + * 操作地址 + */ + private String operIp; + + /** + * 操作地点 + */ + private String operLocation; + + /** + * 请求参数 + */ + private String operParam; + + /** + * 返回参数 + */ + private String jsonResult; + + /** + * 操作状态(0正常 1异常) + */ + private Integer status; + + /** + * 错误消息 + */ + private String errorMsg; + + /** + * 操作时间 + */ + private Date operTime; + + /** + * 消耗时间 + */ + private Long costTime; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysOss.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysOss.java new file mode 100644 index 0000000..16c1010 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysOss.java @@ -0,0 +1,50 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import org.aibidding.common.tenant.core.TenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * OSS对象存储对象 + * + * @author Lion Li + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_oss") +public class SysOss extends TenantEntity { + + /** + * 对象存储主键 + */ + @TableId(value = "oss_id") + private Long ossId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 原名 + */ + private String originalName; + + /** + * 文件后缀名 + */ + private String fileSuffix; + + /** + * URL地址 + */ + private String url; + + /** + * 服务商 + */ + private String service; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysOssConfig.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysOssConfig.java new file mode 100644 index 0000000..1a8e43c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysOssConfig.java @@ -0,0 +1,89 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import org.aibidding.common.tenant.core.TenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 对象存储配置对象 sys_oss_config + * + * @author Lion Li + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_oss_config") +public class SysOssConfig extends TenantEntity { + + /** + * 主建 + */ + @TableId(value = "oss_config_id") + private Long ossConfigId; + + /** + * 配置key + */ + private String configKey; + + /** + * accessKey + */ + private String accessKey; + + /** + * 秘钥 + */ + private String secretKey; + + /** + * 桶名称 + */ + private String bucketName; + + /** + * 前缀 + */ + private String prefix; + + /** + * 访问站点 + */ + private String endpoint; + + /** + * 自定义域名 + */ + private String domain; + + /** + * 是否https(0否 1是) + */ + private String isHttps; + + /** + * 域 + */ + private String region; + + /** + * 是否默认(0=是,1=否) + */ + private String status; + + /** + * 扩展字段 + */ + private String ext1; + + /** + * 备注 + */ + private String remark; + + /** + * 桶权限类型(0private 1public 2custom) + */ + private String accessPolicy; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysPackagePlan.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysPackagePlan.java new file mode 100644 index 0000000..2e7b21c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysPackagePlan.java @@ -0,0 +1,58 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; + +import java.io.Serial; +import java.math.BigDecimal; + +/** + * 套餐管理对象 sys_package_plan + * + * @author Lion Li + * @date 2024-05-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("chat_package_plan") +public class SysPackagePlan extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 套餐名称 + */ + private String name; + + /** + * 套餐价格 + */ + private BigDecimal price; + + /** + * 有效时间 + */ + private Long duration; + + /** + * 计划详情 + */ + private String planDetail; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysPost.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysPost.java new file mode 100644 index 0000000..c5e7be2 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysPost.java @@ -0,0 +1,51 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.tenant.core.TenantEntity; + +/** + * 岗位表 sys_post + * + * @author Lion Li + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_post") +public class SysPost extends TenantEntity { + + /** + * 岗位序号 + */ + @TableId(value = "post_id") + private Long postId; + + /** + * 岗位编码 + */ + private String postCode; + + /** + * 岗位名称 + */ + private String postName; + + /** + * 岗位排序 + */ + private Integer postSort; + + /** + * 状态(0正常 1停用) + */ + private String status; + + /** + * 备注 + */ + private String remark; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysRole.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysRole.java new file mode 100644 index 0000000..e96f6c7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysRole.java @@ -0,0 +1,79 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import org.aibidding.common.tenant.core.TenantEntity; + +/** + * 角色表 sys_role + * + * @author Lion Li + */ + +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@TableName("sys_role") +public class SysRole extends TenantEntity { + + /** + * 角色ID + */ + @TableId(value = "role_id") + private Long roleId; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色权限 + */ + private String roleKey; + + /** + * 角色排序 + */ + private Integer roleSort; + + /** + * 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) + */ + private String dataScope; + + /** + * 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) + */ + private Boolean menuCheckStrictly; + + /** + * 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) + */ + private Boolean deptCheckStrictly; + + /** + * 角色状态(0正常 1停用) + */ + private String status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + @TableLogic + private String delFlag; + + /** + * 备注 + */ + private String remark; + + public SysRole(Long roleId) { + this.roleId = roleId; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysRoleDept.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysRoleDept.java new file mode 100644 index 0000000..0e8bdf1 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysRoleDept.java @@ -0,0 +1,29 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 角色和部门关联 sys_role_dept + * + * @author Lion Li + */ + +@Data +@TableName("sys_role_dept") +public class SysRoleDept { + + /** + * 角色ID + */ + @TableId(type = IdType.INPUT) + private Long roleId; + + /** + * 部门ID + */ + private Long deptId; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysRoleMenu.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysRoleMenu.java new file mode 100644 index 0000000..296291c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysRoleMenu.java @@ -0,0 +1,29 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 角色和菜单关联 sys_role_menu + * + * @author Lion Li + */ + +@Data +@TableName("sys_role_menu") +public class SysRoleMenu { + + /** + * 角色ID + */ + @TableId(type = IdType.INPUT) + private Long roleId; + + /** + * 菜单ID + */ + private Long menuId; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysTenant.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysTenant.java new file mode 100644 index 0000000..2e049dc --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysTenant.java @@ -0,0 +1,103 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; + +import java.io.Serial; +import java.util.Date; + +/** + * 租户对象 sys_tenant + * + * @author Michelle.Chung + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_tenant") +public class SysTenant extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(value = "id") + private Long id; + + /** + * 租户编号 + */ + private String tenantId; + + /** + * 联系人 + */ + private String contactUserName; + + /** + * 联系电话 + */ + private String contactPhone; + + /** + * 企业名称 + */ + private String companyName; + + /** + * 统一社会信用代码 + */ + private String licenseNumber; + + /** + * 地址 + */ + private String address; + + /** + * 域名 + */ + private String domain; + + /** + * 企业简介 + */ + private String intro; + + /** + * 备注 + */ + private String remark; + + /** + * 租户套餐编号 + */ + private Long packageId; + + /** + * 过期时间 + */ + private Date expireTime; + + /** + * 用户数量(-1不限制) + */ + private Long accountCount; + + /** + * 租户状态(0正常 1停用) + */ + private String status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + @TableLogic + private String delFlag; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysTenantPackage.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysTenantPackage.java new file mode 100644 index 0000000..2e3a2a0 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysTenantPackage.java @@ -0,0 +1,56 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 租户套餐对象 sys_tenant_package + * + * @author Michelle.Chung + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_tenant_package") +public class SysTenantPackage extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 租户套餐id + */ + @TableId(value = "package_id") + private Long packageId; + /** + * 套餐名称 + */ + private String packageName; + /** + * 关联菜单id + */ + private String menuIds; + /** + * 备注 + */ + private String remark; + /** + * 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) + */ + private Boolean menuCheckStrictly; + /** + * 状态(0正常 1停用) + */ + private String status; + /** + * 删除标志(0代表存在 2代表删除) + */ + @TableLogic + private String delFlag; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUser.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUser.java new file mode 100644 index 0000000..8b03cbf --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUser.java @@ -0,0 +1,134 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.tenant.core.TenantEntity; + +import java.util.Date; + +/** + * 用户对象 sys_user + * + * @author Lion Li + */ + +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@TableName("sys_user") +public class SysUser extends TenantEntity { + + /** + * 用户ID + */ + @TableId(value = "user_id") + private Long userId; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 用户账号 + */ + private String userName; + + + /** + * 用户套餐 + */ + private String userPlan; + + /** + * 用户昵称 + */ + private String nickName; + + /** + * 用户类型(sys_user系统用户) + */ + private String userType; + + /** + * 用户邮箱 + */ + private String email; + + /** + * 手机号码 + */ + private String phonenumber; + + /** + * 用户性别 + */ + private String sex; + + /** + * 用户头像 + */ + private String avatar; + + /** + * 密码 + */ + @TableField( + insertStrategy = FieldStrategy.NOT_EMPTY, + updateStrategy = FieldStrategy.NOT_EMPTY, + whereStrategy = FieldStrategy.NOT_EMPTY + ) + private String password; + + /** + * 帐号状态(0正常 1停用) + */ + private String status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + @TableLogic + private String delFlag; + + /** + * 最后登录IP + */ + private String loginIp; + + /** + * 注册域名 + */ + private String domainName; + + /** + * 最后登录时间 + */ + private Date loginDate; + + /** + * 备注 + */ + private String remark; + + /** 普通用户的标识,对当前开发者帐号唯一。一个openid对应一个公众号或小程序 */ + private String openId; + + /** 用户余额 */ + private Double userBalance; + + /** 用户等级 */ + private String userGrade; + + public SysUser(Long userId) { + this.userId = userId; + } + + public boolean isSuperAdmin() { + return UserConstants.SUPER_ADMIN_ID.equals(this.userId); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserGroup.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserGroup.java new file mode 100644 index 0000000..3abfe6b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserGroup.java @@ -0,0 +1,58 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.*; +import org.aibidding.common.tenant.core.TenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 【请填写功能名称】对象 sys_user_group + * + * @author Lion Li + * @date 2024-08-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_user_group") +public class SysUserGroup extends TenantEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 用户组名称 + */ + private String groupName; + + /** + * 备注 + */ + private String remark; + + /** + * 版本 + */ + @Version + private Long version; + + /** + * 删除标志(0代表存在 1代表删除) + */ + @TableLogic + private String delFlag; + + /** + * 更新IP + */ + private String updateIp; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserModel.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserModel.java new file mode 100644 index 0000000..abfd69f --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserModel.java @@ -0,0 +1,42 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; + +import java.io.Serial; + +/** + * 【请填写功能名称】对象 sys_user_model + * + * @author Lion Li + * @date 2024-08-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sys_user_model") +public class SysUserModel extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(value = "id") + private Long id; + + /** + * 模型id + */ + private Long mid; + + /** + * 用户组id + */ + private Long gid; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserOnline.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserOnline.java new file mode 100644 index 0000000..09fcbe9 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserOnline.java @@ -0,0 +1,54 @@ +package org.aibidding.system.domain; + +import lombok.Data; + +/** + * 当前在线会话 + * + * @author Lion Li + */ + +@Data +public class SysUserOnline { + + /** + * 会话编号 + */ + private String tokenId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 用户名称 + */ + private String userName; + + /** + * 登录IP地址 + */ + private String ipaddr; + + /** + * 登录地址 + */ + private String loginLocation; + + /** + * 浏览器类型 + */ + private String browser; + + /** + * 操作系统 + */ + private String os; + + /** + * 登录时间 + */ + private Long loginTime; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserPost.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserPost.java new file mode 100644 index 0000000..5f2a5fa --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserPost.java @@ -0,0 +1,29 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 用户和岗位关联 sys_user_post + * + * @author Lion Li + */ + +@Data +@TableName("sys_user_post") +public class SysUserPost { + + /** + * 用户ID + */ + @TableId(type = IdType.INPUT) + private Long userId; + + /** + * 岗位ID + */ + private Long postId; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserRole.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserRole.java new file mode 100644 index 0000000..bca8727 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/SysUserRole.java @@ -0,0 +1,29 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 用户和角色关联 sys_user_role + * + * @author Lion Li + */ + +@Data +@TableName("sys_user_role") +public class SysUserRole { + + /** + * 用户ID + */ + @TableId(type = IdType.INPUT) + private Long userId; + + /** + * 角色ID + */ + private Long roleId; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/WxRobConfig.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/WxRobConfig.java new file mode 100644 index 0000000..afc5e1b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/WxRobConfig.java @@ -0,0 +1,66 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.*; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 微信机器人对象 wx_rob_config + * + * @author Lion Li + * @date 2024-05-01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("chat_rob_config") +public class WxRobConfig extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 用户id + */ + private Long userId; + + /** + * 机器人名称 + */ + private String botName; + + /** + * 机器唯一码 + */ + private String uniqueKey; + + /** + * 备注(微信号) + */ + private String remark; + + /** + * 默认好友回复开关 + */ + private String defaultFriend; + + /** + * 默认群回复开关 + */ + private String defaultGroup; + + + /** + * 机器启用1禁用0 + */ + private String enable; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/WxRobKeyword.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/WxRobKeyword.java new file mode 100644 index 0000000..346798c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/WxRobKeyword.java @@ -0,0 +1,67 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; + +import java.io.Serial; + +/** + * 【请填写功能名称】对象 wx_rob_keyword + * + * @author Lion Li + * @date 2024-05-01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("wx_rob_keyword") +public class WxRobKeyword extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(value = "id") + private Long id; + + /** + * 机器唯一码 + */ + private String uniqueKey; + + /** + * 关键词 + */ + private String keyData; + + /** + * 回复内容 + */ + private String valueData; + + /** + * 回复类型 + */ + private String typeData; + + /** + * 目标昵称 + */ + private String nickName; + + /** + * 群1好友0 + */ + private Integer toGroup; + + /** + * 启用1禁用0 + */ + private Integer enable; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/WxRobRelation.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/WxRobRelation.java new file mode 100644 index 0000000..324e3b9 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/WxRobRelation.java @@ -0,0 +1,62 @@ +package org.aibidding.system.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.mybatis.core.domain.BaseEntity; + +import java.io.Serial; + +/** + * 【请填写功能名称】对象 wx_rob_relation + * + * @author Lion Li + * @date 2024-05-01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("wx_rob_relation") +public class WxRobRelation extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(value = "id") + private Long id; + + /** + * 外接唯一码 + */ + private String outKey; + + /** + * 机器唯一码 + */ + private String uniqueKey; + + /** + * 目标昵称 + */ + private String nickName; + + /** + * 群1好友0 + */ + private Integer toGroup; + + /** + * 启用1禁用0 + */ + private Integer enable; + + /** + * IP白名单 + */ + private String whiteList; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatAppStoreBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatAppStoreBo.java new file mode 100644 index 0000000..20aaa53 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatAppStoreBo.java @@ -0,0 +1,59 @@ +package org.aibidding.system.domain.bo; + +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.ChatAppStore; +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 应用市场业务对象 voice_role + * + * @author Lion Li + * @date 2024-03-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = ChatAppStore.class, reverseConvertGenerate = false) +public class ChatAppStoreBo extends BaseEntity { + + /** + * id + */ + @NotNull(message = "id不能为空") + private Long id; + + /** + * 角色名称 + */ + @NotBlank(message = "名称不能为空") + private String name; + + /** + * 角色描述 + */ + @NotBlank(message = "描述不能为空") + private String description; + + /** + * 头像 + */ + @NotBlank(message = "头像不能为空") + private String avatar; + + /** + * 音频地址 + */ + @NotBlank(message = "应用地址不能为空") + private String appUrl; + + /** + * 备注 + */ + @NotBlank(message = "备注不能为空") + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatConfigBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatConfigBo.java new file mode 100644 index 0000000..74d2d07 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatConfigBo.java @@ -0,0 +1,68 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.ChatConfig; + +/** + * 对话配置信息 +业务对象 chat_config + * + * @author Lion Li + * @date 2024-04-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = ChatConfig.class, reverseConvertGenerate = false) +public class ChatConfigBo extends BaseEntity { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 配置类型 + */ + @NotBlank(message = "配置类型不能为空", groups = { AddGroup.class, EditGroup.class }) + private String category; + + /** + * 配置名称 + */ + @NotBlank(message = "配置名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String configName; + + /** + * 配置值 + */ + @NotBlank(message = "配置值不能为空", groups = { AddGroup.class, EditGroup.class }) + private String configValue; + + /** + * 说明 + */ + @NotBlank(message = "参数说明不能为空", groups = { AddGroup.class, EditGroup.class }) + private String configDict; + + /** + * 备注 + */ + @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) + private String remark; + + /** + * 更新IP + */ + @NotBlank(message = "更新IP不能为空", groups = { AddGroup.class, EditGroup.class }) + private String updateIp; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatGptsBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatGptsBo.java new file mode 100644 index 0000000..de65600 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatGptsBo.java @@ -0,0 +1,87 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.ChatGpts; + +/** + * gpts管理业务对象 chat_gpts + * + * @author Lion Li + * @date 2024-07-09 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = ChatGpts.class, reverseConvertGenerate = false) +public class ChatGptsBo extends BaseEntity { + + /** + * id + */ + @NotNull(message = "id不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * gpts应用id + */ + @NotBlank(message = "gpts应用id不能为空", groups = { AddGroup.class, EditGroup.class }) + private String gid; + + /** + * gpts应用名称 + */ + @NotBlank(message = "gpts应用名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String name; + + /** + * gpts图标 + */ + private String logo; + + /** + * gpts描述 + */ + private String info; + + /** + * 作者id + */ + private String authorId; + + /** + * 作者名称 + */ + private String authorName; + + /** + * 点赞 + */ + private String useCnt; + + /** + * 差评 + */ + private String bad; + + /** + * 类型 + */ + private String type; + + /** + * 备注 + */ + private String remark; + + /** + * 更新IP + */ + private String updateIp; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatMessageBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatMessageBo.java new file mode 100644 index 0000000..040194d --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatMessageBo.java @@ -0,0 +1,71 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.ChatMessage; + +/** + * 聊天消息业务对象 chat_message + * + * @author Lion Li + * @date 2023-11-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = ChatMessage.class, reverseConvertGenerate = false) +public class ChatMessageBo extends BaseEntity { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 用户ID + */ + private Long userId; + + /** + * 用户名称 + */ + private String userName; + + /** + * 对话角色 + */ + private String role; + + /** + * 消息内容 + */ + @NotBlank(message = "消息内容不能为空", groups = { AddGroup.class, EditGroup.class }) + private String content; + + /** + * 扣除费用 + */ + private Double deductCost; + + /** + * 累计 Tokens + */ + private Integer totalTokens; + + /** + * 模型名称 + */ + private String modelName; + + /** + * 备注 + */ + private String remark; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatVisitorUsageBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatVisitorUsageBo.java new file mode 100644 index 0000000..59c204c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatVisitorUsageBo.java @@ -0,0 +1,61 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.ChatVisitorUsage; + +/** + * 访客管理业务对象 chat_visitor_usage + * + * @author Lion Li + * @date 2024-07-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = ChatVisitorUsage.class, reverseConvertGenerate = false) +public class ChatVisitorUsageBo extends BaseEntity { + + /** + * id + */ + @NotNull(message = "id不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 浏览器指纹 + */ + @NotBlank(message = "浏览器指纹不能为空", groups = { AddGroup.class, EditGroup.class }) + private String fingerprint; + + /** + * 使用次数 + */ + @NotBlank(message = "使用次数不能为空", groups = { AddGroup.class, EditGroup.class }) + private String usageCount; + + /** + * ip地址 + */ + @NotBlank(message = "ip地址不能为空", groups = { AddGroup.class, EditGroup.class }) + private String ipAddress; + + /** + * 备注 + */ + @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) + private String remark; + + /** + * 更新IP + */ + @NotBlank(message = "更新IP不能为空", groups = { AddGroup.class, EditGroup.class }) + private String updateIp; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatVoucherBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatVoucherBo.java new file mode 100644 index 0000000..022e2ab --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/ChatVoucherBo.java @@ -0,0 +1,68 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.ChatVoucher; + +import java.math.BigDecimal; + +/** + * 用户兑换记录业务对象 chat_voucher + * + * @author Lion Li + * @date 2024-05-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = ChatVoucher.class, reverseConvertGenerate = false) +public class ChatVoucherBo extends BaseEntity { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 用户id + */ + private Long userId; + + /** + * 兑换码 + */ + private String code; + + /** + * 兑换金额 + */ + @NotNull(message = "兑换金额不能为空", groups = { AddGroup.class, EditGroup.class }) + private BigDecimal amount; + + /** + * 兑换状态 + */ + private String status; + + /** + * 兑换前余额 + */ + private Double balanceBefore; + + /** + * 兑换后余额 + */ + private Double balanceAfter; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/PaymentOrdersBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/PaymentOrdersBo.java new file mode 100644 index 0000000..8d9baff --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/PaymentOrdersBo.java @@ -0,0 +1,76 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.PaymentOrder; + +import java.math.BigDecimal; + +/** + * 支付订单业务对象 payment_orders + * + * @author Lion Li + * @date 2024-04-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = PaymentOrder.class, reverseConvertGenerate = false) +public class PaymentOrdersBo extends BaseEntity { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 订单编号 + */ + @NotBlank(message = "订单编号不能为空", groups = { AddGroup.class, EditGroup.class }) + private String orderNo; + + /** + * 订单名称 + */ + @NotBlank(message = "订单名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String orderName; + + /** + * 金额 + */ + @NotNull(message = "金额不能为空", groups = { AddGroup.class, EditGroup.class }) + private BigDecimal amount; + + /** + * 支付状态 + */ + @NotBlank(message = "支付状态不能为空", groups = { AddGroup.class, EditGroup.class }) + private String paymentStatus; + + /** + * 支付方式 + */ + @NotBlank(message = "支付方式不能为空", groups = { AddGroup.class, EditGroup.class }) + private String paymentMethod; + + /** + * 用户ID + */ + @NotNull(message = "用户ID不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long userId; + + /** + * 备注 + */ + @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) + private String remark; + + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysConfigBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysConfigBo.java new file mode 100644 index 0000000..592b88a --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysConfigBo.java @@ -0,0 +1,63 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.SysConfig; + +/** + * 参数配置业务对象 sys_config + * + * @author Michelle.Chung + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysConfig.class, reverseConvertGenerate = false) +public class SysConfigBo extends BaseEntity { + + /** + * 参数主键 + */ + @NotNull(message = "参数主键不能为空", groups = { EditGroup.class }) + private Long configId; + + /** + * 参数名称 + */ + @NotBlank(message = "参数名称不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 100, message = "参数名称不能超过{max}个字符") + private String configName; + + /** + * 参数键名 + */ + @NotBlank(message = "参数键名不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 100, message = "参数键名长度不能超过{max}个字符") + private String configKey; + + /** + * 参数键值 + */ + @NotBlank(message = "参数键值不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 500, message = "参数键值长度不能超过{max}个字符") + private String configValue; + + /** + * 系统内置(Y是 N否) + */ + private String configType; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysDeptBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysDeptBo.java new file mode 100644 index 0000000..0784a2e --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysDeptBo.java @@ -0,0 +1,73 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.SysDept; + +/** + * 部门业务对象 sys_dept + * + * @author Michelle.Chung + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysDept.class, reverseConvertGenerate = false) +public class SysDeptBo extends BaseEntity { + + /** + * 部门id + */ + @NotNull(message = "部门id不能为空", groups = { EditGroup.class }) + private Long deptId; + + /** + * 父部门ID + */ + private Long parentId; + + /** + * 部门名称 + */ + @NotBlank(message = "部门名称不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 30, message = "部门名称长度不能超过{max}个字符") + private String deptName; + + /** + * 显示顺序 + */ + @NotNull(message = "显示顺序不能为空") + private Integer orderNum; + + /** + * 负责人 + */ + private String leader; + + /** + * 联系电话 + */ + @Size(min = 0, max = 11, message = "联系电话长度不能超过{max}个字符") + private String phone; + + /** + * 邮箱 + */ + @Email(message = "邮箱格式不正确") + @Size(min = 0, max = 50, message = "邮箱长度不能超过{max}个字符") + private String email; + + /** + * 部门状态(0正常 1停用) + */ + private String status; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysDictDataBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysDictDataBo.java new file mode 100644 index 0000000..7a380b2 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysDictDataBo.java @@ -0,0 +1,88 @@ +package org.aibidding.system.domain.bo; + +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.SysDictData; +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 字典数据业务对象 sys_dict_data + * + * @author Michelle.Chung + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysDictData.class, reverseConvertGenerate = false) +public class SysDictDataBo extends BaseEntity { + + /** + * 字典编码 + */ + @NotNull(message = "字典编码不能为空", groups = { EditGroup.class }) + private Long dictCode; + + /** + * 字典排序 + */ + private Integer dictSort; + + /** + * 字典标签 + */ + @NotBlank(message = "字典标签不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 100, message = "字典标签长度不能超过{max}个字符") + private String dictLabel; + + /** + * 字典键值 + */ + @NotBlank(message = "字典键值不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 100, message = "字典键值长度不能超过{max}个字符") + private String dictValue; + + /** + * 字典类型 + */ + @NotBlank(message = "字典类型不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 100, message = "字典类型长度不能超过{max}个字符") + private String dictType; + + /** + * 样式属性(其他样式扩展) + */ + @Size(min = 0, max = 100, message = "样式属性长度不能超过{max}个字符") + private String cssClass; + + /** + * 表格回显样式 + */ + private String listClass; + + /** + * 是否默认(Y是 N否) + */ + private String isDefault; + + /** + * 状态(0正常 1停用) + */ + private String status; + + /** + * 创建部门 + */ + private Long createDept; + + /** + * 备注 + */ + private String remark; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysDictTypeBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysDictTypeBo.java new file mode 100644 index 0000000..be6fd0f --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysDictTypeBo.java @@ -0,0 +1,58 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.SysDictType; + +/** + * 字典类型业务对象 sys_dict_type + * + * @author Michelle.Chung + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysDictType.class, reverseConvertGenerate = false) +public class SysDictTypeBo extends BaseEntity { + + /** + * 字典主键 + */ + @NotNull(message = "字典主键不能为空", groups = { EditGroup.class }) + private Long dictId; + + /** + * 字典名称 + */ + @NotBlank(message = "字典名称不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 100, message = "字典类型名称长度不能超过{max}个字符") + private String dictName; + + /** + * 字典类型 + */ + @NotBlank(message = "字典类型不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 100, message = "字典类型类型长度不能超过{max}个字符") + @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)") + private String dictType; + + /** + * 状态(0正常 1停用) + */ + private String status; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysLogininforBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysLogininforBo.java new file mode 100644 index 0000000..7f58315 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysLogininforBo.java @@ -0,0 +1,77 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.system.domain.SysLogininfor; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * 系统访问记录业务对象 sys_logininfor + * + * @author Michelle.Chung + */ + +@Data +@AutoMapper(target = SysLogininfor.class, reverseConvertGenerate = false) +public class SysLogininforBo { + + /** + * 访问ID + */ + private Long infoId; + + /** + * 租户编号 + */ + private String tenantId; + + /** + * 用户账号 + */ + private String userName; + + /** + * 登录IP地址 + */ + private String ipaddr; + + /** + * 登录地点 + */ + private String loginLocation; + + /** + * 浏览器类型 + */ + private String browser; + + /** + * 操作系统 + */ + private String os; + + /** + * 登录状态(0成功 1失败) + */ + private String status; + + /** + * 提示消息 + */ + private String msg; + + /** + * 访问时间 + */ + private Date loginTime; + + /** + * 请求参数 + */ + private Map params = new HashMap<>(); + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysMenuBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysMenuBo.java new file mode 100644 index 0000000..5804578 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysMenuBo.java @@ -0,0 +1,111 @@ +package org.aibidding.system.domain.bo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.SysMenu; +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 菜单权限业务对象 sys_menu + * + * @author Michelle.Chung + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysMenu.class, reverseConvertGenerate = false) +public class SysMenuBo extends BaseEntity { + + /** + * 菜单ID + */ + @NotNull(message = "菜单ID不能为空", groups = { EditGroup.class }) + private Long menuId; + + /** + * 父菜单ID + */ + private Long parentId; + + /** + * 菜单名称 + */ + @NotBlank(message = "菜单名称不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 50, message = "菜单名称长度不能超过{max}个字符") + private String menuName; + + /** + * 显示顺序 + */ + @NotNull(message = "显示顺序不能为空", groups = { AddGroup.class, EditGroup.class }) + private Integer orderNum; + + /** + * 路由地址 + */ + @Size(min = 0, max = 200, message = "路由地址不能超过{max}个字符") + private String path; + + /** + * 组件路径 + */ + @Size(min = 0, max = 200, message = "组件路径不能超过{max}个字符") + private String component; + + /** + * 路由参数 + */ + private String queryParam; + + /** + * 是否为外链(0是 1否) + */ + private String isFrame; + + /** + * 是否缓存(0缓存 1不缓存) + */ + private String isCache; + + /** + * 菜单类型(M目录 C菜单 F按钮) + */ + @NotBlank(message = "菜单类型不能为空", groups = { AddGroup.class, EditGroup.class }) + private String menuType; + + /** + * 显示状态(0显示 1隐藏) + */ + private String visible; + + /** + * 菜单状态(0正常 1停用) + */ + private String status; + + /** + * 权限标识 + */ + @JsonInclude(JsonInclude.Include.NON_NULL) + @Size(min = 0, max = 100, message = "权限标识长度不能超过{max}个字符") + private String perms; + + /** + * 菜单图标 + */ + private String icon; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysModelBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysModelBo.java new file mode 100644 index 0000000..f7d1385 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysModelBo.java @@ -0,0 +1,82 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.SysModel; + +/** + * 系统模型业务对象 sys_model + * + * @author Lion Li + * @date 2024-04-04 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysModel.class, reverseConvertGenerate = false) +public class SysModelBo extends BaseEntity { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 模型名称 + */ + @NotBlank(message = "模型名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String modelName; + + + /** + * 模型描述 + */ + @NotBlank(message = "模型描述不能为空", groups = { AddGroup.class, EditGroup.class }) + private String modelDescribe; + + /** + * 模型价格 + */ + @NotNull(message = "模型价格不能为空", groups = { AddGroup.class, EditGroup.class }) + private double modelPrice; + + /** + * 计费类型 (1 token扣费; 2 次数扣费 ) + */ + @NotBlank(message = "计费类型不能为空", groups = { AddGroup.class, EditGroup.class }) + private String modelType; + + /** + * 模型状态 (0 显示; 1 隐藏 ) + */ + private String modelShow; + + + /** + * 系统提示词 + */ + private String systemPrompt; + + /** + * 请求地址 + */ + private String apiHost; + + /** + * 请求密钥 + */ + private String apiKey; + /** + * 备注 + */ + @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysNoticeBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysNoticeBo.java new file mode 100644 index 0000000..394dd3a --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysNoticeBo.java @@ -0,0 +1,65 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.core.xss.Xss; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.SysNotice; + +/** + * 通知公告业务对象 sys_notice + * + * @author Michelle.Chung + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysNotice.class, reverseConvertGenerate = false) +public class SysNoticeBo extends BaseEntity { + + /** + * 公告ID + */ + @NotNull(message = "公告ID不能为空", groups = { EditGroup.class }) + private Long noticeId; + + /** + * 公告标题 + */ + @Xss(message = "公告标题不能包含脚本字符") + @NotBlank(message = "公告标题不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 50, message = "公告标题不能超过{max}个字符") + private String noticeTitle; + + /** + * 公告类型(1通知 2公告) + */ + private String noticeType; + + /** + * 公告内容 + */ + private String noticeContent; + + /** + * 公告状态(0正常 1关闭) + */ + private String status; + + /** + * 备注 + */ + private String remark; + + /** + * 创建人名称 + */ + private String createByName; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysNoticeStateBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysNoticeStateBo.java new file mode 100644 index 0000000..d6049ee --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysNoticeStateBo.java @@ -0,0 +1,54 @@ +package org.aibidding.system.domain.bo; + +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.system.domain.SysNoticeState; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; + +/** + * 用户阅读状态业务对象 sys_notice_state + * + * @author Lion Li + * @date 2024-05-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysNoticeState.class, reverseConvertGenerate = false) +public class SysNoticeStateBo extends BaseEntity { + + /** + * ID + */ + @NotNull(message = "ID不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 用户ID + */ + @NotNull(message = "用户ID不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long userId; + + /** + * 公告ID + */ + @NotNull(message = "公告ID不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long noticeId; + + /** + * 阅读状态(0未读 1已读) + */ + @NotBlank(message = "阅读状态(0未读 1已读)不能为空", groups = { AddGroup.class, EditGroup.class }) + private String readStatus; + + /** + * 备注 + */ + @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysOperLogBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysOperLogBo.java new file mode 100644 index 0000000..39bdfcb --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysOperLogBo.java @@ -0,0 +1,127 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import io.github.linpeilie.annotations.AutoMappers; +import lombok.Data; +import org.aibidding.common.log.event.OperLogEvent; +import org.aibidding.system.domain.SysOperLog; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * 操作日志记录业务对象 sys_oper_log + * + * @author Michelle.Chung + * @date 2023-02-07 + */ + +@Data +@AutoMappers({ + @AutoMapper(target = SysOperLog.class, reverseConvertGenerate = false), + @AutoMapper(target = OperLogEvent.class) +}) +public class SysOperLogBo { + + /** + * 日志主键 + */ + private Long operId; + + /** + * 租户编号 + */ + private String tenantId; + + /** + * 模块标题 + */ + private String title; + + /** + * 业务类型(0其它 1新增 2修改 3删除) + */ + private Integer businessType; + + /** + * 业务类型数组 + */ + private Integer[] businessTypes; + + /** + * 方法名称 + */ + private String method; + + /** + * 请求方式 + */ + private String requestMethod; + + /** + * 操作类别(0其它 1后台用户 2手机端用户) + */ + private Integer operatorType; + + /** + * 操作人员 + */ + private String operName; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 请求URL + */ + private String operUrl; + + /** + * 主机地址 + */ + private String operIp; + + /** + * 操作地点 + */ + private String operLocation; + + /** + * 请求参数 + */ + private String operParam; + + /** + * 返回参数 + */ + private String jsonResult; + + /** + * 操作状态(0正常 1异常) + */ + private Integer status; + + /** + * 错误消息 + */ + private String errorMsg; + + /** + * 操作时间 + */ + private Date operTime; + + /** + * 消耗时间 + */ + private Long costTime; + + /** + * 请求参数 + */ + private Map params = new HashMap<>(); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysOssBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysOssBo.java new file mode 100644 index 0000000..28b5bf0 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysOssBo.java @@ -0,0 +1,49 @@ +package org.aibidding.system.domain.bo; + +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.SysOss; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * OSS对象存储分页查询对象 sys_oss + * + * @author Lion Li + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysOss.class, reverseConvertGenerate = false) +public class SysOssBo extends BaseEntity { + + /** + * ossId + */ + private Long ossId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 原名 + */ + private String originalName; + + /** + * 文件后缀名 + */ + private String fileSuffix; + + /** + * URL地址 + */ + private String url; + + /** + * 服务商 + */ + private String service; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysOssConfigBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysOssConfigBo.java new file mode 100644 index 0000000..41b7a8a --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysOssConfigBo.java @@ -0,0 +1,109 @@ +package org.aibidding.system.domain.bo; + +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.SysOssConfig; +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 对象存储配置业务对象 sys_oss_config + * + * @author Lion Li + * @author 孤舟烟雨 + * @date 2021-08-13 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysOssConfig.class, reverseConvertGenerate = false) +public class SysOssConfigBo extends BaseEntity { + + /** + * 主建 + */ + @NotNull(message = "主建不能为空", groups = {EditGroup.class}) + private Long ossConfigId; + + /** + * 配置key + */ + @NotBlank(message = "配置key不能为空", groups = {AddGroup.class, EditGroup.class}) + @Size(min = 2, max = 100, message = "configKey长度必须介于{min}和{max} 之间") + private String configKey; + + /** + * accessKey + */ + @NotBlank(message = "accessKey不能为空", groups = {AddGroup.class, EditGroup.class}) + @Size(min = 2, max = 100, message = "accessKey长度必须介于{min}和{max} 之间") + private String accessKey; + + /** + * 秘钥 + */ + @NotBlank(message = "secretKey不能为空", groups = {AddGroup.class, EditGroup.class}) + @Size(min = 2, max = 100, message = "secretKey长度必须介于{min}和{max} 之间") + private String secretKey; + + /** + * 桶名称 + */ + @NotBlank(message = "桶名称不能为空", groups = {AddGroup.class, EditGroup.class}) + @Size(min = 2, max = 100, message = "bucketName长度必须介于{min}和{max}之间") + private String bucketName; + + /** + * 前缀 + */ + private String prefix; + + /** + * 访问站点 + */ + @NotBlank(message = "访问站点不能为空", groups = {AddGroup.class, EditGroup.class}) + @Size(min = 2, max = 100, message = "endpoint长度必须介于{min}和{max}之间") + private String endpoint; + + /** + * 自定义域名 + */ + private String domain; + + /** + * 是否https(Y=是,N=否) + */ + private String isHttps; + + /** + * 是否默认(0=是,1=否) + */ + private String status; + + /** + * 域 + */ + private String region; + + /** + * 扩展字段 + */ + private String ext1; + + /** + * 备注 + */ + private String remark; + + /** + * 桶权限类型(0private 1public 2custom) + */ + @NotBlank(message = "桶权限类型不能为空", groups = {AddGroup.class, EditGroup.class}) + private String accessPolicy; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysPackagePlanBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysPackagePlanBo.java new file mode 100644 index 0000000..e48f174 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysPackagePlanBo.java @@ -0,0 +1,61 @@ +package org.aibidding.system.domain.bo; + +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.system.domain.SysPackagePlan; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; + +/** + * 套餐管理业务对象 sys_package_plan + * + * @author Lion Li + * @date 2024-05-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysPackagePlan.class, reverseConvertGenerate = false) +public class SysPackagePlanBo extends BaseEntity { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 套餐名称 + */ + @NotBlank(message = "套餐名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String name; + + /** + * 套餐价格 + */ + @NotNull(message = "套餐价格不能为空", groups = { AddGroup.class, EditGroup.class }) + private BigDecimal price; + + /** + * 有效时间 + */ + @NotNull(message = "有效时间不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long duration; + + /** + * 计划详情 + */ + @NotBlank(message = "计划详情不能为空", groups = { AddGroup.class, EditGroup.class }) + private String planDetail; + + /** + * 备注 + */ + @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysPostBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysPostBo.java new file mode 100644 index 0000000..64a9b30 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysPostBo.java @@ -0,0 +1,62 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.SysPost; + +/** + * 岗位信息业务对象 sys_post + * + * @author Michelle.Chung + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysPost.class, reverseConvertGenerate = false) +public class SysPostBo extends BaseEntity { + + /** + * 岗位ID + */ + @NotNull(message = "岗位ID不能为空", groups = { EditGroup.class }) + private Long postId; + + /** + * 岗位编码 + */ + @NotBlank(message = "岗位编码不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 64, message = "岗位编码长度不能超过{max}个字符") + private String postCode; + + /** + * 岗位名称 + */ + @NotBlank(message = "岗位名称不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 50, message = "岗位名称长度不能超过{max}个字符") + private String postName; + + /** + * 显示顺序 + */ + @NotNull(message = "显示顺序不能为空", groups = { AddGroup.class, EditGroup.class }) + private Integer postSort; + + /** + * 状态(0正常 1停用) + */ + private String status; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysRoleBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysRoleBo.java new file mode 100644 index 0000000..ef8d43d --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysRoleBo.java @@ -0,0 +1,97 @@ +package org.aibidding.system.domain.bo; + +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.SysRole; +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * 角色信息业务对象 sys_role + * + * @author Michelle.Chung + */ + +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysRole.class, reverseConvertGenerate = false) +public class SysRoleBo extends BaseEntity { + + /** + * 角色ID + */ + @NotNull(message = "角色ID不能为空", groups = { EditGroup.class }) + private Long roleId; + + /** + * 角色名称 + */ + @NotBlank(message = "角色名称不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 30, message = "角色名称长度不能超过{max}个字符") + private String roleName; + + /** + * 角色权限字符串 + */ + @NotBlank(message = "角色权限字符串不能为空", groups = { AddGroup.class, EditGroup.class }) + @Size(min = 0, max = 100, message = "权限字符长度不能超过{max}个字符") + private String roleKey; + + /** + * 显示顺序 + */ + @NotNull(message = "显示顺序不能为空", groups = { AddGroup.class, EditGroup.class }) + private Integer roleSort; + + /** + * 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限) + */ + private String dataScope; + + /** + * 菜单树选择项是否关联显示 + */ + private Boolean menuCheckStrictly; + + /** + * 部门树选择项是否关联显示 + */ + private Boolean deptCheckStrictly; + + /** + * 角色状态(0正常 1停用) + */ + private String status; + + /** + * 备注 + */ + private String remark; + + /** + * 菜单组 + */ + private Long[] menuIds; + + /** + * 部门组(数据权限) + */ + private Long[] deptIds; + + public SysRoleBo(Long roleId) { + this.roleId = roleId; + } + + public boolean isSuperAdmin() { + return UserConstants.SUPER_ADMIN_ID.equals(this.roleId); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysTenantBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysTenantBo.java new file mode 100644 index 0000000..5523971 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysTenantBo.java @@ -0,0 +1,114 @@ +package org.aibidding.system.domain.bo; + +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.SysTenant; +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 租户业务对象 sys_tenant + * + * @author Michelle.Chung + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysTenant.class, reverseConvertGenerate = false) +public class SysTenantBo extends BaseEntity { + + /** + * id + */ + @NotNull(message = "id不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 租户编号 + */ + private String tenantId; + + /** + * 联系人 + */ + @NotBlank(message = "联系人不能为空", groups = { AddGroup.class, EditGroup.class }) + private String contactUserName; + + /** + * 联系电话 + */ + @NotBlank(message = "联系电话不能为空", groups = { AddGroup.class, EditGroup.class }) + private String contactPhone; + + /** + * 企业名称 + */ + @NotBlank(message = "企业名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String companyName; + + /** + * 用户名(创建系统用户) + */ + @NotBlank(message = "用户名不能为空", groups = { AddGroup.class }) + private String username; + + /** + * 密码(创建系统用户) + */ + @NotBlank(message = "密码不能为空", groups = { AddGroup.class }) + private String password; + + /** + * 统一社会信用代码 + */ + private String licenseNumber; + + /** + * 地址 + */ + private String address; + + /** + * 域名 + */ + private String domain; + + /** + * 企业简介 + */ + private String intro; + + /** + * 备注 + */ + private String remark; + + /** + * 租户套餐编号 + */ + @NotNull(message = "租户套餐不能为空", groups = { AddGroup.class }) + private Long packageId; + + /** + * 过期时间 + */ + private Date expireTime; + + /** + * 用户数量(-1不限制) + */ + private Long accountCount; + + /** + * 租户状态(0正常 1停用) + */ + private String status; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysTenantPackageBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysTenantPackageBo.java new file mode 100644 index 0000000..8985ace --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysTenantPackageBo.java @@ -0,0 +1,59 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import io.github.linpeilie.annotations.AutoMapping; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.SysTenantPackage; + +/** + * 租户套餐业务对象 sys_tenant_package + * + * @author Michelle.Chung + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysTenantPackage.class, reverseConvertGenerate = false) +public class SysTenantPackageBo extends BaseEntity { + + /** + * 租户套餐id + */ + @NotNull(message = "租户套餐id不能为空", groups = { EditGroup.class }) + private Long packageId; + + /** + * 套餐名称 + */ + @NotBlank(message = "套餐名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String packageName; + + /** + * 关联菜单id + */ + @AutoMapping(target = "menuIds", expression = "java(org.aibidding.common.core.utils.StringUtils.join(source.getMenuIds(), \",\"))") + private Long[] menuIds; + + /** + * 备注 + */ + private String remark; + + /** + * 菜单树选择项是否关联显示 + */ + private Boolean menuCheckStrictly; + + /** + * 状态(0正常 1停用) + */ + private String status; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserBo.java new file mode 100644 index 0000000..a24c033 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserBo.java @@ -0,0 +1,140 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.core.xss.Xss; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.common.sensitive.annotation.Sensitive; +import org.aibidding.common.sensitive.core.SensitiveStrategy; +import org.aibidding.system.domain.SysUser; + +/** + * 用户信息业务对象 sys_user + * + * @author Michelle.Chung + */ + +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysUser.class, reverseConvertGenerate = false) +public class SysUserBo extends BaseEntity { + + /** + * 用户ID + */ + private Long userId; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 用户账号 + */ + @Xss(message = "用户账号不能包含脚本字符") + @NotBlank(message = "用户账号不能为空") + @Size(min = 0, max = 30, message = "用户账号长度不能超过{max}个字符") + private String userName; + + /** + * 用户昵称 + */ + @Xss(message = "用户昵称不能包含脚本字符") + @Size(min = 0, max = 30, message = "用户昵称长度不能超过{max}个字符") + private String nickName; + + /** + * 用户类型(sys_user系统用户) + */ + private String userType; + + /** + * 用户邮箱 + */ + @Sensitive(strategy = SensitiveStrategy.EMAIL) + @Email(message = "邮箱格式不正确") + @Size(min = 0, max = 50, message = "邮箱长度不能超过{max}个字符") + private String email; + + /** + * 手机号码 + */ + @Sensitive(strategy = SensitiveStrategy.PHONE) + private String phonenumber; + + /** + * 用户性别(0男 1女 2未知) + */ + private String sex; + + /** + * 密码 + */ + private String password; + + + /** + * 用户套餐 + */ + private String userPlan; + + /** + * 帐号状态(0正常 1停用) + */ + private String status; + + /** + * 微信头像 + */ + private String avatar; + + /** + * 备注 + */ + private String remark; + + /** + * 注册域名 + */ + private String domainName; + /** + * 角色组 + */ + private Long[] roleIds; + + /** + * 岗位组 + */ + private Long[] postIds; + + /** + * 数据权限 当前角色ID + */ + private Long roleId; + + /** 普通用户的标识,对当前开发者帐号唯一。一个openid对应一个公众号或小程序 */ + private String openId; + + /** 用户等级 */ + private String userGrade; + + /** 用户余额 */ + private Double userBalance; + + public SysUserBo(Long userId) { + this.userId = userId; + } + + public boolean isSuperAdmin() { + return UserConstants.SUPER_ADMIN_ID.equals(this.userId); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserGroupBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserGroupBo.java new file mode 100644 index 0000000..2cf42dc --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserGroupBo.java @@ -0,0 +1,48 @@ +package org.aibidding.system.domain.bo; + +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.system.domain.SysUserGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; + +/** + * 【请填写功能名称】业务对象 sys_user_group + * + * @author Lion Li + * @date 2024-08-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysUserGroup.class, reverseConvertGenerate = false) +public class SysUserGroupBo extends BaseEntity { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 用户组名称 + */ + @NotBlank(message = "用户组名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String groupName; + + /** + * 备注 + */ + @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) + private String remark; + + /** + * 更新IP + */ + @NotBlank(message = "更新IP不能为空", groups = { AddGroup.class, EditGroup.class }) + private String updateIp; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserModelBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserModelBo.java new file mode 100644 index 0000000..7b97238 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserModelBo.java @@ -0,0 +1,42 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.SysUserModel; + +/** + * 【请填写功能名称】业务对象 sys_user_model + * + * @author Lion Li + * @date 2024-08-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = SysUserModel.class, reverseConvertGenerate = false) +public class SysUserModelBo extends BaseEntity { + + /** + * id + */ + @NotNull(message = "id不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 模型id + */ + @NotNull(message = "模型id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long mid; + + /** + * 用户组id + */ + @NotNull(message = "用户组id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long gid; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserPasswordBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserPasswordBo.java new file mode 100644 index 0000000..bfd0d75 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserPasswordBo.java @@ -0,0 +1,32 @@ +package org.aibidding.system.domain.bo; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + + +/** + * 描述:用户密码修改bo + * + * @author ageerle@163.com + * date 2025/3/9 + */ +@Data +public class SysUserPasswordBo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 旧密码 + */ + @NotBlank(message = "旧密码不能为空") + private String oldPassword; + + /** + * 新密码 + */ + @NotBlank(message = "新密码不能为空") + private String newPassword; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserProfileBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserProfileBo.java new file mode 100644 index 0000000..5b7b2f1 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/SysUserProfileBo.java @@ -0,0 +1,55 @@ +package org.aibidding.system.domain.bo; + +import org.aibidding.common.core.xss.Xss; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.common.sensitive.annotation.Sensitive; +import org.aibidding.common.sensitive.core.SensitiveStrategy; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Size; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * 个人信息业务处理 + * + * @author Michelle.Chung + */ + +@Data +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class SysUserProfileBo extends BaseEntity { + + /** + * 用户ID + */ + private Long userId; + + /** + * 用户昵称 + */ + @Xss(message = "用户昵称不能包含脚本字符") + @Size(min = 0, max = 30, message = "用户昵称长度不能超过{max}个字符") + private String nickName; + + /** + * 用户邮箱 + */ + @Sensitive(strategy = SensitiveStrategy.EMAIL) + @Email(message = "邮箱格式不正确") + @Size(min = 0, max = 50, message = "邮箱长度不能超过{max}个字符") + private String email; + + /** + * 手机号码 + */ + @Sensitive(strategy = SensitiveStrategy.PHONE) + private String phonenumber; + + /** + * 用户性别(0男 1女 2未知) + */ + private String sex; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/WxRobConfigBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/WxRobConfigBo.java new file mode 100644 index 0000000..164b74d --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/WxRobConfigBo.java @@ -0,0 +1,63 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.WxRobConfig; + +/** + * 微信机器人业务对象 wx_rob_config + * + * @author Lion Li + * @date 2024-05-01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = WxRobConfig.class, reverseConvertGenerate = false) +public class WxRobConfigBo extends BaseEntity { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 用户id + */ + private Long userId; + + /** + * 机器人名称 + */ + private String botName; + + /** + * 机器唯一码 + */ + private String uniqueKey; + + /** + * 默认好友回复开关 + */ + private String defaultFriend; + + /** + * 默认群回复开关 + */ + private String defaultGroup; + + /** + * 机器启用1禁用0 + */ + private String enable; + + /** + * 备注 + */ + private String remark; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/WxRobKeywordBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/WxRobKeywordBo.java new file mode 100644 index 0000000..b30cba5 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/WxRobKeywordBo.java @@ -0,0 +1,73 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.WxRobKeyword; + +/** + * 【请填写功能名称】业务对象 wx_rob_keyword + * + * @author Lion Li + * @date 2024-05-01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = WxRobKeyword.class, reverseConvertGenerate = false) +public class WxRobKeywordBo extends BaseEntity { + + /** + * + */ + @NotNull(message = "不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 机器唯一码 + */ + @NotBlank(message = "机器唯一码不能为空", groups = { AddGroup.class, EditGroup.class }) + private String uniqueKey; + + /** + * 关键词 + */ + @NotBlank(message = "关键词不能为空", groups = { AddGroup.class, EditGroup.class }) + private String keyData; + + /** + * 回复内容 + */ + @NotBlank(message = "回复内容不能为空", groups = { AddGroup.class, EditGroup.class }) + private String valueData; + + /** + * 回复类型 + */ + @NotBlank(message = "回复类型不能为空", groups = { AddGroup.class, EditGroup.class }) + private String typeData; + + /** + * 目标昵称 + */ + @NotBlank(message = "目标昵称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String nickName; + + /** + * 群1好友0 + */ + @NotNull(message = "群1好友0不能为空", groups = { AddGroup.class, EditGroup.class }) + private Integer toGroup; + + /** + * 启用1禁用0 + */ + @NotNull(message = "启用1禁用0不能为空", groups = { AddGroup.class, EditGroup.class }) + private Integer enable; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/WxRobRelationBo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/WxRobRelationBo.java new file mode 100644 index 0000000..74ca4b7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/bo/WxRobRelationBo.java @@ -0,0 +1,67 @@ +package org.aibidding.system.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.common.mybatis.core.domain.BaseEntity; +import org.aibidding.system.domain.WxRobRelation; + +/** + * 【请填写功能名称】业务对象 wx_rob_relation + * + * @author Lion Li + * @date 2024-05-01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = WxRobRelation.class, reverseConvertGenerate = false) +public class WxRobRelationBo extends BaseEntity { + + /** + * + */ + @NotNull(message = "不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 外接唯一码 + */ + @NotBlank(message = "外接唯一码不能为空", groups = { AddGroup.class, EditGroup.class }) + private String outKey; + + /** + * 机器唯一码 + */ + @NotBlank(message = "机器唯一码不能为空", groups = { AddGroup.class, EditGroup.class }) + private String uniqueKey; + + /** + * 目标昵称 + */ + @NotBlank(message = "目标昵称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String nickName; + + /** + * 群1好友0 + */ + @NotNull(message = "群1好友0不能为空", groups = { AddGroup.class, EditGroup.class }) + private Integer toGroup; + + /** + * 启用1禁用0 + */ + @NotNull(message = "启用1禁用0不能为空", groups = { AddGroup.class, EditGroup.class }) + private Integer enable; + + /** + * IP白名单 + */ + @NotBlank(message = "IP白名单不能为空", groups = { AddGroup.class, EditGroup.class }) + private String whiteList; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/model/ApiResult.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/model/ApiResult.java new file mode 100644 index 0000000..5239c98 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/model/ApiResult.java @@ -0,0 +1,31 @@ +package org.aibidding.system.domain.model; + +import lombok.Getter; +import lombok.Setter; +import lombok.extern.slf4j.Slf4j; + +/** + * @author https://www.wdbyte.com + */ +@Slf4j +@Getter +@Setter +public class ApiResult { + private Integer code; + private String message; + private Object data; + + public ApiResult() { + } + + public ApiResult(Integer code, String message) { + this.code = code; + this.message = message; + } + + public ApiResult(Integer code, String message, Object data) { + this.code = code; + this.message = message; + this.data = data; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/model/ReceiveMessage.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/model/ReceiveMessage.java new file mode 100644 index 0000000..c6d81bf --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/model/ReceiveMessage.java @@ -0,0 +1,58 @@ +package org.aibidding.system.domain.model; + +import lombok.Data; + +@Data +public class ReceiveMessage { + /** + * 开发者微信号 + */ + private String toUserName; + /** + * 发送方账号(一个openid) + */ + private String fromUserName; + /** + * 消息创建时间(整形) + */ + private String createTime; + /** + * 消息类型 + */ + private String msgType; + /** + * 文本消息内容 + */ + private String content; + /** + * 消息ID 64位 + */ + String msgId; + /** + * 消息的数据ID 消息来自文章才有 + */ + private String msgDataId; + /** + * 多图文时第几篇文章,从1开始 消息如果来自文章才有 + */ + private String idx; + /** + * 订阅事件 subscribe 订阅 unsbscribe 取消订阅 + */ + private String event; + /** + * 扫码 - ticket + */ + private String ticket; + + public String getReplyTextMsg(String msg) { + String xml = "\n" + + " \n" + + " \n" + + " " + System.currentTimeMillis() + "\n" + + " \n" + + " \n" + + " "; + return xml; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/model/WeixinQrCode.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/model/WeixinQrCode.java new file mode 100644 index 0000000..52a14c1 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/model/WeixinQrCode.java @@ -0,0 +1,15 @@ +package org.aibidding.system.domain.model; + +import lombok.Data; + +/** + * @author https://www.wdbyte.com + */ +@Data +public class WeixinQrCode { + + private String ticket; + private Long expireSeconds; + private String url; + private String qrCodeUrl; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/request/EmailRequest.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/request/EmailRequest.java new file mode 100644 index 0000000..9add2c0 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/request/EmailRequest.java @@ -0,0 +1,18 @@ +package org.aibidding.system.domain.request; + +import jakarta.validation.constraints.NotNull; +import lombok.Data; + + +/** + * 用户登录 + */ +@Data +public class EmailRequest { + /** + * 账号 + */ + @NotNull(message = "账号不能为空") + private String username; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/request/OrderRequest.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/request/OrderRequest.java new file mode 100644 index 0000000..a79016c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/request/OrderRequest.java @@ -0,0 +1,32 @@ +package org.aibidding.system.domain.request; + +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +@Data +public class OrderRequest { + + /** + * 商品金额 + */ + @NotNull(message = "商品金额") + private String money; + + /** + * 商品名称 + */ + @NotNull(message = "商品名称") + private String name; + + /** + * 订单编号 + */ + @NotNull(message = "订单编号") + private String orderNo; + + /** + * 支付方式 + */ + @NotNull(message = "支付方式") + private String payType; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/request/UserRequest.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/request/UserRequest.java new file mode 100644 index 0000000..3c7c2fe --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/request/UserRequest.java @@ -0,0 +1,18 @@ +package org.aibidding.system.domain.request; + +import jakarta.validation.constraints.NotNull; +import lombok.Data; + + +/** + * 编辑用户 + */ +@Data +public class UserRequest { + /** + * 用户名称 + */ + @NotNull(message = "用户名称不能为空") + private String nickName; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/request/translation/TranslationRequest.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/request/translation/TranslationRequest.java new file mode 100644 index 0000000..d56ebd5 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/request/translation/TranslationRequest.java @@ -0,0 +1,29 @@ +package org.aibidding.system.domain.request.translation; + +import lombok.Data; + +/** + * 描述:翻译请求对象 + * + * @author ageerle@163.com + * date 2025/1/13 + */ + +@Data +public class TranslationRequest { + /** + * 提示词 + */ + private String prompt; + + /** + * 模型名称 + */ + private String model; + + /** + * 目标语言 + */ + private String targetLanguage; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/AvatarVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/AvatarVo.java new file mode 100644 index 0000000..660220a --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/AvatarVo.java @@ -0,0 +1,18 @@ +package org.aibidding.system.domain.vo; + +import lombok.Data; + +/** + * 用户头像信息 + * + * @author Michelle.Chung + */ +@Data +public class AvatarVo { + + /** + * 头像地址 + */ + private String imgUrl; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/CacheListInfoVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/CacheListInfoVo.java new file mode 100644 index 0000000..fd4fa05 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/CacheListInfoVo.java @@ -0,0 +1,23 @@ +package org.aibidding.system.domain.vo; + +import lombok.Data; + +import java.util.List; +import java.util.Map; +import java.util.Properties; + +/** + * 缓存监控列表信息 + * + * @author Michelle.Chung + */ +@Data +public class CacheListInfoVo { + + private Properties info; + + private Long dbSize; + + private List> commandStats; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/CaptchaVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/CaptchaVo.java new file mode 100644 index 0000000..7da074e --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/CaptchaVo.java @@ -0,0 +1,25 @@ +package org.aibidding.system.domain.vo; + +import lombok.Data; + +/** + * 验证码信息 + * + * @author Michelle.Chung + */ +@Data +public class CaptchaVo { + + /** + * 是否开启验证码 + */ + private Boolean captchaEnabled = true; + + private String uuid; + + /** + * 验证码图片 + */ + private String img; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatAppStoreVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatAppStoreVo.java new file mode 100644 index 0000000..29b0bee --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatAppStoreVo.java @@ -0,0 +1,65 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.system.domain.ChatAppStore; + +import java.io.Serial; +import java.io.Serializable; + + + +/** + * 应用市场视图对象 + * + * @author Lion Li + * @date 2024-03-19 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = ChatAppStore.class) +public class ChatAppStoreVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + + /** + * 角色名称 + */ + @ExcelProperty(value = "名称") + private String name; + + /** + * 角色描述 + */ + @ExcelProperty(value = "描述") + private String description; + + /** + * 头像 + */ + @ExcelProperty(value = "头像") + private String avatar; + + /** + * 音频地址 + */ + @ExcelProperty(value = "应用地址") + private String appUrl; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatConfigVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatConfigVo.java new file mode 100644 index 0000000..9a3e857 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatConfigVo.java @@ -0,0 +1,72 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.system.domain.ChatConfig; + +import java.io.Serial; +import java.io.Serializable; + + + +/** + * 对话配置信息 +视图对象 chat_config + * + * @author Lion Li + * @date 2024-04-13 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = ChatConfig.class) +public class ChatConfigVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ExcelProperty(value = "主键") + private Long id; + + /** + * 配置类型 + */ + @ExcelProperty(value = "配置类型") + private String category; + + /** + * 配置名称 + */ + @ExcelProperty(value = "配置名称") + private String configName; + + /** + * 配置值 + */ + @ExcelProperty(value = "配置值") + private String configValue; + + /** + * 说明 + */ + @ExcelProperty(value = "说明") + private String configDict; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 更新IP + */ + @ExcelProperty(value = "更新IP") + private String updateIp; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatGptsVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatGptsVo.java new file mode 100644 index 0000000..5c81345 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatGptsVo.java @@ -0,0 +1,100 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.system.domain.ChatGpts; + +import java.io.Serial; +import java.io.Serializable; + + +/** + * gpts管理视图对象 chat_gpts + * + * @author Lion Li + * @date 2024-07-09 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = ChatGpts.class) +public class ChatGptsVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + + /** + * gpts应用id + */ + @ExcelProperty(value = "gpts应用id") + private String gid; + + /** + * gpts应用名称 + */ + @ExcelProperty(value = "gpts应用名称") + private String name; + + /** + * gpts图标 + */ + @ExcelProperty(value = "gpts图标") + private String logo; + + /** + * gpts描述 + */ + @ExcelProperty(value = "gpts描述") + private String info; + + /** + * 作者id + */ + @ExcelProperty(value = "作者id") + private String authorId; + + /** + * 作者名称 + */ + @ExcelProperty(value = "作者名称") + private String authorName; + + /** + * 点赞 + */ + @ExcelProperty(value = "点赞") + private String useCnt; + + /** + * 差评 + */ + @ExcelProperty(value = "差评") + private String bad; + + /** + * 类型 + */ + @ExcelProperty(value = "类型") + private String type; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 更新IP + */ + @ExcelProperty(value = "更新IP") + private String updateIp; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatMessageVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatMessageVo.java new file mode 100644 index 0000000..0839630 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatMessageVo.java @@ -0,0 +1,90 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import org.aibidding.system.domain.ChatMessage; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + +/** + * 聊天消息视图对象 chat_message + * + * @author Lion Li + * @date 2023-11-26 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = ChatMessage.class) +public class ChatMessageVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 用户ID + */ + @NotBlank(message = "用户ID", groups = { AddGroup.class, EditGroup.class }) + private Long userId; + + /** + * 用户名称 + */ + @NotBlank(message = "用户名称") + private String userName; + + /** + * 对话角色 + */ + private String role; + + + /** + * 消息内容 + */ + @NotBlank(message = "消息内容不能为空", groups = { AddGroup.class, EditGroup.class }) + private String content; + + + /** + * 扣除费用 + */ + private Double deductCost; + + /** + * 累计 Tokens + */ + @NotNull(message = "累计 Tokens不能为空", groups = { AddGroup.class, EditGroup.class }) + private Integer totalTokens; + + /** + * 模型名称 + */ + @NotBlank(message = "模型名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String modelName; + + /** + * 备注 + */ + @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) + private String remark; + + /** + * 创建时间 + */ + private Date createTime; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatTokenVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatTokenVo.java new file mode 100644 index 0000000..54122d4 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatTokenVo.java @@ -0,0 +1,43 @@ +package org.aibidding.system.domain.vo; + +import org.aibidding.common.core.validate.AddGroup; +import org.aibidding.common.core.validate.EditGroup; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户token chat_token + * + * @author Lion Li + * @date 2023-11-26 + */ +@Data +public class ChatTokenVo implements Serializable { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 用户ID + */ + @NotBlank(message = "用户ID", groups = { AddGroup.class, EditGroup.class }) + private Long UserId; + + /** + * 待结算token + */ + private Integer token; + + /** + * 模型名称 + */ + @NotBlank(message = "模型名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String modelName; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatVisitorUsageVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatVisitorUsageVo.java new file mode 100644 index 0000000..bd8d451 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatVisitorUsageVo.java @@ -0,0 +1,64 @@ +package org.aibidding.system.domain.vo; + +import org.aibidding.system.domain.ChatVisitorUsage; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + + +/** + * 访客管理视图对象 chat_visitor_usage + * + * @author Lion Li + * @date 2024-07-14 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = ChatVisitorUsage.class) +public class ChatVisitorUsageVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + + /** + * 浏览器指纹 + */ + @ExcelProperty(value = "浏览器指纹") + private String fingerprint; + + /** + * 使用次数 + */ + @ExcelProperty(value = "使用次数") + private String usageCount; + + /** + * ip地址 + */ + @ExcelProperty(value = "ip地址") + private String ipAddress; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 更新IP + */ + @ExcelProperty(value = "更新IP") + private String updateIp; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatVoucherVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatVoucherVo.java new file mode 100644 index 0000000..5cf8cbe --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ChatVoucherVo.java @@ -0,0 +1,87 @@ +package org.aibidding.system.domain.vo; + +import org.aibidding.system.domain.ChatVoucher; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; + +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + + + +/** + * 用户兑换记录视图对象 chat_voucher + * + * @author Lion Li + * @date 2024-05-03 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = ChatVoucher.class) +public class ChatVoucherVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ExcelProperty(value = "主键") + private Long id; + + /** + * 用户id + */ + @ExcelProperty(value = "用户id") + private Long userId; + + /** + * 用户名称 + */ + @ExcelProperty(value = "用户名称") + private String userName; + + /** + * 兑换码 + */ + @ExcelProperty(value = "兑换码") + private String code; + + /** + * 兑换金额 + */ + @ExcelProperty(value = "兑换金额") + private Double amount; + + /** + * 兑换状态 + */ + @ExcelProperty(value = "兑换状态") + private String status; + + /** + * 兑换前余额 + */ + @ExcelProperty(value = "兑换前余额") + private Double balanceBefore; + + /** + * 兑换后余额 + */ + @ExcelProperty(value = "兑换后余额") + private Double balanceAfter; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + @ExcelProperty(value = "创建时间") + private String createTime; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/DeptTreeSelectVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/DeptTreeSelectVo.java new file mode 100644 index 0000000..b9098a8 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/DeptTreeSelectVo.java @@ -0,0 +1,26 @@ +package org.aibidding.system.domain.vo; + +import cn.hutool.core.lang.tree.Tree; +import lombok.Data; + +import java.util.List; + +/** + * 角色部门列表树信息 + * + * @author Michelle.Chung + */ +@Data +public class DeptTreeSelectVo { + + /** + * 选中部门列表 + */ + private List checkedKeys; + + /** + * 下拉树结构列表 + */ + private List> depts; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/LoginTenantVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/LoginTenantVo.java new file mode 100644 index 0000000..7005a31 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/LoginTenantVo.java @@ -0,0 +1,25 @@ +package org.aibidding.system.domain.vo; + +import lombok.Data; + +import java.util.List; + +/** + * 登录租户对象 + * + * @author Michelle.Chung + */ +@Data +public class LoginTenantVo { + + /** + * 租户开关 + */ + private Boolean tenantEnabled; + + /** + * 租户对象列表 + */ + private List voList; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/LoginVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/LoginVo.java new file mode 100644 index 0000000..cde0537 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/LoginVo.java @@ -0,0 +1,15 @@ +package org.aibidding.system.domain.vo; + +import lombok.Data; +import org.aibidding.common.core.domain.model.LoginUser; + +/** + * 登录返回信息 + * + * @author Michelle.Chung + */ +@Data +public class LoginVo { + private String token; + private LoginUser userInfo; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/MenuTreeSelectVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/MenuTreeSelectVo.java new file mode 100644 index 0000000..cde66d4 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/MenuTreeSelectVo.java @@ -0,0 +1,26 @@ +package org.aibidding.system.domain.vo; + +import cn.hutool.core.lang.tree.Tree; +import lombok.Data; + +import java.util.List; + +/** + * 角色菜单列表树信息 + * + * @author Michelle.Chung + */ +@Data +public class MenuTreeSelectVo { + + /** + * 选中菜单列表 + */ + private List checkedKeys; + + /** + * 菜单下拉树结构列表 + */ + private List> menus; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/MetaVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/MetaVo.java new file mode 100644 index 0000000..8912ef1 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/MetaVo.java @@ -0,0 +1,61 @@ +package org.aibidding.system.domain.vo; + +import lombok.Data; +import org.aibidding.common.core.utils.StringUtils; + +/** + * 路由显示信息 + * + * @author aibidding + */ + +@Data +public class MetaVo { + + /** + * 设置该路由在侧边栏和面包屑中展示的名字 + */ + private String title; + + /** + * 设置该路由的图标,对应路径src/assets/icons/svg + */ + private String icon; + + /** + * 设置为true,则不会被 缓存 + */ + private boolean noCache; + + /** + * 内链地址(http(s)://开头) + */ + private String link; + + public MetaVo(String title, String icon) { + this.title = title; + this.icon = icon; + } + + public MetaVo(String title, String icon, boolean noCache) { + this.title = title; + this.icon = icon; + this.noCache = noCache; + } + + public MetaVo(String title, String icon, String link) { + this.title = title; + this.icon = icon; + this.link = link; + } + + public MetaVo(String title, String icon, boolean noCache, String link) { + this.title = title; + this.icon = icon; + this.noCache = noCache; + if (StringUtils.ishttp(link)) { + this.link = link; + } + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/PaymentOrdersVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/PaymentOrdersVo.java new file mode 100644 index 0000000..3330fdc --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/PaymentOrdersVo.java @@ -0,0 +1,93 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.system.domain.PaymentOrder; + +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + +/** + * 支付订单视图对象 payment_orders + * + * @author Lion Li + * @date 2024-04-16 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = PaymentOrder.class) +public class PaymentOrdersVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ExcelProperty(value = "主键") + private Long id; + + /** + * 订单编号 + */ + @ExcelProperty(value = "订单编号") + private String orderNo; + + /** + * 订单名称 + */ + @ExcelProperty(value = "订单名称") + private String orderName; + + /** + * 金额 + */ + @ExcelProperty(value = "金额") + private BigDecimal amount; + + /** + * 支付状态 + */ + @ExcelProperty(value = "支付状态") + private String paymentStatus; + + /** + * 支付方式 + */ + @ExcelProperty(value = "支付方式") + private String paymentMethod; + + /** + * 用户ID + */ + @ExcelProperty(value = "用户ID") + private Long userId; + + /** + * 用户ID + */ + @ExcelProperty(value = "用户名称") + private String userName; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 二维码网络地址 + */ + private String url; + + /** + * 创建时间 + */ + private Date createTime; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ProfileVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ProfileVo.java new file mode 100644 index 0000000..a2e9433 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ProfileVo.java @@ -0,0 +1,29 @@ +package org.aibidding.system.domain.vo; + +import lombok.Data; + +/** + * 用户个人信息 + * + * @author Michelle.Chung + */ +@Data +public class ProfileVo { + + /** + * 用户信息 + */ + private SysUserVo user; + + /** + * 用户所属角色组 + */ + private String roleGroup; + + /** + * 用户所属岗位组 + */ + private String postGroup; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/RouterVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/RouterVo.java new file mode 100644 index 0000000..e5d3cb4 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/RouterVo.java @@ -0,0 +1,62 @@ +package org.aibidding.system.domain.vo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.util.List; + +/** + * 路由配置信息 + * + * @author Lion Li + */ +@Data +@JsonInclude(JsonInclude.Include.NON_EMPTY) +public class RouterVo { + + /** + * 路由名字 + */ + private String name; + + /** + * 路由地址 + */ + private String path; + + /** + * 是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现 + */ + private boolean hidden; + + /** + * 重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 + */ + private String redirect; + + /** + * 组件地址 + */ + private String component; + + /** + * 路由参数:如 {"id": 1, "name": "ry"} + */ + private String query; + + /** + * 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 + */ + private Boolean alwaysShow; + + /** + * 其他元素 + */ + private MetaVo meta; + + /** + * 子路由 + */ + private List children; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysConfigVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysConfigVo.java new file mode 100644 index 0000000..7db3e72 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysConfigVo.java @@ -0,0 +1,72 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.common.excel.annotation.ExcelDictFormat; +import org.aibidding.common.excel.convert.ExcelDictConvert; +import org.aibidding.system.domain.SysConfig; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + +/** + * 参数配置视图对象 sys_config + * + * @author Michelle.Chung + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysConfig.class) +public class SysConfigVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 参数主键 + */ + @ExcelProperty(value = "参数主键") + private Long configId; + + /** + * 参数名称 + */ + @ExcelProperty(value = "参数名称") + private String configName; + + /** + * 参数键名 + */ + @ExcelProperty(value = "参数键名") + private String configKey; + + /** + * 参数键值 + */ + @ExcelProperty(value = "参数键值") + private String configValue; + + /** + * 系统内置(Y是 N否) + */ + @ExcelProperty(value = "系统内置", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_yes_no") + private String configType; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysDeptVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysDeptVo.java new file mode 100644 index 0000000..0670aae --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysDeptVo.java @@ -0,0 +1,91 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.common.excel.annotation.ExcelDictFormat; +import org.aibidding.common.excel.convert.ExcelDictConvert; +import org.aibidding.system.domain.SysDept; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +/** + * 部门视图对象 sys_dept + * + * @author Michelle.Chung + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysDept.class) +public class SysDeptVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 部门id + */ + @ExcelProperty(value = "部门id") + private Long deptId; + + /** + * 父部门id + */ + private Long parentId; + + /** + * 父部门名称 + */ + private String parentName; + + /** + * 祖级列表 + */ + private String ancestors; + + /** + * 部门名称 + */ + @ExcelProperty(value = "部门名称") + private String deptName; + + /** + * 显示顺序 + */ + private Integer orderNum; + + /** + * 负责人 + */ + @ExcelProperty(value = "负责人") + private String leader; + + /** + * 联系电话 + */ + @ExcelProperty(value = "联系电话") + private String phone; + + /** + * 邮箱 + */ + @ExcelProperty(value = "邮箱") + private String email; + + /** + * 部门状态(0正常 1停用) + */ + @ExcelProperty(value = "部门状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_normal_disable") + private String status; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysDictDataVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysDictDataVo.java new file mode 100644 index 0000000..0b3b909 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysDictDataVo.java @@ -0,0 +1,95 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.aibidding.common.excel.annotation.ExcelDictFormat; +import org.aibidding.common.excel.convert.ExcelDictConvert; +import org.aibidding.system.domain.SysDictData; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + +/** + * 字典数据视图对象 sys_dict_data + * + * @author Michelle.Chung + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysDictData.class) +public class SysDictDataVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 字典编码 + */ + @ExcelProperty(value = "字典编码") + private Long dictCode; + + /** + * 字典排序 + */ + @ExcelProperty(value = "字典排序") + private Integer dictSort; + + /** + * 字典标签 + */ + @ExcelProperty(value = "字典标签") + private String dictLabel; + + /** + * 字典键值 + */ + @ExcelProperty(value = "字典键值") + private String dictValue; + + /** + * 字典类型 + */ + @ExcelProperty(value = "字典类型") + private String dictType; + + /** + * 样式属性(其他样式扩展) + */ + private String cssClass; + + /** + * 表格回显样式 + */ + private String listClass; + + /** + * 是否默认(Y是 N否) + */ + @ExcelProperty(value = "是否默认", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_yes_no") + private String isDefault; + + /** + * 状态(0正常 1停用) + */ + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_normal_disable") + private String status; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysDictTypeVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysDictTypeVo.java new file mode 100644 index 0000000..9087812 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysDictTypeVo.java @@ -0,0 +1,66 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.aibidding.common.excel.annotation.ExcelDictFormat; +import org.aibidding.common.excel.convert.ExcelDictConvert; +import org.aibidding.system.domain.SysDictType; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + +/** + * 字典类型视图对象 sys_dict_type + * + * @author Michelle.Chung + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysDictType.class) +public class SysDictTypeVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 字典主键 + */ + @ExcelProperty(value = "字典主键") + private Long dictId; + + /** + * 字典名称 + */ + @ExcelProperty(value = "字典名称") + private String dictName; + + /** + * 字典类型 + */ + @ExcelProperty(value = "字典类型") + private String dictType; + + /** + * 状态(0正常 1停用) + */ + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_normal_disable") + private String status; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysLogininforVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysLogininforVo.java new file mode 100644 index 0000000..a9d84f2 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysLogininforVo.java @@ -0,0 +1,93 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.aibidding.common.excel.annotation.ExcelDictFormat; +import org.aibidding.common.excel.convert.ExcelDictConvert; +import org.aibidding.system.domain.SysLogininfor; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 系统访问记录视图对象 sys_logininfor + * + * @author Michelle.Chung + * @date 2023-02-07 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysLogininfor.class) +public class SysLogininforVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 访问ID + */ + @ExcelProperty(value = "序号") + private Long infoId; + + /** + * 租户编号 + */ + private String tenantId; + + /** + * 用户账号 + */ + @ExcelProperty(value = "用户账号") + private String userName; + + /** + * 登录状态(0成功 1失败) + */ + @ExcelProperty(value = "登录状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_common_status") + private String status; + + /** + * 登录IP地址 + */ + @ExcelProperty(value = "登录地址") + private String ipaddr; + + /** + * 登录地点 + */ + @ExcelProperty(value = "登录地点") + private String loginLocation; + + /** + * 浏览器类型 + */ + @ExcelProperty(value = "浏览器") + private String browser; + + /** + * 操作系统 + */ + @ExcelProperty(value = "操作系统") + private String os; + + + /** + * 提示消息 + */ + @ExcelProperty(value = "提示消息") + private String msg; + + /** + * 访问时间 + */ + @ExcelProperty(value = "访问时间") + private Date loginTime; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysMenuVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysMenuVo.java new file mode 100644 index 0000000..a770e11 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysMenuVo.java @@ -0,0 +1,116 @@ +package org.aibidding.system.domain.vo; + +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.system.domain.SysMenu; + +import java.io.Serial; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + + +/** + * 菜单权限视图对象 sys_menu + * + * @author Michelle.Chung + */ +@Data +@AutoMapper(target = SysMenu.class) +public class SysMenuVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 菜单ID + */ + private Long menuId; + + /** + * 菜单名称 + */ + private String menuName; + + /** + * 父菜单ID + */ + private Long parentId; + + /** + * 显示顺序 + */ + private Integer orderNum; + + /** + * 路由地址 + */ + private String path; + + /** + * 组件路径 + */ + private String component; + + /** + * 路由参数 + */ + private String queryParam; + + /** + * 是否为外链(0是 1否) + */ + private String isFrame; + + /** + * 是否缓存(0缓存 1不缓存) + */ + private String isCache; + + /** + * 菜单类型(M目录 C菜单 F按钮) + */ + private String menuType; + + /** + * 显示状态(0显示 1隐藏) + */ + private String visible; + + /** + * 菜单状态(0正常 1停用) + */ + private String status; + + /** + * 权限标识 + */ + private String perms; + + /** + * 菜单图标 + */ + private String icon; + + /** + * 创建部门 + */ + private Long createDept; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 子菜单 + */ + private List children = new ArrayList<>(); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysModelVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysModelVo.java new file mode 100644 index 0000000..521541b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysModelVo.java @@ -0,0 +1,85 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.system.domain.SysModel; + +import java.io.Serial; +import java.io.Serializable; + + +/** + * 系统模型视图对象 sys_model + * + * @author Lion Li + * @date 2024-04-04 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysModel.class) +public class SysModelVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ExcelProperty(value = "主键") + private Long id; + + /** + * 模型名称 + */ + @ExcelProperty(value = "模型名称") + private String modelName; + + + /** + * 模型描述 + */ + @ExcelProperty(value = "模型描述") + private String modelDescribe; + + /** + * 模型价格 + */ + @ExcelProperty(value = "模型价格") + private double modelPrice; + + /** + * 计费类型 + */ + @ExcelProperty(value = "计费类型") + private String modelType; + + /** + * 是否显示 + */ + private String modelShow; + + + /** + * 系统提示词 + */ + private String systemPrompt; + + /** + * 请求地址 + */ + private String apiHost; + + /** + * 模型名称 + */ + private String apiKey; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysNoticeStateVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysNoticeStateVo.java new file mode 100644 index 0000000..a8eb5ca --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysNoticeStateVo.java @@ -0,0 +1,61 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.common.excel.annotation.ExcelDictFormat; +import org.aibidding.common.excel.convert.ExcelDictConvert; +import org.aibidding.system.domain.SysNoticeState; + +import java.io.Serial; +import java.io.Serializable; + + +/** + * 用户阅读状态视图对象 sys_notice_state + * + * @author Lion Li + * @date 2024-05-11 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysNoticeState.class) +public class SysNoticeStateVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ExcelProperty(value = "ID") + private Long id; + + /** + * 用户ID + */ + @ExcelProperty(value = "用户ID") + private Long userId; + + /** + * 公告ID + */ + @ExcelProperty(value = "公告ID") + private Long noticeId; + + /** + * 阅读状态(0未读 1已读) + */ + @ExcelProperty(value = "阅读状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0=未读,1=已读") + private String readStatus; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysNoticeVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysNoticeVo.java new file mode 100644 index 0000000..43b5ad8 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysNoticeVo.java @@ -0,0 +1,73 @@ +package org.aibidding.system.domain.vo; + +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.common.translation.annotation.Translation; +import org.aibidding.common.translation.constant.TransConstant; +import org.aibidding.system.domain.SysNotice; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 通知公告视图对象 sys_notice + * + * @author Michelle.Chung + */ +@Data +@AutoMapper(target = SysNotice.class) +public class SysNoticeVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 公告ID + */ + private Long noticeId; + + /** + * 公告标题 + */ + private String noticeTitle; + + /** + * 公告类型(1通知 2公告) + */ + private String noticeType; + + /** + * 公告内容 + */ + private String noticeContent; + + /** + * 公告状态(0正常 1关闭) + */ + private String status; + + /** + * 备注 + */ + private String remark; + + /** + * 创建者 + */ + private Long createBy; + + /** + * 创建人名称 + */ + @Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "createBy") + private String createByName; + + /** + * 创建时间 + */ + private Date createTime; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysOperLogVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysOperLogVo.java new file mode 100644 index 0000000..6dc6fcd --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysOperLogVo.java @@ -0,0 +1,144 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.common.excel.annotation.ExcelDictFormat; +import org.aibidding.common.excel.convert.ExcelDictConvert; +import org.aibidding.system.domain.SysOperLog; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + +/** + * 操作日志记录视图对象 sys_oper_log + * + * @author Michelle.Chung + * @date 2023-02-07 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysOperLog.class) +public class SysOperLogVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 日志主键 + */ + @ExcelProperty(value = "日志主键") + private Long operId; + + /** + * 租户编号 + */ + private String tenantId; + + /** + * 模块标题 + */ + @ExcelProperty(value = "操作模块") + private String title; + + /** + * 业务类型(0其它 1新增 2修改 3删除) + */ + @ExcelProperty(value = "业务类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_oper_type") + private Integer businessType; + + /** + * 业务类型数组 + */ + private Integer[] businessTypes; + + /** + * 方法名称 + */ + @ExcelProperty(value = "请求方法") + private String method; + + /** + * 请求方式 + */ + @ExcelProperty(value = "请求方式") + private String requestMethod; + + /** + * 操作类别(0其它 1后台用户 2手机端用户) + */ + @ExcelProperty(value = "操作类别", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0=其它,1=后台用户,2=手机端用户") + private Integer operatorType; + + /** + * 操作人员 + */ + @ExcelProperty(value = "操作人员") + private String operName; + + /** + * 部门名称 + */ + @ExcelProperty(value = "部门名称") + private String deptName; + + /** + * 请求URL + */ + @ExcelProperty(value = "请求地址") + private String operUrl; + + /** + * 主机地址 + */ + @ExcelProperty(value = "操作地址") + private String operIp; + + /** + * 操作地点 + */ + @ExcelProperty(value = "操作地点") + private String operLocation; + + /** + * 请求参数 + */ + @ExcelProperty(value = "请求参数") + private String operParam; + + /** + * 返回参数 + */ + @ExcelProperty(value = "返回参数") + private String jsonResult; + + /** + * 操作状态(0正常 1异常) + */ + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_common_status") + private Integer status; + + /** + * 错误消息 + */ + @ExcelProperty(value = "错误消息") + private String errorMsg; + + /** + * 操作时间 + */ + @ExcelProperty(value = "操作时间") + private Date operTime; + + /** + * 消耗时间 + */ + @ExcelProperty(value = "消耗时间") + private Long costTime; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysOssConfigVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysOssConfigVo.java new file mode 100644 index 0000000..49c20bf --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysOssConfigVo.java @@ -0,0 +1,97 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import org.aibidding.system.domain.SysOssConfig; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + + +/** + * 对象存储配置视图对象 sys_oss_config + * + * @author Lion Li + * @author 孤舟烟雨 + * @date 2021-08-13 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysOssConfig.class) +public class SysOssConfigVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主建 + */ + private Long ossConfigId; + + /** + * 配置key + */ + private String configKey; + + /** + * accessKey + */ + private String accessKey; + + /** + * 秘钥 + */ + private String secretKey; + + /** + * 桶名称 + */ + private String bucketName; + + /** + * 前缀 + */ + private String prefix; + + /** + * 访问站点 + */ + private String endpoint; + + /** + * 自定义域名 + */ + private String domain; + + /** + * 是否https(Y=是,N=否) + */ + private String isHttps; + + /** + * 域 + */ + private String region; + + /** + * 是否默认(0=是,1=否) + */ + private String status; + + /** + * 扩展字段 + */ + private String ext1; + + /** + * 备注 + */ + private String remark; + + /** + * 桶权限类型(0private 1public 2custom) + */ + private String accessPolicy; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysOssUploadVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysOssUploadVo.java new file mode 100644 index 0000000..19582c9 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysOssUploadVo.java @@ -0,0 +1,28 @@ +package org.aibidding.system.domain.vo; + +import lombok.Data; + +/** + * 上传对象信息 + * + * @author Michelle.Chung + */ +@Data +public class SysOssUploadVo { + + /** + * URL地址 + */ + private String url; + + /** + * 文件名 + */ + private String fileName; + + /** + * 对象存储主键 + */ + private String ossId; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysOssVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysOssVo.java new file mode 100644 index 0000000..bf17fd2 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysOssVo.java @@ -0,0 +1,72 @@ +package org.aibidding.system.domain.vo; + +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.common.translation.annotation.Translation; +import org.aibidding.common.translation.constant.TransConstant; +import org.aibidding.system.domain.SysOss; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +/** + * OSS对象存储视图对象 sys_oss + * + * @author Lion Li + */ +@Data +@AutoMapper(target = SysOss.class) +public class SysOssVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 对象存储主键 + */ + private Long ossId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 原名 + */ + private String originalName; + + /** + * 文件后缀名 + */ + private String fileSuffix; + + /** + * URL地址 + */ + private String url; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 上传人 + */ + private Long createBy; + + /** + * 上传人名称 + */ + @Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "createBy") + private String createByName; + + /** + * 服务商 + */ + private String service; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysPackagePlanVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysPackagePlanVo.java new file mode 100644 index 0000000..61f1827 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysPackagePlanVo.java @@ -0,0 +1,65 @@ +package org.aibidding.system.domain.vo; + +import java.math.BigDecimal; +import org.aibidding.system.domain.SysPackagePlan; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + + +/** + * 套餐管理视图对象 sys_package_plan + * + * @author Lion Li + * @date 2024-05-05 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysPackagePlan.class) +public class SysPackagePlanVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ExcelProperty(value = "主键") + private Long id; + + /** + * 套餐名称 + */ + @ExcelProperty(value = "套餐名称") + private String name; + + /** + * 套餐价格 + */ + @ExcelProperty(value = "套餐价格") + private BigDecimal price; + + /** + * 有效时间 + */ + @ExcelProperty(value = "有效时间") + private Long duration; + + /** + * 计划详情 + */ + @ExcelProperty(value = "计划详情") + private String planDetail; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysPostVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysPostVo.java new file mode 100644 index 0000000..43632e4 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysPostVo.java @@ -0,0 +1,73 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.common.excel.annotation.ExcelDictFormat; +import org.aibidding.common.excel.convert.ExcelDictConvert; +import org.aibidding.system.domain.SysPost; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 岗位信息视图对象 sys_post + * + * @author Michelle.Chung + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysPost.class) +public class SysPostVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 岗位ID + */ + @ExcelProperty(value = "岗位序号") + private Long postId; + + /** + * 岗位编码 + */ + @ExcelProperty(value = "岗位编码") + private String postCode; + + /** + * 岗位名称 + */ + @ExcelProperty(value = "岗位名称") + private String postName; + + /** + * 显示顺序 + */ + @ExcelProperty(value = "岗位排序") + private Integer postSort; + + /** + * 状态(0正常 1停用) + */ + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_normal_disable") + private String status; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysRoleVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysRoleVo.java new file mode 100644 index 0000000..a199ce8 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysRoleVo.java @@ -0,0 +1,100 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.excel.annotation.ExcelDictFormat; +import org.aibidding.common.excel.convert.ExcelDictConvert; +import org.aibidding.system.domain.SysRole; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +/** + * 角色信息视图对象 sys_role + * + * @author Michelle.Chung + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysRole.class) +public class SysRoleVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + @ExcelProperty(value = "角色序号") + private Long roleId; + + /** + * 角色名称 + */ + @ExcelProperty(value = "角色名称") + private String roleName; + + /** + * 角色权限字符串 + */ + @ExcelProperty(value = "角色权限") + private String roleKey; + + /** + * 显示顺序 + */ + @ExcelProperty(value = "角色排序") + private Integer roleSort; + + /** + * 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限) + */ + @ExcelProperty(value = "数据范围", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") + private String dataScope; + + /** + * 菜单树选择项是否关联显示 + */ + @ExcelProperty(value = "菜单树选择项是否关联显示") + private Boolean menuCheckStrictly; + + /** + * 部门树选择项是否关联显示 + */ + @ExcelProperty(value = "部门树选择项是否关联显示") + private Boolean deptCheckStrictly; + + /** + * 角色状态(0正常 1停用) + */ + @ExcelProperty(value = "角色状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_normal_disable") + private String status; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; + + /** + * 用户是否存在此角色标识 默认不存在 + */ + private boolean flag = false; + + public boolean isSuperAdmin() { + return UserConstants.SUPER_ADMIN_ID.equals(this.roleId); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysTenantPackageVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysTenantPackageVo.java new file mode 100644 index 0000000..fb2137f --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysTenantPackageVo.java @@ -0,0 +1,66 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.common.excel.annotation.ExcelDictFormat; +import org.aibidding.common.excel.convert.ExcelDictConvert; +import org.aibidding.system.domain.SysTenantPackage; + +import java.io.Serial; +import java.io.Serializable; + + +/** + * 租户套餐视图对象 sys_tenant_package + * + * @author Michelle.Chung + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysTenantPackage.class) +public class SysTenantPackageVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 租户套餐id + */ + @ExcelProperty(value = "租户套餐id") + private Long packageId; + + /** + * 套餐名称 + */ + @ExcelProperty(value = "套餐名称") + private String packageName; + + /** + * 关联菜单id + */ + @ExcelProperty(value = "关联菜单id") + private String menuIds; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 菜单树选择项是否关联显示 + */ + @ExcelProperty(value = "菜单树选择项是否关联显示") + private Boolean menuCheckStrictly; + + /** + * 状态(0正常 1停用) + */ + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0=正常,1=停用") + private String status; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysTenantVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysTenantVo.java new file mode 100644 index 0000000..74a82f9 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysTenantVo.java @@ -0,0 +1,115 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.common.excel.annotation.ExcelDictFormat; +import org.aibidding.common.excel.convert.ExcelDictConvert; +import org.aibidding.system.domain.SysTenant; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + +/** + * 租户视图对象 sys_tenant + * + * @author Michelle.Chung + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysTenant.class) +public class SysTenantVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + + /** + * 租户编号 + */ + @ExcelProperty(value = "租户编号") + private String tenantId; + + /** + * 联系人 + */ + @ExcelProperty(value = "联系人") + private String contactUserName; + + /** + * 联系电话 + */ + @ExcelProperty(value = "联系电话") + private String contactPhone; + + /** + * 企业名称 + */ + @ExcelProperty(value = "企业名称") + private String companyName; + + /** + * 统一社会信用代码 + */ + @ExcelProperty(value = "统一社会信用代码") + private String licenseNumber; + + /** + * 地址 + */ + @ExcelProperty(value = "地址") + private String address; + + /** + * 域名 + */ + @ExcelProperty(value = "域名") + private String domain; + + /** + * 企业简介 + */ + @ExcelProperty(value = "企业简介") + private String intro; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 租户套餐编号 + */ + @ExcelProperty(value = "租户套餐编号") + private Long packageId; + + /** + * 过期时间 + */ + @ExcelProperty(value = "过期时间") + private Date expireTime; + + /** + * 用户数量(-1不限制) + */ + @ExcelProperty(value = "用户数量") + private Long accountCount; + + /** + * 租户状态(0正常 1停用) + */ + @ExcelProperty(value = "租户状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0=正常,1=停用") + private String status; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserExportVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserExportVo.java new file mode 100644 index 0000000..3b2ab85 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserExportVo.java @@ -0,0 +1,72 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.aibidding.common.excel.annotation.ExcelDictFormat; +import org.aibidding.common.excel.convert.ExcelDictConvert; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +/** + * 用户对象导出VO + * + * @author Lion Li + */ + +@Data +@NoArgsConstructor +@AutoMapper(target = SysUserVo.class, convertGenerate = false) +public class SysUserExportVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + @ExcelProperty(value = "用户序号") + private Long userId; + + /** + * 用户账号 + */ + @ExcelProperty(value = "用户账号") + private String userName; + + /** + * 用户昵称 + */ + @ExcelProperty(value = "用户名称") + private String nickName; + + /** + * 帐号状态(0正常 1停用) + */ + @ExcelProperty(value = "帐号状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_normal_disable") + private String status; + + /** + * 用户余额 + */ + @ExcelProperty(value = "用户余额") + private Double userBalance; + + /** + * 用户等级 + */ + @ExcelProperty(value = "用户等级") + @ExcelDictFormat(dictType = "sys_user_grade") + private String userGrade; + + /** + * 最后登录时间 + */ + @ExcelProperty(value = "最后登录时间") + private Date loginDate; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserGroupVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserGroupVo.java new file mode 100644 index 0000000..592d0b7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserGroupVo.java @@ -0,0 +1,52 @@ +package org.aibidding.system.domain.vo; + +import org.aibidding.system.domain.SysUserGroup; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + + +/** + * 【请填写功能名称】视图对象 sys_user_group + * + * @author Lion Li + * @date 2024-08-03 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysUserGroup.class) +public class SysUserGroupVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ExcelProperty(value = "主键") + private Long id; + + /** + * 用户组名称 + */ + @ExcelProperty(value = "用户组名称") + private String groupName; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 更新IP + */ + @ExcelProperty(value = "更新IP") + private String updateIp; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserImportVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserImportVo.java new file mode 100644 index 0000000..866911d --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserImportVo.java @@ -0,0 +1,41 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 用户对象导入VO + * + * @author Lion Li + */ + +@Data +@NoArgsConstructor +public class SysUserImportVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 用户名称 + */ + @ExcelProperty(value = "用户名称") + private String userName; + + /** + * 用户余额 + */ + @ExcelProperty(value = "用户余额") + private Double userBalance; + + /** + * 用户等级 + */ + @ExcelProperty(value = "用户等级(0免费用户 1付费用户)") + private String userGrade; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserInfoVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserInfoVo.java new file mode 100644 index 0000000..9c00159 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserInfoVo.java @@ -0,0 +1,40 @@ +package org.aibidding.system.domain.vo; + +import lombok.Data; + +import java.util.List; + +/** + * 用户信息 + * + * @author Michelle.Chung + */ +@Data +public class SysUserInfoVo { + + /** + * 用户信息 + */ + private SysUserVo user; + + /** + * 角色ID列表 + */ + private List roleIds; + + /** + * 角色列表 + */ + private List roles; + + /** + * 岗位ID列表 + */ + private List postIds; + + /** + * 岗位列表 + */ + private List posts; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserModelVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserModelVo.java new file mode 100644 index 0000000..134b2a5 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserModelVo.java @@ -0,0 +1,46 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.system.domain.SysUserModel; + +import java.io.Serial; +import java.io.Serializable; + + +/** + * 【请填写功能名称】视图对象 sys_user_model + * + * @author Lion Li + * @date 2024-08-03 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = SysUserModel.class) +public class SysUserModelVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + + /** + * 模型id + */ + @ExcelProperty(value = "模型id") + private Long mid; + + /** + * 用户组id + */ + @ExcelProperty(value = "用户组id") + private Long gid; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserOptionVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserOptionVo.java new file mode 100644 index 0000000..1b4d9e7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserOptionVo.java @@ -0,0 +1,30 @@ +package org.aibidding.system.domain.vo; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + + +/** + * 用户信息视图对象 sys_user + * + * @author Michelle.Chung + */ +@Data +public class SysUserOptionVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private Long userId; + + /** + * 用户账号 + */ + private String name; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserVo.java new file mode 100644 index 0000000..e72b293 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/SysUserVo.java @@ -0,0 +1,155 @@ +package org.aibidding.system.domain.vo; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.system.domain.SysUser; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 用户信息视图对象 sys_user + * + * @author Michelle.Chung + */ +@Data +@AutoMapper(target = SysUser.class) +public class SysUserVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private Long userId; + + /** + * 租户ID + */ + private String tenantId; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 用户账号 + */ + private String userName; + + /** + * 用户套餐 + */ + private String userPlan; + + /** + * 用户昵称 + */ + private String nickName; + + /** + * 用户类型(sys_user系统用户) + */ + private String userType; + + /** + * 用户邮箱 + */ + private String email; + + /** + * 手机号码 + */ + private String phonenumber; + + /** + * 用户性别(0男 1女 2未知) + */ + private String sex; + + /** + * 头像地址 + */ + private String avatar; + + /** + * 微信头像地址 + */ + private String wxAvatar; + + + /** + * 密码 + */ + @JsonIgnore + @JsonProperty + private String password; + + /** + * 帐号状态(0正常 1停用) + */ + private String status; + + /** + * 最后登录IP + */ + private String loginIp; + + /** + * 最后登录时间 + */ + private Date loginDate; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 部门对象 + */ + private SysDeptVo dept; + + /** + * 注册域名 + */ + private String domainName; + + /** + * 角色对象 + */ + private List roles; + + /** + * 角色组 + */ + private Long[] roleIds; + + /** + * 岗位组 + */ + private Long[] postIds; + + /** + * 数据权限 当前角色ID + */ + private Long roleId; + + /** 用户等级 */ + private String userGrade; + + /** 用户余额 */ + private Double userBalance; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/TenantListVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/TenantListVo.java new file mode 100644 index 0000000..5497852 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/TenantListVo.java @@ -0,0 +1,21 @@ +package org.aibidding.system.domain.vo; + +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +/** + * 租户列表 + * + * @author Lion Li + */ +@Data +@AutoMapper(target = SysTenantVo.class) +public class TenantListVo { + + private String tenantId; + + private String companyName; + + private String domain; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/UserInfoVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/UserInfoVo.java new file mode 100644 index 0000000..3001e2c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/UserInfoVo.java @@ -0,0 +1,30 @@ +package org.aibidding.system.domain.vo; + +import lombok.Data; + +import java.util.Set; + +/** + * 登录用户信息 + * + * @author Michelle.Chung + */ +@Data +public class UserInfoVo { + + /** + * 用户基本信息 + */ + private SysUserVo user; + + /** + * 菜单权限 + */ + private Set permissions; + + /** + * 角色权限 + */ + private Set roles; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/WxRobConfigVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/WxRobConfigVo.java new file mode 100644 index 0000000..9311891 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/WxRobConfigVo.java @@ -0,0 +1,84 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.aibidding.common.excel.annotation.ExcelDictFormat; +import org.aibidding.common.excel.convert.ExcelDictConvert; +import org.aibidding.system.domain.WxRobConfig; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + + + +/** + * 微信机器人视图对象 wx_rob_config + * + * @author Lion Li + * @date 2024-05-01 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = WxRobConfig.class) +public class WxRobConfigVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ExcelProperty(value = "主键") + private Long id; + + /** + * 用户id + */ + private Long userId; + + /** + * 用户名称 + */ + private String userName; + + /** + * 机器人名称 + */ + private String botName; + + /** + * 机器唯一码 + */ + @ExcelProperty(value = "机器唯一码") + private String uniqueKey; + + /** + * 备注 + */ + @ExcelProperty(value = "备注", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "备注") + private String remark; + + /** + * 默认好友回复开关 + */ + @ExcelProperty(value = "默认好友回复开关") + private String defaultFriend; + + /** + * 默认群回复开关 + */ + @ExcelProperty(value = "默认群回复开关") + private String defaultGroup; + + + /** + * 机器启用1禁用0 + */ + @ExcelProperty(value = "机器启用1禁用0") + private String enable; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/WxRobKeywordVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/WxRobKeywordVo.java new file mode 100644 index 0000000..83463a0 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/WxRobKeywordVo.java @@ -0,0 +1,77 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.system.domain.WxRobKeyword; + +import java.io.Serial; +import java.io.Serializable; + + + +/** + * 【请填写功能名称】视图对象 wx_rob_keyword + * + * @author Lion Li + * @date 2024-05-01 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = WxRobKeyword.class) +public class WxRobKeywordVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + private Long id; + + /** + * 机器唯一码 + */ + @ExcelProperty(value = "机器唯一码") + private String uniqueKey; + + /** + * 关键词 + */ + @ExcelProperty(value = "关键词") + private String keyData; + + /** + * 回复内容 + */ + @ExcelProperty(value = "回复内容") + private String valueData; + + /** + * 回复类型 + */ + @ExcelProperty(value = "回复类型") + private String typeData; + + /** + * 目标昵称 + */ + @ExcelProperty(value = "目标昵称") + private String nickName; + + /** + * 群1好友0 + */ + @ExcelProperty(value = "群1好友0") + private Integer toGroup; + + /** + * 启用1禁用0 + */ + @ExcelProperty(value = "启用1禁用0") + private Integer enable; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/WxRobRelationVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/WxRobRelationVo.java new file mode 100644 index 0000000..731890a --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/WxRobRelationVo.java @@ -0,0 +1,71 @@ +package org.aibidding.system.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.system.domain.WxRobRelation; + +import java.io.Serial; +import java.io.Serializable; + + + +/** + * 【请填写功能名称】视图对象 wx_rob_relation + * + * @author Lion Li + * @date 2024-05-01 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = WxRobRelation.class) +public class WxRobRelationVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + private Long id; + + /** + * 外接唯一码 + */ + @ExcelProperty(value = "外接唯一码") + private String outKey; + + /** + * 机器唯一码 + */ + @ExcelProperty(value = "机器唯一码") + private String uniqueKey; + + /** + * 目标昵称 + */ + @ExcelProperty(value = "目标昵称") + private String nickName; + + /** + * 群1好友0 + */ + @ExcelProperty(value = "群1好友0") + private Integer toGroup; + + /** + * 启用1禁用0 + */ + @ExcelProperty(value = "启用1禁用0") + private Integer enable; + + /** + * IP白名单 + */ + @ExcelProperty(value = "IP白名单") + private String whiteList; + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/CoverCallbackVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/CoverCallbackVo.java new file mode 100644 index 0000000..861b488 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/CoverCallbackVo.java @@ -0,0 +1,24 @@ +package org.aibidding.system.domain.vo.cover; + +import lombok.Data; + +/** + * 翻唱回调VO + * + * @author NSL + * @since 2024-12-26 + */ +@Data +public class CoverCallbackVo { + /** 本次请求的订单号 */ + private String orderId; + + /** 用户ID */ + private String userId; + + /** 本次消费金额 */ + private String cost; + + /** 翻唱后的URL */ + private String coverUrl; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/CoverParamVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/CoverParamVo.java new file mode 100644 index 0000000..9956a4a --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/CoverParamVo.java @@ -0,0 +1,60 @@ +package org.aibidding.system.domain.vo.cover; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 翻唱歌曲入参 + * + * @author NSL + * @since 2024-12-25 + */ +@Data +public class CoverParamVo implements Serializable { + + /** + * 歌曲名称 + */ + @ExcelProperty(value = "歌曲名称") + private String coverMusicName; + /** + * 歌曲地址 + */ + @ExcelProperty(value = "歌曲地址") + private String coverMusicUrl; + /** + * 歌手性别 枚举 FEMALE 女性 MALE 男性 + */ + @ExcelProperty(value = "歌手性别") + private String coverSingerGender; + /** + * 歌手姓名 + */ + @ExcelProperty(value = "歌手姓名") + private String coverSingerName; + /** + * 参考音频:用户首次翻唱,必填;第二次及之后翻唱:若为空则沿用最近一次参考音频训练模型,若不为空则使用该参考音频训练模型。 + * 可多传 + */ + @ExcelProperty(value = "参考音频") + private List promptAudioUrl; + /** + * 用户性别 FEMALE MALE + */ + @ExcelProperty(value = "用户性别") + private String userGender; + /** + * 用户id + */ + @ExcelProperty(value = "用户id") + private String userId; + + /** + * 业务主键id + */ + @ExcelProperty(value = "业务主键id") + private String orderId; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/CoverPromptAudioVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/CoverPromptAudioVo.java new file mode 100644 index 0000000..861d53c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/CoverPromptAudioVo.java @@ -0,0 +1,44 @@ +package org.aibidding.system.domain.vo.cover; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.system.domain.Cover; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 翻唱用户参考音频视图对象 + * + * @author NSL + * @since 2024-12-25 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = Cover.class) +public class CoverPromptAudioVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + @ExcelProperty(value = "id") + private Long id; + /** + * 用户id + */ + @ExcelProperty(value = "用户id") + private Long userId; + /** + * 翻唱主表id + */ + @ExcelProperty(value = "翻唱主表id") + private Long coverId; + /** + * 翻唱后的URL + */ + @ExcelProperty(value = "参考音频") + private String promptAudioUrl; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/CoverVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/CoverVo.java new file mode 100644 index 0000000..5d02404 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/CoverVo.java @@ -0,0 +1,68 @@ +package org.aibidding.system.domain.vo.cover; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.aibidding.system.domain.Cover; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 翻唱视图对象 + * + * @author NSL + * @date 2024-12-25 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = Cover.class) +public class CoverVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + @ExcelProperty(value = "id") + private Long id; + /** + * 歌曲名称 + */ + @ExcelProperty(value = "歌曲名称") + private String coverMusicName; + /** + * 歌曲地址 + */ + @ExcelProperty(value = "歌曲地址") + private String coverMusicUrl; + /** + * 歌手性别 枚举 FEMALE 女性 MALE 男性 + */ + @ExcelProperty(value = "歌手性别") + private String coverSingerGender; + /** + * 歌手姓名 + */ + @ExcelProperty(value = "歌手姓名") + private String coverSingerName; + /** + * 用户性别 FEMALE MALE + */ + @ExcelProperty(value = "用户性别") + private String userGender; + /** + * 用户id + */ + @ExcelProperty(value = "用户id") + private Long userId; + /** + * 本次消费金额 + */ + @ExcelProperty(value = "本次消费金额") + private String cost; + /** + * 翻唱后的URL + */ + @ExcelProperty(value = "翻唱后的URL") + private String coverUrl; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/MusicVo.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/MusicVo.java new file mode 100644 index 0000000..4a17896 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/cover/MusicVo.java @@ -0,0 +1,35 @@ +package org.aibidding.system.domain.vo.cover; + +import lombok.Data; + +/** + * @author NSL + * @since 2024-12-25 + */ +@Data +public class MusicVo { + /** + * 歌曲名称 + */ + private String musicName; + + /** + * 音乐地址 + */ + private String mp3Url; + + /** + * 歌曲图片 + */ + private String pic; + + /** + * 歌手或乐队名 + */ + private String singerName; + + /** + * 歌手性别 + */ + private String singerGender; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptAllQueryDto.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptAllQueryDto.java new file mode 100644 index 0000000..40f1f6b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptAllQueryDto.java @@ -0,0 +1,29 @@ +package org.aibidding.system.domain.vo.ppt; + +import lombok.Data; + +/** + * 查询所有PPT列表查询参数 + * + * @author NSL + * @since 2024/12/31 + */ +@Data +public class PptAllQueryDto { + // 分页 + private Integer page; + // 每页大小(最大不超过100) + private Integer size; + // ppt id(非必填) + private String id; + // 第三方用户ID(非必填) + private String uid; + // 模板ID(非必填) + private String templateId; + // 创建开始时间(非必填) + private String startDate; + // 创建结束时间(非必填) + private String endDate; + // 按时间倒序返回(非必填) + private boolean desc; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptGenerateContentDto.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptGenerateContentDto.java new file mode 100644 index 0000000..d97aaea --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptGenerateContentDto.java @@ -0,0 +1,27 @@ +package org.aibidding.system.domain.vo.ppt; + +import lombok.Data; + +/** + * 生成大纲内容参数 + * + * @author NSL + * @since 2024/12/31 + */ +@Data +public class PptGenerateContentDto { + // 模板ID(非必填) + private String templateId; + + // 大纲 markdown 文本 + private String outlineMarkdown; + + // 异步生成PPT(这里必须为 true 才会流式生成) + private boolean asyncGenPptx = false; + + // 用户要求 + private String prompt; + + // 文件数据url,调用解析文件内容接口返回 + private String dataUrl; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptGenerateOutlineDto.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptGenerateOutlineDto.java new file mode 100644 index 0000000..dda69bc --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptGenerateOutlineDto.java @@ -0,0 +1,25 @@ +package org.aibidding.system.domain.vo.ppt; + +import lombok.Data; + +/** + * 生成PPT大纲参数 + * + * @author NSL + * @since 2024/12/31 + */ +@Data +public class PptGenerateOutlineDto { + // 是否流式生成(默认流式) + private boolean stream = true; + // 篇幅长度:short/medium/long, 默认 medium, 分别对应: 10-15页/20-30页/25-35页 + private String length = "medium"; + // 语言: zh/zh-Hant/en/ja/ko/ar/de/fr/it/pt/es/ru + private String lang; + // 用户要求(小于50字) + private String prompt; + // 方式一:通过主题创建 主题(与dataUrl可同时存在) + private String subject; + // 方式二:通过文件内容创建 文件数据url,通过解析文件内容接口返回(与subject可同时存在) + private String dataUrl; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptGeneratePptxDto.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptGeneratePptxDto.java new file mode 100644 index 0000000..b4fd330 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptGeneratePptxDto.java @@ -0,0 +1,24 @@ +package org.aibidding.system.domain.vo.ppt; + +import lombok.Data; + +/** + * 生成PPT参数 + * + * @author NSL + * @since 2024/12/31 + */ +@Data +public class PptGeneratePptxDto { + // 模板ID(非必填) + private String templateId; + + // 是否返回PPT数据结构 + private boolean pptxProperty; + + // 大纲内容markdown + private String outlineContentMarkdown; + + // 备注(PPT页面备注,非必填,数组 ["内容页面一备注", "内容页面二备注"]) + private String notes; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptTemplateFilterDto.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptTemplateFilterDto.java new file mode 100644 index 0000000..ee45b7b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptTemplateFilterDto.java @@ -0,0 +1,24 @@ +package org.aibidding.system.domain.vo.ppt; + +import lombok.Data; + +/** + * PPT模板筛选查询参数 + * + * @author NSL + * @since 2024/12/31 + */ +@Data +public class PptTemplateFilterDto { + // 模板类型(必传):1系统模板、4用户自定义模板 + private Integer type; + + // 类目筛选 ['年终总结', '教育培训', '医学医疗', '商业计划书', '企业介绍', '毕业答辩', '营销推广', '晚会表彰', '个人简历'] + private String category; + + // 风格筛选 ['扁平简约', '商务科技', '文艺清新', '卡通手绘', '中国风', '创意时尚', '创意趣味'] + private String style; + + // 主题颜色筛选 ['#FA920A', '#589AFD', '#7664FA', '#65E5EC', '#61D328', '#F5FD59', '#E05757', '#8F5A0B', '#FFFFFF', '#000000'] + private String themeColor; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptTemplateQueryDto.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptTemplateQueryDto.java new file mode 100644 index 0000000..c45eaea --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/domain/vo/ppt/PptTemplateQueryDto.java @@ -0,0 +1,19 @@ +package org.aibidding.system.domain.vo.ppt; + +import lombok.Data; + +/** + * 分页查询 PPT 模板查询参数 + * + * @author NSL + * @since 2024/12/31 + */ +@Data +public class PptTemplateQueryDto { + // 分页 + private Integer page; + // 每页大小(最大不超过100) + private Integer size; + // 模型筛选参数 + private PptTemplateFilterDto filters; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/CustomerBigDecimalSerialize.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/CustomerBigDecimalSerialize.java new file mode 100644 index 0000000..83500b6 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/CustomerBigDecimalSerialize.java @@ -0,0 +1,25 @@ +package org.aibidding.system.handler; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Objects; + +public class CustomerBigDecimalSerialize extends JsonSerializer { + @Override + public void serialize(BigDecimal value, JsonGenerator gen, SerializerProvider serializers) throws IOException { + if(Objects.nonNull(value)) { + //返回到前端的数据为数字类型,前端接收有可能丢失精度 + //gen.writeNumber(value.stripTrailingZeros()); + //返回到前端的数据为字符串类型 + gen.writeString(value.stripTrailingZeros().toPlainString()); + //去除0后缀,如果想统一进行保留精度,也可以采用类似处理 + }else {//如果为null的话,就写null + gen.writeNull(); + } + } +} + diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/MyMsgHandler.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/MyMsgHandler.java new file mode 100644 index 0000000..ad8c242 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/MyMsgHandler.java @@ -0,0 +1,230 @@ +package org.aibidding.system.handler; + +import com.jfinal.kit.PropKit; +import org.aibidding.common.chat.domain.request.ChatRequest; +import org.aibidding.common.chat.entity.chat.ChatCompletion; +import org.aibidding.common.chat.entity.images.Item; +import org.aibidding.common.wechat.itchat4j.beans.BaseMsg; +import org.aibidding.common.wechat.itchat4j.core.CoreManage; +import org.aibidding.common.wechat.itchat4j.face.IMsgHandlerFace; +import org.aibidding.common.wechat.itchat4j.utils.LogInterface; +import org.aibidding.common.wechat.itchat4j.utils.enums.SendMsgType; +import org.aibidding.common.wechat.itchat4j.utils.tools.CommonTools; +import org.aibidding.common.wechat.web.constant.ConfigKeys; +import org.aibidding.common.wechat.web.model.WxRobConfig; +import org.aibidding.common.wechat.web.model.WxRobKeyword; +import org.aibidding.system.domain.vo.WxRobConfigVo; +import org.aibidding.system.service.ISseService; +import org.apache.commons.lang3.StringUtils; + +import java.io.File; +import java.util.List; +import java.util.regex.Matcher; + +/** + * 消息处理实现 默认方案 + * @author WesleyOne + * @create 2018/12/11 + */ +public class MyMsgHandler implements IMsgHandlerFace,LogInterface { + private String uniqueKey; + private final ISseService sseService; + private WxRobConfigVo robConfigVo; + + public MyMsgHandler(String uniqueKey,ISseService sseService,WxRobConfigVo robConfigVo){ + this.uniqueKey = uniqueKey; + this.sseService = sseService; + this.robConfigVo = robConfigVo; + } + + private String getDownloadPath(String fileName) { + String download_path = PropKit.get("download_path"); + return download_path+ File.separator + uniqueKey +File.separator + fileName; + } + + @Override + public void textMsgHandle(BaseMsg msg) { + String fromNickName = msg.getFromNickName(); + String fromUserName = msg.getFromUserName(); + boolean groupMsg = msg.isGroupMsg(); + String text = msg.getText().trim(); + + if (groupMsg && text.contains("@" + fromNickName)) { + handleGroupMessage(fromNickName, fromUserName, text); + } else { + respondWithChatGPT(fromUserName, text); + } + } + + private void handleGroupMessage(String fromNickName, String fromUserName, String text) { + String prompt = text.replace("@" + fromNickName + " ", ""); + if (prompt.startsWith("画")) { + generateAndSendImage(fromUserName, prompt.replaceFirst("画 ", "")); + } else { + respondWithChatGPT(fromUserName, prompt); + } + } + + private void generateAndSendImage(String fromUserName, String prompt) { + List items = sseService.wxDall(prompt,robConfigVo.getUserId().toString()); + WxRobKeyword robKeyword = new WxRobKeyword(); + robKeyword.setTypeData(SendMsgType.IMG.toValue()); + robKeyword.setValueData(items.get(0).getUrl()); + sendDataByType(fromUserName, robKeyword); + } + + + + private void respondWithChatGPT(String fromUserName, String prompt) { + ChatRequest chatBO = new ChatRequest(); + //chatBO.setPrompt(prompt); + chatBO.setModel(ChatCompletion.Model.GPT_3_5_TURBO.getName()); + String chat = sseService.chat(chatBO,robConfigVo.getUserId().toString()); + WxRobKeyword robKeyword = new WxRobKeyword(); + robKeyword.setTypeData(SendMsgType.TEXT.toValue()); + robKeyword.setValueData(chat); + sendDataByType(fromUserName, robKeyword); + } + + private boolean sendDataByType(String fromUserName, WxRobKeyword robKeyword) { + String data; + String type; + if (robKeyword != null){ + data = robKeyword.getValueData(); + type = robKeyword.getTypeData(); + CoreManage.addSendMsg4UserName(uniqueKey,fromUserName,data,SendMsgType.fromValue(type)); + return true; + } + return false; + } + + + @Override + public void sysMsgHandle(BaseMsg msg) { + String fromNickName = msg.getFromNickName(); + String fromUserName = msg.getFromUserName(); + boolean groupMsg = msg.isGroupMsg(); + + /** + * 群里的新人进群消息处理 + * 优先发专门这个群的欢迎词 + * 没有发通用的 + * 欢迎词内容实质就是在最前面加上@昵称\n + * + * 欢迎词的关键字 + * @see ConfigKeys#DEAFAULT_WELCOME + */ + + // 解析新人名字 + String text = msg.getContent(); + String newNickName = ""; + Matcher matcher = CommonTools.getMatcher("邀请\"(.+?)\"加入了群聊", text); + if (matcher.find()){ + newNickName = matcher.group(1); + }else{ + matcher = CommonTools.getMatcher("\"(.+?)\"通过扫描(.+?)分享的二维码加入群聊", text); + if (matcher.find()){ + newNickName = matcher.group(1); + } + } + + if (StringUtils.isNotEmpty(newNickName)){ + + WxRobConfig robConfig = WxRobConfig.dao.findFirst("SELECT * FROM wx_rob_config WHERE unique_key = ? LIMIT 1", uniqueKey); + if(robConfig != null && robConfig.getEnable()){ + // 判断是否要回复 + boolean isOpen = false; + // 判断是群聊的话是否允许回复 昵称关键字 + if (robConfig.getToGroup() && groupMsg){ + isOpen = true; + } + if (isOpen){ + WxRobKeyword robKeyword = WxRobKeyword.dao.findFirst("SELECT * FROM wx_rob_keyword WHERE unique_key = ? AND key_data = ? AND nick_name = ? AND enable = 1 AND to_group = ? ORDER BY id DESC LIMIT 1", uniqueKey, ConfigKeys.DEAFAULT_WELCOME,fromNickName,msg.isGroupMsg()?1:0); + if (sendSysWelcomeMsg(fromUserName, newNickName, robKeyword)){ return;} + } + + // 没有专门的关键字,则使用默认关键字 + isOpen = false; + // 判断是群聊的话是否允许回复 昵称关键字 + if (robConfig.getDefaultGroup() && groupMsg){ + isOpen = true; + } + if (isOpen){ + WxRobKeyword defaultRobKeyword = WxRobKeyword.dao.findFirst("SELECT * FROM wx_rob_keyword WHERE unique_key = ? AND key_data = ? AND nick_name = ? AND enable = 1 AND to_group = ? ORDER BY id DESC LIMIT 1", uniqueKey, ConfigKeys.DEAFAULT_WELCOME, ConfigKeys.DEAFAULT_KEYWORD,msg.isGroupMsg()?1:0); + if (sendSysWelcomeMsg(fromUserName, newNickName, defaultRobKeyword)){ return;} + } + } + } + + } + + /** + * 发送欢迎内容 + * @param fromUserName + * @param newNickName + * @param robKeyword + * @return + */ + private boolean sendSysWelcomeMsg(String fromUserName, String newNickName, WxRobKeyword robKeyword) { + if (robKeyword != null){ + if (robKeyword.getTypeData().equals(SendMsgType.TEXT.toValue())){ + robKeyword.setValueData(String.format("@%s\n%s",newNickName,robKeyword.getValueData())); + } + if (sendDataByType(fromUserName, robKeyword)) { + return true; + } + } + return false; + } + + @Override + public void picMsgHandle(BaseMsg msg) { +// // 这里使用收到图片的时间作为文件名 +// String fileName = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date()) + ".jpg"; +// // 保存图片的路径 +// String picPath = getDownloadPath(fileName); +// // 调用此方法来保存图片 +// DownloadTools.getDownloadFn(msg, MsgTypeEnum.PIC.getType(), picPath, this.uniqueKey); +// CoreManage.addSendMsg4UserName(uniqueKey,msg.getFromUserName(),"图片保存成功",SendMsgType.TEXT); + return; + } + + @Override + public void voiceMsgHandle(BaseMsg msg) { +// // 这里使用收到语音的时间作为文件名 +// String fileName = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date()) + ".mp3"; +// // 保存语音的路径 +// String voicePath = getDownloadPath(fileName); +// // 调用此方法来保存语音 +// DownloadTools.getDownloadFn(msg, MsgTypeEnum.VOICE.getType(), voicePath, this.uniqueKey); +// CoreManage.addSendMsg4UserName(uniqueKey,msg.getFromUserName(),"声音保存成功",SendMsgType.TEXT); + return; + } + + @Override + public void videoMsgHandle(BaseMsg msg) { +// // 这里使用收到小视频的时间作为文件名 +// String fileName = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date()) + ".mp4"; +// // 保存小视频的路径 +// String viedoPath = getDownloadPath(fileName); +// // 调用此方法来保存小视频 +// DownloadTools.getDownloadFn(msg, MsgTypeEnum.VIEDO.getType(), viedoPath,this.uniqueKey); +// CoreManage.addSendMsg4UserName(uniqueKey,msg.getFromUserName(),"视频保存成功",SendMsgType.TEXT); + return; + } + + @Override + public void nameCardMsgHandle(BaseMsg msg) { + return ; + } + + @Override + public void verifyAddFriendMsgHandle(BaseMsg msg) { + return ; + } + + @Override + public void mediaMsgHandle(BaseMsg msg) { + return ; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/AbstractHandler.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/AbstractHandler.java new file mode 100644 index 0000000..686d28d --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/AbstractHandler.java @@ -0,0 +1,9 @@ +package org.aibidding.system.handler.wxcp; + +import me.chanjar.weixin.cp.message.WxCpMessageHandler; + +/** + * @author Binary Wang + */ +public abstract class AbstractHandler implements WxCpMessageHandler { +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/ContactChangeHandler.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/ContactChangeHandler.java new file mode 100644 index 0000000..d51e675 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/ContactChangeHandler.java @@ -0,0 +1,33 @@ +package org.aibidding.system.handler.wxcp; + + +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage; +import org.aibidding.common.core.utils.JsonUtils; +import org.aibidding.system.builder.TextBuilder; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * 通讯录变更事件处理器. + * + * @author Binary Wang + */ +@Slf4j +@Component +public class ContactChangeHandler extends AbstractHandler { + + @Override + public WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage, Map context, WxCpService cpService, + WxSessionManager sessionManager) { + String content = "收到通讯录变更事件,内容:" + JsonUtils.toJson(wxMessage); + log.info(content); + + return new TextBuilder().build(content, wxMessage, cpService); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/EnterAgentHandler.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/EnterAgentHandler.java new file mode 100644 index 0000000..e150360 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/EnterAgentHandler.java @@ -0,0 +1,29 @@ +package org.aibidding.system.handler.wxcp; + +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage; + +import java.util.Map; + +/** + *
+ *
+ * Created by Binary Wang on 2018/8/27.
+ * 
+ * + * @author Binary Wang + */ +@Slf4j +public class EnterAgentHandler extends AbstractHandler { + private static final int TEST_AGENT = 1000002; + + @Override + public WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage, Map context, WxCpService wxCpService, WxSessionManager sessionManager) throws WxErrorException { + // do something + return null; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/LocationHandler.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/LocationHandler.java new file mode 100644 index 0000000..ded73d3 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/LocationHandler.java @@ -0,0 +1,44 @@ +package org.aibidding.system.handler.wxcp; + +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.common.api.WxConsts; +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage; +import org.aibidding.system.builder.TextBuilder; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @author Binary Wang + */ +@Slf4j +@Component +public class LocationHandler extends AbstractHandler { + + @Override + public WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage, Map context, WxCpService cpService, + WxSessionManager sessionManager) { + if (wxMessage.getMsgType().equals(WxConsts.XmlMsgType.LOCATION)) { + //TODO 接收处理用户发送的地理位置消息 + try { + String content = "感谢反馈,您的的地理位置已收到!"; + return new TextBuilder().build(content, wxMessage, null); + } catch (Exception e) { + log.error("位置消息接收处理失败", e); + return null; + } + } + + //上报地理位置事件 + log.info("\n上报地理位置,纬度 : {}\n经度 : {}\n精度 : {}", + wxMessage.getLatitude(), wxMessage.getLongitude(), String.valueOf(wxMessage.getPrecision())); + + //TODO 可以将用户地理位置信息保存到本地数据库,以便以后使用 + + return null; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/LogHandler.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/LogHandler.java new file mode 100644 index 0000000..2a1d042 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/LogHandler.java @@ -0,0 +1,26 @@ +package org.aibidding.system.handler.wxcp; + +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage; +import org.aibidding.common.core.utils.JsonUtils; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @author Binary Wang + */ +@Slf4j +@Component +public class LogHandler extends AbstractHandler { + @Override + public WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage, Map context, WxCpService cpService, + WxSessionManager sessionManager) { + log.info("\n接收到请求消息,内容:{}", JsonUtils.toJson(wxMessage)); + return null; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/MenuHandler.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/MenuHandler.java new file mode 100644 index 0000000..452f36c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/MenuHandler.java @@ -0,0 +1,34 @@ +package org.aibidding.system.handler.wxcp; + +import me.chanjar.weixin.common.api.WxConsts.MenuButtonType; +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @author Binary Wang + */ +@Component +public class MenuHandler extends AbstractHandler { + + @Override + public WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage, Map context, WxCpService cpService, + WxSessionManager sessionManager) { + + String msg = String.format("type:%s, event:%s, key:%s", + wxMessage.getMsgType(), wxMessage.getEvent(), + wxMessage.getEventKey()); + if (MenuButtonType.VIEW.equals(wxMessage.getEvent())) { + return null; + } + + return WxCpXmlOutMessage.TEXT().content(msg) + .fromUser(wxMessage.getToUserName()).toUser(wxMessage.getFromUserName()) + .build(); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/MsgHandler.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/MsgHandler.java new file mode 100644 index 0000000..581a2a6 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/MsgHandler.java @@ -0,0 +1,44 @@ +package org.aibidding.system.handler.wxcp; + +import lombok.RequiredArgsConstructor; +import me.chanjar.weixin.common.api.WxConsts; +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage; +import org.aibidding.system.builder.TextBuilder; +import org.aibidding.system.service.ISseService; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @author Binary Wang + */ +@Component +@RequiredArgsConstructor +public class MsgHandler extends AbstractHandler { + + private final ISseService sseService; + + + + @Override + public WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage, Map context, WxCpService cpService, + WxSessionManager sessionManager) { + final String msgType = wxMessage.getMsgType(); + if (msgType == null) { + // 如果msgType没有,就自己根据具体报文内容做处理 + } + + if (!msgType.equals(WxConsts.XmlMsgType.EVENT)) { + //TODO 可以选择将消息保存到本地 + } + //TODO 组装回复消息 + String content = sseService.wxCpChat(wxMessage.getContent()); + + return new TextBuilder().build(content, wxMessage, cpService); + + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/NullHandler.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/NullHandler.java new file mode 100644 index 0000000..503a243 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/NullHandler.java @@ -0,0 +1,23 @@ +package org.aibidding.system.handler.wxcp; + +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @author Binary Wang + */ +@Component +public class NullHandler extends AbstractHandler { + + @Override + public WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage, Map context, WxCpService cpService, + WxSessionManager sessionManager) { + return null; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/ScanHandler.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/ScanHandler.java new file mode 100644 index 0000000..c54d0eb --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/ScanHandler.java @@ -0,0 +1,8 @@ +package org.aibidding.system.handler.wxcp; + +/** + * @author Binary Wang + */ +public abstract class ScanHandler extends AbstractHandler { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/SubscribeHandler.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/SubscribeHandler.java new file mode 100644 index 0000000..4613969 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/SubscribeHandler.java @@ -0,0 +1,63 @@ +package org.aibidding.system.handler.wxcp; + +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.WxCpUser; +import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage; +import org.aibidding.system.builder.TextBuilder; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @author Binary Wang + */ +@Slf4j +@Component +public class SubscribeHandler extends AbstractHandler { + + @Override + public WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage, Map context, WxCpService cpService, + WxSessionManager sessionManager) throws WxErrorException { + + log.info("新关注用户 OPENID: " + wxMessage.getFromUserName()); + + // 获取微信用户基本信息 + WxCpUser userWxInfo = cpService.getUserService().getById(wxMessage.getFromUserName()); + + if (userWxInfo != null) { + // TODO 可以添加关注用户到本地 + } + + WxCpXmlOutMessage responseResult = null; + try { + responseResult = handleSpecial(wxMessage); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + + if (responseResult != null) { + return responseResult; + } + + try { + return new TextBuilder().build("感谢关注", wxMessage, cpService); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + + return null; + } + + /** + * 处理特殊请求,比如如果是扫码进来的,可以做相应处理 + */ + private WxCpXmlOutMessage handleSpecial(WxCpXmlMessage wxMessage) { + //TODO + return null; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/UnsubscribeHandler.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/UnsubscribeHandler.java new file mode 100644 index 0000000..ca61c66 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/handler/wxcp/UnsubscribeHandler.java @@ -0,0 +1,28 @@ +package org.aibidding.system.handler.wxcp; + +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.common.session.WxSessionManager; +import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; +import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @author Binary Wang + */ +@Slf4j +@Component +public class UnsubscribeHandler extends AbstractHandler { + + @Override + public WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage, Map context, WxCpService cpService, + WxSessionManager sessionManager) { + String openId = wxMessage.getFromUserName(); + log.info("取消关注用户 OPENID: " + openId); + // TODO 可以更新本地数据库为取消关注状态 + return null; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/listener/SSEEventSourceListener.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/listener/SSEEventSourceListener.java new file mode 100644 index 0000000..0268873 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/listener/SSEEventSourceListener.java @@ -0,0 +1,142 @@ +package org.aibidding.system.listener; + + +import cn.hutool.core.collection.CollectionUtil; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.RequiredArgsConstructor; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Response; +import okhttp3.ResponseBody; +import okhttp3.sse.EventSource; +import okhttp3.sse.EventSourceListener; +import org.aibidding.common.chat.config.LocalCache; +import org.aibidding.common.chat.entity.chat.ChatCompletionResponse; +import org.aibidding.common.chat.utils.TikTokensUtil; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.system.domain.bo.ChatMessageBo; +import org.aibidding.system.domain.bo.SysModelBo; +import org.aibidding.system.domain.vo.SysModelVo; +import org.aibidding.system.service.IChatCostService; +import org.aibidding.system.service.IChatMessageService; +import org.aibidding.system.service.ISysModelService; +import org.jetbrains.annotations.NotNull; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitter; + +import java.util.List; +import java.util.Objects; + +/** + * 描述:OpenAIEventSourceListener + * + * @author https:www.unfbx.com + * @date 2023-02-22 + */ +@Slf4j +@RequiredArgsConstructor +@Component +public class SSEEventSourceListener extends EventSourceListener { + + private ResponseBodyEmitter emitter; + + private StringBuilder stringBuffer = new StringBuilder(); + + @Autowired(required = false) + public SSEEventSourceListener(ResponseBodyEmitter emitter) { + this.emitter = emitter; + } + private static final ISysModelService sysModelService = SpringUtils.getBean(ISysModelService.class); + private String modelName; + /** + * {@inheritDoc} + */ + @Override + public void onOpen(EventSource eventSource, Response response) { + log.info("OpenAI建立sse连接..."); + } + + /** + * {@inheritDoc} + */ + @SneakyThrows + @Override + public void onEvent(@NotNull EventSource eventSource, String id, String type, String data) { + try { + if ("[DONE]".equals(data)) { + //成功响应 + emitter.complete(); + if(StringUtils.isNotEmpty(modelName)){ + IChatCostService IChatCostService = SpringUtils.context().getBean(IChatCostService.class); + IChatMessageService chatMessageService = SpringUtils.context().getBean(IChatMessageService.class); + ChatMessageBo chatMessageBo = new ChatMessageBo(); + chatMessageBo.setModelName(modelName); + chatMessageBo.setContent(stringBuffer.toString()); + Long userId = (Long)LocalCache.CACHE.get("userId"); + if(userId == null){ + return; + } + chatMessageBo.setUserId(userId); + //查询按次数扣费的模型 + SysModelBo sysModelBo = new SysModelBo(); + sysModelBo.setModelType("2"); + sysModelBo.setModelName(modelName); + List sysModelList = sysModelService.queryList(sysModelBo); + if (CollectionUtil.isNotEmpty(sysModelList)){ + chatMessageBo.setDeductCost(0d); + chatMessageBo.setRemark("提问时扣费"); + // 保存消息记录 + chatMessageService.insertByBo(chatMessageBo); + }else{ + int tokens = TikTokensUtil.tokens(modelName,stringBuffer.toString()); + chatMessageBo.setTotalTokens(tokens); + // 按token扣费并且保存消息记录 + IChatCostService.deductToken(chatMessageBo); + } + } + return; + } + // 解析返回内容 + ObjectMapper mapper = new ObjectMapper(); + ChatCompletionResponse completionResponse = mapper.readValue(data, ChatCompletionResponse.class); + if(completionResponse == null || CollectionUtil.isEmpty(completionResponse.getChoices())){ + return; + } + Object content = completionResponse.getChoices().get(0).getDelta().getContent(); + if(content == null){ + return; + } + if(StringUtils.isEmpty(modelName)){ + modelName = completionResponse.getModel(); + } + stringBuffer.append(content); + emitter.send(data); + } catch (Exception e) { + log.error("sse信息推送失败{}内容:{}",e.getMessage(),data); + eventSource.cancel(); + } + } + + @Override + public void onClosed(EventSource eventSource) { + log.info("OpenAI关闭sse连接..."); + } + + @SneakyThrows + @Override + public void onFailure(EventSource eventSource, Throwable t, Response response) { + if (Objects.isNull(response)) { + return; + } + ResponseBody body = response.body(); + if (Objects.nonNull(body)) { + log.error("OpenAI sse连接异常data:{},异常:{}", body.string(), t); + } else { + log.error("OpenAI sse连接异常data:{},异常:{}", response, t); + } + eventSource.cancel(); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/listener/SysUserImportListener.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/listener/SysUserImportListener.java new file mode 100644 index 0000000..20b966c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/listener/SysUserImportListener.java @@ -0,0 +1,123 @@ +package org.aibidding.system.listener; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.crypto.digest.BCrypt; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.core.utils.ValidatorUtils; +import org.aibidding.common.excel.core.ExcelListener; +import org.aibidding.common.excel.core.ExcelResult; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.system.domain.bo.SysUserBo; +import org.aibidding.system.domain.vo.SysUserImportVo; +import org.aibidding.system.domain.vo.SysUserVo; +import org.aibidding.system.service.ISysUserService; +import lombok.extern.slf4j.Slf4j; + +import java.util.List; + +/** + * 系统用户自定义导入 + * + * @author Lion Li + */ +@Slf4j +public class SysUserImportListener extends AnalysisEventListener implements ExcelListener { + + private final ISysUserService userService; + + private final String password; + + private final Boolean isUpdateSupport; + + private final Long operUserId; + + private int successNum = 0; + private int failureNum = 0; + private final StringBuilder successMsg = new StringBuilder(); + private final StringBuilder failureMsg = new StringBuilder(); + + public SysUserImportListener(Boolean isUpdateSupport) { + // String initPassword = SpringUtils.getBean(ISysConfigService.class).selectConfigByKey("sys.user.initPassword"); + this.userService = SpringUtils.getBean(ISysUserService.class); + this.password = BCrypt.hashpw("123456"); + this.isUpdateSupport = isUpdateSupport; + this.operUserId = LoginHelper.getUserId(); + } + + @Override + public void invoke(SysUserImportVo userVo, AnalysisContext context) { + SysUserVo sysUser = this.userService.selectUserByUserName(userVo.getUserName()); + try { + // 验证是否存在这个用户 + if (ObjectUtil.isNull(sysUser)) { + SysUserBo user = BeanUtil.toBean(userVo, SysUserBo.class); + ValidatorUtils.validate(user); + if(StringUtils.isEmpty(user.getNickName())){ + user.setNickName(user.getUserName()); + } + user.setDeptId(103L); + user.setPassword(password); + user.setCreateBy(operUserId); + userService.insertUser(user); + successNum++; + successMsg.append("
").append(successNum).append("、账号 ").append(user.getUserName()).append(" 导入成功"); + } else if (isUpdateSupport) { + Long userId = sysUser.getUserId(); + SysUserBo user = BeanUtil.toBean(userVo, SysUserBo.class); + user.setUserId(userId); + ValidatorUtils.validate(user); + userService.checkUserAllowed(user.getUserId()); + userService.checkUserDataScope(user.getUserId()); + user.setUpdateBy(operUserId); + userService.updateUser(user); + successNum++; + successMsg.append("
").append(successNum).append("、账号 ").append(user.getUserName()).append(" 更新成功"); + } else { + failureNum++; + failureMsg.append("
").append(failureNum).append("、账号 ").append(sysUser.getUserName()).append(" 已存在"); + } + } catch (Exception e) { + failureNum++; + String msg = "
" + failureNum + "、账号 " + sysUser.getUserName() + " 导入失败:"; + failureMsg.append(msg).append(e.getMessage()); + log.error(msg, e); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + + } + + @Override + public ExcelResult getExcelResult() { + return new ExcelResult<>() { + + @Override + public String getAnalysis() { + if (failureNum > 0) { + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + throw new ServiceException(failureMsg.toString()); + } else { + successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + } + return successMsg.toString(); + } + + @Override + public List getList() { + return null; + } + + @Override + public List getErrorList() { + return null; + } + }; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatAppStoreMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatAppStoreMapper.java new file mode 100644 index 0000000..72bb04b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatAppStoreMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.ChatAppStore; +import org.aibidding.system.domain.vo.ChatAppStoreVo; + +/** + * 应用市场Mapper接口 + * + * @author Lion Li + * @date 2024-03-19 + */ +public interface ChatAppStoreMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatConfigMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatConfigMapper.java new file mode 100644 index 0000000..9b8839f --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatConfigMapper.java @@ -0,0 +1,17 @@ +package org.aibidding.system.mapper; + +import org.aibidding.system.domain.ChatConfig; +import org.aibidding.system.domain.vo.ChatConfigVo; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 对话配置信息 +Mapper接口 + * + * @author Lion Li + * @date 2024-04-13 + */ +public interface ChatConfigMapper extends BaseMapperPlus { + + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatGptsMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatGptsMapper.java new file mode 100644 index 0000000..2a08ef6 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatGptsMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.ChatGpts; +import org.aibidding.system.domain.vo.ChatGptsVo; + +/** + * gpts管理Mapper接口 + * + * @author Lion Li + * @date 2024-07-09 + */ +public interface ChatGptsMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatMessageMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatMessageMapper.java new file mode 100644 index 0000000..5f2be3d --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatMessageMapper.java @@ -0,0 +1,16 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.ChatMessage; +import org.aibidding.system.domain.vo.ChatMessageVo; + + +/** + * 聊天消息Mapper接口 + * + * @author Lion Li + * @date 2023-11-26 + */ +public interface ChatMessageMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatTokenMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatTokenMapper.java new file mode 100644 index 0000000..0875355 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatTokenMapper.java @@ -0,0 +1,16 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.ChatToken; +import org.aibidding.system.domain.vo.ChatTokenVo; + + +/** + * 聊天消息Mapper接口 + * + * @author Lion Li + * @date 2023-11-26 + */ +public interface ChatTokenMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatVisitorUsageMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatVisitorUsageMapper.java new file mode 100644 index 0000000..5421218 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatVisitorUsageMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.system.mapper; + +import org.aibidding.system.domain.ChatVisitorUsage; +import org.aibidding.system.domain.vo.ChatVisitorUsageVo; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 访客管理Mapper接口 + * + * @author Lion Li + * @date 2024-07-14 + */ +public interface ChatVisitorUsageMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatVoucherMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatVoucherMapper.java new file mode 100644 index 0000000..ae5ab5f --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/ChatVoucherMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.ChatVoucher; +import org.aibidding.system.domain.vo.ChatVoucherVo; + +/** + * 用户兑换记录Mapper接口 + * + * @author Lion Li + * @date 2024-05-03 + */ +public interface ChatVoucherMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/CoverMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/CoverMapper.java new file mode 100644 index 0000000..a32d767 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/CoverMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.Cover; +import org.aibidding.system.domain.vo.cover.CoverVo; + +/** + * 翻唱Mapper接口 + * + * @author NSL + * @since 2024-12-25 + */ +public interface CoverMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/CoverPromptAudioMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/CoverPromptAudioMapper.java new file mode 100644 index 0000000..f1bb32e --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/CoverPromptAudioMapper.java @@ -0,0 +1,23 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.CoverPromptAudio; +import org.aibidding.system.domain.vo.cover.CoverPromptAudioVo; + +import java.util.List; + +/** + * 翻唱用户参考音频Mapper接口 + * + * @author NSL + * @since 2024-12-25 + */ +public interface CoverPromptAudioMapper extends BaseMapperPlus { + + /** + * 获取最近一次翻唱记录 + * @param userId 用户id + * @return 翻唱记录 + */ + List selectLatestVoByUserId(Long userId); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/PaymentOrdersMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/PaymentOrdersMapper.java new file mode 100644 index 0000000..7f3dc0b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/PaymentOrdersMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.system.mapper; + +import org.aibidding.system.domain.PaymentOrder; +import org.aibidding.system.domain.vo.PaymentOrdersVo; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 支付订单Mapper接口 + * + * @author Lion Li + * @date 2024-04-16 + */ +public interface PaymentOrdersMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysConfigMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysConfigMapper.java new file mode 100644 index 0000000..aac16c8 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysConfigMapper.java @@ -0,0 +1,14 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysConfig; +import org.aibidding.system.domain.vo.SysConfigVo; + +/** + * 参数配置 数据层 + * + * @author Lion Li + */ +public interface SysConfigMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysDeptMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysDeptMapper.java new file mode 100644 index 0000000..426ce6c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysDeptMapper.java @@ -0,0 +1,46 @@ +package org.aibidding.system.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Param; +import org.aibidding.common.mybatis.annotation.DataColumn; +import org.aibidding.common.mybatis.annotation.DataPermission; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysDept; +import org.aibidding.system.domain.vo.SysDeptVo; + +import java.util.List; + +/** + * 部门管理 数据层 + * + * @author Lion Li + */ +public interface SysDeptMapper extends BaseMapperPlus { + + /** + * 查询部门管理数据 + * + * @param queryWrapper 查询条件 + * @return 部门信息集合 + */ + @DataPermission({ + @DataColumn(key = "deptName", value = "dept_id") + }) + List selectDeptList(@Param(Constants.WRAPPER) Wrapper queryWrapper); + + @DataPermission({ + @DataColumn(key = "deptName", value = "dept_id") + }) + SysDeptVo selectDeptById(Long deptId); + + /** + * 根据角色ID查询部门树信息 + * + * @param roleId 角色ID + * @param deptCheckStrictly 部门树选择项是否关联显示 + * @return 选中部门列表 + */ + List selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysDictDataMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysDictDataMapper.java new file mode 100644 index 0000000..6304814 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysDictDataMapper.java @@ -0,0 +1,25 @@ +package org.aibidding.system.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysDictData; +import org.aibidding.system.domain.vo.SysDictDataVo; + +import java.util.List; + +/** + * 字典表 数据层 + * + * @author Lion Li + */ +public interface SysDictDataMapper extends BaseMapperPlus { + + default List selectDictDataByType(String dictType) { + return selectVoList( + new LambdaQueryWrapper() + .eq(SysDictData::getStatus, UserConstants.DICT_NORMAL) + .eq(SysDictData::getDictType, dictType) + .orderByAsc(SysDictData::getDictSort)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysDictTypeMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysDictTypeMapper.java new file mode 100644 index 0000000..8a71fb6 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysDictTypeMapper.java @@ -0,0 +1,14 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysDictType; +import org.aibidding.system.domain.vo.SysDictTypeVo; + +/** + * 字典表 数据层 + * + * @author Lion Li + */ +public interface SysDictTypeMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysLogininforMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysLogininforMapper.java new file mode 100644 index 0000000..89e9ec7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysLogininforMapper.java @@ -0,0 +1,14 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysLogininfor; +import org.aibidding.system.domain.vo.SysLogininforVo; + +/** + * 系统访问日志情况信息 数据层 + * + * @author Lion Li + */ +public interface SysLogininforMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysMenuMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysMenuMapper.java new file mode 100644 index 0000000..a5c7acb --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysMenuMapper.java @@ -0,0 +1,83 @@ +package org.aibidding.system.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Param; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysMenu; +import org.aibidding.system.domain.vo.SysMenuVo; + +import java.util.List; + +/** + * 菜单表 数据层 + * + * @author Lion Li + */ +public interface SysMenuMapper extends BaseMapperPlus { + + /** + * 根据用户所有权限 + * + * @return 权限列表 + */ + List selectMenuPerms(); + + /** + * 根据用户查询系统菜单列表 + * + * @param queryWrapper 查询条件 + * @return 菜单列表 + */ + List selectMenuListByUserId(@Param(Constants.WRAPPER) Wrapper queryWrapper); + + /** + * 根据用户ID查询权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + List selectMenuPermsByUserId(Long userId); + + /** + * 根据角色ID查询权限 + * + * @param roleId 角色ID + * @return 权限列表 + */ + List selectMenuPermsByRoleId(Long roleId); + + /** + * 根据用户ID查询菜单 + * + * @return 菜单列表 + */ + default List selectMenuTreeAll() { + LambdaQueryWrapper lqw = new LambdaQueryWrapper() + .in(SysMenu::getMenuType, UserConstants.TYPE_DIR, UserConstants.TYPE_MENU) + .eq(SysMenu::getStatus, UserConstants.MENU_NORMAL) + .orderByAsc(SysMenu::getParentId) + .orderByAsc(SysMenu::getOrderNum); + return this.selectList(lqw); + } + + /** + * 根据用户ID查询菜单 + * + * @param userId 用户ID + * @return 菜单列表 + */ + List selectMenuTreeByUserId(Long userId); + + /** + * 根据角色ID查询菜单树信息 + * + * @param roleId 角色ID + * @param menuCheckStrictly 菜单树选择项是否关联显示 + * @return 选中菜单列表 + */ + List selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysModelMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysModelMapper.java new file mode 100644 index 0000000..3cb6e15 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysModelMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.system.mapper; + +import org.aibidding.system.domain.SysModel; +import org.aibidding.system.domain.vo.SysModelVo; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 系统模型Mapper接口 + * + * @author Lion Li + * @date 2024-04-04 + */ +public interface SysModelMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysNoticeMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysNoticeMapper.java new file mode 100644 index 0000000..bec9835 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysNoticeMapper.java @@ -0,0 +1,14 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysNotice; +import org.aibidding.system.domain.vo.SysNoticeVo; + +/** + * 通知公告表 数据层 + * + * @author Lion Li + */ +public interface SysNoticeMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysNoticeStateMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysNoticeStateMapper.java new file mode 100644 index 0000000..2c0e4a7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysNoticeStateMapper.java @@ -0,0 +1,19 @@ +package org.aibidding.system.mapper; + +import org.aibidding.system.domain.SysNoticeState; +import org.aibidding.system.domain.vo.SysNoticeStateVo; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 用户阅读状态Mapper接口 + * + * @author Lion Li + * @date 2024-05-11 + */ +public interface SysNoticeStateMapper extends BaseMapperPlus { + + /** + * 阅读所有公告 + */ + void readAllNotice(); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysOperLogMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysOperLogMapper.java new file mode 100644 index 0000000..aae424e --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysOperLogMapper.java @@ -0,0 +1,14 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysOperLog; +import org.aibidding.system.domain.vo.SysOperLogVo; + +/** + * 操作日志 数据层 + * + * @author Lion Li + */ +public interface SysOperLogMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysOssConfigMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysOssConfigMapper.java new file mode 100644 index 0000000..ac8c2dd --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysOssConfigMapper.java @@ -0,0 +1,16 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysOssConfig; +import org.aibidding.system.domain.vo.SysOssConfigVo; + +/** + * 对象存储配置Mapper接口 + * + * @author Lion Li + * @author 孤舟烟雨 + * @date 2021-08-13 + */ +public interface SysOssConfigMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysOssMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysOssMapper.java new file mode 100644 index 0000000..9aa8642 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysOssMapper.java @@ -0,0 +1,13 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysOss; +import org.aibidding.system.domain.vo.SysOssVo; + +/** + * 文件上传 数据层 + * + * @author Lion Li + */ +public interface SysOssMapper extends BaseMapperPlus { +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysPackagePlanMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysPackagePlanMapper.java new file mode 100644 index 0000000..cbcb448 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysPackagePlanMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysPackagePlan; +import org.aibidding.system.domain.vo.SysPackagePlanVo; + +/** + * 套餐管理Mapper接口 + * + * @author Lion Li + * @date 2024-05-05 + */ +public interface SysPackagePlanMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysPostMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysPostMapper.java new file mode 100644 index 0000000..85434a6 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysPostMapper.java @@ -0,0 +1,32 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysPost; +import org.aibidding.system.domain.vo.SysPostVo; + +import java.util.List; + +/** + * 岗位信息 数据层 + * + * @author Lion Li + */ +public interface SysPostMapper extends BaseMapperPlus { + + /** + * 根据用户ID获取岗位选择框列表 + * + * @param userId 用户ID + * @return 选中岗位ID列表 + */ + List selectPostListByUserId(Long userId); + + /** + * 查询用户所属岗位组 + * + * @param userName 用户名 + * @return 结果 + */ + List selectPostsByUserName(String userName); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysRoleDeptMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysRoleDeptMapper.java new file mode 100644 index 0000000..063c793 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysRoleDeptMapper.java @@ -0,0 +1,13 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysRoleDept; + +/** + * 角色与部门关联表 数据层 + * + * @author Lion Li + */ +public interface SysRoleDeptMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysRoleMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysRoleMapper.java new file mode 100644 index 0000000..f36a28b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysRoleMapper.java @@ -0,0 +1,68 @@ +package org.aibidding.system.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; +import org.aibidding.common.mybatis.annotation.DataColumn; +import org.aibidding.common.mybatis.annotation.DataPermission; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysRole; +import org.aibidding.system.domain.vo.SysRoleVo; + +import java.util.List; + +/** + * 角色表 数据层 + * + * @author Lion Li + */ +public interface SysRoleMapper extends BaseMapperPlus { + + @DataPermission({ + @DataColumn(key = "deptName", value = "d.dept_id") + }) + Page selectPageRoleList(@Param("page") Page page, @Param(Constants.WRAPPER) Wrapper queryWrapper); + + /** + * 根据条件分页查询角色数据 + * + * @param queryWrapper 查询条件 + * @return 角色数据集合信息 + */ + @DataPermission({ + @DataColumn(key = "deptName", value = "d.dept_id") + }) + List selectRoleList(@Param(Constants.WRAPPER) Wrapper queryWrapper); + + @DataPermission({ + @DataColumn(key = "deptName", value = "d.dept_id") + }) + SysRoleVo selectRoleById(Long roleId); + + /** + * 根据用户ID查询角色 + * + * @param userId 用户ID + * @return 角色列表 + */ + List selectRolePermissionByUserId(Long userId); + + + /** + * 根据用户ID获取角色选择框列表 + * + * @param userId 用户ID + * @return 选中角色ID列表 + */ + List selectRoleListByUserId(Long userId); + + /** + * 根据用户ID查询角色 + * + * @param userName 用户名 + * @return 角色列表 + */ + List selectRolesByUserName(String userName); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysRoleMenuMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysRoleMenuMapper.java new file mode 100644 index 0000000..332a5db --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysRoleMenuMapper.java @@ -0,0 +1,13 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysRoleMenu; + +/** + * 角色与菜单关联表 数据层 + * + * @author Lion Li + */ +public interface SysRoleMenuMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysTenantMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysTenantMapper.java new file mode 100644 index 0000000..9920bca --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysTenantMapper.java @@ -0,0 +1,14 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysTenant; +import org.aibidding.system.domain.vo.SysTenantVo; + +/** + * 租户Mapper接口 + * + * @author Michelle.Chung + */ +public interface SysTenantMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysTenantPackageMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysTenantPackageMapper.java new file mode 100644 index 0000000..ae845f1 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysTenantPackageMapper.java @@ -0,0 +1,14 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysTenantPackage; +import org.aibidding.system.domain.vo.SysTenantPackageVo; + +/** + * 租户套餐Mapper接口 + * + * @author Michelle.Chung + */ +public interface SysTenantPackageMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserGroupMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserGroupMapper.java new file mode 100644 index 0000000..0c35f76 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserGroupMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysUserGroup; +import org.aibidding.system.domain.vo.SysUserGroupVo; + +/** + * 【请填写功能名称】Mapper接口 + * + * @author Lion Li + * @date 2024-08-03 + */ +public interface SysUserGroupMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserMapper.java new file mode 100644 index 0000000..bb42401 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserMapper.java @@ -0,0 +1,165 @@ +package org.aibidding.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.aibidding.common.mybatis.annotation.DataColumn; +import org.aibidding.common.mybatis.annotation.DataPermission; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysUser; +import org.aibidding.system.domain.bo.SysUserBo; +import org.aibidding.system.domain.vo.SysUserVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户表 数据层 + * + * @author Lion Li + */ +public interface SysUserMapper extends BaseMapperPlus { + + @DataPermission({ + @DataColumn(key = "deptName", value = "d.dept_id"), + @DataColumn(key = "userName", value = "u.user_id") + }) + Page selectPageUserList(@Param("page") Page page, @Param(Constants.WRAPPER) Wrapper queryWrapper); + + /** + * 根据条件分页查询用户列表 + * + * @param queryWrapper 查询条件 + * @return 用户信息集合信息 + */ + @DataPermission({ + @DataColumn(key = "deptName", value = "d.dept_id"), + @DataColumn(key = "userName", value = "u.user_id") + }) + List selectUserList(@Param(Constants.WRAPPER) Wrapper queryWrapper); + + /** + * 根据条件分页查询已配用户角色列表 + * + * @param queryWrapper 查询条件 + * @return 用户信息集合信息 + */ + @DataPermission({ + @DataColumn(key = "deptName", value = "d.dept_id"), + @DataColumn(key = "userName", value = "u.user_id") + }) + Page selectAllocatedList(@Param("page") Page page, @Param(Constants.WRAPPER) Wrapper queryWrapper); + + /** + * 根据条件分页查询未分配用户角色列表 + * + * @param queryWrapper 查询条件 + * @return 用户信息集合信息 + */ + @DataPermission({ + @DataColumn(key = "deptName", value = "d.dept_id"), + @DataColumn(key = "userName", value = "u.user_id") + }) + Page selectUnallocatedList(@Param("page") Page page, @Param(Constants.WRAPPER) Wrapper queryWrapper); + + /** + * 通过用户名查询用户 + * + * @param userName 用户名 + * @return 用户对象信息 + */ + SysUserVo selectUserByUserName(String userName); + + /** + * 通过OpenId查询用户 + * + * @param OpenId 微信用户唯一标识 + * @return 用户对象信息 + */ + SysUserVo selectUserByOpenId(String OpenId); + + /** + * 通过手机号查询用户 + * + * @param phonenumber 手机号 + * @return 用户对象信息 + */ + SysUserVo selectUserByPhonenumber(String phonenumber); + + /** + * 通过邮箱查询用户 + * + * @param email 邮箱 + * @return 用户对象信息 + */ + SysUserVo selectUserByEmail(String email); + + /** + * 通过用户名查询用户(不走租户插件) + * + * @param userName 用户名 + * @param tenantId 租户id + * @return 用户对象信息 + */ + @InterceptorIgnore(tenantLine = "true") + SysUserVo selectTenantUserByUserName(String userName, String tenantId); + + /** + * 通过手机号查询用户(不走租户插件) + * + * @param phonenumber 手机号 + * @param tenantId 租户id + * @return 用户对象信息 + */ + @InterceptorIgnore(tenantLine = "true") + SysUserVo selectTenantUserByPhonenumber(String phonenumber, String tenantId); + + /** + * 通过邮箱查询用户(不走租户插件) + * + * @param email 邮箱 + * @param tenantId 租户id + * @return 用户对象信息 + */ + @InterceptorIgnore(tenantLine = "true") + SysUserVo selectTenantUserByEmail(String email, String tenantId); + + /** + * 通过用户ID查询用户 + * + * @param userId 用户ID + * @return 用户对象信息 + */ +// @DataPermission({ +// @DataColumn(key = "deptName", value = "d.dept_id"), +// @DataColumn(key = "userName", value = "u.user_id") +// }) + @InterceptorIgnore(dataPermission = "true") + SysUserVo selectUserById(Long userId); + + @Override +// @DataPermission({ +// @DataColumn(key = "deptName", value = "dept_id"), +// @DataColumn(key = "userName", value = "user_id") +// }) + @InterceptorIgnore(dataPermission = "true") + int update(@Param(Constants.ENTITY) SysUser user, @Param(Constants.WRAPPER) Wrapper updateWrapper); + + @Override +// @DataPermission({ +// @DataColumn(key = "deptName", value = "dept_id"), +// @DataColumn(key = "userName", value = "user_id") +// }) + @InterceptorIgnore(dataPermission = "true") + int updateById(@Param(Constants.ENTITY) SysUser user); + + + /** + * 小程序 -修改用户信息 + * + * @param user + * + */ + void updateXcxUser(SysUserBo user); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserModelMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserModelMapper.java new file mode 100644 index 0000000..f619260 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserModelMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysUserModel; +import org.aibidding.system.domain.vo.SysUserModelVo; + +/** + * 【请填写功能名称】Mapper接口 + * + * @author Lion Li + * @date 2024-08-03 + */ +public interface SysUserModelMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserPostMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserPostMapper.java new file mode 100644 index 0000000..63e48b1 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserPostMapper.java @@ -0,0 +1,13 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysUserPost; + +/** + * 用户与岗位关联表 数据层 + * + * @author Lion Li + */ +public interface SysUserPostMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserRoleMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserRoleMapper.java new file mode 100644 index 0000000..8ff61b6 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/SysUserRoleMapper.java @@ -0,0 +1,17 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.SysUserRole; + +import java.util.List; + +/** + * 用户与角色关联表 数据层 + * + * @author Lion Li + */ +public interface SysUserRoleMapper extends BaseMapperPlus { + + List selectUserIdsByRoleId(Long roleId); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/WxRobConfigMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/WxRobConfigMapper.java new file mode 100644 index 0000000..9d63bea --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/WxRobConfigMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.WxRobConfig; +import org.aibidding.system.domain.vo.WxRobConfigVo; + +/** + * 【请填写功能名称】Mapper接口 + * + * @author Lion Li + * @date 2024-05-01 + */ +public interface WxRobConfigMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/WxRobKeywordMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/WxRobKeywordMapper.java new file mode 100644 index 0000000..932f5c8 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/WxRobKeywordMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.system.mapper; + +import org.aibidding.system.domain.WxRobKeyword; +import org.aibidding.system.domain.vo.WxRobKeywordVo; +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 【请填写功能名称】Mapper接口 + * + * @author Lion Li + * @date 2024-05-01 + */ +public interface WxRobKeywordMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/WxRobRelationMapper.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/WxRobRelationMapper.java new file mode 100644 index 0000000..71c9f5d --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/mapper/WxRobRelationMapper.java @@ -0,0 +1,15 @@ +package org.aibidding.system.mapper; + +import org.aibidding.common.mybatis.core.mapper.BaseMapperPlus; +import org.aibidding.system.domain.WxRobRelation; +import org.aibidding.system.domain.vo.WxRobRelationVo; + +/** + * 【请填写功能名称】Mapper接口 + * + * @author Lion Li + * @date 2024-05-01 + */ +public interface WxRobRelationMapper extends BaseMapperPlus { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/request/RoleListDto.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/request/RoleListDto.java new file mode 100644 index 0000000..6404412 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/request/RoleListDto.java @@ -0,0 +1,24 @@ +package org.aibidding.system.request; + +import lombok.Data; + +/** + * 描述: + * + * @author ageerle@163.com + * date 2024/4/27 + */ +@Data +public class RoleListDto { + + private String name; + + private String description; + + private String voicesId; + + private String avatar; + + private String previewAudio; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/request/RoleRequest.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/request/RoleRequest.java new file mode 100644 index 0000000..2922153 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/request/RoleRequest.java @@ -0,0 +1,36 @@ +package org.aibidding.system.request; + +import lombok.Data; + +/** + * @author WangLe + */ +@Data +public class RoleRequest { + + /** + * 角色名称 + */ + private String name; + + /** + * 角色默认风格音频样本,base64 编码的音频数据 + */ + private String prompt; + + /** + * 角色描述 + */ + private String description; + + /** + * 头像 + */ + private String avatar; + + /** + * 专业克隆样本Zip文件的分片上传ID,请先通过分片上传接口完成文件上传 + */ + private String lora; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/request/SimpleGenerateRequest.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/request/SimpleGenerateRequest.java new file mode 100644 index 0000000..188fccc --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/request/SimpleGenerateRequest.java @@ -0,0 +1,63 @@ +package org.aibidding.system.request; + +import lombok.Data; + +import java.util.List; + +/** + * @author WangLe + */ +@Data +public class SimpleGenerateRequest { + + /** + * 角色ID + */ + private String voiceId; + + /** + * 要生成的文本内容 + */ + private String text; + + /** + * 要生成的文本内容 优先级高于text + */ + private List texts; + + /** + * 角色风格 ID (默认为default) + */ + private String promptId = "default"; + + /** + * 要使用的模型ID (目前统一为reecho-neural-voice-001) + */ + private String model = "reecho-neural-voice-001"; + + /** + * 多样性 (0-100,默认为97) + */ + private Integer randomness; + + /** + * 稳定性过滤 (0-100,默认为100) + */ + private Integer stability_boost; + + /** + * 概率优选(0-100,默认为99) + */ + private Integer probability_optimization; + + /** + * 是否直接返回生成音频的Base64 DataURL,而不是Url链接(默认为false) + */ + private Boolean origin_audio; + + /** + * 是否启用流式生成 + */ + private Boolean stream; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/MetadataResponse.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/MetadataResponse.java new file mode 100644 index 0000000..71e73c6 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/MetadataResponse.java @@ -0,0 +1,27 @@ +package org.aibidding.system.response; + +import lombok.Data; + +import java.util.List; + +/** + * @author WangLe + */ +@Data +public class MetadataResponse { + + /** + * 语音角色头像 URL + */ + private String avatar; + + /** + * 语音角色描述 + */ + private String description; + + /** + * 语音角色风格列表 + */ + private List prompts; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/PromptResponse.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/PromptResponse.java new file mode 100644 index 0000000..bbc597d --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/PromptResponse.java @@ -0,0 +1,29 @@ +package org.aibidding.system.response; + +import lombok.Data; + +/** + * 描述:语音角色风格列表 + * + * @author ageerle@163.com + * date 2024/4/27 + */ +@Data +public class PromptResponse { + + /** + * 角色风格 ID + */ + private String id; + + /** + * 角色风格名称 + */ + private String name; + + /** + * 角色风格样本音频 URL + */ + private String promptOriginAudioStorageUrl; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/RoleDataResponse.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/RoleDataResponse.java new file mode 100644 index 0000000..82ae8f7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/RoleDataResponse.java @@ -0,0 +1,35 @@ +package org.aibidding.system.response; + +import lombok.Data; + +/** + * @author WangLe + */ +@Data +public class RoleDataResponse { + /** + * 语音角色 ID + */ + private String id; + + /** + * 音角色名称 + */ + private String name; + + /** + * 语音角色状态,可以为 + * pending(瞬时克隆已完成) + * lora-pending(专业克隆训练中) + * lora-success(专业克隆已完成) + * lora-failed(专业克隆失败) + */ + private String status; + private MetadataResponse metadata; + private String from; + private String originId; + private String createdAt; + private String updatedAt; + private String deletedAt; + private String userId; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/RoleResponse.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/RoleResponse.java new file mode 100644 index 0000000..13c6c38 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/RoleResponse.java @@ -0,0 +1,22 @@ +package org.aibidding.system.response; + +import lombok.Data; + +/** + * @author WangLe + */ +@Data +public class RoleResponse { + /** + * 状态码 + */ + private String status; + /** + * 状态信息 + */ + private String message; + /** + * 创建的语音角色详情 + */ + private RoleDataResponse data; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/SimpleGenerateDataResponse.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/SimpleGenerateDataResponse.java new file mode 100644 index 0000000..b40eee9 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/SimpleGenerateDataResponse.java @@ -0,0 +1,30 @@ +package org.aibidding.system.response; + +import lombok.Data; + +/** + * @author WangLe + */ +@Data +public class SimpleGenerateDataResponse { + + /** + * 本次生成的ID + */ + private String id; + + /** + * 本次生成结果的音频文件地址 + */ + private String audio; + + /** + * 流式MP3端点 + */ + private String streamUrl; + + /** + * 本次生成所消耗的点数 + */ + private Integer credit_used; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/SimpleGenerateResponse.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/SimpleGenerateResponse.java new file mode 100644 index 0000000..9d5f2ac --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/SimpleGenerateResponse.java @@ -0,0 +1,25 @@ +package org.aibidding.system.response; + +import lombok.Data; + +/** + * @author WangLe + */ +@Data +public class SimpleGenerateResponse { + + /** + * 状态码,失败时则为500 + */ + private String status; + + /** + * 状态消息 + */ + private String message; + + /** + * 生成详情 + */ + private SimpleGenerateDataResponse data; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/rolelist/ChatAppStoreVO.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/rolelist/ChatAppStoreVO.java new file mode 100644 index 0000000..e079d72 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/rolelist/ChatAppStoreVO.java @@ -0,0 +1,19 @@ +package org.aibidding.system.response.rolelist; + +import lombok.Data; + +@Data +public class ChatAppStoreVO { + + + private String name; + + private String description; + + private String voicesId; + + private String avatar; + + private String appUrl; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/rolelist/ContentResponse.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/rolelist/ContentResponse.java new file mode 100644 index 0000000..8499be7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/rolelist/ContentResponse.java @@ -0,0 +1,78 @@ +package org.aibidding.system.response.rolelist; + +import lombok.Data; + +/** + * + * 描述:获取当前用户的语音角色列表返回对象 + * + * @author ageerle@163.com + * date 2024/4/27 + */ +import java.util.List; + +@Data +public class ContentResponse { + + /** + * 语音角色 ID + */ + private String id; + + /** + * 语音角色名称 + */ + private String name; + + /** + * 语音角色状态,可以为pending(瞬时克隆已完成)、lora-pending(专业克隆训练中)、lora-success(专业克隆已完成)、lora-failed(专业克隆失败) + */ + private String status; + + + private Metadata metadata; + @Data + public static class Metadata { + + /** + * 语音角色头像 URL + */ + private String avatar; + + /** + * 语音角色描述 + */ + private String description; + + /** + * 语音角色风格列表 + */ + private List prompts; + + private String previewAudio; + + private String promptMP3StorageUrl; + + @Data + public static class prompt { + /** + * 角色风格 ID + */ + private String id; + + /** + * 角色风格名称 + */ + private String name; + + /** + * 角色风格样本音频 URL + */ + private String promptOriginAudioStorageUrl; + + } + + } + +} + diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/rolelist/RoleListResponse.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/rolelist/RoleListResponse.java new file mode 100644 index 0000000..f2508f1 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/response/rolelist/RoleListResponse.java @@ -0,0 +1,24 @@ +package org.aibidding.system.response.rolelist; + +import lombok.Data; + +import java.util.List; + +/** + * @author WangLe + */ +@Data +public class RoleListResponse { + /** + * 状态码 + */ + private String status; + /** + * 状态信息 + */ + private String message; + /** + * 创建的语音角色详情 + */ + private List data; +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/runner/SystemApplicationRunner.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/runner/SystemApplicationRunner.java new file mode 100644 index 0000000..69e4852 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/runner/SystemApplicationRunner.java @@ -0,0 +1,28 @@ +package org.aibidding.system.runner; + +import org.aibidding.system.service.ISysOssConfigService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.stereotype.Component; + +/** + * 初始化 system 模块对应业务数据 + * + * @author Lion Li + */ +@Slf4j +@RequiredArgsConstructor +@Component +public class SystemApplicationRunner implements ApplicationRunner { + + private final ISysOssConfigService ossConfigService; + + @Override + public void run(ApplicationArguments args) throws Exception { + ossConfigService.init(); + log.info("初始化OSS配置成功"); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatAppStoreService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatAppStoreService.java new file mode 100644 index 0000000..8f0405f --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatAppStoreService.java @@ -0,0 +1,71 @@ +package org.aibidding.system.service; + +import org.aibidding.system.domain.vo.ChatAppStoreVo; +import org.aibidding.system.domain.bo.ChatAppStoreBo; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.system.request.RoleListDto; +import org.aibidding.system.request.RoleRequest; +import org.aibidding.system.request.SimpleGenerateRequest; +import org.aibidding.system.response.SimpleGenerateDataResponse; +import org.aibidding.system.response.rolelist.ChatAppStoreVO; + +import java.util.Collection; +import java.util.List; + +/** + * 应用市场Service接口 + * + * @author Lion Li + * @date 2024-03-19 + */ +public interface IChatAppStoreService { + + /** + * 查询应用市场 + */ + ChatAppStoreVo queryById(Long id); + + /** + * 查询应用市场列表 + */ + TableDataInfo queryPageList(ChatAppStoreBo bo, PageQuery pageQuery); + + /** + * 查询应用市场列表 + */ + List queryList(ChatAppStoreBo bo); + + /** + * 新增应用市场 + */ + Boolean insertByBo(RoleRequest roleRequest); + + /** + * 生成音频 + */ + SimpleGenerateDataResponse simpleGenerate(SimpleGenerateRequest simpleGenerateRequest); + + /** + * 修改应用市场 + */ + Boolean updateByBo(ChatAppStoreBo bo); + + /** + * 校验并批量删除应用市场信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 查询市场角色 + * + * @return 角色列表 + */ + List roleList(); + + /** + * 收藏市场角色 + * + */ + void copyRole(RoleListDto roleListDto); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatConfigService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatConfigService.java new file mode 100644 index 0000000..512fb61 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatConfigService.java @@ -0,0 +1,53 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.ChatConfigBo; +import org.aibidding.system.domain.vo.ChatConfigVo; + +import java.util.Collection; +import java.util.List; + +/** + * 对话配置信息Service接口 + * @date 2024-04-13 + */ +public interface IChatConfigService { + + /** + * 查询配置信息 + + */ + ChatConfigVo queryById(Long id); + + /** + * 查询配置信息列表 + */ + TableDataInfo queryPageList(ChatConfigBo bo, PageQuery pageQuery); + + /** + * 查询配置信息列表 + */ + List queryList(ChatConfigBo bo); + + /** + * 新增配置信息 + + */ + Boolean insertByBo(ChatConfigBo bo); + + /** + * 修改配置信息 + */ + Boolean updateByBo(ChatConfigBo bo); + + /** + * 校验并批量删除配置信息信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 查询系统参数 + */ + List getSysConfigValue(String category); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatCostService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatCostService.java new file mode 100644 index 0000000..57bd9b3 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatCostService.java @@ -0,0 +1,37 @@ +package org.aibidding.system.service; + +import org.aibidding.system.domain.bo.ChatMessageBo; + +public interface IChatCostService { + + /** + * 根据消耗的tokens扣除余额 + * + * @param chatMessageBo + * @return 结果 + */ + + void deductToken(ChatMessageBo chatMessageBo); + + /** + * 扣除用户的余额 + * + */ + void deductUserBalance(Long userId, Double numberCost); + + + /** + * 扣除任务费用并且保存记录 + * + * @param type 任务类型 + * @param prompt 任务描述 + * @param cost 扣除费用 + */ + void taskDeduct(String type,String prompt, double cost); + + + /** + * 判断用户是否付费 + */ + void checkUserGrade(); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatGptsService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatGptsService.java new file mode 100644 index 0000000..0471bf5 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatGptsService.java @@ -0,0 +1,48 @@ +package org.aibidding.system.service; + +import org.aibidding.system.domain.vo.ChatGptsVo; +import org.aibidding.system.domain.bo.ChatGptsBo; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * gpts管理Service接口 + * + * @author Lion Li + * @date 2024-07-09 + */ +public interface IChatGptsService { + + /** + * 查询gpts管理 + */ + ChatGptsVo queryById(Long id); + + /** + * 查询gpts管理列表 + */ + TableDataInfo queryPageList(ChatGptsBo bo, PageQuery pageQuery); + + /** + * 查询gpts管理列表 + */ + List queryList(ChatGptsBo bo); + + /** + * 新增gpts管理 + */ + Boolean insertByBo(ChatGptsBo bo); + + /** + * 修改gpts管理 + */ + Boolean updateByBo(ChatGptsBo bo); + + /** + * 校验并批量删除gpts管理信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatMessageService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatMessageService.java new file mode 100644 index 0000000..3a6661f --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatMessageService.java @@ -0,0 +1,48 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.ChatMessageBo; +import org.aibidding.system.domain.vo.ChatMessageVo; + +import java.util.Collection; +import java.util.List; + +/** + * 聊天消息Service接口 + * + * @author Lion Li + * @date 2023-11-26 + */ +public interface IChatMessageService { + + /** + * 查询聊天消息 + */ + ChatMessageVo queryById(Long id); + + /** + * 查询聊天消息列表 + */ + TableDataInfo queryPageList(ChatMessageBo bo, PageQuery pageQuery); + + /** + * 查询聊天消息列表 + */ + List queryList(ChatMessageBo bo); + + /** + * 新增聊天消息 + */ + Boolean insertByBo(ChatMessageBo bo); + + /** + * 修改聊天消息 + */ + Boolean updateByBo(ChatMessageBo bo); + + /** + * 校验并批量删除聊天消息信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatTokenService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatTokenService.java new file mode 100644 index 0000000..f6e85ae --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatTokenService.java @@ -0,0 +1,25 @@ +package org.aibidding.system.service; + +import org.aibidding.system.domain.ChatToken; + +/** + * 聊天消息Service接口 + * + * @author Lion Li + * @date 2023-11-26 + */ +public interface IChatTokenService { + + /** + * 查询用户token + */ + ChatToken queryByUserId(Long userId,String modelName); + + /** + * 清空用户token + */ + void resetToken(Long userId,String modelName); + + void editToken(ChatToken chatToken); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatVisitorUsageService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatVisitorUsageService.java new file mode 100644 index 0000000..9ef1104 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatVisitorUsageService.java @@ -0,0 +1,48 @@ +package org.aibidding.system.service; + +import org.aibidding.system.domain.vo.ChatVisitorUsageVo; +import org.aibidding.system.domain.bo.ChatVisitorUsageBo; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 访客管理Service接口 + * + * @author Lion Li + * @date 2024-07-14 + */ +public interface IChatVisitorUsageService { + + /** + * 查询访客管理 + */ + ChatVisitorUsageVo queryById(Long id); + + /** + * 查询访客管理列表 + */ + TableDataInfo queryPageList(ChatVisitorUsageBo bo, PageQuery pageQuery); + + /** + * 查询访客管理列表 + */ + List queryList(ChatVisitorUsageBo bo); + + /** + * 新增访客管理 + */ + Boolean insertByBo(ChatVisitorUsageBo bo); + + /** + * 修改访客管理 + */ + Boolean updateByBo(ChatVisitorUsageBo bo); + + /** + * 校验并批量删除访客管理信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatVoucherService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatVoucherService.java new file mode 100644 index 0000000..ae94ca7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IChatVoucherService.java @@ -0,0 +1,53 @@ +package org.aibidding.system.service; + +import org.aibidding.system.domain.vo.ChatVoucherVo; +import org.aibidding.system.domain.bo.ChatVoucherBo; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 用户兑换记录Service接口 + * + * @author Lion Li + * @date 2024-05-03 + */ +public interface IChatVoucherService { + + /** + * 查询用户兑换记录 + */ + ChatVoucherVo queryById(Long id); + + /** + * 查询用户兑换记录列表 + */ + TableDataInfo queryPageList(ChatVoucherBo bo, PageQuery pageQuery); + + /** + * 查询用户兑换记录列表 + */ + List queryList(ChatVoucherBo bo); + + /** + * 新增用户兑换记录 + */ + Boolean insertByBo(ChatVoucherBo bo); + + /** + * 修改用户兑换记录 + */ + Boolean updateByBo(ChatVoucherBo bo); + + /** + * 校验并批量删除用户兑换记录信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 兑换卡密 + */ + Boolean redeem(ChatVoucherBo bo); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ICoverPromptAudioService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ICoverPromptAudioService.java new file mode 100644 index 0000000..1aed04b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ICoverPromptAudioService.java @@ -0,0 +1,11 @@ +package org.aibidding.system.service; + +/** + * 翻唱用户参考音频Service接口 + * + * @author NSL + * @since 2024-12-25 + */ +public interface ICoverPromptAudioService { + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ICoverService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ICoverService.java new file mode 100644 index 0000000..83f5e23 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ICoverService.java @@ -0,0 +1,49 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.vo.cover.CoverCallbackVo; +import org.aibidding.system.domain.vo.cover.CoverParamVo; +import org.aibidding.system.domain.vo.cover.CoverVo; +import org.aibidding.system.domain.vo.cover.MusicVo; + +import java.util.List; + +/** + * 翻唱Service接口 + * + * @author NSL + * @since 2024-12-25 + */ +public interface ICoverService { + + /** + * 查找歌曲 + * + * @param musicName 歌曲名称 + * @return 匹配的歌曲信息集合 + */ + List searchMusic(String musicName); + + /** + * 翻唱回调 + * + * @param coverCallbackVo 回调信息 + */ + void callback(CoverCallbackVo coverCallbackVo); + + /** + * 翻唱歌曲 + * + * @param coverParamVo 翻唱信息 + */ + void saveCoverTask(CoverParamVo coverParamVo); + + /** + * 查询用户的翻唱记录 + * + * @return 翻唱记录 + */ + TableDataInfo searchCoverRecord(PageQuery pageQuery); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IPaymentOrdersService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IPaymentOrdersService.java new file mode 100644 index 0000000..a17dfe7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IPaymentOrdersService.java @@ -0,0 +1,62 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.PaymentOrdersBo; +import org.aibidding.system.domain.request.OrderRequest; +import org.aibidding.system.domain.vo.PaymentOrdersVo; + +import java.util.Collection; +import java.util.List; + +/** + * 支付订单Service接口 + * + * @author Lion Li + * @date 2024-04-16 + */ +public interface IPaymentOrdersService { + + /** + * 查询支付订单 + */ + PaymentOrdersVo queryById(Long id); + + + /** + * 创建支付订单 + */ + PaymentOrdersBo createPayOrder(OrderRequest orderRequest); + + /** + * 修改订单状态为已支付 + * + */ + void updatePayOrder(OrderRequest orderRequest); + + + /** + * 查询支付订单列表 + */ + TableDataInfo queryPageList(PaymentOrdersBo bo, PageQuery pageQuery); + + /** + * 查询支付订单列表 + */ + List queryList(PaymentOrdersBo bo); + + /** + * 新增支付订单 + */ + Boolean insertByBo(PaymentOrdersBo bo); + + /** + * 修改支付订单 + */ + Boolean updateByBo(PaymentOrdersBo bo); + + /** + * 校验并批量删除支付订单信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IPptService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IPptService.java new file mode 100644 index 0000000..b1d37ee --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IPptService.java @@ -0,0 +1,63 @@ +package org.aibidding.system.service; + +import com.alibaba.fastjson.JSONObject; +import org.aibidding.system.domain.vo.ppt.*; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; + +/** + * AI_PPT Service接口 + * + * @author NSL + * @since 2024-12-30 + */ +public interface IPptService { + /** + * 同步流式生成 PPT + * + * @param title ppt 标题 + */ + void syncStreamGeneratePpt(String title); + + /** + * 查询 PPT 列表 + * + * @param pptQueryVo 查询参数 + */ + void selectPptList(PptAllQueryDto pptQueryVo); + + /** + * 分页查询 PPT 模板 + * @param pptQueryVo 查询参数 + */ + JSONObject getPptTemplates(PptTemplateQueryDto pptQueryVo); + + /** + * 生成大纲 + * @param generateOutlineDto 生成大纲参数 + */ + SseEmitter generateOutline(PptGenerateOutlineDto generateOutlineDto); + + /** + * 生成大纲内容 + * @param generateContentDto 生成大纲内容参数 + */ + SseEmitter generateContent(PptGenerateContentDto generateContentDto); + + /** + * 生成ppt + * @param generatePptxDto 生成PPT参数 + */ + JSONObject generatePptx(PptGeneratePptxDto generatePptxDto); + + /** + * 获取API Token + * @return 文多多Token + */ + String getApiToken(); + + /** + * 生成PPT成功回调接口 + */ + void successCallback(); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISseService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISseService.java new file mode 100644 index 0000000..b45c51b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISseService.java @@ -0,0 +1,82 @@ +package org.aibidding.system.service; + + +import jakarta.servlet.http.HttpServletRequest; +import org.aibidding.common.chat.domain.request.ChatRequest; +import org.aibidding.common.chat.domain.request.Dall3Request; +import org.aibidding.common.chat.entity.Tts.TextToSpeech; +import org.aibidding.common.chat.entity.files.UploadFileResponse; +import org.aibidding.common.chat.entity.images.Item; +import org.aibidding.common.chat.entity.whisper.WhisperResponse; +import org.aibidding.system.domain.request.translation.TranslationRequest; +import org.springframework.core.io.Resource; +import org.springframework.http.ResponseEntity; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; + +import java.util.List; + +/** + * 描述: + * + * @author https:www.unfbx.com + * @date 2023-04-08 + */ +public interface ISseService { + + /** + * 客户端发送消息到服务端 + * @param chatRequest + */ + SseEmitter sseChat(ChatRequest chatRequest,HttpServletRequest request); + + /** + * 语音转文字 + * @param file + */ + WhisperResponse speechToTextTranscriptionsV2(MultipartFile file); + + /** + * 文字转语音 + */ + ResponseEntity textToSpeed(TextToSpeech textToSpeech); + + /** + * 客户端发送消息到服务端 + * @param chatRequest + */ + String chat(ChatRequest chatRequest,String userId); + + /** + * 客户端发送消息到服务端 + */ + List wxDall(String prompt,String userId); + + /** + * 绘画接口 + * @param request + */ + List dall3(Dall3Request request); + + + UploadFileResponse upload(MultipartFile file); + + /** + * 文本翻译 + * @param + */ + String translation(TranslationRequest translationRequest); + + /** + * 调用本地模型 + * @param chatRequest + */ + SseEmitter ollamaChat(ChatRequest chatRequest); + + /** + * 企业应用回复 + * @param prompt 提示词 + * @return 回复内容 + */ + String wxCpChat(String prompt); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysConfigService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysConfigService.java new file mode 100644 index 0000000..5a1a5ab --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysConfigService.java @@ -0,0 +1,87 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.SysConfigBo; +import org.aibidding.system.domain.vo.SysConfigVo; + +import java.util.List; + +/** + * 参数配置 服务层 + * + * @author Lion Li + */ +public interface ISysConfigService { + + + TableDataInfo selectPageConfigList(SysConfigBo config, PageQuery pageQuery); + + /** + * 查询参数配置信息 + * + * @param configId 参数配置ID + * @return 参数配置信息 + */ + SysConfigVo selectConfigById(Long configId); + + /** + * 根据键名查询参数配置信息 + * + * @param configKey 参数键名 + * @return 参数键值 + */ + String selectConfigByKey(String configKey); + + /** + * 获取注册开关 + * @param tenantId 租户id + * @return true开启,false关闭 + */ + boolean selectRegisterEnabled(String tenantId); + + /** + * 查询参数配置列表 + * + * @param config 参数配置信息 + * @return 参数配置集合 + */ + List selectConfigList(SysConfigBo config); + + /** + * 新增参数配置 + * + * @param bo 参数配置信息 + * @return 结果 + */ + String insertConfig(SysConfigBo bo); + + /** + * 修改参数配置 + * + * @param bo 参数配置信息 + * @return 结果 + */ + String updateConfig(SysConfigBo bo); + + /** + * 批量删除参数信息 + * + * @param configIds 需要删除的参数ID + */ + void deleteConfigByIds(Long[] configIds); + + /** + * 重置参数缓存数据 + */ + void resetConfigCache(); + + /** + * 校验参数键名是否唯一 + * + * @param config 参数信息 + * @return 结果 + */ + boolean checkConfigKeyUnique(SysConfigBo config); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysDataScopeService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysDataScopeService.java new file mode 100644 index 0000000..b8acd61 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysDataScopeService.java @@ -0,0 +1,26 @@ +package org.aibidding.system.service; + +/** + * 通用 数据权限 服务 + * + * @author Lion Li + */ +public interface ISysDataScopeService { + + /** + * 获取角色自定义权限 + * + * @param roleId 角色id + * @return 部门id组 + */ + String getRoleCustom(Long roleId); + + /** + * 获取部门及以下权限 + * + * @param deptId 部门id + * @return 部门id组 + */ + String getDeptAndChild(Long deptId); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysDeptService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysDeptService.java new file mode 100644 index 0000000..086d7cb --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysDeptService.java @@ -0,0 +1,118 @@ +package org.aibidding.system.service; + +import cn.hutool.core.lang.tree.Tree; +import org.aibidding.system.domain.SysDept; +import org.aibidding.system.domain.bo.SysDeptBo; +import org.aibidding.system.domain.vo.SysDeptVo; + +import java.util.List; + +/** + * 部门管理 服务层 + * + * @author Lion Li + */ +public interface ISysDeptService { + /** + * 查询部门管理数据 + * + * @param dept 部门信息 + * @return 部门信息集合 + */ + List selectDeptList(SysDeptBo dept); + + /** + * 查询部门树结构信息 + * + * @param dept 部门信息 + * @return 部门树信息集合 + */ + List> selectDeptTreeList(SysDeptBo dept); + + /** + * 构建前端所需要下拉树结构 + * + * @param depts 部门列表 + * @return 下拉树结构列表 + */ + List> buildDeptTreeSelect(List depts); + + /** + * 根据角色ID查询部门树信息 + * + * @param roleId 角色ID + * @return 选中部门列表 + */ + List selectDeptListByRoleId(Long roleId); + + /** + * 根据部门ID查询信息 + * + * @param deptId 部门ID + * @return 部门信息 + */ + SysDeptVo selectDeptById(Long deptId); + + /** + * 根据ID查询所有子部门数(正常状态) + * + * @param deptId 部门ID + * @return 子部门数 + */ + long selectNormalChildrenDeptById(Long deptId); + + /** + * 是否存在部门子节点 + * + * @param deptId 部门ID + * @return 结果 + */ + boolean hasChildByDeptId(Long deptId); + + /** + * 查询部门是否存在用户 + * + * @param deptId 部门ID + * @return 结果 true 存在 false 不存在 + */ + boolean checkDeptExistUser(Long deptId); + + /** + * 校验部门名称是否唯一 + * + * @param dept 部门信息 + * @return 结果 + */ + boolean checkDeptNameUnique(SysDeptBo dept); + + /** + * 校验部门是否有数据权限 + * + * @param deptId 部门id + */ + void checkDeptDataScope(Long deptId); + + /** + * 新增保存部门信息 + * + * @param bo 部门信息 + * @return 结果 + */ + int insertDept(SysDeptBo bo); + + /** + * 修改保存部门信息 + * + * @param bo 部门信息 + * @return 结果 + */ + int updateDept(SysDeptBo bo); + + /** + * 删除部门管理信息 + * + * @param deptId 部门ID + * @return 结果 + */ + int deleteDeptById(Long deptId); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysDictDataService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysDictDataService.java new file mode 100644 index 0000000..1af302f --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysDictDataService.java @@ -0,0 +1,67 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.SysDictDataBo; +import org.aibidding.system.domain.vo.SysDictDataVo; + +import java.util.List; + +/** + * 字典 业务层 + * + * @author Lion Li + */ +public interface ISysDictDataService { + + + TableDataInfo selectPageDictDataList(SysDictDataBo dictData, PageQuery pageQuery); + + /** + * 根据条件分页查询字典数据 + * + * @param dictData 字典数据信息 + * @return 字典数据集合信息 + */ + List selectDictDataList(SysDictDataBo dictData); + + /** + * 根据字典类型和字典键值查询字典数据信息 + * + * @param dictType 字典类型 + * @param dictValue 字典键值 + * @return 字典标签 + */ + String selectDictLabel(String dictType, String dictValue); + + /** + * 根据字典数据ID查询信息 + * + * @param dictCode 字典数据ID + * @return 字典数据 + */ + SysDictDataVo selectDictDataById(Long dictCode); + + /** + * 批量删除字典数据信息 + * + * @param dictCodes 需要删除的字典数据ID + */ + void deleteDictDataByIds(Long[] dictCodes); + + /** + * 新增保存字典数据信息 + * + * @param bo 字典数据信息 + * @return 结果 + */ + List insertDictData(SysDictDataBo bo); + + /** + * 修改保存字典数据信息 + * + * @param bo 字典数据信息 + * @return 结果 + */ + List updateDictData(SysDictDataBo bo); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysDictTypeService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysDictTypeService.java new file mode 100644 index 0000000..3c3cca2 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysDictTypeService.java @@ -0,0 +1,95 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.SysDictTypeBo; +import org.aibidding.system.domain.vo.SysDictDataVo; +import org.aibidding.system.domain.vo.SysDictTypeVo; + +import java.util.List; + +/** + * 字典 业务层 + * + * @author Lion Li + */ +public interface ISysDictTypeService { + + + TableDataInfo selectPageDictTypeList(SysDictTypeBo dictType, PageQuery pageQuery); + + /** + * 根据条件分页查询字典类型 + * + * @param dictType 字典类型信息 + * @return 字典类型集合信息 + */ + List selectDictTypeList(SysDictTypeBo dictType); + + /** + * 根据所有字典类型 + * + * @return 字典类型集合信息 + */ + List selectDictTypeAll(); + + /** + * 根据字典类型查询字典数据 + * + * @param dictType 字典类型 + * @return 字典数据集合信息 + */ + List selectDictDataByType(String dictType); + + /** + * 根据字典类型ID查询信息 + * + * @param dictId 字典类型ID + * @return 字典类型 + */ + SysDictTypeVo selectDictTypeById(Long dictId); + + /** + * 根据字典类型查询信息 + * + * @param dictType 字典类型 + * @return 字典类型 + */ + SysDictTypeVo selectDictTypeByType(String dictType); + + /** + * 批量删除字典信息 + * + * @param dictIds 需要删除的字典ID + */ + void deleteDictTypeByIds(Long[] dictIds); + + /** + * 重置字典缓存数据 + */ + void resetDictCache(); + + /** + * 新增保存字典类型信息 + * + * @param bo 字典类型信息 + * @return 结果 + */ + List insertDictType(SysDictTypeBo bo); + + /** + * 修改保存字典类型信息 + * + * @param bo 字典类型信息 + * @return 结果 + */ + List updateDictType(SysDictTypeBo bo); + + /** + * 校验字典类型称是否唯一 + * + * @param dictType 字典类型 + * @return 结果 + */ + boolean checkDictTypeUnique(SysDictTypeBo dictType); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysLogininforService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysLogininforService.java new file mode 100644 index 0000000..6c29758 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysLogininforService.java @@ -0,0 +1,47 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.SysLogininforBo; +import org.aibidding.system.domain.vo.SysLogininforVo; + +import java.util.List; + +/** + * 系统访问日志情况信息 服务层 + * + * @author Lion Li + */ +public interface ISysLogininforService { + + + TableDataInfo selectPageLogininforList(SysLogininforBo logininfor, PageQuery pageQuery); + + /** + * 新增系统登录日志 + * + * @param bo 访问日志对象 + */ + void insertLogininfor(SysLogininforBo bo); + + /** + * 查询系统登录日志集合 + * + * @param logininfor 访问日志对象 + * @return 登录记录集合 + */ + List selectLogininforList(SysLogininforBo logininfor); + + /** + * 批量删除系统登录日志 + * + * @param infoIds 需要删除的登录日志ID + * @return 结果 + */ + int deleteLogininforByIds(Long[] infoIds); + + /** + * 清空系统登录日志 + */ + void cleanLogininfor(); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysMenuService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysMenuService.java new file mode 100644 index 0000000..4082236 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysMenuService.java @@ -0,0 +1,147 @@ +package org.aibidding.system.service; + +import cn.hutool.core.lang.tree.Tree; +import org.aibidding.system.domain.SysMenu; +import org.aibidding.system.domain.bo.SysMenuBo; +import org.aibidding.system.domain.vo.RouterVo; +import org.aibidding.system.domain.vo.SysMenuVo; + +import java.util.List; +import java.util.Set; + +/** + * 菜单 业务层 + * + * @author Lion Li + */ +public interface ISysMenuService { + + /** + * 根据用户查询系统菜单列表 + * + * @param userId 用户ID + * @return 菜单列表 + */ + List selectMenuList(Long userId); + + /** + * 根据用户查询系统菜单列表 + * + * @param menu 菜单信息 + * @param userId 用户ID + * @return 菜单列表 + */ + List selectMenuList(SysMenuBo menu, Long userId); + + /** + * 根据用户ID查询权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + Set selectMenuPermsByUserId(Long userId); + + /** + * 根据角色ID查询权限 + * + * @param roleId 角色ID + * @return 权限列表 + */ + Set selectMenuPermsByRoleId(Long roleId); + + /** + * 根据用户ID查询菜单树信息 + * + * @param userId 用户ID + * @return 菜单列表 + */ + List selectMenuTreeByUserId(Long userId); + + /** + * 根据角色ID查询菜单树信息 + * + * @param roleId 角色ID + * @return 选中菜单列表 + */ + List selectMenuListByRoleId(Long roleId); + + /** + * 根据租户套餐ID查询菜单树信息 + * + * @param packageId 租户套餐ID + * @return 选中菜单列表 + */ + List selectMenuListByPackageId(Long packageId); + + /** + * 构建前端路由所需要的菜单 + * + * @param menus 菜单列表 + * @return 路由列表 + */ + List buildMenus(List menus); + + /** + * 构建前端所需要下拉树结构 + * + * @param menus 菜单列表 + * @return 下拉树结构列表 + */ + List> buildMenuTreeSelect(List menus); + + /** + * 根据菜单ID查询信息 + * + * @param menuId 菜单ID + * @return 菜单信息 + */ + SysMenuVo selectMenuById(Long menuId); + + /** + * 是否存在菜单子节点 + * + * @param menuId 菜单ID + * @return 结果 true 存在 false 不存在 + */ + boolean hasChildByMenuId(Long menuId); + + /** + * 查询菜单是否存在角色 + * + * @param menuId 菜单ID + * @return 结果 true 存在 false 不存在 + */ + boolean checkMenuExistRole(Long menuId); + + /** + * 新增保存菜单信息 + * + * @param bo 菜单信息 + * @return 结果 + */ + int insertMenu(SysMenuBo bo); + + /** + * 修改保存菜单信息 + * + * @param bo 菜单信息 + * @return 结果 + */ + int updateMenu(SysMenuBo bo); + + /** + * 删除菜单管理信息 + * + * @param menuId 菜单ID + * @return 结果 + */ + int deleteMenuById(Long menuId); + + /** + * 校验菜单名称是否唯一 + * + * @param menu 菜单信息 + * @return 结果 + */ + boolean checkMenuNameUnique(SysMenuBo menu); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysModelService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysModelService.java new file mode 100644 index 0000000..466e4a2 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysModelService.java @@ -0,0 +1,54 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.SysModel; +import org.aibidding.system.domain.bo.SysModelBo; +import org.aibidding.system.domain.vo.SysModelVo; + +import java.util.Collection; +import java.util.List; + +/** + * 系统模型Service接口 + * + * @author Lion Li + * @date 2024-04-04 + */ +public interface ISysModelService { + + /** + * 查询系统模型 + */ + SysModelVo queryById(Long id); + + /** + * 查询系统模型列表 + */ + TableDataInfo queryPageList(SysModelBo bo, PageQuery pageQuery); + + /** + * 查询系统模型列表 + */ + List queryList(SysModelBo bo); + + /** + * 新增系统模型 + */ + Boolean insertByBo(SysModelBo bo); + + /** + * 修改系统模型 + */ + Boolean updateByBo(SysModelBo bo); + + /** + * 校验并批量删除系统模型信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 根据模型名称查询模型 + */ + SysModel selectModelByName(String modelName); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysNoticeService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysNoticeService.java new file mode 100644 index 0000000..b560a6c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysNoticeService.java @@ -0,0 +1,68 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.SysNotice; +import org.aibidding.system.domain.bo.SysNoticeBo; +import org.aibidding.system.domain.vo.SysNoticeVo; + +/** + * 公告 服务层 + * + * @author Lion Li + */ +public interface ISysNoticeService { + + + TableDataInfo selectPageNoticeList(SysNoticeBo notice, PageQuery pageQuery); + + + + /** + * 查询公告信息 + * + * @param noticeId 公告ID + * @return 公告信息 + */ + SysNoticeVo selectNoticeById(Long noticeId); + + /** + * 查询公告列表 + * + * @param notice 公告信息 + * @return 公告集合 + */ + SysNotice getNotice(SysNoticeBo notice); + + /** + * 新增公告 + * + * @param bo 公告信息 + * @return 结果 + */ + int insertNotice(SysNoticeBo bo); + + /** + * 修改公告 + * + * @param bo 公告信息 + * @return 结果 + */ + int updateNotice(SysNoticeBo bo); + + /** + * 删除公告信息 + * + * @param noticeId 公告ID + * @return 结果 + */ + int deleteNoticeById(Long noticeId); + + /** + * 批量删除公告信息 + * + * @param noticeIds 需要删除的公告ID + * @return 结果 + */ + int deleteNoticeByIds(Long[] noticeIds); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysNoticeStateService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysNoticeStateService.java new file mode 100644 index 0000000..2bca908 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysNoticeStateService.java @@ -0,0 +1,48 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.SysNoticeStateBo; +import org.aibidding.system.domain.vo.SysNoticeStateVo; + +import java.util.Collection; +import java.util.List; + +/** + * 用户阅读状态Service接口 + * + * @author Lion Li + * @date 2024-05-11 + */ +public interface ISysNoticeStateService { + + /** + * 查询用户阅读状态 + */ + SysNoticeStateVo queryById(Long id); + + /** + * 查询用户阅读状态列表 + */ + TableDataInfo queryPageList(SysNoticeStateBo bo, PageQuery pageQuery); + + /** + * 查询用户阅读状态列表 + */ + List queryList(SysNoticeStateBo bo); + + /** + * 新增用户阅读状态 + */ + Boolean insertByBo(SysNoticeStateBo bo); + + /** + * 修改用户阅读状态 + */ + Boolean updateByBo(SysNoticeStateBo bo); + + /** + * 校验并批量删除用户阅读状态信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysOperLogService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysOperLogService.java new file mode 100644 index 0000000..8266447 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysOperLogService.java @@ -0,0 +1,54 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.SysOperLogBo; +import org.aibidding.system.domain.vo.SysOperLogVo; + +import java.util.List; + +/** + * 操作日志 服务层 + * + * @author Lion Li + */ +public interface ISysOperLogService { + + TableDataInfo selectPageOperLogList(SysOperLogBo operLog, PageQuery pageQuery); + + /** + * 新增操作日志 + * + * @param bo 操作日志对象 + */ + void insertOperlog(SysOperLogBo bo); + + /** + * 查询系统操作日志集合 + * + * @param operLog 操作日志对象 + * @return 操作日志集合 + */ + List selectOperLogList(SysOperLogBo operLog); + + /** + * 批量删除系统操作日志 + * + * @param operIds 需要删除的操作日志ID + * @return 结果 + */ + int deleteOperLogByIds(Long[] operIds); + + /** + * 查询操作日志详细 + * + * @param operId 操作ID + * @return 操作日志对象 + */ + SysOperLogVo selectOperLogById(Long operId); + + /** + * 清空操作日志 + */ + void cleanOperLog(); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysOssConfigService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysOssConfigService.java new file mode 100644 index 0000000..548f38c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysOssConfigService.java @@ -0,0 +1,65 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.SysOssConfigBo; +import org.aibidding.system.domain.vo.SysOssConfigVo; + +import java.util.Collection; + +/** + * 对象存储配置Service接口 + * + * @author Lion Li + * @author 孤舟烟雨 + * @date 2021-08-13 + */ +public interface ISysOssConfigService { + + /** + * 初始化OSS配置 + */ + void init(); + + /** + * 查询单个 + */ + SysOssConfigVo queryById(Long ossConfigId); + + /** + * 查询列表 + */ + TableDataInfo queryPageList(SysOssConfigBo bo, PageQuery pageQuery); + + + /** + * 根据新增业务对象插入对象存储配置 + * + * @param bo 对象存储配置新增业务对象 + * @return + */ + Boolean insertByBo(SysOssConfigBo bo); + + /** + * 根据编辑业务对象修改对象存储配置 + * + * @param bo 对象存储配置编辑业务对象 + * @return + */ + Boolean updateByBo(SysOssConfigBo bo); + + /** + * 校验并删除数据 + * + * @param ids 主键集合 + * @param isValid 是否校验,true-删除前校验,false-不校验 + * @return + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 启用停用状态 + */ + int updateOssConfigStatus(SysOssConfigBo bo); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysOssService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysOssService.java new file mode 100644 index 0000000..b295f1f --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysOssService.java @@ -0,0 +1,33 @@ +package org.aibidding.system.service; + +import jakarta.servlet.http.HttpServletResponse; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.SysOssBo; +import org.aibidding.system.domain.vo.SysOssVo; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.Collection; +import java.util.List; + +/** + * 文件上传 服务层 + * + * @author Lion Li + */ +public interface ISysOssService { + + TableDataInfo queryPageList(SysOssBo sysOss, PageQuery pageQuery); + + List listByIds(Collection ossIds); + + SysOssVo getById(Long ossId); + + SysOssVo upload(MultipartFile file); + + void download(Long ossId, HttpServletResponse response) throws IOException; + + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysPackagePlanService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysPackagePlanService.java new file mode 100644 index 0000000..0a9522f --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysPackagePlanService.java @@ -0,0 +1,48 @@ +package org.aibidding.system.service; + +import org.aibidding.system.domain.vo.SysPackagePlanVo; +import org.aibidding.system.domain.bo.SysPackagePlanBo; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 套餐管理Service接口 + * + * @author Lion Li + * @date 2024-05-05 + */ +public interface ISysPackagePlanService { + + /** + * 查询套餐管理 + */ + SysPackagePlanVo queryById(Long id); + + /** + * 查询套餐管理列表 + */ + TableDataInfo queryPageList(SysPackagePlanBo bo, PageQuery pageQuery); + + /** + * 查询套餐管理列表 + */ + List queryList(SysPackagePlanBo bo); + + /** + * 新增套餐管理 + */ + Boolean insertByBo(SysPackagePlanBo bo); + + /** + * 修改套餐管理 + */ + Boolean updateByBo(SysPackagePlanBo bo); + + /** + * 校验并批量删除套餐管理信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysPermissionService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysPermissionService.java new file mode 100644 index 0000000..53a3aee --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysPermissionService.java @@ -0,0 +1,28 @@ +package org.aibidding.system.service; + +import java.util.Set; + +/** + * 用户权限处理 + * + * @author Lion Li + */ +public interface ISysPermissionService { + + /** + * 获取角色数据权限 + * + * @param userId 用户id + * @return 角色权限信息 + */ + Set getRolePermission(Long userId); + + /** + * 获取菜单数据权限 + * + * @param userId 用户id + * @return 菜单权限信息 + */ + Set getMenuPermission(Long userId); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysPostService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysPostService.java new file mode 100644 index 0000000..4f536f8 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysPostService.java @@ -0,0 +1,106 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.SysPostBo; +import org.aibidding.system.domain.vo.SysPostVo; + +import java.util.List; + +/** + * 岗位信息 服务层 + * + * @author Lion Li + */ +public interface ISysPostService { + + + TableDataInfo selectPagePostList(SysPostBo post, PageQuery pageQuery); + + /** + * 查询岗位信息集合 + * + * @param post 岗位信息 + * @return 岗位列表 + */ + List selectPostList(SysPostBo post); + + /** + * 查询所有岗位 + * + * @return 岗位列表 + */ + List selectPostAll(); + + /** + * 通过岗位ID查询岗位信息 + * + * @param postId 岗位ID + * @return 角色对象信息 + */ + SysPostVo selectPostById(Long postId); + + /** + * 根据用户ID获取岗位选择框列表 + * + * @param userId 用户ID + * @return 选中岗位ID列表 + */ + List selectPostListByUserId(Long userId); + + /** + * 校验岗位名称 + * + * @param post 岗位信息 + * @return 结果 + */ + boolean checkPostNameUnique(SysPostBo post); + + /** + * 校验岗位编码 + * + * @param post 岗位信息 + * @return 结果 + */ + boolean checkPostCodeUnique(SysPostBo post); + + /** + * 通过岗位ID查询岗位使用数量 + * + * @param postId 岗位ID + * @return 结果 + */ + long countUserPostById(Long postId); + + /** + * 删除岗位信息 + * + * @param postId 岗位ID + * @return 结果 + */ + int deletePostById(Long postId); + + /** + * 批量删除岗位信息 + * + * @param postIds 需要删除的岗位ID + * @return 结果 + */ + int deletePostByIds(Long[] postIds); + + /** + * 新增保存岗位信息 + * + * @param bo 岗位信息 + * @return 结果 + */ + int insertPost(SysPostBo bo); + + /** + * 修改保存岗位信息 + * + * @param bo 岗位信息 + * @return 结果 + */ + int updatePost(SysPostBo bo); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysRoleService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysRoleService.java new file mode 100644 index 0000000..d3fc517 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysRoleService.java @@ -0,0 +1,183 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.SysUserRole; +import org.aibidding.system.domain.bo.SysRoleBo; +import org.aibidding.system.domain.vo.SysRoleVo; + +import java.util.List; +import java.util.Set; + +/** + * 角色业务层 + * + * @author Lion Li + */ +public interface ISysRoleService { + + + TableDataInfo selectPageRoleList(SysRoleBo role, PageQuery pageQuery); + + /** + * 根据条件分页查询角色数据 + * + * @param role 角色信息 + * @return 角色数据集合信息 + */ + List selectRoleList(SysRoleBo role); + + /** + * 根据用户ID查询角色列表 + * + * @param userId 用户ID + * @return 角色列表 + */ + List selectRolesByUserId(Long userId); + + /** + * 根据用户ID查询角色权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + Set selectRolePermissionByUserId(Long userId); + + /** + * 查询所有角色 + * + * @return 角色列表 + */ + List selectRoleAll(); + + /** + * 根据用户ID获取角色选择框列表 + * + * @param userId 用户ID + * @return 选中角色ID列表 + */ + List selectRoleListByUserId(Long userId); + + /** + * 通过角色ID查询角色 + * + * @param roleId 角色ID + * @return 角色对象信息 + */ + SysRoleVo selectRoleById(Long roleId); + + /** + * 校验角色名称是否唯一 + * + * @param role 角色信息 + * @return 结果 + */ + boolean checkRoleNameUnique(SysRoleBo role); + + /** + * 校验角色权限是否唯一 + * + * @param role 角色信息 + * @return 结果 + */ + boolean checkRoleKeyUnique(SysRoleBo role); + + /** + * 校验角色是否允许操作 + * + * @param roleId 角色ID + */ + void checkRoleAllowed(Long roleId); + + /** + * 校验角色是否有数据权限 + * + * @param roleId 角色id + */ + void checkRoleDataScope(Long roleId); + + /** + * 通过角色ID查询角色使用数量 + * + * @param roleId 角色ID + * @return 结果 + */ + long countUserRoleByRoleId(Long roleId); + + /** + * 新增保存角色信息 + * + * @param bo 角色信息 + * @return 结果 + */ + int insertRole(SysRoleBo bo); + + /** + * 修改保存角色信息 + * + * @param bo 角色信息 + * @return 结果 + */ + int updateRole(SysRoleBo bo); + + /** + * 修改角色状态 + * + * @param roleId 角色ID + * @param status 角色状态 + * @return 结果 + */ + int updateRoleStatus(Long roleId, String status); + + /** + * 修改数据权限信息 + * + * @param bo 角色信息 + * @return 结果 + */ + int authDataScope(SysRoleBo bo); + + /** + * 通过角色ID删除角色 + * + * @param roleId 角色ID + * @return 结果 + */ + int deleteRoleById(Long roleId); + + /** + * 批量删除角色信息 + * + * @param roleIds 需要删除的角色ID + * @return 结果 + */ + int deleteRoleByIds(Long[] roleIds); + + /** + * 取消授权用户角色 + * + * @param userRole 用户和角色关联信息 + * @return 结果 + */ + int deleteAuthUser(SysUserRole userRole); + + /** + * 批量取消授权用户角色 + * + * @param roleId 角色ID + * @param userIds 需要取消授权的用户数据ID + * @return 结果 + */ + int deleteAuthUsers(Long roleId, Long[] userIds); + + /** + * 批量选择授权用户角色 + * + * @param roleId 角色ID + * @param userIds 需要删除的用户数据ID + * @return 结果 + */ + int insertAuthUsers(Long roleId, Long[] userIds); + + void cleanOnlineUserByRole(Long roleId); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysTenantPackageService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysTenantPackageService.java new file mode 100644 index 0000000..1e0716b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysTenantPackageService.java @@ -0,0 +1,57 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.SysTenantPackageBo; +import org.aibidding.system.domain.vo.SysTenantPackageVo; + +import java.util.Collection; +import java.util.List; + +/** + * 租户套餐Service接口 + * + * @author Michelle.Chung + */ +public interface ISysTenantPackageService { + + /** + * 查询租户套餐 + */ + SysTenantPackageVo queryById(Long packageId); + + /** + * 查询租户套餐列表 + */ + TableDataInfo queryPageList(SysTenantPackageBo bo, PageQuery pageQuery); + + /** + * 查询租户套餐已启用列表 + */ + List selectList(); + + /** + * 查询租户套餐列表 + */ + List queryList(SysTenantPackageBo bo); + + /** + * 新增租户套餐 + */ + Boolean insertByBo(SysTenantPackageBo bo); + + /** + * 修改租户套餐 + */ + Boolean updateByBo(SysTenantPackageBo bo); + + /** + * 修改套餐状态 + */ + int updatePackageStatus(SysTenantPackageBo bo); + + /** + * 校验并批量删除租户套餐信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysTenantService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysTenantService.java new file mode 100644 index 0000000..36ba859 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysTenantService.java @@ -0,0 +1,82 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.SysTenantBo; +import org.aibidding.system.domain.vo.SysTenantVo; + +import java.util.Collection; +import java.util.List; + +/** + * 租户Service接口 + * + * @author Michelle.Chung + */ +public interface ISysTenantService { + + /** + * 查询租户 + */ + SysTenantVo queryById(Long id); + + /** + * 基于租户ID查询租户 + */ + SysTenantVo queryByTenantId(String tenantId); + + /** + * 查询租户列表 + */ + TableDataInfo queryPageList(SysTenantBo bo, PageQuery pageQuery); + + /** + * 查询租户列表 + */ + List queryList(SysTenantBo bo); + + /** + * 新增租户 + */ + Boolean insertByBo(SysTenantBo bo); + + /** + * 修改租户 + */ + Boolean updateByBo(SysTenantBo bo); + + /** + * 修改租户状态 + */ + int updateTenantStatus(SysTenantBo bo); + + /** + * 校验租户是否允许操作 + */ + void checkTenantAllowed(String tenantId); + + /** + * 校验并批量删除租户信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 校验企业名称是否唯一 + */ + boolean checkCompanyNameUnique(SysTenantBo bo); + + /** + * 校验账号余额 + */ + boolean checkAccountBalance(String tenantId); + + /** + * 校验有效期 + */ + boolean checkExpireTime(String tenantId); + + /** + * 同步租户套餐 + */ + Boolean syncTenantPackage(String tenantId, String packageId); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysUserGroupService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysUserGroupService.java new file mode 100644 index 0000000..691e41c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysUserGroupService.java @@ -0,0 +1,48 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.SysUserGroupBo; +import org.aibidding.system.domain.vo.SysUserGroupVo; + +import java.util.Collection; +import java.util.List; + +/** + * 【请填写功能名称】Service接口 + * + * @author Lion Li + * @date 2024-08-03 + */ +public interface ISysUserGroupService { + + /** + * 查询【请填写功能名称】 + */ + SysUserGroupVo queryById(Long id); + + /** + * 查询【请填写功能名称】列表 + */ + TableDataInfo queryPageList(SysUserGroupBo bo, PageQuery pageQuery); + + /** + * 查询【请填写功能名称】列表 + */ + List queryList(SysUserGroupBo bo); + + /** + * 新增【请填写功能名称】 + */ + Boolean insertByBo(SysUserGroupBo bo); + + /** + * 修改【请填写功能名称】 + */ + Boolean updateByBo(SysUserGroupBo bo); + + /** + * 校验并批量删除【请填写功能名称】信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysUserModelService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysUserModelService.java new file mode 100644 index 0000000..db6235f --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysUserModelService.java @@ -0,0 +1,48 @@ +package org.aibidding.system.service; + +import org.aibidding.system.domain.vo.SysUserModelVo; +import org.aibidding.system.domain.bo.SysUserModelBo; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 【请填写功能名称】Service接口 + * + * @author Lion Li + * @date 2024-08-03 + */ +public interface ISysUserModelService { + + /** + * 查询【请填写功能名称】 + */ + SysUserModelVo queryById(Long id); + + /** + * 查询【请填写功能名称】列表 + */ + TableDataInfo queryPageList(SysUserModelBo bo, PageQuery pageQuery); + + /** + * 查询【请填写功能名称】列表 + */ + List queryList(SysUserModelBo bo); + + /** + * 新增【请填写功能名称】 + */ + Boolean insertByBo(SysUserModelBo bo); + + /** + * 修改【请填写功能名称】 + */ + Boolean updateByBo(SysUserModelBo bo); + + /** + * 校验并批量删除【请填写功能名称】信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysUserService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysUserService.java new file mode 100644 index 0000000..3cf65bc --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/ISysUserService.java @@ -0,0 +1,230 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.SysUser; +import org.aibidding.system.domain.bo.SysUserBo; +import org.aibidding.system.domain.vo.SysUserVo; + +import java.util.List; + +/** + * 用户 业务层 + * + * @author Lion Li + */ +public interface ISysUserService { + + + TableDataInfo selectPageUserList(SysUserBo user, PageQuery pageQuery); + + /** + * 根据条件分页查询用户列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + List selectUserList(SysUserBo user); + + /** + * 根据条件分页查询已分配用户角色列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + TableDataInfo selectAllocatedList(SysUserBo user, PageQuery pageQuery); + + /** + * 根据条件分页查询未分配用户角色列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + TableDataInfo selectUnallocatedList(SysUserBo user, PageQuery pageQuery); + + /** + * 通过用户名查询用户 + * + * @param userName 用户名 + * @return 用户对象信息 + */ + SysUserVo selectUserByUserName(String userName); + + /** + * 通过OpenId查询用户 + * + * @Date 2023/5/18 + * @param openId + * @return SysUserVo + **/ + SysUserVo selectUserByOpenId(String openId); + + /** + * 通过手机号查询用户 + * + * @param phonenumber 手机号 + * @return 用户对象信息 + */ + SysUserVo selectUserByPhonenumber(String phonenumber); + + /** + * 通过用户ID查询用户 + * + * @param userId 用户ID + * @return 用户对象信息 + */ + SysUserVo selectUserById(Long userId); + + /** + * 根据用户ID查询用户所属角色组 + * + * @param userName 用户名 + * @return 结果 + */ + String selectUserRoleGroup(String userName); + + /** + * 根据用户ID查询用户所属岗位组 + * + * @param userName 用户名 + * @return 结果 + */ + String selectUserPostGroup(String userName); + + /** + * 校验用户名称是否唯一 + * + * @param user 用户信息 + * @return 结果 + */ + boolean checkUserNameUnique(SysUserBo user); + + /** + * 校验手机号码是否唯一 + * + * @param user 用户信息 + * @return 结果 + */ + boolean checkPhoneUnique(SysUserBo user); + + /** + * 校验email是否唯一 + * + * @param user 用户信息 + * @return 结果 + */ + boolean checkEmailUnique(SysUserBo user); + + /** + * 校验用户是否允许操作 + * + * @param userId 用户ID + */ + void checkUserAllowed(Long userId); + + /** + * 校验用户是否有数据权限 + * + * @param userId 用户id + */ + void checkUserDataScope(Long userId); + + /** + * 新增用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + int insertUser(SysUserBo user); + + /** + * 注册用户信息 + * + * @Date 2023/5/18 + * @param user + * @param tenantId + * @return SysUser + **/ + SysUser registerUser(SysUserBo user, String tenantId); + + /** + * 修改用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + int updateUser(SysUserBo user); + + /** + * 小程序 - 修改用户信息 + * + * @param user 用户信息 + * + */ + SysUserVo updateXcxUser(SysUserBo user); + + /** + * 用户授权角色 + * + * @param userId 用户ID + * @param roleIds 角色组 + */ + void insertUserAuth(Long userId, Long[] roleIds); + + /** + * 修改用户状态 + * + * @param userId 用户ID + * @param status 帐号状态 + * @return 结果 + */ + int updateUserStatus(Long userId, String status); + + /** + * 修改用户基本信息 + * + * @param user 用户信息 + * @return 结果 + */ + int updateUserProfile(SysUserBo user); + + /** + * 修改用户头像 + * + * @param userId 用户ID + * @param avatar 头像地址 + * @return 结果 + */ + boolean updateUserAvatar(Long userId, String avatar); + + boolean updateUserName(Long userId, String nickName); + + /** + * 重置用户密码 + * + * @param userId 用户ID + * @param password 密码 + * @return 结果 + */ + + int resetUserPwd(Long userId, String password); + + + + /** + * 通过用户ID删除用户 + * + * @param userId 用户ID + * @return 结果 + */ + int deleteUserById(Long userId); + + /** + * 批量删除用户信息 + * + * @param userIds 需要删除的用户ID + * @return 结果 + */ + int deleteUserByIds(Long[] userIds); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IWxRobConfigService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IWxRobConfigService.java new file mode 100644 index 0000000..b991d88 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IWxRobConfigService.java @@ -0,0 +1,48 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.WxRobConfigBo; +import org.aibidding.system.domain.vo.WxRobConfigVo; + +import java.util.Collection; +import java.util.List; + +/** + * 机器人Service接口 + * + * @author Lion Li + * @date 2024-05-01 + */ +public interface IWxRobConfigService { + + /** + * 查询机器人 + */ + WxRobConfigVo queryById(Long id); + + /** + * 查询机器人列表 + */ + TableDataInfo queryPageList(WxRobConfigBo bo, PageQuery pageQuery); + + /** + * 查询当前用户绑定的机器人信息 + */ + List queryList(WxRobConfigBo bo); + + /** + * 新增机器人 + */ + Boolean insertByBo(WxRobConfigBo bo); + + /** + * 修改机器人 + */ + Boolean updateByBo(WxRobConfigBo bo); + + /** + * 校验并批量删除机器人信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IWxRobKeywordService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IWxRobKeywordService.java new file mode 100644 index 0000000..458e897 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IWxRobKeywordService.java @@ -0,0 +1,48 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.WxRobKeywordBo; +import org.aibidding.system.domain.vo.WxRobKeywordVo; + +import java.util.Collection; +import java.util.List; + +/** + * 【请填写功能名称】Service接口 + * + * @author Lion Li + * @date 2024-05-01 + */ +public interface IWxRobKeywordService { + + /** + * 查询【请填写功能名称】 + */ + WxRobKeywordVo queryById(Long id); + + /** + * 查询【请填写功能名称】列表 + */ + TableDataInfo queryPageList(WxRobKeywordBo bo, PageQuery pageQuery); + + /** + * 查询【请填写功能名称】列表 + */ + List queryList(WxRobKeywordBo bo); + + /** + * 新增【请填写功能名称】 + */ + Boolean insertByBo(WxRobKeywordBo bo); + + /** + * 修改【请填写功能名称】 + */ + Boolean updateByBo(WxRobKeywordBo bo); + + /** + * 校验并批量删除【请填写功能名称】信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IWxRobRelationService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IWxRobRelationService.java new file mode 100644 index 0000000..94af1cf --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/IWxRobRelationService.java @@ -0,0 +1,48 @@ +package org.aibidding.system.service; + +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.bo.WxRobRelationBo; +import org.aibidding.system.domain.vo.WxRobRelationVo; + +import java.util.Collection; +import java.util.List; + +/** + * 【请填写功能名称】Service接口 + * + * @author Lion Li + * @date 2024-05-01 + */ +public interface IWxRobRelationService { + + /** + * 查询【请填写功能名称】 + */ + WxRobRelationVo queryById(Long id); + + /** + * 查询【请填写功能名称】列表 + */ + TableDataInfo queryPageList(WxRobRelationBo bo, PageQuery pageQuery); + + /** + * 查询【请填写功能名称】列表 + */ + List queryList(WxRobRelationBo bo); + + /** + * 新增【请填写功能名称】 + */ + Boolean insertByBo(WxRobRelationBo bo); + + /** + * 修改【请填写功能名称】 + */ + Boolean updateByBo(WxRobRelationBo bo); + + /** + * 校验并批量删除【请填写功能名称】信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/SysLoginService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/SysLoginService.java new file mode 100644 index 0000000..19c76a6 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/SysLoginService.java @@ -0,0 +1,432 @@ +package org.aibidding.system.service; + +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; +import cn.binarywang.wx.miniapp.util.WxMaConfigHolder; +import cn.dev33.satoken.exception.NotLoginException; +import cn.dev33.satoken.secure.BCrypt; +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import org.aibidding.common.core.constant.Constants; +import org.aibidding.common.core.constant.GlobalConstants; +import org.aibidding.common.core.constant.TenantConstants; +import org.aibidding.common.core.domain.dto.RoleDTO; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.domain.model.VisitorLoginBody; +import org.aibidding.common.core.domain.model.VisitorLoginUser; +import org.aibidding.common.core.enums.*; +import org.aibidding.common.core.exception.user.CaptchaException; +import org.aibidding.common.core.exception.user.CaptchaExpireException; +import org.aibidding.common.core.exception.user.UserException; +import org.aibidding.common.core.service.ConfigService; +import org.aibidding.common.core.utils.*; +import org.aibidding.common.log.event.LogininforEvent; +import org.aibidding.common.redis.utils.RedisUtils; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.common.tenant.exception.TenantException; +import org.aibidding.common.tenant.helper.TenantHelper; +import org.aibidding.common.wechat.web.utils.UUIDShortUtil; +import org.aibidding.system.domain.SysUser; +import org.aibidding.system.domain.bo.SysUserBo; +import org.aibidding.system.domain.vo.LoginVo; +import org.aibidding.system.domain.vo.SysTenantVo; +import org.aibidding.system.domain.vo.SysUserVo; +import org.aibidding.system.mapper.SysUserMapper; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.common.error.WxErrorException; +import org.apache.commons.lang3.math.NumberUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.time.Duration; +import java.util.Date; +import java.util.List; +import java.util.function.Supplier; + +/** + * 登录校验方法 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Slf4j +@Service +public class SysLoginService { + + private final SysUserMapper userMapper; + private final ISysPermissionService permissionService; + private final ISysTenantService tenantService; + private final WxMaService wxMaService; + private final ISysUserService userService; + private final ConfigService configService; + @Value("${user.password.maxRetryCount}") + private Integer maxRetryCount; + + @Value("${user.password.lockTime}") + private Integer lockTime; + + /** + * 获取微信 + * @param xcxCode 获取xcxCode + */ + public String getOpenidFromCode(String xcxCode) { + try { + WxMaJscode2SessionResult sessionInfo = wxMaService.getUserService().getSessionInfo(xcxCode); + return sessionInfo.getOpenid(); + } catch (WxErrorException e) { + e.printStackTrace(); + return null; + } + } + /** + * 登录验证 + * + * @param username 用户名 + * @param password 密码 + * @param code 验证码 + * @param uuid 唯一标识 + * @return 结果 + */ + public String login(String tenantId, String username, String password, String code, String uuid) { + SysUserVo user = loadUserByUsername(tenantId, username); + checkLogin(LoginType.PASSWORD, tenantId, username, () -> !BCrypt.checkpw(password, user.getPassword())); + // 此处可根据登录用户的数据不同 自行创建 loginUser + LoginUser loginUser = buildLoginUser(user); + // 生成token + LoginHelper.loginByDevice(loginUser, DeviceType.PC); + + recordLogininfor(loginUser.getTenantId(), username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")); + recordLoginInfo(user.getUserId()); + return StpUtil.getTokenValue(); + } + + public String smsLogin(String tenantId, String phonenumber, String smsCode) { + // 校验租户 + checkTenant(tenantId); + // 通过手机号查找用户 + SysUserVo user = loadUserByPhonenumber(tenantId, phonenumber); + + checkLogin(LoginType.SMS, tenantId, user.getUserName(), () -> !validateSmsCode(tenantId, phonenumber, smsCode)); + // 此处可根据登录用户的数据不同 自行创建 loginUser + LoginUser loginUser = buildLoginUser(user); + // 生成token + LoginHelper.loginByDevice(loginUser, DeviceType.APP); + + recordLogininfor(loginUser.getTenantId(), user.getUserName(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")); + recordLoginInfo(user.getUserId()); + return StpUtil.getTokenValue(); + } + + public String emailLogin(String tenantId, String email, String emailCode) { + // 校验租户 + checkTenant(tenantId); + // 通过手机号查找用户 + SysUserVo user = loadUserByEmail(tenantId, email); + + checkLogin(LoginType.EMAIL, tenantId, user.getUserName(), () -> !validateEmailCode(tenantId, email, emailCode)); + // 此处可根据登录用户的数据不同 自行创建 loginUser + LoginUser loginUser = buildLoginUser(user); + // 生成token + LoginHelper.loginByDevice(loginUser, DeviceType.APP); + + recordLogininfor(loginUser.getTenantId(), user.getUserName(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")); + recordLoginInfo(user.getUserId()); + return StpUtil.getTokenValue(); + } + + + /** + * 游客登录 + * + * @param loginBody + * @return String + * @Date 2023/5/18 + **/ + public void visitorLogin(VisitorLoginBody loginBody) { + String openid = ""; + // PC端游客登录 + if (LoginUserType.PC.getCode().equals(loginBody.getType())) { + openid = loginBody.getCode(); + } else { + // 小程序匿名登录 + try { + WxMaJscode2SessionResult session = wxMaService.getUserService().getSessionInfo(loginBody.getCode()); + openid = session.getOpenid(); + } catch (WxErrorException e) { + log.error(e.getMessage(), e); + } finally { + // 清理ThreadLocal + WxMaConfigHolder.remove(); + } + } + } + + public LoginVo mpLogin(String openid) { + // 使用 openid 查询绑定用户 如未绑定用户 则根据业务自行处理 例如 创建默认用户 + SysUserVo user = userService.selectUserByOpenId(openid); + VisitorLoginUser loginUser = new VisitorLoginUser(); + if (ObjectUtil.isNull(user)) { + SysUserBo sysUser = new SysUserBo(); + // 改为自增 + String name = "用户" + UUIDShortUtil.generateShortUuid(); + ; + // 设置默认用户名 + sysUser.setUserName(name); + // 设置默认昵称 + sysUser.setNickName(name); + // 设置默认密码 + sysUser.setPassword(BCrypt.hashpw("123456")); + // 设置微信openId + sysUser.setOpenId(openid); + String configValue = configService.getConfigValue("mail", "amount"); + // 设置默认余额 + sysUser.setUserBalance(NumberUtils.toDouble(configValue, 1)); + // 注册用户,设置默认租户为0 + SysUser registerUser = userService.registerUser(sysUser, "0"); + + // 构建登录用户信息 + loginUser.setTenantId("0"); + loginUser.setUserId(registerUser.getUserId()); + loginUser.setUsername(registerUser.getUserName()); + loginUser.setUserType(UserType.APP_USER.getUserType()); + loginUser.setOpenid(openid); + loginUser.setNickName(registerUser.getNickName()); + + } else { + // 此处可根据登录用户的数据不同 自行创建 loginUser + loginUser.setTenantId(user.getTenantId()); + loginUser.setUserId(user.getUserId()); + loginUser.setUsername(user.getUserName()); + loginUser.setUserType(user.getUserType()); + loginUser.setNickName(user.getNickName()); + loginUser.setAvatar(user.getWxAvatar()); + loginUser.setOpenid(openid); + } + // 生成token + LoginHelper.loginByDevice(loginUser, DeviceType.XCX); + recordLogininfor(loginUser.getTenantId(), loginUser.getUsername(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")); + LoginVo loginVo = new LoginVo(); + // 生成令牌 + loginVo.setToken(StpUtil.getTokenValue()); + loginVo.setUserInfo(loginUser); + return loginVo; + } + + + /** + * 退出登录 + */ + public void logout() { + try { + LoginUser loginUser = LoginHelper.getLoginUser(); + if (TenantHelper.isEnable() && LoginHelper.isSuperAdmin()) { + // 超级管理员 登出清除动态租户 + TenantHelper.clearDynamic(); + } + StpUtil.logout(); + recordLogininfor(loginUser.getTenantId(), loginUser.getUsername(), Constants.LOGOUT, MessageUtils.message("user.logout.success")); + } catch (NotLoginException ignored) { + } + } + + /** + * 记录登录信息 + * + * @param tenantId 租户ID + * @param username 用户名 + * @param status 状态 + * @param message 消息内容 + */ + private void recordLogininfor(String tenantId, String username, String status, String message) { + LogininforEvent logininforEvent = new LogininforEvent(); + logininforEvent.setTenantId(tenantId); + logininforEvent.setUsername(username); + logininforEvent.setStatus(status); + logininforEvent.setMessage(message); + logininforEvent.setRequest(ServletUtils.getRequest()); + SpringUtils.context().publishEvent(logininforEvent); + } + + /** + * 校验短信验证码 + */ + private boolean validateSmsCode(String tenantId, String phonenumber, String smsCode) { + String code = RedisUtils.getCacheObject(GlobalConstants.CAPTCHA_CODE_KEY + phonenumber); + if (StringUtils.isBlank(code)) { + recordLogininfor(tenantId, phonenumber, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); + throw new CaptchaExpireException(); + } + return code.equals(smsCode); + } + + /** + * 校验邮箱验证码 + */ + private boolean validateEmailCode(String tenantId, String email, String emailCode) { + String code = RedisUtils.getCacheObject(GlobalConstants.CAPTCHA_CODE_KEY + email); + if (StringUtils.isBlank(code)) { + recordLogininfor(tenantId, email, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); + throw new CaptchaExpireException(); + } + return code.equals(emailCode); + } + + /** + * 校验验证码 + * + * @param username 用户名 + * @param code 验证码 + * @param uuid 唯一标识 + */ + public void validateCaptcha(String tenantId, String username, String code, String uuid) { + String verifyKey = GlobalConstants.CAPTCHA_CODE_KEY + StringUtils.defaultString(uuid, ""); + String captcha = RedisUtils.getCacheObject(verifyKey); + RedisUtils.deleteObject(verifyKey); + if (captcha == null) { + recordLogininfor(tenantId, username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")); + throw new CaptchaExpireException(); + } + if (!code.equalsIgnoreCase(captcha)) { + recordLogininfor(tenantId, username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")); + throw new CaptchaException(); + } + } + + private SysUserVo loadUserByUsername(String tenantId, String username) { + + SysUser user = userMapper.selectOne(new LambdaQueryWrapper().select(SysUser::getUserName, SysUser::getStatus).eq(TenantHelper.isEnable(), SysUser::getTenantId, tenantId).eq(SysUser::getUserName, username)); + if (ObjectUtil.isNull(user)) { + log.info("登录用户:{} 不存在.", username); + throw new UserException("user.not.exists", username); + } else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { + log.info("登录用户:{} 已被停用.", username); + throw new UserException("user.blocked", username); + } + if (TenantHelper.isEnable()) { + return userMapper.selectTenantUserByUserName(username, tenantId); + } + return userMapper.selectUserByUserName(username); + } + + private SysUserVo loadUserByPhonenumber(String tenantId, String phonenumber) { + SysUser user = userMapper.selectOne(new LambdaQueryWrapper().select(SysUser::getPhonenumber, SysUser::getStatus).eq(TenantHelper.isEnable(), SysUser::getTenantId, tenantId).eq(SysUser::getPhonenumber, phonenumber)); + if (ObjectUtil.isNull(user)) { + log.info("登录用户:{} 不存在.", phonenumber); + throw new UserException("user.not.exists", phonenumber); + } else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { + log.info("登录用户:{} 已被停用.", phonenumber); + throw new UserException("user.blocked", phonenumber); + } + if (TenantHelper.isEnable()) { + return userMapper.selectTenantUserByPhonenumber(phonenumber, tenantId); + } + return userMapper.selectUserByPhonenumber(phonenumber); + } + + private SysUserVo loadUserByEmail(String tenantId, String email) { + SysUser user = userMapper.selectOne(new LambdaQueryWrapper().select(SysUser::getPhonenumber, SysUser::getStatus).eq(TenantHelper.isEnable(), SysUser::getTenantId, tenantId).eq(SysUser::getEmail, email)); + if (ObjectUtil.isNull(user)) { + log.info("登录用户:{} 不存在.", email); + throw new UserException("user.not.exists", email); + } else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { + log.info("登录用户:{} 已被停用.", email); + throw new UserException("user.blocked", email); + } + if (TenantHelper.isEnable()) { + return userMapper.selectTenantUserByEmail(email, tenantId); + } + return userMapper.selectUserByEmail(email); + } + + /** + * 构建登录用户 + */ + private LoginUser buildLoginUser(SysUserVo user) { + LoginUser loginUser = new LoginUser(); + loginUser.setTenantId(user.getTenantId()); + loginUser.setUserId(user.getUserId()); + loginUser.setDeptId(user.getDeptId()); + loginUser.setUsername(user.getUserName()); + loginUser.setAvatar(user.getAvatar()); + loginUser.setUserType(user.getUserType()); + loginUser.setMenuPermission(permissionService.getMenuPermission(user.getUserId())); + loginUser.setRolePermission(permissionService.getRolePermission(user.getUserId())); + loginUser.setDeptName(ObjectUtil.isNull(user.getDept()) ? "" : user.getDept().getDeptName()); + List roles = BeanUtil.copyToList(user.getRoles(), RoleDTO.class); + loginUser.setRoles(roles); + return loginUser; + } + + /** + * 记录登录信息 + * + * @param userId 用户ID + */ + public void recordLoginInfo(Long userId) { + SysUser sysUser = new SysUser(); + sysUser.setUserId(userId); + sysUser.setLoginIp(ServletUtils.getClientIP()); + sysUser.setLoginDate(DateUtils.getNowDate()); + sysUser.setUpdateBy(userId); + userMapper.updateById(sysUser); + } + + /** + * 登录校验 + */ + private void checkLogin(LoginType loginType, String tenantId, String username, Supplier supplier) { + String errorKey = GlobalConstants.PWD_ERR_CNT_KEY + username; + String loginFail = Constants.LOGIN_FAIL; + + // 获取用户登录错误次数(可自定义限制策略 例如: key + username + ip) + Integer errorNumber = RedisUtils.getCacheObject(errorKey); + // 锁定时间内登录 则踢出 + if (ObjectUtil.isNotNull(errorNumber) && errorNumber.equals(maxRetryCount)) { + recordLogininfor(tenantId, username, loginFail, MessageUtils.message(loginType.getRetryLimitExceed(), maxRetryCount, lockTime)); + throw new UserException(loginType.getRetryLimitExceed(), maxRetryCount, lockTime); + } + + if (supplier.get()) { + // 是否第一次 + errorNumber = ObjectUtil.isNull(errorNumber) ? 1 : errorNumber + 1; + // 达到规定错误次数 则锁定登录 + if (errorNumber.equals(maxRetryCount)) { + RedisUtils.setCacheObject(errorKey, errorNumber, Duration.ofMinutes(lockTime)); + recordLogininfor(tenantId, username, loginFail, MessageUtils.message(loginType.getRetryLimitExceed(), maxRetryCount, lockTime)); + throw new UserException(loginType.getRetryLimitExceed(), maxRetryCount, lockTime); + } else { + // 未达到规定错误次数 则递增 + RedisUtils.setCacheObject(errorKey, errorNumber); + recordLogininfor(tenantId, username, loginFail, MessageUtils.message(loginType.getRetryLimitCount(), errorNumber)); + throw new UserException(loginType.getRetryLimitCount(), errorNumber); + } + } + + // 登录成功 清空错误次数 + RedisUtils.deleteObject(errorKey); + } + + private void checkTenant(String tenantId) { + if (!TenantHelper.isEnable()) { + return; + } + if (TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) { + return; + } + SysTenantVo tenant = tenantService.queryByTenantId(tenantId); + if (ObjectUtil.isNull(tenant)) { + log.info("登录租户:{} 不存在.", tenantId); + throw new TenantException("tenant.not.exists"); + } else if (TenantStatus.DISABLE.getCode().equals(tenant.getStatus())) { + log.info("登录租户:{} 已被停用.", tenantId); + throw new TenantException("tenant.blocked"); + } else if (ObjectUtil.isNotNull(tenant.getExpireTime()) && new Date().after(tenant.getExpireTime())) { + log.info("登录租户:{} 已超过有效期.", tenantId); + throw new TenantException("tenant.expired"); + } + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/SysRegisterService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/SysRegisterService.java new file mode 100644 index 0000000..2f64126 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/SysRegisterService.java @@ -0,0 +1,153 @@ +package org.aibidding.system.service; + +import cn.dev33.satoken.secure.BCrypt; +import lombok.RequiredArgsConstructor; +import org.apache.commons.lang3.math.NumberUtils; +import org.aibidding.common.core.constant.Constants; +import org.aibidding.common.core.constant.GlobalConstants; +import org.aibidding.common.core.domain.model.RegisterBody; +import org.aibidding.common.core.exception.base.BaseException; +import org.aibidding.common.core.exception.user.CaptchaException; +import org.aibidding.common.core.exception.user.CaptchaExpireException; +import org.aibidding.common.core.exception.user.UserException; +import org.aibidding.common.core.service.ConfigService; +import org.aibidding.common.core.utils.MessageUtils; +import org.aibidding.common.core.utils.ServletUtils; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.log.event.LogininforEvent; +import org.aibidding.common.redis.utils.RedisUtils; +import org.aibidding.system.domain.SysUser; +import org.aibidding.system.domain.SysUserRole; +import org.aibidding.system.domain.bo.SysUserBo; +import org.aibidding.system.domain.vo.SysUserVo; +import org.aibidding.system.mapper.SysUserRoleMapper; +import org.springframework.stereotype.Service; + +/** + * 注册校验方法 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysRegisterService { + + private final ISysUserService userService; + + private final SysUserRoleMapper userRoleMapper; + + private final ConfigService configService; + /** + * 注册 + */ + public void register(RegisterBody registerBody) { + + + String tenantId = Constants.TENANT_ID; + if(StringUtils.isNotBlank(registerBody.getTenantId())){ + tenantId = registerBody.getTenantId(); + } + String username = registerBody.getUsername(); + String password = registerBody.getPassword(); + + // 检查验证码是否正确 + validateEmail(username,registerBody.getCode()); + SysUserBo sysUser = new SysUserBo(); + sysUser.setDomainName(registerBody.getDomainName()); + sysUser.setUserName(username); + sysUser.setNickName(username); + sysUser.setPassword(BCrypt.hashpw(password)); + if (!userService.checkUserNameUnique(sysUser)) { + throw new UserException("添加用户失败", username); + } + String configValue = configService.getConfigValue("mail", "amount"); + + + + // 设置默认余额 + sysUser.setUserBalance(NumberUtils.toDouble(configValue,1)); + SysUser user = userService.registerUser(sysUser, tenantId); + if (user == null) { + throw new UserException("用户注册失败!"); + } + // 设置默认角色 + SysUserRole sysRole = new SysUserRole(); + sysRole.setUserId(user.getUserId()); + sysRole.setRoleId(1L); + userRoleMapper.insert(sysRole); + recordLogininfor(tenantId, username, Constants.REGISTER, MessageUtils.message("user.register.success")); + } + + /** + * 重置密码 + */ + public void resetPassWord(RegisterBody registerBody) { + String username = registerBody.getUsername(); + String password = registerBody.getPassword(); + SysUserVo user = userService.selectUserByUserName(username); + if(user == null){ + throw new UserException(String.format("用户【%s】,未注册!",username)); + } + // 检查验证码是否正确 + validateEmail(username,registerBody.getCode()); + userService.resetUserPwd(user.getUserId(),BCrypt.hashpw(password)); + } + + /** + * 校验邮箱验证码 + * + * @param username 用户名 + */ + public void validateEmail(String username,String code) { + String key = GlobalConstants.CAPTCHA_CODE_KEY + username; + String captcha = RedisUtils.getCacheObject(key); + if(code.equals(captcha)){ + RedisUtils.deleteObject(captcha); + }else { + throw new BaseException("验证码错误,请重试!"); + } + } + + + /** + * 校验验证码 + * + * @param username 用户名 + * @param code 验证码 + * @param uuid 唯一标识 + */ + public void validateCaptcha(String tenantId, String username, String code, String uuid) { + String verifyKey = GlobalConstants.CAPTCHA_CODE_KEY + StringUtils.defaultString(uuid, ""); + String captcha = RedisUtils.getCacheObject(verifyKey); + RedisUtils.deleteObject(verifyKey); + if (captcha == null) { + recordLogininfor(tenantId, username, Constants.REGISTER, MessageUtils.message("user.jcaptcha.expire")); + throw new CaptchaExpireException(); + } + if (!code.equalsIgnoreCase(captcha)) { + recordLogininfor(tenantId, username, Constants.REGISTER, MessageUtils.message("user.jcaptcha.error")); + throw new CaptchaException(); + } + } + + /** + * 记录登录信息 + * + * @param tenantId 租户ID + * @param username 用户名 + * @param status 状态 + * @param message 消息内容 + * @return + */ + private void recordLogininfor(String tenantId, String username, String status, String message) { + LogininforEvent logininforEvent = new LogininforEvent(); + logininforEvent.setTenantId(tenantId); + logininforEvent.setUsername(username); + logininforEvent.setStatus(status); + logininforEvent.setMessage(message); + logininforEvent.setRequest(ServletUtils.getRequest()); + SpringUtils.context().publishEvent(logininforEvent); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/WeixinUserService.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/WeixinUserService.java new file mode 100644 index 0000000..c83d874 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/WeixinUserService.java @@ -0,0 +1,12 @@ +package org.aibidding.system.service; + +/** + * @Author 公众号:程序猿阿朗 + */ +public interface WeixinUserService { + + void checkSignature(String signature, String timestamp, String nonce); + + String handleWeixinMsg(String body); + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatAppStoreImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatAppStoreImpl.java new file mode 100644 index 0000000..acd837a --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatAppStoreImpl.java @@ -0,0 +1,259 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.exception.base.BaseException; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.system.domain.ChatAppStore; +import org.aibidding.system.domain.bo.ChatAppStoreBo; +import org.aibidding.system.domain.vo.ChatAppStoreVo; +import org.aibidding.system.mapper.ChatAppStoreMapper; +import org.aibidding.system.request.RoleListDto; +import org.aibidding.system.request.RoleRequest; +import org.aibidding.system.request.SimpleGenerateRequest; +import org.aibidding.system.response.RoleResponse; +import org.aibidding.system.response.SimpleGenerateDataResponse; +import org.aibidding.system.response.SimpleGenerateResponse; +import org.aibidding.system.response.rolelist.ContentResponse; +import org.aibidding.system.response.rolelist.RoleListResponse; +import org.aibidding.system.response.rolelist.ChatAppStoreVO; +import org.aibidding.system.service.IChatCostService; +import org.aibidding.system.service.IChatAppStoreService; +import org.aibidding.system.util.AudioOkHttpUtil; +import org.springframework.stereotype.Service; + +import java.io.IOException; +import java.util.*; + +/** + * 应用市场Service业务层处理 + * + * @author Lion Li + * @date 2024-03-19 + */ +@RequiredArgsConstructor +@Service +@Slf4j +public class ChatAppStoreImpl implements IChatAppStoreService { + + private final ChatAppStoreMapper baseMapper; + + private final IChatCostService chatService; + + private final AudioOkHttpUtil audioOkHttpUtil; + + /** + * 查询应用市场 + */ + @Override + public ChatAppStoreVo queryById(Long id) { + return baseMapper.selectVoById(id); + } + + /** + * 查询应用市场列表 + */ + @Override + public TableDataInfo queryPageList(ChatAppStoreBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询应用市场列表 + */ + @Override + public List queryList(ChatAppStoreBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(ChatAppStoreBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getName()), ChatAppStore::getName, bo.getName()); + lqw.eq(StringUtils.isNotBlank(bo.getDescription()), ChatAppStore::getDescription, bo.getDescription()); + lqw.eq(StringUtils.isNotBlank(bo.getAvatar()), ChatAppStore::getAvatar, bo.getAvatar()); + lqw.eq(bo.getCreateBy()!=null, ChatAppStore::getCreateBy, bo.getCreateBy()); + return lqw; + } + + /** + * 新增应用市场 + */ + @Override + public Boolean insertByBo(RoleRequest roleRequest) { + try { + String prompt = convertFileToBase64(roleRequest.getPrompt()); + roleRequest.setPrompt("data:audio/x-m4a;base64," + prompt); + + String avatar = convertFileToBase64(roleRequest.getAvatar()); + roleRequest.setAvatar("data:image/png;base64," + avatar); + + } catch (IOException e) { + log.error("转换base64出现错误:{}", e.getMessage()); + } + // 创建一个Request对象来配置你的请求 + String json = JSONUtil.toJsonStr(roleRequest); + Request postRequest = audioOkHttpUtil.createPostRequest("api/tts/voice", json); + String body = audioOkHttpUtil.executeRequest(postRequest); + RoleResponse bean = JSONUtil.toBean(body, RoleResponse.class); + ChatAppStore addVoiceRole = new ChatAppStore(); + addVoiceRole.setName(roleRequest.getName()); + addVoiceRole.setDescription(roleRequest.getDescription()); + addVoiceRole.setAvatar(bean.getData().getMetadata().getAvatar()); + + return baseMapper.insert(addVoiceRole) > 0; + } + + private static String convertFileToBase64(String fileUrl) throws IOException { + OkHttpClient client = new OkHttpClient(); + Request request = new Request.Builder().url(fileUrl).build(); + Response response = client.newCall(request).execute(); + if (!response.isSuccessful()) throw new IOException("Failed to download file: " + response); + byte[] fileData = response.body().bytes(); + return Base64.getEncoder().encodeToString(fileData); + } + + /** + * 修改应用市场 + */ + @Override + public Boolean updateByBo(ChatAppStoreBo bo) { + ChatAppStore update = MapstructUtils.convert(bo, ChatAppStore.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(ChatAppStore entity) { + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除应用市场 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if (isValid) { + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } + + /** + * 实时生成语音 + * + * @param simpleGenerateRequest 生成语音对象 + * @return 生成的语音信息 + */ + @Override + public SimpleGenerateDataResponse simpleGenerate(SimpleGenerateRequest simpleGenerateRequest) { + double charge = calculateCharge(simpleGenerateRequest.getText()); + // 扣除费用并且保存消息记录 + chatService.taskDeduct(simpleGenerateRequest.getModel(), simpleGenerateRequest.getText(), charge); + // 创建一个Request对象来配置你的请求 + String json = JSONUtil.toJsonStr(simpleGenerateRequest); + Request postRequest = audioOkHttpUtil.createPostRequest("api/tts/simple-generate", json); + String body = audioOkHttpUtil.executeRequest(postRequest); + SimpleGenerateResponse bean = JSONUtil.toBean(body, SimpleGenerateResponse.class); + return bean.getData(); + } + + /** + * 查询市场角色 + * + * @return 角色列表 + */ + @Override + public List roleList() { + Request postRequest = audioOkHttpUtil.createGetRequest("api/tts/voice"); + String body = audioOkHttpUtil.executeRequest(postRequest); + RoleListResponse bean = JSONUtil.toBean(body, RoleListResponse.class); + List roleList = new ArrayList<>(); + for (ContentResponse element : bean.getData()) { + String name = element.getName(); + String description = element.getMetadata().getDescription(); + String voicesId = element.getId(); + String avatar = element.getMetadata().getAvatar(); + String previewAudio; + if (element.getMetadata().getPrompts() == null) { + // 从JSON中解析出的数据没有prompts + previewAudio = element.getMetadata().getPreviewAudio(); + } else { + previewAudio = element.getMetadata().getPrompts().get(0).getPromptOriginAudioStorageUrl(); + } + //roleList.add(new ChatAppStoreVO()); + } + return roleList; + + } + + /** + * 收藏市场角色 + */ + @Override + public void copyRole(RoleListDto roleListDto) { + // 保存至数据库 + ChatAppStore voiceRole = new ChatAppStore(); + voiceRole.setName(roleListDto.getName()); + voiceRole.setDescription(roleListDto.getDescription()); + voiceRole.setAvatar(roleListDto.getAvatar()); + baseMapper.insert(voiceRole); + } + + /** + * 根据文本长度计算扣除的金额。 + * + * @param text 输入的文本 + * @return 扣除的金额 + */ + public static double calculateCharge(String text) { + if (text == null || text.isEmpty()) { + return 0.0; + } + + int length = text.length(); + double charge = 0.0; + + while (length > 0) { + if (length >= 500) { + // 对于每500个字符,扣除0.5元 + charge += (length / 500) * 0.5; + length %= 500; // 处理剩余字符 + } else if (length >= 100) { + // 对于100到499个字符,扣除0.2元 + charge += 0.2; + break; // 处理完毕,退出循环 + } else { + // 对于少于100个字符,扣除0.1元 + charge += 0.1; + break; // 处理完毕,退出循环 + } + } + return charge; + } + + public Long getUserId() { + LoginUser loginUser = LoginHelper.getLoginUser(); + if (loginUser == null) { + throw new BaseException("用户未登录!"); + } + return loginUser.getUserId(); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatConfigServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatConfigServiceImpl.java new file mode 100644 index 0000000..5ba0abc --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatConfigServiceImpl.java @@ -0,0 +1,159 @@ +package org.aibidding.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.event.ConfigChangeEvent; +import org.aibidding.common.core.service.ConfigService; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.ChatConfig; +import org.aibidding.system.domain.bo.ChatConfigBo; +import org.aibidding.system.domain.vo.ChatConfigVo; +import org.aibidding.system.mapper.ChatConfigMapper; +import org.aibidding.system.service.IChatConfigService; +import org.springframework.context.ApplicationEventPublisher; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.List; + +/** + * 对话配置信息 +Service业务层处理 + * + * @author Lion Li + * @date 2024-04-13 + */ +@RequiredArgsConstructor +@Service +@Slf4j +public class ChatConfigServiceImpl implements IChatConfigService, ConfigService { + + private final ChatConfigMapper baseMapper; + + private final ApplicationEventPublisher eventPublisher; + + /** + * 查询对话配置信息 + + */ + @Override + public ChatConfigVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询对话配置信息列表 + */ + @Override + public TableDataInfo queryPageList(ChatConfigBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询对话配置信息列表 + */ + @Override + public List queryList(ChatConfigBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(ChatConfigBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getCategory()), ChatConfig::getCategory, bo.getCategory()); + lqw.like(StringUtils.isNotBlank(bo.getConfigName()), ChatConfig::getConfigName, bo.getConfigName()); + lqw.eq(StringUtils.isNotBlank(bo.getConfigValue()), ChatConfig::getConfigValue, bo.getConfigValue()); + return lqw; + } + + /** + * 新增对话配置信息 + + */ + @Override + public Boolean insertByBo(ChatConfigBo bo) { + ChatConfig add = MapstructUtils.convert(bo, ChatConfig.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改对话配置信息 + + */ + @Override + public Boolean updateByBo(ChatConfigBo bo) { + ChatConfig update = MapstructUtils.convert(bo, ChatConfig.class); + validEntityBeforeSave(update); + // 更新配置信息(类型区分) + eventPublisher.publishEvent(new ConfigChangeEvent(this)); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(ChatConfig entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除对话配置信息 + + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } + + /** + * 根据配置类型和配置key获取值 + * + * @param category + * @param configKey + * @return + */ + @Override + public String getConfigValue(String category,String configKey) { + ChatConfigBo bo = new ChatConfigBo(); + bo.setCategory(category); + bo.setConfigName(configKey); + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + ChatConfigVo chatConfigVo = baseMapper.selectVoOne(lqw); + if(chatConfigVo != null){ + return chatConfigVo.getConfigValue(); + }else { + return ""; + } + } + + /** + * 根据配置类型和配置key获取值 + * + * @param category + * @return + */ + @Override + public List getSysConfigValue(String category) { + ChatConfigBo bo = new ChatConfigBo(); + bo.setCategory(category); + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatCostServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatCostServiceImpl.java new file mode 100644 index 0000000..5dd00c7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatCostServiceImpl.java @@ -0,0 +1,161 @@ +package org.aibidding.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.exception.base.BaseException; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.system.domain.ChatToken; +import org.aibidding.system.domain.SysUser; +import org.aibidding.system.domain.bo.ChatMessageBo; +import org.aibidding.system.domain.bo.SysModelBo; +import org.aibidding.system.domain.vo.SysModelVo; +import org.aibidding.system.mapper.SysUserMapper; +import org.aibidding.system.service.IChatCostService; +import org.aibidding.system.service.IChatMessageService; +import org.aibidding.system.service.IChatTokenService; +import org.aibidding.system.service.ISysModelService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author hncboy + * @date 2023/3/22 19:41 + * 聊天相关业务实现类 + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class ChatCostServiceImpl implements IChatCostService { + + private final SysUserMapper sysUserMapper; + + private final IChatMessageService chatMessageService; + + private final IChatTokenService chatTokenService; + + private final ISysModelService sysModelService; + + /** + * 根据消耗的tokens扣除余额 + * + * @param chatMessageBo + */ + public void deductToken(ChatMessageBo chatMessageBo) { + // 计算总token数 + ChatToken chatToken = chatTokenService.queryByUserId(chatMessageBo.getUserId(), chatMessageBo.getModelName()); + if (chatToken == null) { + chatToken = new ChatToken(); + chatToken.setToken(0); + } + int totalTokens = chatToken.getToken() + chatMessageBo.getTotalTokens(); + // 如果总token数大于等于1000,进行费用扣除 + if (totalTokens >= 1000) { + // 计算费用 + int token1 = totalTokens / 1000; + int token2 = totalTokens % 1000; + if (token2 > 0) { + // 保存剩余tokens + chatToken.setModelName(chatMessageBo.getModelName()); + chatToken.setUserId(chatMessageBo.getUserId()); + chatToken.setToken(token2); + chatTokenService.editToken(chatToken); + } else { + chatTokenService.resetToken(chatMessageBo.getUserId(), chatMessageBo.getModelName()); + } + // 扣除用户余额 + SysModelBo sysModelBo = new SysModelBo(); + sysModelBo.setModelName(chatMessageBo.getModelName()); + List sysModelList = sysModelService.queryList(sysModelBo); + double modelPrice = sysModelList.get(0).getModelPrice(); + Double numberCost = token1 * modelPrice; + deductUserBalance(chatMessageBo.getUserId(), numberCost); + chatMessageBo.setDeductCost(numberCost); + } else { + // 扣除用户余额 + deductUserBalance(chatMessageBo.getUserId(), 0.0); + chatMessageBo.setDeductCost(0d); + chatMessageBo.setRemark("不满1kToken,计入下一次!"); + chatToken.setToken(totalTokens); + chatToken.setModelName(chatMessageBo.getModelName()); + chatToken.setUserId(chatMessageBo.getUserId()); + chatTokenService.editToken(chatToken); + } + // 保存消息记录 + chatMessageService.insertByBo(chatMessageBo); + } + + + + /** + * 从用户余额中扣除费用 + * + * @param userId 用户ID + * @param numberCost 要扣除的费用 + */ + @Override + public void deductUserBalance(Long userId, Double numberCost) { + SysUser sysUser = sysUserMapper.selectById(userId); + if (sysUser == null) { + return; + } + + Double userBalance = sysUser.getUserBalance(); + if (userBalance < numberCost || userBalance == 0) { + throw new ServiceException("余额不足, 请充值"); + } + sysUserMapper.update(null, + new LambdaUpdateWrapper() + .set(SysUser::getUserBalance, Math.max(userBalance - numberCost, 0)) + .eq(SysUser::getUserId, userId)); + } + + + + /** + * 扣除任务费用 + * + */ + @Override + public void taskDeduct(String type,String prompt, double cost) { + // 判断用户是否付费 + checkUserGrade(); + // 扣除费用 + deductUserBalance(getUserId(), cost); + // 保存消息记录 + ChatMessageBo chatMessageBo = new ChatMessageBo(); + chatMessageBo.setUserId(getUserId()); + chatMessageBo.setModelName(type); + chatMessageBo.setContent(prompt); + chatMessageBo.setDeductCost(cost); + chatMessageBo.setTotalTokens(0); + chatMessageService.insertByBo(chatMessageBo); + } + + /** + * 判断用户是否付费 + */ + @Override + public void checkUserGrade() { + SysUser sysUser = sysUserMapper.selectById(getUserId()); + if("0".equals(sysUser.getUserGrade())){ + throw new BaseException("This model is currently unavailable for free users. Please make any amount of deposit to access."); + } + } + + /** + * 获取用户Id + * + * @return + */ + public Long getUserId() { + LoginUser loginUser = LoginHelper.getLoginUser(); + if (loginUser == null) { + throw new BaseException("用户未登录!"); + } + return loginUser.getUserId(); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatGptsServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatGptsServiceImpl.java new file mode 100644 index 0000000..18ea743 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatGptsServiceImpl.java @@ -0,0 +1,118 @@ +package org.aibidding.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.ChatGpts; +import org.aibidding.system.domain.bo.ChatGptsBo; +import org.aibidding.system.domain.vo.ChatGptsVo; +import org.aibidding.system.mapper.ChatGptsMapper; +import org.aibidding.system.service.IChatGptsService; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * gpts管理Service业务层处理 + * + * @author Lion Li + * @date 2024-07-09 + */ +@RequiredArgsConstructor +@Service +public class ChatGptsServiceImpl implements IChatGptsService { + + private final ChatGptsMapper baseMapper; + + /** + * 查询gpts管理 + */ + @Override + public ChatGptsVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询gpts管理列表 + */ + @Override + public TableDataInfo queryPageList(ChatGptsBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询gpts管理列表 + */ + @Override + public List queryList(ChatGptsBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(ChatGptsBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getGid()), ChatGpts::getGid, bo.getGid()); + lqw.like(StringUtils.isNotBlank(bo.getName()), ChatGpts::getName, bo.getName()); + lqw.eq(StringUtils.isNotBlank(bo.getLogo()), ChatGpts::getLogo, bo.getLogo()); + lqw.eq(StringUtils.isNotBlank(bo.getInfo()), ChatGpts::getInfo, bo.getInfo()); + lqw.eq(StringUtils.isNotBlank(bo.getAuthorId()), ChatGpts::getAuthorId, bo.getAuthorId()); + lqw.like(StringUtils.isNotBlank(bo.getAuthorName()), ChatGpts::getAuthorName, bo.getAuthorName()); + lqw.eq(StringUtils.isNotBlank(bo.getUseCnt()), ChatGpts::getUseCnt, bo.getUseCnt()); + lqw.eq(StringUtils.isNotBlank(bo.getBad()), ChatGpts::getBad, bo.getBad()); + lqw.eq(StringUtils.isNotBlank(bo.getType()), ChatGpts::getType, bo.getType()); + lqw.eq(StringUtils.isNotBlank(bo.getUpdateIp()), ChatGpts::getUpdateIp, bo.getUpdateIp()); + return lqw; + } + + /** + * 新增gpts管理 + */ + @Override + public Boolean insertByBo(ChatGptsBo bo) { + ChatGpts add = MapstructUtils.convert(bo, ChatGpts.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改gpts管理 + */ + @Override + public Boolean updateByBo(ChatGptsBo bo) { + ChatGpts update = MapstructUtils.convert(bo, ChatGpts.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(ChatGpts entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除gpts管理 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatMessageServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatMessageServiceImpl.java new file mode 100644 index 0000000..325e086 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatMessageServiceImpl.java @@ -0,0 +1,144 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.ChatMessage; +import org.aibidding.system.domain.SysUser; +import org.aibidding.system.domain.bo.ChatMessageBo; +import org.aibidding.system.domain.vo.ChatMessageVo; +import org.aibidding.system.domain.vo.SysUserVo; +import org.aibidding.system.mapper.ChatMessageMapper; +import org.aibidding.system.mapper.SysUserMapper; +import org.aibidding.system.service.IChatMessageService; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 聊天消息Service业务层处理 + * + * @author Lion Li + * @date 2023-11-26 + */ +@RequiredArgsConstructor +@Service +public class ChatMessageServiceImpl implements IChatMessageService { + + private final ChatMessageMapper baseMapper; + + private final SysUserMapper sysUserMapper; + /** + * 查询聊天消息 + */ + @Override + public ChatMessageVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询聊天消息列表 + */ + @Override + public TableDataInfo queryPageList(ChatMessageBo bo, PageQuery pageQuery) { + // 根据用户名称查询用户 + if(StringUtils.isNotEmpty(bo.getUserName())){ + SysUserVo sysUserVo = sysUserMapper.selectUserByUserName(bo.getUserName()); + bo.setUserId(sysUserVo.getUserId()); + } + + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + if(CollectionUtil.isEmpty(result.getRecords())){ + return TableDataInfo.build(result); + } + List userIds = result.getRecords().stream() + .map(ChatMessageVo::getUserId) + .collect(Collectors.toList()); + // 一次性查询所有userName + Map userIdToUserNameMap = getUserNamesByUserIds(userIds); + // 设置userName + result.getRecords().forEach(chatMessageVo -> { + chatMessageVo.setUserName(userIdToUserNameMap.get(chatMessageVo.getUserId())); + }); + return TableDataInfo.build(result); + } + + private Map getUserNamesByUserIds(List userIds) { + // 实现批量查询userName的逻辑,例如通过sysUserMapper查询sys_user表 + List sysUsers = sysUserMapper.selectBatchIds(userIds); + return sysUsers.stream() + .collect(Collectors.toMap(SysUser::getUserId, SysUser::getUserName)); + } + + /** + * 查询聊天消息列表 + */ + @Override + public List queryList(ChatMessageBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(ChatMessageBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(bo.getUserId() != null, ChatMessage::getUserId, bo.getUserId()); + lqw.eq(StringUtils.isNotBlank(bo.getContent()), ChatMessage::getContent, bo.getContent()); + lqw.eq(bo.getDeductCost() != null, ChatMessage::getDeductCost, bo.getDeductCost()); + lqw.eq(bo.getTotalTokens() != null, ChatMessage::getTotalTokens, bo.getTotalTokens()); + lqw.like(StringUtils.isNotBlank(bo.getModelName()), ChatMessage::getModelName, bo.getModelName()); + return lqw; + } + + /** + * 新增聊天消息 + */ + @Override + public Boolean insertByBo(ChatMessageBo bo) { + ChatMessage add = MapstructUtils.convert(bo, ChatMessage.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改聊天消息 + */ + @Override + public Boolean updateByBo(ChatMessageBo bo) { + ChatMessage update = MapstructUtils.convert(bo, ChatMessage.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(ChatMessage entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除聊天消息 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatTokenServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatTokenServiceImpl.java new file mode 100644 index 0000000..f579c32 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatTokenServiceImpl.java @@ -0,0 +1,55 @@ +package org.aibidding.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import org.aibidding.system.domain.ChatToken; +import org.aibidding.system.mapper.ChatTokenMapper; +import org.aibidding.system.service.IChatTokenService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +/** + * 聊天消息Service业务层处理 + * + * @author Lion Li + * @date 2023-11-26 + */ +@RequiredArgsConstructor +@Service +public class ChatTokenServiceImpl implements IChatTokenService { + + private final ChatTokenMapper baseMapper; + + @Override + public ChatToken queryByUserId(Long userId,String modelName) { + return baseMapper.selectOne( + new LambdaQueryWrapper() + .eq(ChatToken::getUserId, userId) + .eq(ChatToken::getModelName, modelName) + .last("limit 1") + ); + } + + /** + * 清空用户token + * + */ + @Override + public void resetToken(Long userId,String modelName) { + ChatToken chatToken = queryByUserId(userId, modelName); + chatToken.setToken(0); + baseMapper.updateById(chatToken); + } + + /** + * 增加用户token + * + */ + @Override + public void editToken(ChatToken chatToken) { + if(chatToken.getId() == null){ + baseMapper.insert(chatToken); + }else { + baseMapper.updateById(chatToken); + } + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatVisitorUsageServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatVisitorUsageServiceImpl.java new file mode 100644 index 0000000..59c3408 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatVisitorUsageServiceImpl.java @@ -0,0 +1,112 @@ +package org.aibidding.system.service.impl; + +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.aibidding.system.domain.bo.ChatVisitorUsageBo; +import org.aibidding.system.domain.vo.ChatVisitorUsageVo; +import org.aibidding.system.domain.ChatVisitorUsage; +import org.aibidding.system.mapper.ChatVisitorUsageMapper; +import org.aibidding.system.service.IChatVisitorUsageService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 访客管理Service业务层处理 + * + * @author Lion Li + * @date 2024-07-14 + */ +@RequiredArgsConstructor +@Service +public class ChatVisitorUsageServiceImpl implements IChatVisitorUsageService { + + private final ChatVisitorUsageMapper baseMapper; + + /** + * 查询访客管理 + */ + @Override + public ChatVisitorUsageVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询访客管理列表 + */ + @Override + public TableDataInfo queryPageList(ChatVisitorUsageBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询访客管理列表 + */ + @Override + public List queryList(ChatVisitorUsageBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(ChatVisitorUsageBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getFingerprint()), ChatVisitorUsage::getFingerprint, bo.getFingerprint()); + lqw.eq(StringUtils.isNotBlank(bo.getUsageCount()), ChatVisitorUsage::getUsageCount, bo.getUsageCount()); + lqw.eq(StringUtils.isNotBlank(bo.getIpAddress()), ChatVisitorUsage::getIpAddress, bo.getIpAddress()); + lqw.eq(StringUtils.isNotBlank(bo.getUpdateIp()), ChatVisitorUsage::getUpdateIp, bo.getUpdateIp()); + return lqw; + } + + /** + * 新增访客管理 + */ + @Override + public Boolean insertByBo(ChatVisitorUsageBo bo) { + ChatVisitorUsage add = MapstructUtils.convert(bo, ChatVisitorUsage.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改访客管理 + */ + @Override + public Boolean updateByBo(ChatVisitorUsageBo bo) { + ChatVisitorUsage update = MapstructUtils.convert(bo, ChatVisitorUsage.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(ChatVisitorUsage entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除访客管理 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatVoucherServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatVoucherServiceImpl.java new file mode 100644 index 0000000..f9b77e2 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/ChatVoucherServiceImpl.java @@ -0,0 +1,180 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.system.domain.SysUser; +import org.aibidding.system.domain.bo.SysUserBo; +import org.aibidding.system.domain.vo.SysUserVo; +import org.aibidding.system.mapper.SysUserMapper; +import org.aibidding.system.service.ISysUserService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.aibidding.system.domain.bo.ChatVoucherBo; +import org.aibidding.system.domain.vo.ChatVoucherVo; +import org.aibidding.system.domain.ChatVoucher; +import org.aibidding.system.mapper.ChatVoucherMapper; +import org.aibidding.system.service.IChatVoucherService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; +import java.util.stream.Collectors; + +/** + * 用户兑换记录Service业务层处理 + * + * @author Lion Li + * @date 2024-05-03 + */ +@RequiredArgsConstructor +@Service +public class ChatVoucherServiceImpl implements IChatVoucherService { + + private final ChatVoucherMapper baseMapper; + + private final ISysUserService sysUserService; + + private final SysUserMapper sysUserMapper; + + /** + * 查询用户兑换记录 + */ + @Override + public ChatVoucherVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询用户兑换记录列表 + */ + @Override + public TableDataInfo queryPageList(ChatVoucherBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + if(CollectionUtil.isEmpty(result.getRecords())){ + return TableDataInfo.build(result); + } + // 获取所有userId + List userIds = result.getRecords().stream() + .map(ChatVoucherVo::getUserId) + .collect(Collectors.toList()); + // 一次性查询所有userName + Map userIdToUserNameMap = getUserNamesByUserIds(userIds); + // 设置userName + result.getRecords().forEach(chatVoucherVo -> { + chatVoucherVo.setUserName(userIdToUserNameMap.get(chatVoucherVo.getUserId())); + }); + return TableDataInfo.build(result); + } + + private Map getUserNamesByUserIds(List userIds) { + // 实现批量查询userName的逻辑,例如通过sysUserMapper查询sys_user表 + List sysUsers = sysUserMapper.selectBatchIds(userIds); + return sysUsers.stream() + .collect(Collectors.toMap(SysUser::getUserId, SysUser::getUserName)); + } + + /** + * 查询用户兑换记录列表 + */ + @Override + public List queryList(ChatVoucherBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(ChatVoucherBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(bo.getUserId() != null, ChatVoucher::getUserId, bo.getUserId()); + lqw.eq(StringUtils.isNotBlank(bo.getCode()), ChatVoucher::getCode, bo.getCode()); + lqw.eq(bo.getAmount() != null, ChatVoucher::getAmount, bo.getAmount()); + lqw.eq(StringUtils.isNotBlank(bo.getStatus()), ChatVoucher::getStatus, bo.getStatus()); + return lqw; + } + + /** + * 新增用户兑换记录 + */ + @Override + public Boolean insertByBo(ChatVoucherBo bo) { + ChatVoucher add = MapstructUtils.convert(bo, ChatVoucher.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改用户兑换记录 + */ + @Override + public Boolean updateByBo(ChatVoucherBo bo) { + ChatVoucher update = MapstructUtils.convert(bo, ChatVoucher.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(ChatVoucher entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除用户兑换记录 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } + + /** + * 兑换卡密 + * + * @param bo 卡密信息 + */ + @Override + public Boolean redeem(ChatVoucherBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getCode()), ChatVoucher::getCode, bo.getCode()); + ChatVoucherVo chatVoucherVo = baseMapper.selectVoOne(lqw); + if(chatVoucherVo != null){ + // 如果卡密已经兑换 + if("2".equals(chatVoucherVo.getStatus())){ + return false; + } + SysUserVo sysUserVo = sysUserService.selectUserById(LoginHelper.getLoginUser().getUserId()); + // 更新卡密记录 + chatVoucherVo.setUserId(LoginHelper.getLoginUser().getUserId()); + chatVoucherVo.setStatus("2"); + chatVoucherVo.setBalanceBefore(sysUserVo.getUserBalance()); + chatVoucherVo.setBalanceAfter(sysUserVo.getUserBalance()+chatVoucherVo.getAmount()); + // 添加用户余额 + sysUserVo.setUserBalance(sysUserVo.getUserBalance() + chatVoucherVo.getAmount()); + SysUserBo user = new SysUserBo(); + BeanUtil.copyProperties(sysUserVo,user); + sysUserService.updateUser(user); + + ChatVoucher update = MapstructUtils.convert(chatVoucherVo, ChatVoucher.class); + baseMapper.updateById(update); + }else { + return false; + } + return true; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/CoverPromptAudioServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/CoverPromptAudioServiceImpl.java new file mode 100644 index 0000000..5e483a5 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/CoverPromptAudioServiceImpl.java @@ -0,0 +1,22 @@ +package org.aibidding.system.service.impl; + +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.aibidding.system.mapper.CoverPromptAudioMapper; +import org.aibidding.system.service.ICoverPromptAudioService; +import org.springframework.stereotype.Service; + +/** + * 翻唱用户参考音频Service业务层处理 + * + * @author NSL + * @since 2024-12-25 + */ +@Service +@Slf4j +public class CoverPromptAudioServiceImpl implements ICoverPromptAudioService { + + @Resource + private CoverPromptAudioMapper coverPromptAudioMapper; + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/CoverServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/CoverServiceImpl.java new file mode 100644 index 0000000..ca643e8 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/CoverServiceImpl.java @@ -0,0 +1,134 @@ +package org.aibidding.system.service.impl; + +import cn.dev33.satoken.exception.NotLoginException; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.lang.TypeReference; +import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Request; +import org.apache.commons.lang3.math.NumberUtils; +import org.aibidding.common.core.exception.base.BaseException; +import org.aibidding.common.core.service.ConfigService; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.wechat.itchat4j.utils.enums.ResultEnum; +import org.aibidding.system.cofing.OkHttpConfig; +import org.aibidding.system.domain.Cover; +import org.aibidding.system.domain.CoverPromptAudio; +import org.aibidding.system.domain.model.ApiResult; +import org.aibidding.system.domain.vo.cover.*; +import org.aibidding.system.mapper.CoverMapper; +import org.aibidding.system.mapper.CoverPromptAudioMapper; +import org.aibidding.system.service.IChatCostService; +import org.aibidding.system.service.ICoverService; +import org.aibidding.system.util.WeChatScanHttpUtil; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static org.aibidding.common.satoken.utils.LoginHelper.getLoginUser; + +/** + * 翻唱Service业务层处理 + * + * @author NSL + * @since 2024-12-25 + */ +@RequiredArgsConstructor +@Service +@Slf4j +public class CoverServiceImpl implements ICoverService { + + private final CoverMapper coverMapper; + private final CoverPromptAudioMapper coverPromptAudioMapper; + private final ConfigService configService; + private final IChatCostService chatCostService; + private final WeChatScanHttpUtil weChatScanHttpUtil; + private final OkHttpConfig okHttpConfig; + + @Override + public List searchMusic(String musicName) { + Map queryMap = new HashMap<>(); + queryMap.put("keyword", musicName); + String json = JSONUtil.toJsonStr(queryMap); + Request postRequest = weChatScanHttpUtil.createPostRequest(getKey("search_music_url"), json); + String body = weChatScanHttpUtil.executeRequest(postRequest); + ApiResult apiResult = JSONUtil.toBean(body, ApiResult.class); + Object data = apiResult.getData(); + Map> userMap = JSONUtil.toBean(JSONUtil.toJsonStr(data), new TypeReference<>() {}, true); + return userMap.get("musicList"); + } + + @Override + public void callback(CoverCallbackVo coverCallbackVo) { + Cover cover = BeanUtil.copyProperties(coverCallbackVo, Cover.class); + coverMapper.insertOrUpdate(cover); + } + + @Override + public void saveCoverTask(CoverParamVo coverParamVo) { + Long userId = null; + try { + userId = getLoginUser().getUserId(); + } catch (Exception e) { + throw new NotLoginException(NotLoginException.NOT_TOKEN_MESSAGE, NotLoginException.NOT_TOKEN, NotLoginException.NOT_TOKEN); + } + List promptAudioUrl = coverParamVo.getPromptAudioUrl(); + Cover cover = BeanUtil.copyProperties(coverParamVo, Cover.class); + cover.setUserId(userId); + coverMapper.insertOrUpdate(cover); + if (CollUtil.isEmpty(promptAudioUrl)) { + // 查询用户最近一次翻唱记录 + List coverPromptAudioVoList = coverPromptAudioMapper.selectLatestVoByUserId(userId); + if (CollUtil.isEmpty(coverPromptAudioVoList)) { + throw new BaseException("未查询到翻唱记录,请上传参考音频!"); + } + List promptAudioUrlList = coverPromptAudioVoList.stream().map(CoverPromptAudioVo::getPromptAudioUrl).collect(Collectors.toList()); + coverParamVo.setPromptAudioUrl(promptAudioUrlList); + } else { + // 保存用户翻唱记录 + for (String audioUrl : promptAudioUrl) { + CoverPromptAudio coverPromptAudio = new CoverPromptAudio(); + coverPromptAudio.setPromptAudioUrl(audioUrl); + coverPromptAudio.setUserId(userId); + coverPromptAudio.setCoverId(cover.getId()); + coverPromptAudioMapper.insertOrUpdate(coverPromptAudio); + } + } + coverParamVo.setUserId(String.valueOf(userId)); + coverParamVo.setOrderId(String.valueOf(cover.getId())); + coverParamVo.setUserGender(""); + log.info("发起翻唱任务,入参{}", JSONUtil.toJsonStr(coverParamVo)); + // 调用翻唱API + Request postRequest = weChatScanHttpUtil.createPostRequest(getKey("cover_url"), JSONUtil.toJsonStr(coverParamVo)); + String body = weChatScanHttpUtil.executeRequest(postRequest); + ApiResult apiResult = JSONUtil.toBean(body, ApiResult.class); + if (ResultEnum.SUCCESS.getCode().equals(String.valueOf(apiResult.getCode()))) { + // 扣费 + chatCostService.taskDeduct("cover", "token", NumberUtils.toDouble(okHttpConfig.getGenerate(), 2.5)); + } + log.info("调用翻唱结果,出参{}", body); + } + + @Override + public TableDataInfo searchCoverRecord(PageQuery pageQuery) { + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); + queryWrapper.eq(Cover::getUserId, getLoginUser().getUserId()); + queryWrapper.orderByDesc(Cover::getCreateTime); + Page result = coverMapper.selectVoPage(pageQuery.build(), queryWrapper); + return TableDataInfo.build(result); + } + + public String getKey(String key) { + return configService.getConfigValue("cover", key); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/PaymentOrdersServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/PaymentOrdersServiceImpl.java new file mode 100644 index 0000000..d634171 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/PaymentOrdersServiceImpl.java @@ -0,0 +1,211 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.exception.base.BaseException; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.system.domain.PaymentOrder; +import org.aibidding.system.domain.SysUser; +import org.aibidding.system.domain.bo.PaymentOrdersBo; +import org.aibidding.system.domain.bo.SysPackagePlanBo; +import org.aibidding.system.domain.bo.SysUserBo; +import org.aibidding.system.domain.request.OrderRequest; +import org.aibidding.system.domain.vo.PaymentOrdersVo; +import org.aibidding.system.domain.vo.SysPackagePlanVo; +import org.aibidding.system.domain.vo.SysUserVo; +import org.aibidding.system.mapper.PaymentOrdersMapper; +import org.aibidding.system.mapper.SysUserMapper; +import org.aibidding.system.service.IPaymentOrdersService; +import org.aibidding.system.service.ISysPackagePlanService; +import org.aibidding.system.service.ISysUserService; +import org.aibidding.system.util.OrderNumberGenerator; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 支付订单Service业务层处理 + * + * @author Lion Li + * @date 2024-04-16 + */ +@RequiredArgsConstructor +@Service +public class PaymentOrdersServiceImpl implements IPaymentOrdersService { + + private final PaymentOrdersMapper baseMapper; + + private final SysUserMapper sysUserMapper; + + private final ISysUserService userService; + + private final ISysPackagePlanService planService; + + /** + * 查询支付订单 + */ + @Override + public PaymentOrdersVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 创建支付订单 + */ + @Override + public PaymentOrdersBo createPayOrder(OrderRequest orderRequest) { + LoginUser loginUser = LoginHelper.getLoginUser(); + PaymentOrdersBo paymentOrder = new PaymentOrdersBo(); + paymentOrder.setOrderName(orderRequest.getName()); + paymentOrder.setAmount(new BigDecimal(orderRequest.getMoney())); + paymentOrder.setOrderNo(OrderNumberGenerator.generate()); + paymentOrder.setUserId(loginUser.getUserId()); + // TODO 支付状态默认待支付 - 添加枚举 + paymentOrder.setPaymentStatus("1"); + // 保存支付订单 + insertByBo(paymentOrder); + return paymentOrder; + } + + /** + * 修改订单状态为已支付 + * + */ + @Override + public void updatePayOrder(OrderRequest orderRequest) { + PaymentOrdersBo paymentOrdersBo = new PaymentOrdersBo(); + paymentOrdersBo.setOrderNo(orderRequest.getOrderNo()); + List paymentOrdersList = queryList(paymentOrdersBo); + if (CollectionUtil.isEmpty(paymentOrdersList)){ + throw new BaseException("订单不存在!"); + } + // 根据价格查询套餐 + SysPackagePlanBo sysPackagePlanBo = new SysPackagePlanBo(); + sysPackagePlanBo.setPrice(new BigDecimal(orderRequest.getMoney())); + SysPackagePlanVo sysPackagePlanVo = planService.queryList(sysPackagePlanBo).get(0); + + + // 订单状态修改为已支付 + PaymentOrdersVo paymentOrdersVo = paymentOrdersList.get(0); + // 1 未支付 2未支付 + paymentOrdersVo.setPaymentStatus("2"); + paymentOrdersVo.setPaymentMethod(orderRequest.getPayType()); + BeanUtil.copyProperties(paymentOrdersVo,paymentOrdersBo); + updateByBo(paymentOrdersBo); + // 用户充值费用 + double money = paymentOrdersBo.getAmount().doubleValue(); + SysUserVo sysUserVo = userService.selectUserById(paymentOrdersVo.getUserId()); + sysUserVo.setUserBalance(sysUserVo.getUserBalance() + money); + SysUserBo sysUserBo = new SysUserBo(); + BeanUtil.copyProperties(sysUserVo,sysUserBo); + // 设置为付费用户 + sysUserBo.setUserGrade("1"); + sysUserBo.setUserPlan(sysPackagePlanVo.getId().toString()); + userService.updateUser(sysUserBo); + } + + /** + * 查询支付订单列表 + */ + @Override + public TableDataInfo queryPageList(PaymentOrdersBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + if(CollectionUtil.isEmpty(result.getRecords())){ + return TableDataInfo.build(result); + } + // 获取所有userId + List userIds = result.getRecords().stream() + .map(PaymentOrdersVo::getUserId) + .collect(Collectors.toList()); + // 一次性查询所有userName + Map userIdToUserNameMap = getUserNamesByUserIds(userIds); + // 设置userName + result.getRecords().forEach(paymentOrderVo -> { + paymentOrderVo.setUserName(userIdToUserNameMap.get(paymentOrderVo.getUserId())); + }); + return TableDataInfo.build(result); + } + private Map getUserNamesByUserIds(List userIds) { + // 实现批量查询userName的逻辑,例如通过sysUserMapper查询sys_user表 + List sysUsers = sysUserMapper.selectBatchIds(userIds); + return sysUsers.stream() + .collect(Collectors.toMap(SysUser::getUserId, SysUser::getUserName)); + } + + /** + * 查询支付订单列表 + */ + @Override + public List queryList(PaymentOrdersBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(PaymentOrdersBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getOrderNo()), PaymentOrder::getOrderNo, bo.getOrderNo()); + lqw.like(StringUtils.isNotBlank(bo.getOrderName()), PaymentOrder::getOrderName, bo.getOrderName()); + lqw.eq(bo.getAmount() != null, PaymentOrder::getAmount, bo.getAmount()); + lqw.eq(StringUtils.isNotBlank(bo.getPaymentStatus()), PaymentOrder::getPaymentStatus, bo.getPaymentStatus()); + lqw.eq(StringUtils.isNotBlank(bo.getPaymentMethod()), PaymentOrder::getPaymentMethod, bo.getPaymentMethod()); + lqw.eq(bo.getUserId() != null, PaymentOrder::getUserId, bo.getUserId()); + return lqw; + } + + /** + * 新增支付订单 + */ + @Override + public Boolean insertByBo(PaymentOrdersBo bo) { + PaymentOrder add = MapstructUtils.convert(bo, PaymentOrder.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改支付订单 + */ + @Override + public Boolean updateByBo(PaymentOrdersBo bo) { + PaymentOrder update = MapstructUtils.convert(bo, PaymentOrder.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(PaymentOrder entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除支付订单 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/PptServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/PptServiceImpl.java new file mode 100644 index 0000000..a795a02 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/PptServiceImpl.java @@ -0,0 +1,137 @@ +package org.aibidding.system.service.impl; + +import cn.dev33.satoken.exception.NotLoginException; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.math.NumberUtils; +import org.aibidding.common.core.constant.Constants; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.service.ConfigService; +import org.aibidding.common.redis.utils.RedisUtils; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.system.cofing.OkHttpConfig; +import org.aibidding.system.domain.vo.ppt.*; +import org.aibidding.system.service.IChatCostService; +import org.aibidding.system.service.IPptService; +import org.aibidding.system.util.HttpUtils; +import org.aibidding.system.util.WddPptApi; +import org.springframework.stereotype.Service; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; + +import javax.swing.filechooser.FileSystemView; +import java.io.File; +import java.time.Duration; + +/** + * AI-PPTService业务层处理 + * + * @author NSL + * @since 2024-12-30 + */ +@RequiredArgsConstructor +@Service +@Slf4j +public class PptServiceImpl implements IPptService { + + private final OkHttpConfig okHttpConfig; + private final ConfigService configService; + private final IChatCostService chatCostService; + + @Override + public void syncStreamGeneratePpt(String title) { + // 创建 api token (有效期2小时,同一个 uid 创建时之前的 token 会在10秒内失效) + String apiToken = getApiToken(); + // 生成大纲 + System.out.println("\n\n========== 正在生成大纲 =========="); + String outline = WddPptApi.generateOutline(apiToken, title, null, null); + + // 生成大纲内容 + System.out.println("\n\n========== 正在生成大纲内容 =========="); + String markdown = WddPptApi.generateContent(apiToken, outline, null, null); + + // 随机一个模板 + System.out.println("\n\n========== 随机选择模板 =========="); + String templateId = WddPptApi.randomOneTemplateId(apiToken); + System.out.println(templateId); + + // 生成PPT + System.out.println("\n\n========== 正在生成PPT =========="); + JSONObject pptInfo = WddPptApi.generatePptx(apiToken, templateId, markdown, false); + String pptId = pptInfo.getString("id"); + System.out.println("pptId: " + pptId); + System.out.println("ppt主题:" + pptInfo.getString("subject")); + System.out.println("ppt封面:" + pptInfo.getString("coverUrl") + "?token=" + apiToken); + + // 下载PPT到桌面 + System.out.println("\n\n========== 正在下载PPT =========="); + JSONObject result = WddPptApi.downloadPptx(apiToken, pptId); + String url = result.getString("fileUrl"); + System.out.println("ppt链接:" + url); + String savePath = FileSystemView.getFileSystemView().getHomeDirectory().getAbsolutePath() + File.separator + pptId + ".pptx"; + try { + HttpUtils.download(url, new File(savePath)); + } catch (Exception e) { + + } + System.out.println("ppt下载完成,保存路径:" + savePath); + } + + @Override + public void selectPptList(PptAllQueryDto pptQueryVo) { + String apiToken = getApiToken(); + // todo 无权限访问 + JSONObject jsonObject = WddPptApi.listAllPptx(apiToken, JSONUtil.toJsonStr(pptQueryVo)); + System.out.println(jsonObject); + } + + @Override + public JSONObject getPptTemplates(PptTemplateQueryDto pptQueryVo) { + return WddPptApi.getPptTemplates(getApiToken(), JSONUtil.toJsonStr(pptQueryVo)); + } + + @Override + public SseEmitter generateOutline(PptGenerateOutlineDto generateOutlineDto) { + return WddPptApi.sseGenerateOutline(getApiToken(), generateOutlineDto.getSubject(), generateOutlineDto.getDataUrl(), generateOutlineDto.getPrompt()); + } + + @Override + public SseEmitter generateContent(PptGenerateContentDto generateContentDto) { + return WddPptApi.sseGenerateContent(getApiToken(), generateContentDto.getOutlineMarkdown(), generateContentDto.getDataUrl(), generateContentDto.getPrompt()); + } + + @Override + public JSONObject generatePptx(PptGeneratePptxDto generatePptxDto) { + return WddPptApi.generatePptx(getApiToken(), generatePptxDto.getTemplateId(), generatePptxDto.getOutlineContentMarkdown(), generatePptxDto.isPptxProperty()); + } + + public String getKey(String key) { + return configService.getConfigValue("ppt", key); + } + + @Override + public String getApiToken() { + LoginUser loginUser = null; + try { + loginUser = LoginHelper.getLoginUser(); + } catch (Exception e) { + throw new NotLoginException(NotLoginException.NOT_TOKEN_MESSAGE, NotLoginException.NOT_TOKEN, NotLoginException.NOT_TOKEN); + } + String userId = String.valueOf(loginUser.getUserId()); + // 创建 api token (有效期2小时,同一个 uid 创建时之前的 token 会在10秒内失效) + String apiToken = RedisUtils.getCacheObject(Constants.WDD_TOKEN_KEY + userId); + if (StrUtil.isEmpty(apiToken)) { + apiToken = WddPptApi.createApiToken(getKey("apiKey"), userId, null); + RedisUtils.setCacheObject(Constants.WDD_TOKEN_KEY, apiToken, Duration.ofMinutes(Constants.WDD_TOKEN_EXPIRATION)); + } + return apiToken; + } + + @Override + public void successCallback() { + // 扣费 + chatCostService.taskDeduct("ppt", "AI-PPT", NumberUtils.toDouble(okHttpConfig.getGenerate(), 1.1)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SseServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SseServiceImpl.java new file mode 100644 index 0000000..45e4cd7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SseServiceImpl.java @@ -0,0 +1,683 @@ +package org.aibidding.system.service.impl; + +import cn.dev33.satoken.stp.StpUtil; +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.zhipu.oapi.ClientV4; +import com.zhipu.oapi.service.v4.tools.*; +import io.github.ollama4j.OllamaAPI; +import io.github.ollama4j.models.chat.OllamaChatMessage; +import io.github.ollama4j.models.chat.OllamaChatMessageRole; +import io.github.ollama4j.models.chat.OllamaChatRequestBuilder; +import io.github.ollama4j.models.chat.OllamaChatRequestModel; +import io.github.ollama4j.models.generate.OllamaStreamHandler; +import jakarta.servlet.http.HttpServletRequest; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import okhttp3.*; +import org.aibidding.common.chat.config.ChatConfig; +import org.aibidding.common.chat.config.LocalCache; +import org.aibidding.common.chat.domain.request.ChatRequest; +import org.aibidding.common.chat.domain.request.Dall3Request; +import org.aibidding.common.chat.entity.Tts.TextToSpeech; +import org.aibidding.common.chat.entity.chat.*; +import org.aibidding.common.chat.entity.files.UploadFileResponse; +import org.aibidding.common.chat.entity.images.Image; +import org.aibidding.common.chat.entity.images.ImageResponse; +import org.aibidding.common.chat.entity.images.Item; +import org.aibidding.common.chat.entity.images.ResponseFormat; +import org.aibidding.common.chat.entity.whisper.WhisperResponse; +import org.aibidding.common.chat.openai.OpenAiStreamClient; +import org.aibidding.common.chat.openai.plugin.PluginAbstract; +import org.aibidding.common.chat.plugin.CmdPlugin; +import org.aibidding.common.chat.plugin.CmdReq; +import org.aibidding.common.chat.plugin.SqlPlugin; +import org.aibidding.common.chat.plugin.SqlReq; +import org.aibidding.common.chat.utils.TikTokensUtil; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.exception.base.BaseException; +import org.aibidding.common.core.service.ConfigService; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.core.utils.file.FileUtils; +import org.aibidding.common.core.utils.file.MimeTypeUtils; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.system.domain.SysModel; +import org.aibidding.system.domain.bo.ChatMessageBo; +import org.aibidding.system.domain.request.translation.TranslationRequest; +import org.aibidding.system.listener.SSEEventSourceListener; +import org.aibidding.system.service.*; +import org.springframework.core.io.InputStreamResource; +import org.springframework.core.io.Resource; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; + + +@Service +@Slf4j +@RequiredArgsConstructor +public class SseServiceImpl implements ISseService { + + private OpenAiStreamClient openAiStreamClient; + + private final ChatConfig chatConfig; + + + private final IChatCostService chatService; + + private final IChatMessageService chatMessageService; + + private final ISysModelService sysModelService; + + private final ConfigService configService; + + static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build(); + + private static final String requestIdTemplate = "mycompany-%d"; + + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public SseEmitter sseChat(ChatRequest chatRequest, HttpServletRequest request) { + openAiStreamClient = chatConfig.getOpenAiStreamClient(); + SseEmitter sseEmitter = new SseEmitter(0L); + SSEEventSourceListener openAIEventSourceListener = new SSEEventSourceListener(sseEmitter); + // 获取对话消息列表 + List messages = chatRequest.getMessages(); + + try { + String chatString = null; + Object content = messages.get(messages.size() - 1).getContent(); + if (content instanceof List listContent) { + if (!listContent.isEmpty() && listContent.get(0) instanceof Content) { + chatString = ((Content) listContent.get(0)).getText(); + } + } else if (content instanceof String) { + chatString = (String) content; + } + + String configValue = getKey("enabled"); + if (Boolean.parseBoolean(configValue)) { + // 判断文本是否合规 + String type = textReview(chatString); + // 审核状态 1 代表合法 + if (!"1".equals(type) && StringUtils.isNotEmpty(type)) { + throw new BaseException("文本不合规,请修改!"); + } + } + + if (StpUtil.isLogin()) { + LocalCache.CACHE.put("userId", getUserId()); + + ChatMessageBo chatMessageBo = new ChatMessageBo(); + chatMessageBo.setUserId(getUserId()); + chatMessageBo.setModelName(chatRequest.getModel()); + chatMessageBo.setContent(chatString); + + String model = chatRequest.getModel(); + // 如果是gpts系列模型 + if (chatRequest.getModel().startsWith("gpt-4-gizmo")) { + model = "gpt-4-gizmo"; + } + SysModel sysModel = sysModelService.selectModelByName(model); + if (sysModel == null) { + // 如果模型不存在默认使用token扣费方式 + processByToken(chatRequest.getModel(), chatString, chatMessageBo); + } else { + openAiStreamClient = chatConfig.createOpenAiStreamClient(sysModel.getApiHost(), sysModel.getApiKey()); + // 模型设置默认提示词 + if (StringUtils.isNotEmpty(sysModel.getSystemPrompt())) { + Message sysMessage = Message.builder().content(sysModel.getSystemPrompt()).role(Message.Role.SYSTEM).build(); + messages.add(sysMessage); + } + // 计费类型: 1 token扣费 2 次数扣费 + if ("2".equals(sysModel.getModelType())) { + processByModelPrice(sysModel, chatMessageBo); + } else { + processByToken(chatRequest.getModel(), chatString, chatMessageBo); + } + } + } + String zhipuValue = configService.getConfigValue("zhipu", "key"); + // 添加联网信息 + if(StringUtils.isNotEmpty(zhipuValue)){ + ClientV4 client = new ClientV4.Builder(zhipuValue) + .networkConfig(300, 100, 100, 100, TimeUnit.SECONDS) + .connectionPool(new okhttp3.ConnectionPool(8, 1, TimeUnit.SECONDS)) + .build(); + + SearchChatMessage jsonNodes = new SearchChatMessage(); + jsonNodes.setRole(Message.Role.USER.getName()); + jsonNodes.setContent(chatString); + + String requestId = String.format(requestIdTemplate, System.currentTimeMillis()); + WebSearchParamsRequest chatCompletionRequest = WebSearchParamsRequest.builder() + .model("web-search-pro") + .stream(Boolean.TRUE) + .messages(Collections.singletonList(jsonNodes)) + .requestId(requestId) + .build(); + WebSearchApiResponse webSearchApiResponse = client.webSearchProStreamingInvoke(chatCompletionRequest); + List choices = new ArrayList<>(); + if (webSearchApiResponse.isSuccess()) { + AtomicBoolean isFirst = new AtomicBoolean(true); + + AtomicReference lastAccumulator = new AtomicReference<>(); + + webSearchApiResponse.getFlowable().map(result -> result) + .doOnNext(accumulator -> { + { + if (isFirst.getAndSet(false)) { + log.info("Response: "); + } + ChoiceDelta delta = accumulator.getChoices().get(0).getDelta(); + if (delta != null && delta.getToolCalls() != null) { + log.info("tool_calls: {}", mapper.writeValueAsString(delta.getToolCalls())); + } + choices.add(delta); + } + }) + .doOnComplete(() -> System.out.println("Stream completed.")) + .doOnError(throwable -> System.err.println("Error: " + throwable)) + .blockingSubscribe(); + + WebSearchPro chatMessageAccumulator = lastAccumulator.get(); + + webSearchApiResponse.setFlowable(null);// 打印前置空 + webSearchApiResponse.setData(chatMessageAccumulator); + } + + + Message message = Message.builder().role(Message.Role.ASSISTANT).content(choices.get(1).getToolCalls().toString()).build(); + messages.add(message); + } + + if ("openCmd".equals(chatRequest.getModel())) { + sseEmitter.send(cmdPlugin(messages)); + sseEmitter.complete(); + } else if ("sqlPlugin".equals(chatRequest.getModel())) { + sseEmitter.send(sqlPlugin(messages)); + sseEmitter.complete(); + } else { + ChatCompletion completion = ChatCompletion + .builder() + .messages(messages) + .model(chatRequest.getModel()) + .temperature(chatRequest.getTemperature()) + .topP(chatRequest.getTop_p()) + .stream(true) + .build(); + openAiStreamClient.streamChatCompletion(completion, openAIEventSourceListener); + } + } catch (Exception e) { + String message = e.getMessage(); + sendErrorEvent(sseEmitter, message); + return sseEmitter; + } + return sseEmitter; + } + + public String cmdPlugin(List messages) { + CmdPlugin plugin = new CmdPlugin(CmdReq.class); + // 插件名称 + plugin.setName("命令行工具"); + // 方法名称 + plugin.setFunction("openCmd"); + // 方法说明 + plugin.setDescription("提供一个命令行指令,比如<记事本>,指令使用中文"); + + PluginAbstract.Arg arg = new PluginAbstract.Arg(); + // 参数名称 + arg.setName("cmd"); + // 参数说明 + arg.setDescription("命令行指令"); + // 参数类型 + arg.setType("string"); + arg.setRequired(true); + plugin.setArgs(Collections.singletonList(arg)); + //有四个重载方法,都可以使用 + ChatCompletionResponse response = openAiStreamClient.chatCompletionWithPlugin(messages,"gpt-4o-mini",plugin); + return response.getChoices().get(0).getMessage().getContent().toString(); + } + + public String sqlPlugin(List messages) { + SqlPlugin plugin = new SqlPlugin(SqlReq.class); + // 插件名称 + plugin.setName("数据库查询插件"); + // 方法名称 + plugin.setFunction("sqlPlugin"); + // 方法说明 + plugin.setDescription("提供一个用户名称查询余额信息"); + + PluginAbstract.Arg arg = new PluginAbstract.Arg(); + // 参数名称 + arg.setName("username"); + // 参数说明 + arg.setDescription("用户名称"); + // 参数类型 + arg.setType("string"); + arg.setRequired(true); + plugin.setArgs(Collections.singletonList(arg)); + //有四个重载方法,都可以使用 + ChatCompletionResponse response = openAiStreamClient.chatCompletionWithPlugin(messages,"gpt-4o-mini",plugin); + return response.getChoices().get(0).getMessage().getContent().toString(); + } + + /** + * 根据次数扣除余额 + * + * @param model 模型信息 + * @param chatMessageBo 对话信息 + */ + private void processByModelPrice(SysModel model, ChatMessageBo chatMessageBo) { + double cost = model.getModelPrice(); + chatService.deductUserBalance(getUserId(), cost); + chatMessageBo.setDeductCost(cost); + chatMessageService.insertByBo(chatMessageBo); + } + + /** + * 根据token扣除余额 + * + * @param modelName 模型名称 + * @param text 消息内容 + * @param chatMessageBo 消息记录 + */ + private void processByToken(String modelName, String text, ChatMessageBo chatMessageBo) { + int tokens = TikTokensUtil.tokens(modelName, text); + chatMessageBo.setTotalTokens(tokens); + chatService.deductToken(chatMessageBo); + } + + /** + * 文字转语音 + */ + @Override + public ResponseEntity textToSpeed(TextToSpeech textToSpeech) { + ResponseBody body = openAiStreamClient.textToSpeech(textToSpeech); + if (body != null) { + // 将ResponseBody转换为InputStreamResource + InputStreamResource resource = new InputStreamResource(body.byteStream()); + + // 创建并返回ResponseEntity + return ResponseEntity.ok() + .contentType(MediaType.parseMediaType("audio/mpeg")) + .body(resource); + } else { + // 如果ResponseBody为空,返回404状态码 + return ResponseEntity.notFound().build(); + } + } + + + /** + * 语音转文字 + */ + @Override + public WhisperResponse speechToTextTranscriptionsV2(MultipartFile file) { + // 确保文件不为空 + if (file.isEmpty()) { + throw new IllegalStateException("Cannot convert an empty MultipartFile"); + } + if (!FileUtils.isValidFileExtention(file, MimeTypeUtils.AUDIO__EXTENSION)) { + throw new IllegalStateException("File Extention not supported"); + } + // 创建一个文件对象 + File fileA = new File(System.getProperty("java.io.tmpdir") + File.separator + file.getOriginalFilename()); + try { + // 将 MultipartFile 的内容写入文件 + file.transferTo(fileA); + } catch (IOException e) { + throw new RuntimeException("Failed to convert MultipartFile to File", e); + } + return openAiStreamClient.speechToTextTranscriptions(fileA); + } + + @Override + public String chat(ChatRequest chatRequest, String userId) { + return null; + } + + /** + * dall-e-3绘画接口 + * + * @param request + * @return + */ + @Override + public List dall3(Dall3Request request) { + openAiStreamClient = chatConfig.getOpenAiStreamClient(); + chatService.checkUserGrade(); + // DALL3 绘图模型 + Image image = Image.builder() + .responseFormat(ResponseFormat.URL.getName()) + .model(Image.Model.DALL_E_3.getName()) + .prompt(request.getPrompt()) + .n(1) + .quality(request.getQuality()) + .size(request.getSize()) + .style(request.getStyle()) + .build(); + ImageResponse imageResponse = openAiStreamClient.genImages(image); + SysModel sysModel = sysModelService.selectModelByName(request.getModel()); + //chatService.deductUserBalance(getUserId(),sysModelList.get(0).getModelPrice()); + // 保存消息记录 + ChatMessageBo chatMessageBo = new ChatMessageBo(); + chatMessageBo.setUserId(getUserId()); + chatMessageBo.setModelName(Image.Model.DALL_E_3.getName()); + chatMessageBo.setContent(request.getPrompt()); + chatMessageBo.setDeductCost(sysModel.getModelPrice()); + chatMessageBo.setTotalTokens(0); + chatMessageService.insertByBo(chatMessageBo); + return imageResponse.getData(); + } + + @Override + public List wxDall(String prompt, String userId) { + openAiStreamClient = chatConfig.getOpenAiStreamClient(); + // DALL3 绘图模型 + Image image = Image.builder() + .responseFormat(ResponseFormat.URL.getName()) + .model(Image.Model.DALL_E_3.getName()) + .prompt(prompt) + .n(1) + .build(); + ImageResponse imageResponse = openAiStreamClient.genImages(image); + SysModel dall3 = sysModelService.selectModelByName("dall3"); + chatService.deductUserBalance(Long.valueOf(userId), 0.3); + // 保存消息记录 + ChatMessageBo chatMessageBo = new ChatMessageBo(); + chatMessageBo.setUserId(getUserId()); + chatMessageBo.setModelName(Image.Model.DALL_E_3.getName()); + chatMessageBo.setContent(prompt); + chatMessageBo.setDeductCost(dall3.getModelPrice()); + chatMessageBo.setTotalTokens(0); + chatMessageService.insertByBo(chatMessageBo); + return imageResponse.getData(); + } + + /** + * 获取用户Id + * + * @return + */ + public Long getUserId() { + LoginUser loginUser = LoginHelper.getLoginUser(); + if (loginUser == null) { + throw new BaseException("用户未登录!"); + } + return loginUser.getUserId(); + } + + @Override + public UploadFileResponse upload(MultipartFile file) { + if (file.isEmpty()) { + throw new IllegalStateException("Cannot upload an empty MultipartFile"); + } + if (!FileUtils.isValidFileExtention(file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION)) { + throw new IllegalStateException("File Extention not supported"); + } + openAiStreamClient = chatConfig.getOpenAiStreamClient(); + return openAiStreamClient.uploadFile("fine-tune", convertMultiPartToFile(file)); + } + + private File convertMultiPartToFile(MultipartFile multipartFile) { + File file = null; + try { + // 获取原始文件名 + String originalFileName = multipartFile.getOriginalFilename(); + // 默认扩展名 + String extension = ".tmp"; + // 尝试从原始文件名中获取扩展名 + if (originalFileName != null && originalFileName.contains(".")) { + extension = originalFileName.substring(originalFileName.lastIndexOf(".")); + } + + // 使用原始文件的扩展名创建临时文件 + Path tempFile = Files.createTempFile(null, extension); + file = tempFile.toFile(); + + // 将MultipartFile的内容写入文件 + try (InputStream inputStream = multipartFile.getInputStream(); + FileOutputStream outputStream = new FileOutputStream(file)) { + int read; + byte[] bytes = new byte[1024]; + while ((read = inputStream.read(bytes)) != -1) { + outputStream.write(bytes, 0, read); + } + } catch (IOException e) { + // 处理文件写入异常 + e.printStackTrace(); + } + } catch (IOException e) { + // 处理临时文件创建异常 + e.printStackTrace(); + } + return file; + } + + // 发送SSE错误事件的封装方法 + private void sendErrorEvent(SseEmitter sseEmitter, String errorMessage) { + SseEmitter.SseEventBuilder event = SseEmitter.event() + .name("error") + .data(errorMessage); + try { + sseEmitter.send(event); + } catch (IOException e) { + log.error("发送事件失败: {}", e.getMessage()); + } + sseEmitter.complete(); + } + + /** + * 文本内容审核 + * + * @param msg + * @return String + * @Date 2023/5/27 + **/ + public String textReview(String msg) { + String conclusionType = ""; + try { + String text = URLEncoder.encode(msg); + okhttp3.MediaType mediaType = okhttp3.MediaType.parse("application/x-www-form-urlencoded"); + RequestBody body = RequestBody.create(mediaType, "text=" + text); + Request request = new Request.Builder() + .url("https://aip.baidubce.com/rest/2.0/solution/v1/text_censor/v2/user_defined?access_token=" + getAccessToken()) + .method("POST", body) + .addHeader("Content-Type", "application/x-www-form-urlencoded") + .addHeader("Accept", "application/json") + .build(); + Response response = HTTP_CLIENT.newCall(request).execute(); + JSONObject jsonObject = JSONObject.parseObject(response.body().string()); + conclusionType = jsonObject.getString("conclusionType"); + } catch (IOException e) { + log.info("发生错误{}", e.getMessage()); + } + return conclusionType; + } + + /** + * 从用户的AK,SK生成鉴权签名(Access Token) + * + * @return 鉴权签名(Access Token) + * @throws IOException IO异常 + */ + public String getAccessToken() throws IOException { + okhttp3.MediaType mediaType = okhttp3.MediaType.parse("application/x-www-form-urlencoded"); + RequestBody body = RequestBody.create(mediaType, "grant_type=client_credentials&client_id=" + getKey("apiKey") + + "&client_secret=" + getKey("secretKey")); + Request request = new Request.Builder() + .url("https://aip.baidubce.com/oauth/2.0/token") + .method("POST", body) + .addHeader("Content-Type", "application/x-www-form-urlencoded") + .build(); + Response response = HTTP_CLIENT.newCall(request).execute(); + return JSONObject.parseObject(response.body().string()).getString("access_token"); + } + + public String getKey(String key) { + return configService.getConfigValue("review", key); + } + + /** + * 获取客户端的 IP 地址 + * + * @param request HTTP 请求对象 + * @return 客户端的 IP 地址,如果无法获取则返回 "unknown" + */ + public static String getClientIpAddress(HttpServletRequest request) { + String ipAddress = request.getHeader("X-Forwarded-For"); + if (ipAddress != null && !ipAddress.isEmpty() && !"unknown".equalsIgnoreCase(ipAddress)) { + return ipAddress.split(",")[0].trim(); + } + + ipAddress = request.getHeader("Proxy-Client-IP"); + if (ipAddress != null && !ipAddress.isEmpty() && !"unknown".equalsIgnoreCase(ipAddress)) { + return ipAddress; + } + + ipAddress = request.getHeader("WL-Proxy-Client-IP"); + if (ipAddress != null && !ipAddress.isEmpty() && !"unknown".equalsIgnoreCase(ipAddress)) { + return ipAddress; + } + + ipAddress = request.getHeader("HTTP_CLIENT_IP"); + if (ipAddress != null && !ipAddress.isEmpty() && !"unknown".equalsIgnoreCase(ipAddress)) { + return ipAddress; + } + + ipAddress = request.getHeader("HTTP_X_FORWARDED_FOR"); + if (ipAddress != null && !ipAddress.isEmpty() && !"unknown".equalsIgnoreCase(ipAddress)) { + return ipAddress; + } + + ipAddress = request.getRemoteAddr(); + if (ipAddress != null && !ipAddress.isEmpty() && !"unknown".equalsIgnoreCase(ipAddress)) { + return ipAddress; + } + + return "unknown"; + } + + + @Override + public String translation(TranslationRequest translationRequest) { + // 翻译模型固定为gpt-4o-mini + translationRequest.setModel("gpt-4o-mini"); + ChatMessageBo chatMessageBo = new ChatMessageBo(); + chatMessageBo.setUserId(getUserId()); + chatMessageBo.setModelName(translationRequest.getModel()); + chatMessageBo.setContent(translationRequest.getPrompt()); + chatMessageBo.setDeductCost(0.01); + chatMessageBo.setTotalTokens(0); + chatMessageService.insertByBo(chatMessageBo); + openAiStreamClient = chatConfig.getOpenAiStreamClient(); + List messageList = new ArrayList<>(); + Message sysMessage = Message.builder().role(Message.Role.SYSTEM).content("你是一位精通各国语言的翻译大师\n" + + "\n" + + "请将用户输入词语翻译成{" + translationRequest.getTargetLanguage() + "}\n" + + "\n" + + "==示例输出==\n" + + "**原文** : <这里显示要翻译的原文信息>\n" + + "**翻译** : <这里显示翻译成英语的结果>\n" + + "==示例结束==\n" + + "\n" + + "注意:请严格按示例进行输出,返回markdown格式").build(); + messageList.add(sysMessage); + Message message = Message.builder().role(Message.Role.USER).content(translationRequest.getPrompt()).build(); + messageList.add(message); + ChatCompletionResponse chatCompletionResponse = null; + try { + ChatCompletion chatCompletion = ChatCompletion + .builder() + .messages(messageList) + .model(translationRequest.getModel()) + .stream(false) + .build(); + chatCompletionResponse = openAiStreamClient.chatCompletion(chatCompletion); + }catch (Exception e) { + log.error(e.getMessage()); + } + + return chatCompletionResponse.getChoices().get(0).getMessage().getContent().toString(); + } + + @Override + public SseEmitter ollamaChat(ChatRequest chatRequest) { + String[] parts = chatRequest.getModel().split("ollama-"); + SysModel sysModel = sysModelService.selectModelByName(chatRequest.getModel()); + final SseEmitter emitter = new SseEmitter(); + String host = sysModel.getApiHost(); + List msgList = chatRequest.getMessages(); + List messages = new ArrayList<>(); + + for (Message message : msgList) { + OllamaChatMessage ollamaChatMessage = new OllamaChatMessage(); + ollamaChatMessage.setRole(OllamaChatMessageRole.USER); + ollamaChatMessage.setContent(message.getContent().toString()); + messages.add(ollamaChatMessage); + } + OllamaAPI api = new OllamaAPI(host); + api.setRequestTimeoutSeconds(100); + OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(parts[1]); + + OllamaChatRequestModel requestModel = builder + .withMessages(messages) + .build(); + + // 异步执行 OllAma API 调用 + CompletableFuture.runAsync(() -> { + try { + StringBuilder response = new StringBuilder(); + OllamaStreamHandler streamHandler = (s) -> { + String substr = s.substring(response.length()); + response.append(substr); + System.out.println(substr); + try { + emitter.send(substr); + } catch (IOException e) { + sendErrorEvent(emitter, e.getMessage()); + } + }; + api.chat(requestModel, streamHandler); + emitter.complete(); + } catch (Exception e) { + sendErrorEvent(emitter, e.getMessage()); + } + }); + return emitter; + } + + @Override + public String wxCpChat(String prompt) { + List messageList = new ArrayList<>(); + Message message = Message.builder().role(Message.Role.USER).content(prompt).build(); + messageList.add(message); + ChatCompletion chatCompletion = ChatCompletion + .builder() + .messages(messageList) + .model("gpt-4o-mini") + .stream(false) + .build(); + ChatCompletionResponse chatCompletionResponse = openAiStreamClient.chatCompletion(chatCompletion); + return chatCompletionResponse.getChoices().get(0).getMessage().getContent().toString(); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysConfigServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysConfigServiceImpl.java new file mode 100644 index 0000000..a749b17 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysConfigServiceImpl.java @@ -0,0 +1,203 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.constant.CacheNames; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.redis.utils.CacheUtils; +import org.aibidding.common.tenant.helper.TenantHelper; +import org.aibidding.system.domain.SysConfig; +import org.aibidding.system.domain.bo.SysConfigBo; +import org.aibidding.system.domain.vo.SysConfigVo; +import org.aibidding.system.mapper.SysConfigMapper; +import org.aibidding.system.service.ISysConfigService; +import org.springframework.cache.annotation.CachePut; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 参数配置 服务层实现 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysConfigServiceImpl implements ISysConfigService { + + private final SysConfigMapper baseMapper; + + @Override + public TableDataInfo selectPageConfigList(SysConfigBo config, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(config); + Page page = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(page); + } + + /** + * 查询参数配置信息 + * + * @param configId 参数配置ID + * @return 参数配置信息 + */ + @Override + @DS("master") + public SysConfigVo selectConfigById(Long configId) { + return baseMapper.selectVoById(configId); + } + + /** + * 根据键名查询参数配置信息 + * + * @param configKey 参数key + * @return 参数键值 + */ + @Cacheable(cacheNames = CacheNames.SYS_CONFIG, key = "#configKey") + @Override + public String selectConfigByKey(String configKey) { + SysConfig retConfig = baseMapper.selectOne(new LambdaQueryWrapper() + .eq(SysConfig::getConfigKey, configKey)); + if (ObjectUtil.isNotNull(retConfig)) { + return retConfig.getConfigValue(); + } + return StringUtils.EMPTY; + } + + /** + * 获取注册开关 + * @param tenantId 租户id + * @return true开启,false关闭 + */ + @Override + public boolean selectRegisterEnabled(String tenantId) { + SysConfig retConfig = baseMapper.selectOne(new LambdaQueryWrapper() + .eq(SysConfig::getConfigKey, "sys.account.registerUser") + .eq(TenantHelper.isEnable(),SysConfig::getTenantId, tenantId)); + if (ObjectUtil.isNull(retConfig)) { + return false; + } + return Convert.toBool(retConfig.getConfigValue()); + } + + /** + * 查询参数配置列表 + * + * @param config 参数配置信息 + * @return 参数配置集合 + */ + @Override + public List selectConfigList(SysConfigBo config) { + LambdaQueryWrapper lqw = buildQueryWrapper(config); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SysConfigBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getConfigName()), SysConfig::getConfigName, bo.getConfigName()); + lqw.eq(StringUtils.isNotBlank(bo.getConfigType()), SysConfig::getConfigType, bo.getConfigType()); + lqw.like(StringUtils.isNotBlank(bo.getConfigKey()), SysConfig::getConfigKey, bo.getConfigKey()); + lqw.between(params.get("beginTime") != null && params.get("endTime") != null, + SysConfig::getCreateTime, params.get("beginTime"), params.get("endTime")); + return lqw; + } + + /** + * 新增参数配置 + * + * @param bo 参数配置信息 + * @return 结果 + */ + @CachePut(cacheNames = CacheNames.SYS_CONFIG, key = "#bo.configKey") + @Override + public String insertConfig(SysConfigBo bo) { + SysConfig config = MapstructUtils.convert(bo, SysConfig.class); + int row = baseMapper.insert(config); + if (row > 0) { + return config.getConfigValue(); + } + throw new ServiceException("操作失败"); + } + + /** + * 修改参数配置 + * + * @param bo 参数配置信息 + * @return 结果 + */ + @CachePut(cacheNames = CacheNames.SYS_CONFIG, key = "#bo.configKey") + @Override + public String updateConfig(SysConfigBo bo) { + int row = 0; + SysConfig config = MapstructUtils.convert(bo, SysConfig.class); + if (config.getConfigId() != null) { + SysConfig temp = baseMapper.selectById(config.getConfigId()); + if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) { + CacheUtils.evict(CacheNames.SYS_CONFIG, temp.getConfigKey()); + } + row = baseMapper.updateById(config); + } else { + row = baseMapper.update(config, new LambdaQueryWrapper() + .eq(SysConfig::getConfigKey, config.getConfigKey())); + } + if (row > 0) { + return config.getConfigValue(); + } + throw new ServiceException("操作失败"); + } + + /** + * 批量删除参数信息 + * + * @param configIds 需要删除的参数ID + */ + @Override + public void deleteConfigByIds(Long[] configIds) { + for (Long configId : configIds) { + SysConfig config = baseMapper.selectById(configId); + if (StringUtils.equals(UserConstants.YES, config.getConfigType())) { + throw new ServiceException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey())); + } + CacheUtils.evict(CacheNames.SYS_CONFIG, config.getConfigKey()); + } + baseMapper.deleteBatchIds(Arrays.asList(configIds)); + } + + /** + * 重置参数缓存数据 + */ + @Override + public void resetConfigCache() { + CacheUtils.clear(CacheNames.SYS_CONFIG); + } + + /** + * 校验参数键名是否唯一 + * + * @param config 参数配置信息 + * @return 结果 + */ + @Override + public boolean checkConfigKeyUnique(SysConfigBo config) { + long configId = ObjectUtil.isNull(config.getConfigId()) ? -1L : config.getConfigId(); + SysConfig info = baseMapper.selectOne(new LambdaQueryWrapper().eq(SysConfig::getConfigKey, config.getConfigKey())); + if (ObjectUtil.isNotNull(info) && info.getConfigId() != configId) { + return false; + } + return true; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysDataScopeServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysDataScopeServiceImpl.java new file mode 100644 index 0000000..99210cb --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysDataScopeServiceImpl.java @@ -0,0 +1,61 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import org.aibidding.common.core.utils.StreamUtils; +import org.aibidding.common.mybatis.helper.DataBaseHelper; +import org.aibidding.system.domain.SysDept; +import org.aibidding.system.domain.SysRoleDept; +import org.aibidding.system.mapper.SysDeptMapper; +import org.aibidding.system.mapper.SysRoleDeptMapper; +import org.aibidding.system.service.ISysDataScopeService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 数据权限 实现 + *

+ * 注意: 此Service内不允许调用标注`数据权限`注解的方法 + * 例如: deptMapper.selectList 此 selectList 方法标注了`数据权限`注解 会出现循环解析的问题 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service("sdss") +public class SysDataScopeServiceImpl implements ISysDataScopeService { + + private final SysRoleDeptMapper roleDeptMapper; + private final SysDeptMapper deptMapper; + + @Override + public String getRoleCustom(Long roleId) { + List list = roleDeptMapper.selectList( + new LambdaQueryWrapper() + .select(SysRoleDept::getDeptId) + .eq(SysRoleDept::getRoleId, roleId)); + if (CollUtil.isNotEmpty(list)) { + return StreamUtils.join(list, rd -> Convert.toStr(rd.getDeptId())); + } + return null; + } + + @Override + public String getDeptAndChild(Long deptId) { + List deptList = deptMapper.selectList(new LambdaQueryWrapper() + .select(SysDept::getDeptId) + .apply(DataBaseHelper.findInSet(deptId, "ancestors"))); + List ids = StreamUtils.toList(deptList, SysDept::getDeptId); + ids.add(deptId); + List list = deptMapper.selectList(new LambdaQueryWrapper() + .select(SysDept::getDeptId) + .in(SysDept::getDeptId, ids)); + if (CollUtil.isNotEmpty(list)) { + return StreamUtils.join(list, d -> Convert.toStr(d.getDeptId())); + } + return null; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysDeptServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysDeptServiceImpl.java new file mode 100644 index 0000000..140a7f5 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysDeptServiceImpl.java @@ -0,0 +1,325 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.lang.tree.Tree; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.constant.CacheNames; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.service.DeptService; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.core.utils.TreeBuildUtils; +import org.aibidding.common.mybatis.helper.DataBaseHelper; +import org.aibidding.common.redis.utils.CacheUtils; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.system.domain.SysDept; +import org.aibidding.system.domain.SysRole; +import org.aibidding.system.domain.SysUser; +import org.aibidding.system.domain.bo.SysDeptBo; +import org.aibidding.system.domain.vo.SysDeptVo; +import org.aibidding.system.mapper.SysDeptMapper; +import org.aibidding.system.mapper.SysRoleMapper; +import org.aibidding.system.mapper.SysUserMapper; +import org.aibidding.system.service.ISysDeptService; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * 部门管理 服务实现 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysDeptServiceImpl implements ISysDeptService, DeptService { + + private final SysDeptMapper baseMapper; + private final SysRoleMapper roleMapper; + private final SysUserMapper userMapper; + + /** + * 查询部门管理数据 + * + * @param dept 部门信息 + * @return 部门信息集合 + */ + @Override + public List selectDeptList(SysDeptBo dept) { + LambdaQueryWrapper lqw = buildQueryWrapper(dept); + return baseMapper.selectDeptList(lqw); + } + + /** + * 查询部门树结构信息 + * + * @param bo 部门信息 + * @return 部门树信息集合 + */ + @Override + public List> selectDeptTreeList(SysDeptBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + List depts = baseMapper.selectList(lqw); + return buildDeptTreeSelect(depts); + } + + private LambdaQueryWrapper buildQueryWrapper(SysDeptBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(SysDept::getDelFlag, "0"); + lqw.eq(ObjectUtil.isNotNull(bo.getDeptId()), SysDept::getDeptId, bo.getDeptId()); + lqw.eq(ObjectUtil.isNotNull(bo.getParentId()), SysDept::getParentId, bo.getParentId()); + lqw.like(StringUtils.isNotBlank(bo.getDeptName()), SysDept::getDeptName, bo.getDeptName()); + lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDept::getStatus, bo.getStatus()); + lqw.orderByAsc(SysDept::getParentId); + lqw.orderByAsc(SysDept::getOrderNum); + return lqw; + } + + /** + * 构建前端所需要下拉树结构 + * + * @param depts 部门列表 + * @return 下拉树结构列表 + */ + @Override + public List> buildDeptTreeSelect(List depts) { + if (CollUtil.isEmpty(depts)) { + return CollUtil.newArrayList(); + } + return TreeBuildUtils.build(depts, (dept, tree) -> + tree.setId(dept.getDeptId()) + .setParentId(dept.getParentId()) + .setName(dept.getDeptName()) + .setWeight(dept.getOrderNum())); + } + + /** + * 根据角色ID查询部门树信息 + * + * @param roleId 角色ID + * @return 选中部门列表 + */ + @Override + public List selectDeptListByRoleId(Long roleId) { + SysRole role = roleMapper.selectById(roleId); + return baseMapper.selectDeptListByRoleId(roleId, role.getDeptCheckStrictly()); + } + + /** + * 根据部门ID查询信息 + * + * @param deptId 部门ID + * @return 部门信息 + */ + @Cacheable(cacheNames = CacheNames.SYS_DEPT, key = "#deptId") + @Override + public SysDeptVo selectDeptById(Long deptId) { + SysDeptVo dept = baseMapper.selectVoById(deptId); + if (ObjectUtil.isNull(dept)) { + return null; + } + SysDeptVo parentDept = baseMapper.selectVoOne(new LambdaQueryWrapper() + .select(SysDept::getDeptName).eq(SysDept::getDeptId, dept.getParentId())); + dept.setParentName(ObjectUtil.isNotNull(parentDept) ? parentDept.getDeptName() : null); + return dept; + } + + /** + * 通过部门ID查询部门名称 + * + * @param deptIds 部门ID串逗号分隔 + * @return 部门名称串逗号分隔 + */ + @Override + public String selectDeptNameByIds(String deptIds) { + List list = new ArrayList<>(); + for (Long id : StringUtils.splitTo(deptIds, Convert::toLong)) { + SysDeptVo vo = SpringUtils.getAopProxy(this).selectDeptById(id); + if (ObjectUtil.isNotNull(vo)) { + list.add(vo.getDeptName()); + } + } + return String.join(StringUtils.SEPARATOR, list); + } + + /** + * 根据ID查询所有子部门数(正常状态) + * + * @param deptId 部门ID + * @return 子部门数 + */ + @Override + public long selectNormalChildrenDeptById(Long deptId) { + return baseMapper.selectCount(new LambdaQueryWrapper() + .eq(SysDept::getStatus, UserConstants.DEPT_NORMAL) + .apply(DataBaseHelper.findInSet(deptId, "ancestors"))); + } + + /** + * 是否存在子节点 + * + * @param deptId 部门ID + * @return 结果 + */ + @Override + public boolean hasChildByDeptId(Long deptId) { + return baseMapper.exists(new LambdaQueryWrapper() + .eq(SysDept::getParentId, deptId)); + } + + /** + * 查询部门是否存在用户 + * + * @param deptId 部门ID + * @return 结果 true 存在 false 不存在 + */ + @Override + public boolean checkDeptExistUser(Long deptId) { + return userMapper.exists(new LambdaQueryWrapper() + .eq(SysUser::getDeptId, deptId)); + } + + /** + * 校验部门名称是否唯一 + * + * @param dept 部门信息 + * @return 结果 + */ + @Override + public boolean checkDeptNameUnique(SysDeptBo dept) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysDept::getDeptName, dept.getDeptName()) + .eq(SysDept::getParentId, dept.getParentId()) + .ne(ObjectUtil.isNotNull(dept.getDeptId()), SysDept::getDeptId, dept.getDeptId())); + return !exist; + } + + /** + * 校验部门是否有数据权限 + * + * @param deptId 部门id + */ + @Override + public void checkDeptDataScope(Long deptId) { + if (ObjectUtil.isNull(deptId)) { + return; + } + if (LoginHelper.isSuperAdmin()) { + return; + } + SysDeptVo dept = baseMapper.selectDeptById(deptId); + if (ObjectUtil.isNull(dept)) { + throw new ServiceException("没有权限访问部门数据!"); + } + } + + /** + * 新增保存部门信息 + * + * @param bo 部门信息 + * @return 结果 + */ + @Override + public int insertDept(SysDeptBo bo) { + SysDept info = baseMapper.selectById(bo.getParentId()); + // 如果父节点不为正常状态,则不允许新增子节点 + if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) { + throw new ServiceException("部门停用,不允许新增"); + } + SysDept dept = MapstructUtils.convert(bo, SysDept.class); + dept.setAncestors(info.getAncestors() + StringUtils.SEPARATOR + dept.getParentId()); + return baseMapper.insert(dept); + } + + /** + * 修改保存部门信息 + * + * @param bo 部门信息 + * @return 结果 + */ + @CacheEvict(cacheNames = CacheNames.SYS_DEPT, key = "#bo.deptId") + @Override + public int updateDept(SysDeptBo bo) { + SysDept dept = MapstructUtils.convert(bo, SysDept.class); + SysDept oldDept = baseMapper.selectById(dept.getDeptId()); + if (!oldDept.getParentId().equals(dept.getParentId())) { + // 如果是新父部门 则校验是否具有新父部门权限 避免越权 + this.checkDeptDataScope(dept.getParentId()); + SysDept newParentDept = baseMapper.selectById(dept.getParentId()); + if (ObjectUtil.isNotNull(newParentDept) && ObjectUtil.isNotNull(oldDept)) { + String newAncestors = newParentDept.getAncestors() + StringUtils.SEPARATOR + newParentDept.getDeptId(); + String oldAncestors = oldDept.getAncestors(); + dept.setAncestors(newAncestors); + updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); + } + } + int result = baseMapper.updateById(dept); + if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors()) + && !StringUtils.equals(UserConstants.DEPT_NORMAL, dept.getAncestors())) { + // 如果该部门是启用状态,则启用该部门的所有上级部门 + updateParentDeptStatusNormal(dept); + } + return result; + } + + /** + * 修改该部门的父级部门状态 + * + * @param dept 当前部门 + */ + private void updateParentDeptStatusNormal(SysDept dept) { + String ancestors = dept.getAncestors(); + Long[] deptIds = Convert.toLongArray(ancestors); + baseMapper.update(null, new LambdaUpdateWrapper() + .set(SysDept::getStatus, UserConstants.DEPT_NORMAL) + .in(SysDept::getDeptId, Arrays.asList(deptIds))); + } + + /** + * 修改子元素关系 + * + * @param deptId 被修改的部门ID + * @param newAncestors 新的父ID集合 + * @param oldAncestors 旧的父ID集合 + */ + private void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) { + List children = baseMapper.selectList(new LambdaQueryWrapper() + .apply(DataBaseHelper.findInSet(deptId, "ancestors"))); + List list = new ArrayList<>(); + for (SysDept child : children) { + SysDept dept = new SysDept(); + dept.setDeptId(child.getDeptId()); + dept.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors)); + list.add(dept); + } + if (CollUtil.isNotEmpty(list)) { + if (baseMapper.updateBatchById(list)) { + list.forEach(dept -> CacheUtils.evict(CacheNames.SYS_DEPT, dept.getDeptId())); + } + } + } + + /** + * 删除部门管理信息 + * + * @param deptId 部门ID + * @return 结果 + */ + @CacheEvict(cacheNames = CacheNames.SYS_DEPT, key = "#deptId") + @Override + public int deleteDeptById(Long deptId) { + return baseMapper.deleteById(deptId); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysDictDataServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysDictDataServiceImpl.java new file mode 100644 index 0000000..94fe12d --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysDictDataServiceImpl.java @@ -0,0 +1,139 @@ +package org.aibidding.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.constant.CacheNames; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.redis.utils.CacheUtils; +import org.aibidding.system.domain.SysDictData; +import org.aibidding.system.domain.bo.SysDictDataBo; +import org.aibidding.system.domain.vo.SysDictDataVo; +import org.aibidding.system.mapper.SysDictDataMapper; +import org.aibidding.system.service.ISysDictDataService; +import org.springframework.cache.annotation.CachePut; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 字典 业务层处理 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysDictDataServiceImpl implements ISysDictDataService { + + private final SysDictDataMapper baseMapper; + + @Override + public TableDataInfo selectPageDictDataList(SysDictDataBo dictData, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(dictData); + Page page = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(page); + } + + /** + * 根据条件分页查询字典数据 + * + * @param dictData 字典数据信息 + * @return 字典数据集合信息 + */ + @Override + public List selectDictDataList(SysDictDataBo dictData) { + LambdaQueryWrapper lqw = buildQueryWrapper(dictData); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SysDictDataBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(bo.getDictSort() != null, SysDictData::getDictSort, bo.getDictSort()); + lqw.like(StringUtils.isNotBlank(bo.getDictLabel()), SysDictData::getDictLabel, bo.getDictLabel()); + lqw.eq(StringUtils.isNotBlank(bo.getDictType()), SysDictData::getDictType, bo.getDictType()); + lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDictData::getStatus, bo.getStatus()); + lqw.orderByAsc(SysDictData::getDictSort); + return lqw; + } + + /** + * 根据字典类型和字典键值查询字典数据信息 + * + * @param dictType 字典类型 + * @param dictValue 字典键值 + * @return 字典标签 + */ + @Override + public String selectDictLabel(String dictType, String dictValue) { + return baseMapper.selectOne(new LambdaQueryWrapper() + .select(SysDictData::getDictLabel) + .eq(SysDictData::getDictType, dictType) + .eq(SysDictData::getDictValue, dictValue)) + .getDictLabel(); + } + + /** + * 根据字典数据ID查询信息 + * + * @param dictCode 字典数据ID + * @return 字典数据 + */ + @Override + public SysDictDataVo selectDictDataById(Long dictCode) { + return baseMapper.selectVoById(dictCode); + } + + /** + * 批量删除字典数据信息 + * + * @param dictCodes 需要删除的字典数据ID + */ + @Override + public void deleteDictDataByIds(Long[] dictCodes) { + for (Long dictCode : dictCodes) { + SysDictData data = baseMapper.selectById(dictCode); + baseMapper.deleteById(dictCode); + CacheUtils.evict(CacheNames.SYS_DICT, data.getDictType()); + } + } + + /** + * 新增保存字典数据信息 + * + * @param bo 字典数据信息 + * @return 结果 + */ + @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType") + @Override + public List insertDictData(SysDictDataBo bo) { + SysDictData data = MapstructUtils.convert(bo, SysDictData.class); + int row = baseMapper.insert(data); + if (row > 0) { + return baseMapper.selectDictDataByType(data.getDictType()); + } + throw new ServiceException("操作失败"); + } + + /** + * 修改保存字典数据信息 + * + * @param bo 字典数据信息 + * @return 结果 + */ + @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType") + @Override + public List updateDictData(SysDictDataBo bo) { + SysDictData data = MapstructUtils.convert(bo, SysDictData.class); + int row = baseMapper.updateById(data); + if (row > 0) { + return baseMapper.selectDictDataByType(data.getDictType()); + } + throw new ServiceException("操作失败"); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysDictTypeServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysDictTypeServiceImpl.java new file mode 100644 index 0000000..f06ddc2 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysDictTypeServiceImpl.java @@ -0,0 +1,268 @@ +package org.aibidding.system.service.impl; + +import cn.dev33.satoken.context.SaHolder; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.aibidding.common.core.constant.CacheConstants; +import org.aibidding.common.core.constant.CacheNames; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.service.DictService; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.core.utils.StreamUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.redis.utils.CacheUtils; +import org.aibidding.system.domain.SysDictData; +import org.aibidding.system.domain.SysDictType; +import org.aibidding.system.domain.bo.SysDictTypeBo; +import org.aibidding.system.domain.vo.SysDictDataVo; +import org.aibidding.system.domain.vo.SysDictTypeVo; +import org.aibidding.system.mapper.SysDictDataMapper; +import org.aibidding.system.mapper.SysDictTypeMapper; +import org.aibidding.system.service.ISysDictTypeService; +import lombok.RequiredArgsConstructor; +import org.springframework.cache.annotation.CachePut; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 字典 业务层处理 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService { + + private final SysDictTypeMapper baseMapper; + private final SysDictDataMapper dictDataMapper; + + @Override + public TableDataInfo selectPageDictTypeList(SysDictTypeBo dictType, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(dictType); + Page page = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(page); + } + + /** + * 根据条件分页查询字典类型 + * + * @param dictType 字典类型信息 + * @return 字典类型集合信息 + */ + @Override + public List selectDictTypeList(SysDictTypeBo dictType) { + LambdaQueryWrapper lqw = buildQueryWrapper(dictType); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SysDictTypeBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getDictName()), SysDictType::getDictName, bo.getDictName()); + lqw.like(StringUtils.isNotBlank(bo.getDictType()), SysDictType::getDictType, bo.getDictType()); + lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDictType::getStatus, bo.getStatus()); + lqw.between(params.get("beginTime") != null && params.get("endTime") != null, + SysDictType::getCreateTime, params.get("beginTime"), params.get("endTime")); + return lqw; + } + + /** + * 根据所有字典类型 + * + * @return 字典类型集合信息 + */ + @Override + public List selectDictTypeAll() { + return baseMapper.selectVoList(); + } + + /** + * 根据字典类型查询字典数据 + * + * @param dictType 字典类型 + * @return 字典数据集合信息 + */ + // @Cacheable(cacheNames = CacheNames.SYS_DICT, key = "#dictType") + @Override + public List selectDictDataByType(String dictType) { + List dictDatas = dictDataMapper.selectDictDataByType(dictType); + if (CollUtil.isNotEmpty(dictDatas)) { + return dictDatas; + } + return null; + } + + /** + * 根据字典类型ID查询信息 + * + * @param dictId 字典类型ID + * @return 字典类型 + */ + @Override + public SysDictTypeVo selectDictTypeById(Long dictId) { + return baseMapper.selectVoById(dictId); + } + + /** + * 根据字典类型查询信息 + * + * @param dictType 字典类型 + * @return 字典类型 + */ + @Cacheable(cacheNames = CacheNames.SYS_DICT, key = "#dictType") + @Override + public SysDictTypeVo selectDictTypeByType(String dictType) { + return baseMapper.selectVoById(new LambdaQueryWrapper().eq(SysDictType::getDictType, dictType)); + } + + /** + * 批量删除字典类型信息 + * + * @param dictIds 需要删除的字典ID + */ + @Override + public void deleteDictTypeByIds(Long[] dictIds) { + for (Long dictId : dictIds) { + SysDictType dictType = baseMapper.selectById(dictId); + if (dictDataMapper.exists(new LambdaQueryWrapper() + .eq(SysDictData::getDictType, dictType.getDictType()))) { + throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName())); + } + CacheUtils.evict(CacheNames.SYS_DICT, dictType.getDictType()); + } + baseMapper.deleteBatchIds(Arrays.asList(dictIds)); + } + + /** + * 重置字典缓存数据 + */ + @Override + public void resetDictCache() { + CacheUtils.clear(CacheNames.SYS_DICT); + } + + /** + * 新增保存字典类型信息 + * + * @param bo 字典类型信息 + * @return 结果 + */ + @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType") + @Override + public List insertDictType(SysDictTypeBo bo) { + SysDictType dict = MapstructUtils.convert(bo, SysDictType.class); + int row = baseMapper.insert(dict); + if (row > 0) { + return new ArrayList<>(); + } + throw new ServiceException("操作失败"); + } + + /** + * 修改保存字典类型信息 + * + * @param bo 字典类型信息 + * @return 结果 + */ + @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType") + @Override + @Transactional(rollbackFor = Exception.class) + public List updateDictType(SysDictTypeBo bo) { + SysDictType dict = MapstructUtils.convert(bo, SysDictType.class); + SysDictType oldDict = baseMapper.selectById(dict.getDictId()); + dictDataMapper.update(null, new LambdaUpdateWrapper() + .set(SysDictData::getDictType, dict.getDictType()) + .eq(SysDictData::getDictType, oldDict.getDictType())); + int row = baseMapper.updateById(dict); + if (row > 0) { + CacheUtils.evict(CacheNames.SYS_DICT, oldDict.getDictType()); + return dictDataMapper.selectDictDataByType(dict.getDictType()); + } + throw new ServiceException("操作失败"); + } + + /** + * 校验字典类型称是否唯一 + * + * @param dictType 字典类型 + * @return 结果 + */ + @Override + public boolean checkDictTypeUnique(SysDictTypeBo dictType) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysDictType::getDictType, dictType.getDictType()) + .ne(ObjectUtil.isNotNull(dictType.getDictId()), SysDictType::getDictId, dictType.getDictId())); + return !exist; + } + + /** + * 根据字典类型和字典值获取字典标签 + * + * @param dictType 字典类型 + * @param dictValue 字典值 + * @param separator 分隔符 + * @return 字典标签 + */ + @SuppressWarnings("unchecked cast") + @Override + public String getDictLabel(String dictType, String dictValue, String separator) { + // 优先从本地缓存获取 + List datas = (List) SaHolder.getStorage().get(CacheConstants.SYS_DICT_KEY + dictType); + if (ObjectUtil.isNull(datas)) { + datas = SpringUtils.getAopProxy(this).selectDictDataByType(dictType); + SaHolder.getStorage().set(CacheConstants.SYS_DICT_KEY + dictType, datas); + } + + Map map = StreamUtils.toMap(datas, SysDictDataVo::getDictValue, SysDictDataVo::getDictLabel); + if (StringUtils.containsAny(dictValue, separator)) { + return Arrays.stream(dictValue.split(separator)) + .map(v -> map.getOrDefault(v, StringUtils.EMPTY)) + .collect(Collectors.joining(separator)); + } else { + return map.getOrDefault(dictValue, StringUtils.EMPTY); + } + } + + /** + * 根据字典类型和字典标签获取字典值 + * + * @param dictType 字典类型 + * @param dictLabel 字典标签 + * @param separator 分隔符 + * @return 字典值 + */ + @SuppressWarnings("unchecked cast") + @Override + public String getDictValue(String dictType, String dictLabel, String separator) { + // 优先从本地缓存获取 + List datas = (List) SaHolder.getStorage().get(CacheConstants.SYS_DICT_KEY + dictType); + if (ObjectUtil.isNull(datas)) { + datas = SpringUtils.getAopProxy(this).selectDictDataByType(dictType); + SaHolder.getStorage().set(CacheConstants.SYS_DICT_KEY + dictType, datas); + } + + Map map = StreamUtils.toMap(datas, SysDictDataVo::getDictLabel, SysDictDataVo::getDictValue); + if (StringUtils.containsAny(dictLabel, separator)) { + return Arrays.stream(dictLabel.split(separator)) + .map(l -> map.getOrDefault(l, StringUtils.EMPTY)) + .collect(Collectors.joining(separator)); + } else { + return map.getOrDefault(dictLabel, StringUtils.EMPTY); + } + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysLogininforServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysLogininforServiceImpl.java new file mode 100644 index 0000000..3f0e266 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysLogininforServiceImpl.java @@ -0,0 +1,160 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.http.useragent.UserAgent; +import cn.hutool.http.useragent.UserAgentUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.aibidding.common.core.constant.Constants; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.ServletUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.core.utils.ip.AddressUtils; +import org.aibidding.common.log.event.LogininforEvent; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.SysLogininfor; +import org.aibidding.system.domain.bo.SysLogininforBo; +import org.aibidding.system.domain.vo.SysLogininforVo; +import org.aibidding.system.mapper.SysLogininforMapper; +import org.aibidding.system.service.ISysLogininforService; +import jakarta.servlet.http.HttpServletRequest; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.event.EventListener; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 系统访问日志情况信息 服务层处理 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Slf4j +@Service +public class SysLogininforServiceImpl implements ISysLogininforService { + + private final SysLogininforMapper baseMapper; + + /** + * 记录登录信息 + * + * @param logininforEvent 登录事件 + */ + @Async + @EventListener + public void recordLogininfor(LogininforEvent logininforEvent) { + HttpServletRequest request = logininforEvent.getRequest(); + final UserAgent userAgent = UserAgentUtil.parse(request.getHeader("User-Agent")); + final String ip = ServletUtils.getClientIP(request); + + String address = AddressUtils.getRealAddressByIP(ip); + StringBuilder s = new StringBuilder(); + s.append(getBlock(ip)); + s.append(address); + s.append(getBlock(logininforEvent.getUsername())); + s.append(getBlock(logininforEvent.getStatus())); + s.append(getBlock(logininforEvent.getMessage())); + // 打印信息到日志 + log.info(s.toString(), logininforEvent.getArgs()); + // 获取客户端操作系统 + String os = userAgent.getOs().getName(); + // 获取客户端浏览器 + String browser = userAgent.getBrowser().getName(); + // 封装对象 + SysLogininforBo logininfor = new SysLogininforBo(); + logininfor.setTenantId(logininforEvent.getTenantId()); + logininfor.setUserName(logininforEvent.getUsername()); + logininfor.setIpaddr(ip); + logininfor.setLoginLocation(address); + logininfor.setBrowser(browser); + logininfor.setOs(os); + logininfor.setMsg(logininforEvent.getMessage()); + // 日志状态 + if (StringUtils.equalsAny(logininforEvent.getStatus(), Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER)) { + logininfor.setStatus(Constants.SUCCESS); + } else if (Constants.LOGIN_FAIL.equals(logininforEvent.getStatus())) { + logininfor.setStatus(Constants.FAIL); + } + // 插入数据 + insertLogininfor(logininfor); + } + + private String getBlock(Object msg) { + if (msg == null) { + msg = ""; + } + return "[" + msg.toString() + "]"; + } + + @Override + public TableDataInfo selectPageLogininforList(SysLogininforBo logininfor, PageQuery pageQuery) { + Map params = logininfor.getParams(); + LambdaQueryWrapper lqw = new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(logininfor.getIpaddr()), SysLogininfor::getIpaddr, logininfor.getIpaddr()) + .eq(StringUtils.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus()) + .like(StringUtils.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + SysLogininfor::getLoginTime, params.get("beginTime"), params.get("endTime")); + if (StringUtils.isBlank(pageQuery.getOrderByColumn())) { + pageQuery.setOrderByColumn("info_id"); + pageQuery.setIsAsc("desc"); + } + Page page = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(page); + } + + /** + * 新增系统登录日志 + * + * @param bo 访问日志对象 + */ + @Override + public void insertLogininfor(SysLogininforBo bo) { + SysLogininfor logininfor = MapstructUtils.convert(bo, SysLogininfor.class); + logininfor.setLoginTime(new Date()); + baseMapper.insert(logininfor); + } + + /** + * 查询系统登录日志集合 + * + * @param logininfor 访问日志对象 + * @return 登录记录集合 + */ + @Override + public List selectLogininforList(SysLogininforBo logininfor) { + Map params = logininfor.getParams(); + return baseMapper.selectVoList(new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(logininfor.getIpaddr()), SysLogininfor::getIpaddr, logininfor.getIpaddr()) + .eq(StringUtils.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus()) + .like(StringUtils.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + SysLogininfor::getLoginTime, params.get("beginTime"), params.get("endTime")) + .orderByDesc(SysLogininfor::getInfoId)); + } + + /** + * 批量删除系统登录日志 + * + * @param infoIds 需要删除的登录日志ID + * @return 结果 + */ + @Override + public int deleteLogininforByIds(Long[] infoIds) { + return baseMapper.deleteBatchIds(Arrays.asList(infoIds)); + } + + /** + * 清空系统登录日志 + */ + @Override + public void cleanLogininfor() { + baseMapper.delete(new LambdaQueryWrapper<>()); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysMenuServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysMenuServiceImpl.java new file mode 100644 index 0000000..d14cfea --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysMenuServiceImpl.java @@ -0,0 +1,365 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.lang.tree.Tree; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StreamUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.core.utils.TreeBuildUtils; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.system.domain.SysMenu; +import org.aibidding.system.domain.SysRole; +import org.aibidding.system.domain.SysRoleMenu; +import org.aibidding.system.domain.SysTenantPackage; +import org.aibidding.system.domain.bo.SysMenuBo; +import org.aibidding.system.domain.vo.MetaVo; +import org.aibidding.system.domain.vo.RouterVo; +import org.aibidding.system.domain.vo.SysMenuVo; +import org.aibidding.system.mapper.SysMenuMapper; +import org.aibidding.system.mapper.SysRoleMapper; +import org.aibidding.system.mapper.SysRoleMenuMapper; +import org.aibidding.system.mapper.SysTenantPackageMapper; +import org.aibidding.system.service.ISysMenuService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * 菜单 业务层处理 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysMenuServiceImpl implements ISysMenuService { + + private final SysMenuMapper baseMapper; + private final SysRoleMapper roleMapper; + private final SysRoleMenuMapper roleMenuMapper; + private final SysTenantPackageMapper tenantPackageMapper; + + /** + * 根据用户查询系统菜单列表 + * + * @param userId 用户ID + * @return 菜单列表 + */ + @Override + public List selectMenuList(Long userId) { + return selectMenuList(new SysMenuBo(), userId); + } + + /** + * 查询系统菜单列表 + * + * @param menu 菜单信息 + * @return 菜单列表 + */ + @Override + public List selectMenuList(SysMenuBo menu, Long userId) { + List menuList; + // 管理员显示所有菜单信息 + if (LoginHelper.isSuperAdmin(userId)) { + menuList = baseMapper.selectVoList(new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(menu.getMenuName()), SysMenu::getMenuName, menu.getMenuName()) + .eq(StringUtils.isNotBlank(menu.getVisible()), SysMenu::getVisible, menu.getVisible()) + .eq(StringUtils.isNotBlank(menu.getStatus()), SysMenu::getStatus, menu.getStatus()) + .orderByAsc(SysMenu::getParentId) + .orderByAsc(SysMenu::getOrderNum)); + } else { + QueryWrapper wrapper = Wrappers.query(); + wrapper.eq("sur.user_id", userId) + .like(StringUtils.isNotBlank(menu.getMenuName()), "m.menu_name", menu.getMenuName()) + .eq(StringUtils.isNotBlank(menu.getVisible()), "m.visible", menu.getVisible()) + .eq(StringUtils.isNotBlank(menu.getStatus()), "m.status", menu.getStatus()) + .orderByAsc("m.parent_id") + .orderByAsc("m.order_num"); + List list = baseMapper.selectMenuListByUserId(wrapper); + menuList = MapstructUtils.convert(list, SysMenuVo.class); + } + return menuList; + } + + /** + * 根据用户ID查询权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + @Override + public Set selectMenuPermsByUserId(Long userId) { + List perms = baseMapper.selectMenuPermsByUserId(userId); + Set permsSet = new HashSet<>(); + for (String perm : perms) { + if (StringUtils.isNotEmpty(perm)) { + permsSet.addAll(StringUtils.splitList(perm.trim())); + } + } + return permsSet; + } + + /** + * 根据角色ID查询权限 + * + * @param roleId 角色ID + * @return 权限列表 + */ + @Override + public Set selectMenuPermsByRoleId(Long roleId) { + List perms = baseMapper.selectMenuPermsByRoleId(roleId); + Set permsSet = new HashSet<>(); + for (String perm : perms) { + if (StringUtils.isNotEmpty(perm)) { + permsSet.addAll(StringUtils.splitList(perm.trim())); + } + } + return permsSet; + } + + /** + * 根据用户ID查询菜单 + * + * @param userId 用户名称 + * @return 菜单列表 + */ + @Override + public List selectMenuTreeByUserId(Long userId) { + List menus; + if (LoginHelper.isSuperAdmin(userId)) { + menus = baseMapper.selectMenuTreeAll(); + } else { + menus = baseMapper.selectMenuTreeByUserId(userId); + } + return getChildPerms(menus, 0); + } + + /** + * 根据角色ID查询菜单树信息 + * + * @param roleId 角色ID + * @return 选中菜单列表 + */ + @Override + public List selectMenuListByRoleId(Long roleId) { + SysRole role = roleMapper.selectById(roleId); + return baseMapper.selectMenuListByRoleId(roleId, role.getMenuCheckStrictly()); + } + + /** + * 根据租户套餐ID查询菜单树信息 + * + * @param packageId 租户套餐ID + * @return 选中菜单列表 + */ + @Override + public List selectMenuListByPackageId(Long packageId) { + SysTenantPackage tenantPackage = tenantPackageMapper.selectById(packageId); + List menuIds = StringUtils.splitTo(tenantPackage.getMenuIds(), Convert::toLong); + if (CollUtil.isEmpty(menuIds)) { + return List.of(); + } + List parentIds = null; + if (tenantPackage.getMenuCheckStrictly()) { + parentIds = baseMapper.selectObjs(new LambdaQueryWrapper() + .select(SysMenu::getParentId) + .in(SysMenu::getMenuId, menuIds), Convert::toLong); + } + return baseMapper.selectObjs(new LambdaQueryWrapper() + .in(SysMenu::getMenuId, menuIds) + .notIn(CollUtil.isNotEmpty(parentIds), SysMenu::getMenuId, parentIds), Convert::toLong); + } + + /** + * 构建前端路由所需要的菜单 + * + * @param menus 菜单列表 + * @return 路由列表 + */ + @Override + public List buildMenus(List menus) { + List routers = new LinkedList<>(); + for (SysMenu menu : menus) { + RouterVo router = new RouterVo(); + router.setHidden("1".equals(menu.getVisible())); + router.setName(menu.getRouteName()); + router.setPath(menu.getRouterPath()); + router.setComponent(menu.getComponentInfo()); + router.setQuery(menu.getQueryParam()); + router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); + List cMenus = menu.getChildren(); + if (CollUtil.isNotEmpty(cMenus) && UserConstants.TYPE_DIR.equals(menu.getMenuType())) { + router.setAlwaysShow(true); + router.setRedirect("noRedirect"); + router.setChildren(buildMenus(cMenus)); + } else if (menu.isMenuFrame()) { + router.setMeta(null); + List childrenList = new ArrayList<>(); + RouterVo children = new RouterVo(); + children.setPath(menu.getPath()); + children.setComponent(menu.getComponentInfo()); + children.setName(StringUtils.capitalize(menu.getPath())); + children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); + children.setQuery(menu.getQueryParam()); + childrenList.add(children); + router.setChildren(childrenList); + } else if (menu.getParentId().intValue() == 0 && menu.isInnerLink()) { + router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); + router.setPath("/"); + List childrenList = new ArrayList<>(); + RouterVo children = new RouterVo(); + String routerPath = SysMenu.innerLinkReplaceEach(menu.getPath()); + children.setPath(routerPath); + children.setComponent(UserConstants.INNER_LINK); + children.setName(StringUtils.capitalize(routerPath)); + children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getPath())); + childrenList.add(children); + router.setChildren(childrenList); + } + routers.add(router); + } + return routers; + } + + /** + * 构建前端所需要下拉树结构 + * + * @param menus 菜单列表 + * @return 下拉树结构列表 + */ + @Override + public List> buildMenuTreeSelect(List menus) { + if (CollUtil.isEmpty(menus)) { + return CollUtil.newArrayList(); + } + return TreeBuildUtils.build(menus, (menu, tree) -> + tree.setId(menu.getMenuId()) + .setParentId(menu.getParentId()) + .setName(menu.getMenuName()) + .setWeight(menu.getOrderNum())); + } + + /** + * 根据菜单ID查询信息 + * + * @param menuId 菜单ID + * @return 菜单信息 + */ + @Override + public SysMenuVo selectMenuById(Long menuId) { + return baseMapper.selectVoById(menuId); + } + + /** + * 是否存在菜单子节点 + * + * @param menuId 菜单ID + * @return 结果 + */ + @Override + public boolean hasChildByMenuId(Long menuId) { + return baseMapper.exists(new LambdaQueryWrapper().eq(SysMenu::getParentId, menuId)); + } + + /** + * 查询菜单使用数量 + * + * @param menuId 菜单ID + * @return 结果 + */ + @Override + public boolean checkMenuExistRole(Long menuId) { + return roleMenuMapper.exists(new LambdaQueryWrapper().eq(SysRoleMenu::getMenuId, menuId)); + } + + /** + * 新增保存菜单信息 + * + * @param bo 菜单信息 + * @return 结果 + */ + @Override + public int insertMenu(SysMenuBo bo) { + SysMenu menu = MapstructUtils.convert(bo, SysMenu.class); + return baseMapper.insert(menu); + } + + /** + * 修改保存菜单信息 + * + * @param bo 菜单信息 + * @return 结果 + */ + @Override + public int updateMenu(SysMenuBo bo) { + SysMenu menu = MapstructUtils.convert(bo, SysMenu.class); + return baseMapper.updateById(menu); + } + + /** + * 删除菜单管理信息 + * + * @param menuId 菜单ID + * @return 结果 + */ + @Override + public int deleteMenuById(Long menuId) { + return baseMapper.deleteById(menuId); + } + + /** + * 校验菜单名称是否唯一 + * + * @param menu 菜单信息 + * @return 结果 + */ + @Override + public boolean checkMenuNameUnique(SysMenuBo menu) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysMenu::getMenuName, menu.getMenuName()) + .eq(SysMenu::getParentId, menu.getParentId()) + .ne(ObjectUtil.isNotNull(menu.getMenuId()), SysMenu::getMenuId, menu.getMenuId())); + return !exist; + } + + /** + * 根据父节点的ID获取所有子节点 + * + * @param list 分类表 + * @param parentId 传入的父节点ID + * @return String + */ + private List getChildPerms(List list, int parentId) { + List returnList = new ArrayList<>(); + for (SysMenu t : list) { + // 一、根据传入的某个父节点ID,遍历该父节点的所有子节点 + if (t.getParentId() == parentId) { + recursionFn(list, t); + returnList.add(t); + } + } + return returnList; + } + + /** + * 递归列表 + */ + private void recursionFn(List list, SysMenu t) { + // 得到子节点列表 + List childList = StreamUtils.filter(list, n -> n.getParentId().equals(t.getMenuId())); + t.setChildren(childList); + for (SysMenu tChild : childList) { + // 判断是否有子节点 + if (list.stream().anyMatch(n -> n.getParentId().equals(tChild.getMenuId()))) { + recursionFn(list, tChild); + } + } + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysModelServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysModelServiceImpl.java new file mode 100644 index 0000000..51377c5 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysModelServiceImpl.java @@ -0,0 +1,117 @@ +package org.aibidding.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.SysModel; +import org.aibidding.system.domain.bo.SysModelBo; +import org.aibidding.system.domain.vo.SysModelVo; +import org.aibidding.system.mapper.SysModelMapper; +import org.aibidding.system.service.ISysModelService; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.List; + +/** + * 系统模型Service业务层处理 + * + * @author Lion Li + * @date 2024-04-04 + */ +@RequiredArgsConstructor +@Service +public class SysModelServiceImpl implements ISysModelService { + + private final SysModelMapper baseMapper; + + /** + * 查询系统模型 + */ + @Override + public SysModelVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询系统模型列表 + */ + @Override + public TableDataInfo queryPageList(SysModelBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询系统模型列表 + */ + @Override + public List queryList(SysModelBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SysModelBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getModelName()), SysModel::getModelName, bo.getModelName()); + lqw.like(StringUtils.isNotBlank(bo.getModelShow()), SysModel::getModelShow, bo.getModelShow()); + lqw.eq(StringUtils.isNotBlank(bo.getModelDescribe()), SysModel::getModelDescribe, bo.getModelDescribe()); + lqw.eq(StringUtils.isNotBlank(bo.getModelType()), SysModel::getModelType, bo.getModelType()); + return lqw; + } + + /** + * 新增系统模型 + */ + @Override + public Boolean insertByBo(SysModelBo bo) { + SysModel add = MapstructUtils.convert(bo, SysModel.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改系统模型 + */ + @Override + public Boolean updateByBo(SysModelBo bo) { + SysModel update = MapstructUtils.convert(bo, SysModel.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(SysModel entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除系统模型 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } + + @Override + public SysModel selectModelByName(String modelName) { + return baseMapper.selectOne( + new LambdaQueryWrapper().eq(SysModel::getModelName, modelName) + ); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysNoticeServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysNoticeServiceImpl.java new file mode 100644 index 0000000..3c11f61 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysNoticeServiceImpl.java @@ -0,0 +1,165 @@ +package org.aibidding.system.service.impl; + +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.system.domain.SysNotice; +import org.aibidding.system.domain.SysNoticeState; +import org.aibidding.system.domain.SysUser; +import org.aibidding.system.domain.bo.SysNoticeBo; +import org.aibidding.system.domain.vo.SysNoticeVo; +import org.aibidding.system.domain.vo.SysUserVo; +import org.aibidding.system.mapper.SysNoticeMapper; +import org.aibidding.system.mapper.SysNoticeStateMapper; +import org.aibidding.system.mapper.SysUserMapper; +import org.aibidding.system.service.ISysNoticeService; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * 公告 服务层实现 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysNoticeServiceImpl implements ISysNoticeService { + + private final SysNoticeMapper baseMapper; + private final SysNoticeStateMapper noticeStateMapper; + private final SysUserMapper userMapper; + + @Override + public TableDataInfo selectPageNoticeList(SysNoticeBo notice, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(notice); + Page page = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(page); + } + + /** + * 查询公告信息 + * + * @param noticeId 公告ID + * @return 公告信息 + */ + @Override + public SysNoticeVo selectNoticeById(Long noticeId) { + return baseMapper.selectVoById(noticeId); + } + + /** + * 查询公告列表 + * + * @param notice 公告信息 + * @return 公告集合 + */ + @Override + public SysNotice getNotice(SysNoticeBo notice) { + if(!StpUtil.isLogin()){ + return null; + } + + LambdaQueryWrapper lqwState = Wrappers.lambdaQuery(); + Long userId = LoginHelper.getLoginUser().getUserId(); + + lqwState.eq(userId != null, SysNoticeState::getUserId, userId); + // 查询未读通知 + lqwState.eq(SysNoticeState::getReadStatus, "0"); + lqwState.orderByDesc(SysNoticeState::getCreateTime); // 按创建时间降序排序 + List states = noticeStateMapper.selectList(lqwState); // 查询公告阅读状态 + SysNoticeState sysNoticeState = states.isEmpty() ? null : states.get(0); // 取第一条记录 + if (sysNoticeState != null) { + return baseMapper.selectById(sysNoticeState.getNoticeId()); + }else { + return null; + } + } + + private LambdaQueryWrapper buildQueryWrapper(SysNoticeBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getNoticeTitle()), SysNotice::getNoticeTitle, bo.getNoticeTitle()); + lqw.eq(StringUtils.isNotBlank(bo.getNoticeType()), SysNotice::getNoticeType, bo.getNoticeType()); + if (StringUtils.isNotBlank(bo.getCreateByName())) { + SysUserVo sysUser = userMapper.selectUserByUserName(bo.getCreateByName()); + lqw.eq(SysNotice::getCreateBy, ObjectUtil.isNotNull(sysUser) ? sysUser.getUserId() : null); + } + return lqw; + } + + /** + * 新增公告 + * + * @param bo 公告信息 + * @return 结果 + */ + @Override + public int insertNotice(SysNoticeBo bo) { + SysNotice notice = MapstructUtils.convert(bo, SysNotice.class); + // 插入公告 + int insert = baseMapper.insert(notice); + // 公告类型(1通知 2公告) + if("1".equals(bo.getNoticeType())){ + // 将之前通知全部设为已读 + noticeStateMapper.readAllNotice(); + // 插入通知阅读状态 + List sysUserList = userMapper.selectList(); + List noticeStateList = new ArrayList<>(); + for (SysUser sysUser : sysUserList) { + SysNoticeState sysNoticeState = new SysNoticeState(); + if (notice != null) { + sysNoticeState.setNoticeId(notice.getNoticeId()); + sysNoticeState.setUserId(sysUser.getUserId()); + noticeStateList.add(sysNoticeState); + } + } + noticeStateMapper.insertBatch(noticeStateList); + } + return insert; + } + + /** + * 修改公告 + * + * @param bo 公告信息 + * @return 结果 + */ + @Override + public int updateNotice(SysNoticeBo bo) { + SysNotice notice = MapstructUtils.convert(bo, SysNotice.class); + return baseMapper.updateById(notice); + + } + + /** + * 删除公告对象 + * + * @param noticeId 公告ID + * @return 结果 + */ + @Override + public int deleteNoticeById(Long noticeId) { + return baseMapper.deleteById(noticeId); + } + + /** + * 批量删除公告信息 + * + * @param noticeIds 需要删除的公告ID + * @return 结果 + */ + @Override + public int deleteNoticeByIds(Long[] noticeIds) { + return baseMapper.deleteBatchIds(Arrays.asList(noticeIds)); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysNoticeStateServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysNoticeStateServiceImpl.java new file mode 100644 index 0000000..ed1ef08 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysNoticeStateServiceImpl.java @@ -0,0 +1,112 @@ +package org.aibidding.system.service.impl; + +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.aibidding.system.domain.bo.SysNoticeStateBo; +import org.aibidding.system.domain.vo.SysNoticeStateVo; +import org.aibidding.system.domain.SysNoticeState; +import org.aibidding.system.mapper.SysNoticeStateMapper; +import org.aibidding.system.service.ISysNoticeStateService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 用户阅读状态Service业务层处理 + * + * @author Lion Li + * @date 2024-05-11 + */ +@RequiredArgsConstructor +@Service +public class SysNoticeStateServiceImpl implements ISysNoticeStateService { + + private final SysNoticeStateMapper baseMapper; + + /** + * 查询用户阅读状态 + */ + @Override + public SysNoticeStateVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询用户阅读状态列表 + */ + @Override + public TableDataInfo queryPageList(SysNoticeStateBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询用户阅读状态列表 + */ + @Override + public List queryList(SysNoticeStateBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SysNoticeStateBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(bo.getUserId() != null, SysNoticeState::getUserId, bo.getUserId()); + lqw.eq(bo.getNoticeId() != null, SysNoticeState::getNoticeId, bo.getNoticeId()); + lqw.eq(StringUtils.isNotBlank(bo.getReadStatus()), SysNoticeState::getReadStatus, bo.getReadStatus()); + return lqw; + } + + /** + * 新增用户阅读状态 + */ + @Override + public Boolean insertByBo(SysNoticeStateBo bo) { + SysNoticeState add = MapstructUtils.convert(bo, SysNoticeState.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改用户阅读状态 + */ + @Override + public Boolean updateByBo(SysNoticeStateBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + SysNoticeState sysNoticeState = baseMapper.selectOne(lqw); + sysNoticeState.setReadStatus("1"); + return baseMapper.updateById(sysNoticeState) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(SysNoticeState entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除用户阅读状态 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysOperLogServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysOperLogServiceImpl.java new file mode 100644 index 0000000..7289875 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysOperLogServiceImpl.java @@ -0,0 +1,144 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.core.util.ArrayUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.core.utils.ip.AddressUtils; +import org.aibidding.common.log.event.OperLogEvent; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.SysOperLog; +import org.aibidding.system.domain.bo.SysOperLogBo; +import org.aibidding.system.domain.vo.SysOperLogVo; +import org.aibidding.system.mapper.SysOperLogMapper; +import org.aibidding.system.service.ISysOperLogService; +import org.springframework.context.event.EventListener; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 操作日志 服务层处理 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysOperLogServiceImpl implements ISysOperLogService { + + private final SysOperLogMapper baseMapper; + + /** + * 操作日志记录 + * + * @param operLogEvent 操作日志事件 + */ + @Async + @EventListener + public void recordOper(OperLogEvent operLogEvent) { + SysOperLogBo operLog = MapstructUtils.convert(operLogEvent, SysOperLogBo.class); + // 远程查询操作地点 + operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp())); + insertOperlog(operLog); + } + + @Override + public TableDataInfo selectPageOperLogList(SysOperLogBo operLog, PageQuery pageQuery) { + Map params = operLog.getParams(); + LambdaQueryWrapper lqw = new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle()) + .eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0, + SysOperLog::getBusinessType, operLog.getBusinessType()) + .func(f -> { + if (ArrayUtil.isNotEmpty(operLog.getBusinessTypes())) { + f.in(SysOperLog::getBusinessType, Arrays.asList(operLog.getBusinessTypes())); + } + }) + .eq(operLog.getStatus() != null, + SysOperLog::getStatus, operLog.getStatus()) + .like(StringUtils.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + SysOperLog::getOperTime, params.get("beginTime"), params.get("endTime")); + if (StringUtils.isBlank(pageQuery.getOrderByColumn())) { + pageQuery.setOrderByColumn("oper_id"); + pageQuery.setIsAsc("desc"); + } + Page page = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(page); + } + + /** + * 新增操作日志 + * + * @param bo 操作日志对象 + */ + @Override + public void insertOperlog(SysOperLogBo bo) { + SysOperLog operLog = MapstructUtils.convert(bo, SysOperLog.class); + operLog.setOperTime(new Date()); + baseMapper.insert(operLog); + } + + /** + * 查询系统操作日志集合 + * + * @param operLog 操作日志对象 + * @return 操作日志集合 + */ + @Override + public List selectOperLogList(SysOperLogBo operLog) { + Map params = operLog.getParams(); + return baseMapper.selectVoList(new LambdaQueryWrapper() + .like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle()) + .eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0, + SysOperLog::getBusinessType, operLog.getBusinessType()) + .func(f -> { + if (ArrayUtil.isNotEmpty(operLog.getBusinessTypes())) { + f.in(SysOperLog::getBusinessType, Arrays.asList(operLog.getBusinessTypes())); + } + }) + .eq(operLog.getStatus() != null && operLog.getStatus() > 0, + SysOperLog::getStatus, operLog.getStatus()) + .like(StringUtils.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + SysOperLog::getOperTime, params.get("beginTime"), params.get("endTime")) + .orderByDesc(SysOperLog::getOperId)); + } + + /** + * 批量删除系统操作日志 + * + * @param operIds 需要删除的操作日志ID + * @return 结果 + */ + @Override + public int deleteOperLogByIds(Long[] operIds) { + return baseMapper.deleteBatchIds(Arrays.asList(operIds)); + } + + /** + * 查询操作日志详细 + * + * @param operId 操作ID + * @return 操作日志对象 + */ + @Override + public SysOperLogVo selectOperLogById(Long operId) { + return baseMapper.selectVoById(operId); + } + + /** + * 清空操作日志 + */ + @Override + public void cleanOperLog() { + baseMapper.delete(new LambdaQueryWrapper<>()); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysOssConfigServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysOssConfigServiceImpl.java new file mode 100644 index 0000000..948709c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysOssConfigServiceImpl.java @@ -0,0 +1,186 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.aibidding.common.core.constant.CacheNames; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StreamUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.json.utils.JsonUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.oss.constant.OssConstant; +import org.aibidding.common.redis.utils.CacheUtils; +import org.aibidding.common.redis.utils.RedisUtils; +import org.aibidding.common.tenant.core.TenantEntity; +import org.aibidding.common.tenant.helper.TenantHelper; +import org.aibidding.system.domain.SysOssConfig; +import org.aibidding.system.domain.bo.SysOssConfigBo; +import org.aibidding.system.domain.vo.SysOssConfigVo; +import org.aibidding.system.mapper.SysOssConfigMapper; +import org.aibidding.system.service.ISysOssConfigService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 对象存储配置Service业务层处理 + * + * @author Lion Li + * @author 孤舟烟雨 + * @date 2021-08-13 + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class SysOssConfigServiceImpl implements ISysOssConfigService { + + private final SysOssConfigMapper baseMapper; + + /** + * 项目启动时,初始化参数到缓存,加载配置类 + */ + @Override + public void init() { + List list = TenantHelper.ignore(() -> + baseMapper.selectList( + new LambdaQueryWrapper().orderByAsc(TenantEntity::getTenantId)) + ); + Map> map = StreamUtils.groupByKey(list, SysOssConfig::getTenantId); + try { + for (String tenantId : map.keySet()) { + TenantHelper.setDynamic(tenantId); + // 加载OSS初始化配置 + for (SysOssConfig config : map.get(tenantId)) { + String configKey = config.getConfigKey(); + if ("0".equals(config.getStatus())) { + RedisUtils.setCacheObject(OssConstant.DEFAULT_CONFIG_KEY, configKey); + } + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); + } + } + } finally { + TenantHelper.clearDynamic(); + } + } + + @Override + public SysOssConfigVo queryById(Long ossConfigId) { + return baseMapper.selectVoById(ossConfigId); + } + + @Override + public TableDataInfo queryPageList(SysOssConfigBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + + private LambdaQueryWrapper buildQueryWrapper(SysOssConfigBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getConfigKey()), SysOssConfig::getConfigKey, bo.getConfigKey()); + lqw.like(StringUtils.isNotBlank(bo.getBucketName()), SysOssConfig::getBucketName, bo.getBucketName()); + lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysOssConfig::getStatus, bo.getStatus()); + return lqw; + } + + @Override + public Boolean insertByBo(SysOssConfigBo bo) { + SysOssConfig config = MapstructUtils.convert(bo, SysOssConfig.class); + validEntityBeforeSave(config); + boolean flag = baseMapper.insert(config) > 0; + if (flag) { + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); + } + return flag; + } + + @Override + public Boolean updateByBo(SysOssConfigBo bo) { + SysOssConfig config = MapstructUtils.convert(bo, SysOssConfig.class); + validEntityBeforeSave(config); + LambdaUpdateWrapper luw = new LambdaUpdateWrapper<>(); + luw.set(ObjectUtil.isNull(config.getPrefix()), SysOssConfig::getPrefix, ""); + luw.set(ObjectUtil.isNull(config.getRegion()), SysOssConfig::getRegion, ""); + luw.set(ObjectUtil.isNull(config.getExt1()), SysOssConfig::getExt1, ""); + luw.set(ObjectUtil.isNull(config.getRemark()), SysOssConfig::getRemark, ""); + luw.eq(SysOssConfig::getOssConfigId, config.getOssConfigId()); + boolean flag = baseMapper.update(config, luw) > 0; + if (flag) { + CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); + } + return flag; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(SysOssConfig entity) { + if (StringUtils.isNotEmpty(entity.getConfigKey()) + && !checkConfigKeyUnique(entity)) { + throw new ServiceException("操作配置'" + entity.getConfigKey() + "'失败, 配置key已存在!"); + } + } + + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if (isValid) { + if (CollUtil.containsAny(ids, OssConstant.SYSTEM_DATA_IDS)) { + throw new ServiceException("系统内置, 不可删除!"); + } + } + List list = CollUtil.newArrayList(); + for (Long configId : ids) { + SysOssConfig config = baseMapper.selectById(configId); + list.add(config); + } + boolean flag = baseMapper.deleteBatchIds(ids) > 0; + if (flag) { + list.forEach(sysOssConfig -> + CacheUtils.evict(CacheNames.SYS_OSS_CONFIG, sysOssConfig.getConfigKey())); + } + return flag; + } + + /** + * 判断configKey是否唯一 + */ + private boolean checkConfigKeyUnique(SysOssConfig sysOssConfig) { + long ossConfigId = ObjectUtil.isNull(sysOssConfig.getOssConfigId()) ? -1L : sysOssConfig.getOssConfigId(); + SysOssConfig info = baseMapper.selectOne(new LambdaQueryWrapper() + .select(SysOssConfig::getOssConfigId, SysOssConfig::getConfigKey) + .eq(SysOssConfig::getConfigKey, sysOssConfig.getConfigKey())); + if (ObjectUtil.isNotNull(info) && info.getOssConfigId() != ossConfigId) { + return false; + } + return true; + } + + /** + * 启用禁用状态 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int updateOssConfigStatus(SysOssConfigBo bo) { + SysOssConfig sysOssConfig = MapstructUtils.convert(bo, SysOssConfig.class); + int row = baseMapper.update(null, new LambdaUpdateWrapper() + .set(SysOssConfig::getStatus, "1")); + row += baseMapper.updateById(sysOssConfig); + if (row > 0) { + RedisUtils.setCacheObject(OssConstant.DEFAULT_CONFIG_KEY, sysOssConfig.getConfigKey()); + } + return row; + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysOssServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysOssServiceImpl.java new file mode 100644 index 0000000..40d845a --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysOssServiceImpl.java @@ -0,0 +1,174 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.core.convert.Convert; +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.constant.CacheNames; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.service.OssService; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.core.utils.StreamUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.core.utils.file.FileUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.oss.core.OssClient; +import org.aibidding.common.oss.entity.UploadResult; +import org.aibidding.common.oss.enumd.AccessPolicyType; +import org.aibidding.common.oss.factory.OssFactory; +import org.aibidding.system.domain.SysOss; +import org.aibidding.system.domain.bo.SysOssBo; +import org.aibidding.system.domain.vo.SysOssVo; +import org.aibidding.system.mapper.SysOssMapper; +import org.aibidding.system.service.ISysOssService; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 文件上传 服务层实现 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysOssServiceImpl implements ISysOssService, OssService { + + private final SysOssMapper baseMapper; + + @Override + public TableDataInfo queryPageList(SysOssBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + List filterResult = StreamUtils.toList(result.getRecords(), this::matchingUrl); + result.setRecords(filterResult); + return TableDataInfo.build(result); + } + + @Override + public List listByIds(Collection ossIds) { + List list = new ArrayList<>(); + for (Long id : ossIds) { + SysOssVo vo = SpringUtils.getAopProxy(this).getById(id); + if (ObjectUtil.isNotNull(vo)) { + list.add(this.matchingUrl(vo)); + } + } + return list; + } + + @Override + public String selectUrlByIds(String ossIds) { + List list = new ArrayList<>(); + for (Long id : StringUtils.splitTo(ossIds, Convert::toLong)) { + SysOssVo vo = SpringUtils.getAopProxy(this).getById(id); + if (ObjectUtil.isNotNull(vo)) { + list.add(this.matchingUrl(vo).getUrl()); + } + } + return String.join(StringUtils.SEPARATOR, list); + } + + private LambdaQueryWrapper buildQueryWrapper(SysOssBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getFileName()), SysOss::getFileName, bo.getFileName()); + lqw.like(StringUtils.isNotBlank(bo.getOriginalName()), SysOss::getOriginalName, bo.getOriginalName()); + lqw.eq(StringUtils.isNotBlank(bo.getFileSuffix()), SysOss::getFileSuffix, bo.getFileSuffix()); + lqw.eq(StringUtils.isNotBlank(bo.getUrl()), SysOss::getUrl, bo.getUrl()); + lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, + SysOss::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime")); + lqw.eq(ObjectUtil.isNotNull(bo.getCreateBy()), SysOss::getCreateBy, bo.getCreateBy()); + lqw.eq(StringUtils.isNotBlank(bo.getService()), SysOss::getService, bo.getService()); + return lqw; + } + + @Cacheable(cacheNames = CacheNames.SYS_OSS, key = "#ossId") + @Override + public SysOssVo getById(Long ossId) { + return baseMapper.selectVoById(ossId); + } + + @Override + public void download(Long ossId, HttpServletResponse response) throws IOException { + SysOssVo sysOss = SpringUtils.getAopProxy(this).getById(ossId); + if (ObjectUtil.isNull(sysOss)) { + throw new ServiceException("文件数据不存在!"); + } + FileUtils.setAttachmentResponseHeader(response, sysOss.getOriginalName()); + response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8"); + OssClient storage = OssFactory.instance(); + try(InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { + int available = inputStream.available(); + IoUtil.copy(inputStream, response.getOutputStream(), available); + response.setContentLength(available); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + @Override + public SysOssVo upload(MultipartFile file) { + String originalfileName = file.getOriginalFilename(); + String suffix = StringUtils.substring(originalfileName, originalfileName.lastIndexOf("."), originalfileName.length()); + OssClient storage = OssFactory.instance(); + UploadResult uploadResult; + try { + uploadResult = storage.uploadSuffix(file.getBytes(), suffix, file.getContentType()); + } catch (IOException e) { + throw new ServiceException(e.getMessage()); + } + // 保存文件信息 + SysOss oss = new SysOss(); + oss.setUrl(uploadResult.getUrl()); + oss.setFileSuffix(suffix); + oss.setFileName(uploadResult.getFilename()); + oss.setOriginalName(originalfileName); + oss.setService(storage.getConfigKey()); + baseMapper.insert(oss); + SysOssVo sysOssVo = MapstructUtils.convert(oss, SysOssVo.class); + return this.matchingUrl(sysOssVo); + } + + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if (isValid) { + // 做一些业务上的校验,判断是否需要校验 + } + List list = baseMapper.selectBatchIds(ids); + for (SysOss sysOss : list) { + OssClient storage = OssFactory.instance(sysOss.getService()); + storage.delete(sysOss.getUrl()); + } + return baseMapper.deleteBatchIds(ids) > 0; + } + + /** + * 匹配Url + * + * @param oss OSS对象 + * @return oss 匹配Url的OSS对象 + */ + private SysOssVo matchingUrl(SysOssVo oss) { + OssClient storage = OssFactory.instance(oss.getService()); + // 仅修改桶类型为 private 的URL,临时URL时长为120s + if (AccessPolicyType.PRIVATE == storage.getAccessPolicy()) { + oss.setUrl(storage.getPrivateUrl(oss.getFileName(), 120)); + } + return oss; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysPackagePlanServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysPackagePlanServiceImpl.java new file mode 100644 index 0000000..9409890 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysPackagePlanServiceImpl.java @@ -0,0 +1,112 @@ +package org.aibidding.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.SysPackagePlan; +import org.aibidding.system.domain.bo.SysPackagePlanBo; +import org.aibidding.system.domain.vo.SysPackagePlanVo; +import org.aibidding.system.mapper.SysPackagePlanMapper; +import org.aibidding.system.service.ISysPackagePlanService; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 套餐管理Service业务层处理 + * + * @author Lion Li + * @date 2024-05-05 + */ +@RequiredArgsConstructor +@Service +public class SysPackagePlanServiceImpl implements ISysPackagePlanService { + + private final SysPackagePlanMapper baseMapper; + + /** + * 查询套餐管理 + */ + @Override + public SysPackagePlanVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询套餐管理列表 + */ + @Override + public TableDataInfo queryPageList(SysPackagePlanBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询套餐管理列表 + */ + @Override + public List queryList(SysPackagePlanBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SysPackagePlanBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getName()), SysPackagePlan::getName, bo.getName()); + lqw.eq(bo.getPrice() != null, SysPackagePlan::getPrice, bo.getPrice()); + lqw.eq(bo.getDuration() != null, SysPackagePlan::getDuration, bo.getDuration()); + lqw.eq(StringUtils.isNotBlank(bo.getPlanDetail()), SysPackagePlan::getPlanDetail, bo.getPlanDetail()); + return lqw; + } + + /** + * 新增套餐管理 + */ + @Override + public Boolean insertByBo(SysPackagePlanBo bo) { + SysPackagePlan add = MapstructUtils.convert(bo, SysPackagePlan.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改套餐管理 + */ + @Override + public Boolean updateByBo(SysPackagePlanBo bo) { + SysPackagePlan update = MapstructUtils.convert(bo, SysPackagePlan.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(SysPackagePlan entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除套餐管理 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysPermissionServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysPermissionServiceImpl.java new file mode 100644 index 0000000..67933f4 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysPermissionServiceImpl.java @@ -0,0 +1,61 @@ +package org.aibidding.system.service.impl; + +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.constant.TenantConstants; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.system.service.ISysMenuService; +import org.aibidding.system.service.ISysPermissionService; +import org.aibidding.system.service.ISysRoleService; +import org.springframework.stereotype.Service; + +import java.util.HashSet; +import java.util.Set; + +/** + * 用户权限处理 + * + * @author aibidding + */ +@RequiredArgsConstructor +@Service +public class SysPermissionServiceImpl implements ISysPermissionService { + + private final ISysRoleService roleService; + private final ISysMenuService menuService; + + /** + * 获取角色数据权限 + * + * @param userId 用户id + * @return 角色权限信息 + */ + @Override + public Set getRolePermission(Long userId) { + Set roles = new HashSet<>(); + // 管理员拥有所有权限 + if (LoginHelper.isSuperAdmin(userId)) { + roles.add(TenantConstants.SUPER_ADMIN_ROLE_KEY); + } else { + roles.addAll(roleService.selectRolePermissionByUserId(userId)); + } + return roles; + } + + /** + * 获取菜单数据权限 + * + * @param userId 用户id + * @return 菜单权限信息 + */ + @Override + public Set getMenuPermission(Long userId) { + Set perms = new HashSet<>(); + // 管理员拥有所有权限 + if (LoginHelper.isSuperAdmin(userId)) { + perms.add("*:*:*"); + } else { + perms.addAll(menuService.selectMenuPermsByUserId(userId)); + } + return perms; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysPostServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysPostServiceImpl.java new file mode 100644 index 0000000..a7df8d5 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysPostServiceImpl.java @@ -0,0 +1,188 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.SysPost; +import org.aibidding.system.domain.SysUserPost; +import org.aibidding.system.domain.bo.SysPostBo; +import org.aibidding.system.domain.vo.SysPostVo; +import org.aibidding.system.mapper.SysPostMapper; +import org.aibidding.system.mapper.SysUserPostMapper; +import org.aibidding.system.service.ISysPostService; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.List; + +/** + * 岗位信息 服务层处理 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysPostServiceImpl implements ISysPostService { + + private final SysPostMapper baseMapper; + private final SysUserPostMapper userPostMapper; + + @Override + public TableDataInfo selectPagePostList(SysPostBo post, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(post); + Page page = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(page); + } + + /** + * 查询岗位信息集合 + * + * @param post 岗位信息 + * @return 岗位信息集合 + */ + @Override + public List selectPostList(SysPostBo post) { + LambdaQueryWrapper lqw = buildQueryWrapper(post); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SysPostBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getPostCode()), SysPost::getPostCode, bo.getPostCode()); + lqw.like(StringUtils.isNotBlank(bo.getPostName()), SysPost::getPostName, bo.getPostName()); + lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysPost::getStatus, bo.getStatus()); + lqw.orderByAsc(SysPost::getPostSort); + return lqw; + } + + /** + * 查询所有岗位 + * + * @return 岗位列表 + */ + @Override + public List selectPostAll() { + return baseMapper.selectVoList(new QueryWrapper<>()); + } + + /** + * 通过岗位ID查询岗位信息 + * + * @param postId 岗位ID + * @return 角色对象信息 + */ + @Override + public SysPostVo selectPostById(Long postId) { + return baseMapper.selectVoById(postId); + } + + /** + * 根据用户ID获取岗位选择框列表 + * + * @param userId 用户ID + * @return 选中岗位ID列表 + */ + @Override + public List selectPostListByUserId(Long userId) { + return baseMapper.selectPostListByUserId(userId); + } + + /** + * 校验岗位名称是否唯一 + * + * @param post 岗位信息 + * @return 结果 + */ + @Override + public boolean checkPostNameUnique(SysPostBo post) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysPost::getPostName, post.getPostName()) + .ne(ObjectUtil.isNotNull(post.getPostId()), SysPost::getPostId, post.getPostId())); + return !exist; + } + + /** + * 校验岗位编码是否唯一 + * + * @param post 岗位信息 + * @return 结果 + */ + @Override + public boolean checkPostCodeUnique(SysPostBo post) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysPost::getPostCode, post.getPostCode()) + .ne(ObjectUtil.isNotNull(post.getPostId()), SysPost::getPostId, post.getPostId())); + return !exist; + } + + /** + * 通过岗位ID查询岗位使用数量 + * + * @param postId 岗位ID + * @return 结果 + */ + @Override + public long countUserPostById(Long postId) { + return userPostMapper.selectCount(new LambdaQueryWrapper().eq(SysUserPost::getPostId, postId)); + } + + /** + * 删除岗位信息 + * + * @param postId 岗位ID + * @return 结果 + */ + @Override + public int deletePostById(Long postId) { + return baseMapper.deleteById(postId); + } + + /** + * 批量删除岗位信息 + * + * @param postIds 需要删除的岗位ID + * @return 结果 + */ + @Override + public int deletePostByIds(Long[] postIds) { + for (Long postId : postIds) { + SysPost post = baseMapper.selectById(postId); + if (countUserPostById(postId) > 0) { + throw new ServiceException(String.format("%1$s已分配,不能删除", post.getPostName())); + } + } + return baseMapper.deleteBatchIds(Arrays.asList(postIds)); + } + + /** + * 新增保存岗位信息 + * + * @param bo 岗位信息 + * @return 结果 + */ + @Override + public int insertPost(SysPostBo bo) { + SysPost post = MapstructUtils.convert(bo, SysPost.class); + return baseMapper.insert(post); + } + + /** + * 修改保存岗位信息 + * + * @param bo 岗位信息 + * @return 结果 + */ + @Override + public int updatePost(SysPostBo bo) { + SysPost post = MapstructUtils.convert(bo, SysPost.class); + return baseMapper.updateById(post); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysRoleServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysRoleServiceImpl.java new file mode 100644 index 0000000..946338c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysRoleServiceImpl.java @@ -0,0 +1,459 @@ +package org.aibidding.system.service.impl; + +import cn.dev33.satoken.exception.NotLoginException; +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.core.domain.model.LoginUser; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StreamUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.system.domain.SysRole; +import org.aibidding.system.domain.SysRoleDept; +import org.aibidding.system.domain.SysRoleMenu; +import org.aibidding.system.domain.SysUserRole; +import org.aibidding.system.domain.bo.SysRoleBo; +import org.aibidding.system.domain.vo.SysRoleVo; +import org.aibidding.system.mapper.SysRoleDeptMapper; +import org.aibidding.system.mapper.SysRoleMapper; +import org.aibidding.system.mapper.SysRoleMenuMapper; +import org.aibidding.system.mapper.SysUserRoleMapper; +import org.aibidding.system.service.ISysRoleService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * 角色 业务层处理 + * + * @author Lion Li + */ +@RequiredArgsConstructor +@Service +public class SysRoleServiceImpl implements ISysRoleService { + + private final SysRoleMapper baseMapper; + private final SysRoleMenuMapper roleMenuMapper; + private final SysUserRoleMapper userRoleMapper; + private final SysRoleDeptMapper roleDeptMapper; + + @Override + public TableDataInfo selectPageRoleList(SysRoleBo role, PageQuery pageQuery) { + Page page = baseMapper.selectPageRoleList(pageQuery.build(), this.buildQueryWrapper(role)); + return TableDataInfo.build(page); + } + + /** + * 根据条件分页查询角色数据 + * + * @param role 角色信息 + * @return 角色数据集合信息 + */ + @Override + public List selectRoleList(SysRoleBo role) { + return baseMapper.selectRoleList(this.buildQueryWrapper(role)); + } + + private Wrapper buildQueryWrapper(SysRoleBo bo) { + Map params = bo.getParams(); + QueryWrapper wrapper = Wrappers.query(); + wrapper.eq("r.del_flag", UserConstants.ROLE_NORMAL) + .eq(ObjectUtil.isNotNull(bo.getRoleId()), "r.role_id", bo.getRoleId()) + .like(StringUtils.isNotBlank(bo.getRoleName()), "r.role_name", bo.getRoleName()) + .eq(StringUtils.isNotBlank(bo.getStatus()), "r.status", bo.getStatus()) + .like(StringUtils.isNotBlank(bo.getRoleKey()), "r.role_key", bo.getRoleKey()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + "r.create_time", params.get("beginTime"), params.get("endTime")) + .orderByAsc("r.role_sort").orderByAsc("r.create_time");; + return wrapper; + } + + /** + * 根据用户ID查询角色 + * + * @param userId 用户ID + * @return 角色列表 + */ + @Override + public List selectRolesByUserId(Long userId) { + List userRoles = baseMapper.selectRolePermissionByUserId(userId); + List roles = selectRoleAll(); + for (SysRoleVo role : roles) { + for (SysRoleVo userRole : userRoles) { + if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) { + role.setFlag(true); + break; + } + } + } + return roles; + } + + /** + * 根据用户ID查询权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + @Override + public Set selectRolePermissionByUserId(Long userId) { + List perms = baseMapper.selectRolePermissionByUserId(userId); + Set permsSet = new HashSet<>(); + for (SysRoleVo perm : perms) { + if (ObjectUtil.isNotNull(perm)) { + permsSet.addAll(StringUtils.splitList(perm.getRoleKey().trim())); + } + } + return permsSet; + } + + /** + * 查询所有角色 + * + * @return 角色列表 + */ + @Override + public List selectRoleAll() { + return this.selectRoleList(new SysRoleBo()); + } + + /** + * 根据用户ID获取角色选择框列表 + * + * @param userId 用户ID + * @return 选中角色ID列表 + */ + @Override + public List selectRoleListByUserId(Long userId) { + return baseMapper.selectRoleListByUserId(userId); + } + + /** + * 通过角色ID查询角色 + * + * @param roleId 角色ID + * @return 角色对象信息 + */ + @Override + public SysRoleVo selectRoleById(Long roleId) { + return baseMapper.selectRoleById(roleId); + } + + /** + * 校验角色名称是否唯一 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + public boolean checkRoleNameUnique(SysRoleBo role) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysRole::getRoleName, role.getRoleName()) + .ne(ObjectUtil.isNotNull(role.getRoleId()), SysRole::getRoleId, role.getRoleId())); + return !exist; + } + + /** + * 校验角色权限是否唯一 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + public boolean checkRoleKeyUnique(SysRoleBo role) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysRole::getRoleKey, role.getRoleKey()) + .ne(ObjectUtil.isNotNull(role.getRoleId()), SysRole::getRoleId, role.getRoleId())); + return !exist; + } + + /** + * 校验角色是否允许操作 + * + * @param roleId 角色ID + */ + @Override + public void checkRoleAllowed(Long roleId) { + if (ObjectUtil.isNotNull(roleId) && LoginHelper.isSuperAdmin(roleId)) { + throw new ServiceException("不允许操作超级管理员角色"); + } + } + + /** + * 校验角色是否有数据权限 + * + * @param roleId 角色id + */ + @Override + public void checkRoleDataScope(Long roleId) { + if (ObjectUtil.isNull(roleId)) { + return; + } + if (LoginHelper.isSuperAdmin()) { + return; + } + List roles = this.selectRoleList(new SysRoleBo(roleId)); + if (CollUtil.isEmpty(roles)) { + throw new ServiceException("没有权限访问角色数据!"); + } + + } + + /** + * 通过角色ID查询角色使用数量 + * + * @param roleId 角色ID + * @return 结果 + */ + @Override + public long countUserRoleByRoleId(Long roleId) { + return userRoleMapper.selectCount(new LambdaQueryWrapper().eq(SysUserRole::getRoleId, roleId)); + } + + /** + * 新增保存角色信息 + * + * @param bo 角色信息 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int insertRole(SysRoleBo bo) { + SysRole role = MapstructUtils.convert(bo, SysRole.class); + // 新增角色信息 + baseMapper.insert(role); + bo.setRoleId(role.getRoleId()); + return insertRoleMenu(bo); + } + + /** + * 修改保存角色信息 + * + * @param bo 角色信息 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int updateRole(SysRoleBo bo) { + SysRole role = MapstructUtils.convert(bo, SysRole.class); + // 修改角色信息 + baseMapper.updateById(role); + // 删除角色与菜单关联 + roleMenuMapper.delete(new LambdaQueryWrapper().eq(SysRoleMenu::getRoleId, role.getRoleId())); + return insertRoleMenu(bo); + } + + /** + * 修改角色状态 + * + * @param roleId 角色ID + * @param status 角色状态 + * @return 结果 + */ + @Override + public int updateRoleStatus(Long roleId, String status) { + return baseMapper.update(null, + new LambdaUpdateWrapper() + .set(SysRole::getStatus, status) + .eq(SysRole::getRoleId, roleId)); + } + + /** + * 修改数据权限信息 + * + * @param bo 角色信息 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int authDataScope(SysRoleBo bo) { + SysRole role = MapstructUtils.convert(bo, SysRole.class); + // 修改角色信息 + baseMapper.updateById(role); + // 删除角色与部门关联 + roleDeptMapper.delete(new LambdaQueryWrapper().eq(SysRoleDept::getRoleId, role.getRoleId())); + // 新增角色和部门信息(数据权限) + return insertRoleDept(bo); + } + + /** + * 新增角色菜单信息 + * + * @param role 角色对象 + */ + private int insertRoleMenu(SysRoleBo role) { + int rows = 1; + // 新增用户与角色管理 + List list = new ArrayList(); + for (Long menuId : role.getMenuIds()) { + SysRoleMenu rm = new SysRoleMenu(); + rm.setRoleId(role.getRoleId()); + rm.setMenuId(menuId); + list.add(rm); + } + if (list.size() > 0) { + rows = roleMenuMapper.insertBatch(list) ? list.size() : 0; + } + return rows; + } + + /** + * 新增角色部门信息(数据权限) + * + * @param role 角色对象 + */ + private int insertRoleDept(SysRoleBo role) { + int rows = 1; + // 新增角色与部门(数据权限)管理 + List list = new ArrayList(); + for (Long deptId : role.getDeptIds()) { + SysRoleDept rd = new SysRoleDept(); + rd.setRoleId(role.getRoleId()); + rd.setDeptId(deptId); + list.add(rd); + } + if (list.size() > 0) { + rows = roleDeptMapper.insertBatch(list) ? list.size() : 0; + } + return rows; + } + + /** + * 通过角色ID删除角色 + * + * @param roleId 角色ID + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int deleteRoleById(Long roleId) { + // 删除角色与菜单关联 + roleMenuMapper.delete(new LambdaQueryWrapper().eq(SysRoleMenu::getRoleId, roleId)); + // 删除角色与部门关联 + roleDeptMapper.delete(new LambdaQueryWrapper().eq(SysRoleDept::getRoleId, roleId)); + return baseMapper.deleteById(roleId); + } + + /** + * 批量删除角色信息 + * + * @param roleIds 需要删除的角色ID + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int deleteRoleByIds(Long[] roleIds) { + for (Long roleId : roleIds) { + checkRoleAllowed(roleId); + checkRoleDataScope(roleId); + SysRole role = baseMapper.selectById(roleId); + if (countUserRoleByRoleId(roleId) > 0) { + throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName())); + } + } + List ids = Arrays.asList(roleIds); + // 删除角色与菜单关联 + roleMenuMapper.delete(new LambdaQueryWrapper().in(SysRoleMenu::getRoleId, ids)); + // 删除角色与部门关联 + roleDeptMapper.delete(new LambdaQueryWrapper().in(SysRoleDept::getRoleId, ids)); + return baseMapper.deleteBatchIds(ids); + } + + /** + * 取消授权用户角色 + * + * @param userRole 用户和角色关联信息 + * @return 结果 + */ + @Override + public int deleteAuthUser(SysUserRole userRole) { + int rows = userRoleMapper.delete(new LambdaQueryWrapper() + .eq(SysUserRole::getRoleId, userRole.getRoleId()) + .eq(SysUserRole::getUserId, userRole.getUserId())); + if (rows > 0) { + cleanOnlineUserByRole(userRole.getRoleId()); + } + return rows; + } + + /** + * 批量取消授权用户角色 + * + * @param roleId 角色ID + * @param userIds 需要取消授权的用户数据ID + * @return 结果 + */ + @Override + public int deleteAuthUsers(Long roleId, Long[] userIds) { + int rows = userRoleMapper.delete(new LambdaQueryWrapper() + .eq(SysUserRole::getRoleId, roleId) + .in(SysUserRole::getUserId, Arrays.asList(userIds))); + if (rows > 0) { + cleanOnlineUserByRole(roleId); + } + return rows; + } + + /** + * 批量选择授权用户角色 + * + * @param roleId 角色ID + * @param userIds 需要授权的用户数据ID + * @return 结果 + */ + @Override + public int insertAuthUsers(Long roleId, Long[] userIds) { + // 新增用户与角色管理 + int rows = 1; + List list = StreamUtils.toList(List.of(userIds), userId -> { + SysUserRole ur = new SysUserRole(); + ur.setUserId(userId); + ur.setRoleId(roleId); + return ur; + }); + if (CollUtil.isNotEmpty(list)) { + rows = userRoleMapper.insertBatch(list) ? list.size() : 0; + } + if (rows > 0) { + cleanOnlineUserByRole(roleId); + } + return rows; + } + + @Override + public void cleanOnlineUserByRole(Long roleId) { + List keys = StpUtil.searchTokenValue("", 0, -1, false); + if (CollUtil.isEmpty(keys)) { + return; + } + // 角色关联的在线用户量过大会导致redis阻塞卡顿 谨慎操作 + keys.parallelStream().forEach(key -> { + String token = StringUtils.substringAfterLast(key, ":"); + // 如果已经过期则跳过 + if (StpUtil.stpLogic.getTokenActivityTimeoutByToken(token) < -1) { + return; + } + // LoginUser loginUser = LoginHelper.getLoginUser(token); + LoginUser loginUser = LoginHelper.getLoginUser(); + if (loginUser.getRoles().stream().anyMatch(r -> r.getRoleId().equals(roleId))) { + try { + StpUtil.logoutByTokenValue(token); + } catch (NotLoginException ignored) { + } + } + }); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysSensitiveServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysSensitiveServiceImpl.java new file mode 100644 index 0000000..baac793 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysSensitiveServiceImpl.java @@ -0,0 +1,26 @@ +package org.aibidding.system.service.impl; + +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.common.sensitive.core.SensitiveService; +import org.springframework.stereotype.Service; + +/** + * 脱敏服务 + * 默认管理员不过滤 + * 需自行根据业务重写实现 + * + * @author Lion Li + * @version 3.6.0 + */ +@Service +public class SysSensitiveServiceImpl implements SensitiveService { + + /** + * 是否脱敏 + */ + @Override + public boolean isSensitive() { + return !LoginHelper.isSuperAdmin() || !LoginHelper.isTenantAdmin(); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysTenantPackageServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysTenantPackageServiceImpl.java new file mode 100644 index 0000000..ced0cd4 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysTenantPackageServiceImpl.java @@ -0,0 +1,146 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.constant.TenantConstants; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.SysTenant; +import org.aibidding.system.domain.SysTenantPackage; +import org.aibidding.system.domain.bo.SysTenantPackageBo; +import org.aibidding.system.domain.vo.SysTenantPackageVo; +import org.aibidding.system.mapper.SysTenantMapper; +import org.aibidding.system.mapper.SysTenantPackageMapper; +import org.aibidding.system.service.ISysTenantPackageService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 租户套餐Service业务层处理 + * + * @author Michelle.Chung + */ +@RequiredArgsConstructor +@Service +public class SysTenantPackageServiceImpl implements ISysTenantPackageService { + + private final SysTenantPackageMapper baseMapper; + private final SysTenantMapper tenantMapper; + + /** + * 查询租户套餐 + */ + @Override + public SysTenantPackageVo queryById(Long packageId){ + return baseMapper.selectVoById(packageId); + } + + /** + * 查询租户套餐列表 + */ + @Override + public TableDataInfo queryPageList(SysTenantPackageBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + @Override + public List selectList() { + return baseMapper.selectVoList(new LambdaQueryWrapper() + .eq(SysTenantPackage::getStatus, TenantConstants.NORMAL)); + } + + /** + * 查询租户套餐列表 + */ + @Override + public List queryList(SysTenantPackageBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SysTenantPackageBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getPackageName()), SysTenantPackage::getPackageName, bo.getPackageName()); + lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysTenantPackage::getStatus, bo.getStatus()); + return lqw; + } + + /** + * 新增租户套餐 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean insertByBo(SysTenantPackageBo bo) { + SysTenantPackage add = MapstructUtils.convert(bo, SysTenantPackage.class); + // 保存菜单id + List menuIds = Arrays.asList(bo.getMenuIds()); + if (CollUtil.isNotEmpty(menuIds)) { + add.setMenuIds(StringUtils.join(menuIds, ", ")); + } else { + add.setMenuIds(""); + } + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setPackageId(add.getPackageId()); + } + return flag; + } + + /** + * 修改租户套餐 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean updateByBo(SysTenantPackageBo bo) { + SysTenantPackage update = MapstructUtils.convert(bo, SysTenantPackage.class); + // 保存菜单id + List menuIds = Arrays.asList(bo.getMenuIds()); + if (CollUtil.isNotEmpty(menuIds)) { + update.setMenuIds(StringUtils.join(menuIds, ", ")); + } else { + update.setMenuIds(""); + } + return baseMapper.updateById(update) > 0; + } + + /** + * 修改套餐状态 + * + * @param bo 套餐信息 + * @return 结果 + */ + @Override + public int updatePackageStatus(SysTenantPackageBo bo) { + SysTenantPackage tenantPackage = MapstructUtils.convert(bo, SysTenantPackage.class); + return baseMapper.updateById(tenantPackage); + } + + /** + * 批量删除租户套餐 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + boolean exists = tenantMapper.exists(new LambdaQueryWrapper().in(SysTenant::getPackageId, ids)); + if (exists) { + throw new ServiceException("租户套餐已被使用"); + } + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysTenantServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysTenantServiceImpl.java new file mode 100644 index 0000000..dafed27 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysTenantServiceImpl.java @@ -0,0 +1,367 @@ +package org.aibidding.system.service.impl; + +import cn.dev33.satoken.secure.BCrypt; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.RandomUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.aibidding.common.core.constant.CacheNames; +import org.aibidding.common.core.constant.Constants; +import org.aibidding.common.core.constant.TenantConstants; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.SpringUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.*; +import org.aibidding.system.domain.bo.SysTenantBo; +import org.aibidding.system.domain.vo.SysTenantVo; +import org.aibidding.system.mapper.*; +import org.aibidding.system.service.ISysTenantService; +import lombok.RequiredArgsConstructor; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +/** + * 租户Service业务层处理 + * + * @author Michelle.Chung + */ +@RequiredArgsConstructor +@Service +public class SysTenantServiceImpl implements ISysTenantService { + + private final SysTenantMapper baseMapper; + private final SysTenantPackageMapper tenantPackageMapper; + private final SysUserMapper userMapper; + private final SysDeptMapper deptMapper; + private final SysRoleMapper roleMapper; + private final SysRoleMenuMapper roleMenuMapper; + private final SysRoleDeptMapper roleDeptMapper; + private final SysUserRoleMapper userRoleMapper; + private final SysDictTypeMapper dictTypeMapper; + private final SysDictDataMapper dictDataMapper; + private final SysConfigMapper configMapper; + + /** + * 查询租户 + */ + @Override + public SysTenantVo queryById(Long id) { + return baseMapper.selectVoById(id); + } + + /** + * 基于租户ID查询租户 + */ + @Cacheable(cacheNames = CacheNames.SYS_TENANT, key = "#tenantId") + @Override + public SysTenantVo queryByTenantId(String tenantId) { + return baseMapper.selectVoOne(new LambdaQueryWrapper().eq(SysTenant::getTenantId, tenantId)); + } + + /** + * 查询租户列表 + */ + @Override + public TableDataInfo queryPageList(SysTenantBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询租户列表 + */ + @Override + public List queryList(SysTenantBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SysTenantBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getTenantId()), SysTenant::getTenantId, bo.getTenantId()); + lqw.like(StringUtils.isNotBlank(bo.getContactUserName()), SysTenant::getContactUserName, bo.getContactUserName()); + lqw.eq(StringUtils.isNotBlank(bo.getContactPhone()), SysTenant::getContactPhone, bo.getContactPhone()); + lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), SysTenant::getCompanyName, bo.getCompanyName()); + lqw.eq(StringUtils.isNotBlank(bo.getLicenseNumber()), SysTenant::getLicenseNumber, bo.getLicenseNumber()); + lqw.eq(StringUtils.isNotBlank(bo.getAddress()), SysTenant::getAddress, bo.getAddress()); + lqw.eq(StringUtils.isNotBlank(bo.getIntro()), SysTenant::getIntro, bo.getIntro()); + lqw.like(StringUtils.isNotBlank(bo.getDomain()), SysTenant::getDomain, bo.getDomain()); + lqw.eq(bo.getPackageId() != null, SysTenant::getPackageId, bo.getPackageId()); + lqw.eq(bo.getExpireTime() != null, SysTenant::getExpireTime, bo.getExpireTime()); + lqw.eq(bo.getAccountCount() != null, SysTenant::getAccountCount, bo.getAccountCount()); + lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysTenant::getStatus, bo.getStatus()); + return lqw; + } + + /** + * 新增租户 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean insertByBo(SysTenantBo bo) { + SysTenant add = MapstructUtils.convert(bo, SysTenant.class); + + // 获取所有租户编号 + List tenantIds = baseMapper.selectObjs( + new LambdaQueryWrapper().select(SysTenant::getTenantId), Convert::toStr); + String tenantId = generateTenantId(tenantIds); + add.setTenantId(tenantId); + boolean flag = baseMapper.insert(add) > 0; + if (!flag) { + throw new ServiceException("创建租户失败"); + } + bo.setId(add.getId()); + + // 根据套餐创建角色 + Long roleId = createTenantRole(tenantId, bo.getPackageId()); + + // 创建部门: 公司名是部门名称 + SysDept dept = new SysDept(); + dept.setTenantId(tenantId); + dept.setDeptName(bo.getCompanyName()); + dept.setLeader(bo.getUsername()); + dept.setParentId(Constants.TOP_PARENT_ID); + dept.setAncestors(Constants.TOP_PARENT_ID.toString()); + deptMapper.insert(dept); + Long deptId = dept.getDeptId(); + + // 角色和部门关联表 + SysRoleDept roleDept = new SysRoleDept(); + roleDept.setRoleId(roleId); + roleDept.setDeptId(deptId); + roleDeptMapper.insert(roleDept); + + // 创建系统用户 + SysUser user = new SysUser(); + user.setTenantId(tenantId); + user.setUserName(bo.getUsername()); + user.setNickName(bo.getUsername()); + user.setPassword(BCrypt.hashpw(bo.getPassword())); + user.setDeptId(deptId); + userMapper.insert(user); + + // 用户和角色关联表 + SysUserRole userRole = new SysUserRole(); + userRole.setUserId(user.getUserId()); + userRole.setRoleId(roleId); + userRoleMapper.insert(userRole); + + String defaultTenantId = TenantConstants.DEFAULT_TENANT_ID; + List dictTypeList = dictTypeMapper.selectList( + new LambdaQueryWrapper().eq(SysDictType::getTenantId, defaultTenantId)); + List dictDataList = dictDataMapper.selectList( + new LambdaQueryWrapper().eq(SysDictData::getTenantId, defaultTenantId)); + for (SysDictType dictType : dictTypeList) { + dictType.setDictId(null); + dictType.setTenantId(tenantId); + } + for (SysDictData dictData : dictDataList) { + dictData.setDictCode(null); + dictData.setTenantId(tenantId); + } + dictTypeMapper.insertBatch(dictTypeList); + dictDataMapper.insertBatch(dictDataList); + + List sysConfigList = configMapper.selectList( + new LambdaQueryWrapper().eq(SysConfig::getTenantId, defaultTenantId)); + for (SysConfig config : sysConfigList) { + config.setConfigId(null); + config.setTenantId(tenantId); + } + configMapper.insertBatch(sysConfigList); + return true; + } + + /** + * 生成租户id + * + * @param tenantIds 已有租户id列表 + * @return 租户id + */ + private String generateTenantId(List tenantIds) { + // 随机生成6位 + String numbers = RandomUtil.randomNumbers(6); + // 判断是否存在,如果存在则重新生成 + if (tenantIds.contains(numbers)) { + generateTenantId(tenantIds); + } + return numbers; + } + + /** + * 根据租户菜单创建租户角色 + * + * @param tenantId 租户编号 + * @param packageId 租户套餐id + * @return 角色id + */ + private Long createTenantRole(String tenantId, Long packageId) { + // 获取租户套餐 + SysTenantPackage tenantPackage = tenantPackageMapper.selectById(packageId); + if (ObjectUtil.isNull(tenantPackage)) { + throw new ServiceException("套餐不存在"); + } + // 获取套餐菜单id + List menuIds = StringUtils.splitTo(tenantPackage.getMenuIds(), Convert::toLong); + + // 创建角色 + SysRole role = new SysRole(); + role.setTenantId(tenantId); + role.setRoleName(TenantConstants.TENANT_ADMIN_ROLE_NAME); + role.setRoleKey(TenantConstants.TENANT_ADMIN_ROLE_KEY); + role.setRoleSort(1); + role.setStatus(TenantConstants.NORMAL); + roleMapper.insert(role); + Long roleId = role.getRoleId(); + + // 创建角色菜单 + List roleMenus = new ArrayList<>(menuIds.size()); + menuIds.forEach(menuId -> { + SysRoleMenu roleMenu = new SysRoleMenu(); + roleMenu.setRoleId(roleId); + roleMenu.setMenuId(menuId); + roleMenus.add(roleMenu); + }); + roleMenuMapper.insertBatch(roleMenus); + + return roleId; + } + + /** + * 修改租户 + */ + @CacheEvict(cacheNames = CacheNames.SYS_TENANT, key = "#bo.tenantId") + @Override + public Boolean updateByBo(SysTenantBo bo) { + SysTenant tenant = MapstructUtils.convert(bo, SysTenant.class); + tenant.setTenantId(null); + tenant.setPackageId(null); + return baseMapper.updateById(tenant) > 0; + } + + /** + * 修改租户状态 + * + * @param bo 租户信息 + * @return 结果 + */ + @CacheEvict(cacheNames = CacheNames.SYS_TENANT, key = "#bo.tenantId") + @Override + public int updateTenantStatus(SysTenantBo bo) { + SysTenant tenant = MapstructUtils.convert(bo, SysTenant.class); + return baseMapper.updateById(tenant); + } + + /** + * 校验租户是否允许操作 + * + * @param tenantId 租户ID + */ + @Override + public void checkTenantAllowed(String tenantId) { + if (ObjectUtil.isNotNull(tenantId) && TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) { + throw new ServiceException("不允许操作管理租户"); + } + } + + /** + * 批量删除租户 + */ + @CacheEvict(cacheNames = CacheNames.SYS_TENANT, allEntries = true) + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if (isValid) { + // 做一些业务上的校验,判断是否需要校验 + if (ids.contains(TenantConstants.SUPER_ADMIN_ID)) { + throw new ServiceException("超管租户不能删除"); + } + } + return baseMapper.deleteBatchIds(ids) > 0; + } + + /** + * 校验企业名称是否唯一 + */ + @Override + public boolean checkCompanyNameUnique(SysTenantBo bo) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysTenant::getCompanyName, bo.getCompanyName()) + .ne(ObjectUtil.isNotNull(bo.getTenantId()), SysTenant::getTenantId, bo.getTenantId())); + return !exist; + } + + /** + * 校验账号余额 + */ + @Override + public boolean checkAccountBalance(String tenantId) { + SysTenantVo tenant = SpringUtils.getAopProxy(this).queryByTenantId(tenantId); + // 如果余额为-1代表不限制 + if (tenant.getAccountCount() == -1) { + return true; + } + Long userNumber = userMapper.selectCount(new LambdaQueryWrapper<>()); + // 如果余额大于0代表还有可用名额 + return tenant.getAccountCount() - userNumber > 0; + } + + /** + * 校验有效期 + */ + @Override + public boolean checkExpireTime(String tenantId) { + SysTenantVo tenant = SpringUtils.getAopProxy(this).queryByTenantId(tenantId); + // 如果未设置过期时间代表不限制 + if (ObjectUtil.isNull(tenant.getExpireTime())) { + return true; + } + // 如果当前时间在过期时间之前则通过 + return new Date().before(tenant.getExpireTime()); + } + + /** + * 同步租户套餐 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean syncTenantPackage(String tenantId, String packageId) { + SysTenantPackage tenantPackage = tenantPackageMapper.selectById(packageId); + List roles = roleMapper.selectList( + new LambdaQueryWrapper().eq(SysRole::getTenantId, tenantId)); + List roleIds = new ArrayList<>(roles.size() - 1); + List menuIds = StringUtils.splitTo(tenantPackage.getMenuIds(), Convert::toLong); + roles.forEach(item -> { + if (TenantConstants.TENANT_ADMIN_ROLE_KEY.equals(item.getRoleKey())) { + List roleMenus = new ArrayList<>(menuIds.size()); + menuIds.forEach(menuId -> { + SysRoleMenu roleMenu = new SysRoleMenu(); + roleMenu.setRoleId(item.getRoleId()); + roleMenu.setMenuId(menuId); + roleMenus.add(roleMenu); + }); + roleMenuMapper.delete(new LambdaQueryWrapper().eq(SysRoleMenu::getRoleId, item.getRoleId())); + roleMenuMapper.insertBatch(roleMenus); + } else { + roleIds.add(item.getRoleId()); + } + }); + if (!roleIds.isEmpty()) { + roleMenuMapper.delete( + new LambdaQueryWrapper().in(SysRoleMenu::getRoleId, roleIds).notIn(!menuIds.isEmpty(), SysRoleMenu::getMenuId, menuIds)); + } + return true; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysUserGroupServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysUserGroupServiceImpl.java new file mode 100644 index 0000000..004bf9a --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysUserGroupServiceImpl.java @@ -0,0 +1,110 @@ +package org.aibidding.system.service.impl; + +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.aibidding.system.domain.bo.SysUserGroupBo; +import org.aibidding.system.domain.vo.SysUserGroupVo; +import org.aibidding.system.domain.SysUserGroup; +import org.aibidding.system.mapper.SysUserGroupMapper; +import org.aibidding.system.service.ISysUserGroupService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 【请填写功能名称】Service业务层处理 + * + * @author Lion Li + * @date 2024-08-03 + */ +@RequiredArgsConstructor +@Service +public class SysUserGroupServiceImpl implements ISysUserGroupService { + + private final SysUserGroupMapper baseMapper; + + /** + * 查询【请填写功能名称】 + */ + @Override + public SysUserGroupVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询【请填写功能名称】列表 + */ + @Override + public TableDataInfo queryPageList(SysUserGroupBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询【请填写功能名称】列表 + */ + @Override + public List queryList(SysUserGroupBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SysUserGroupBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getGroupName()), SysUserGroup::getGroupName, bo.getGroupName()); + lqw.eq(StringUtils.isNotBlank(bo.getUpdateIp()), SysUserGroup::getUpdateIp, bo.getUpdateIp()); + return lqw; + } + + /** + * 新增【请填写功能名称】 + */ + @Override + public Boolean insertByBo(SysUserGroupBo bo) { + SysUserGroup add = MapstructUtils.convert(bo, SysUserGroup.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改【请填写功能名称】 + */ + @Override + public Boolean updateByBo(SysUserGroupBo bo) { + SysUserGroup update = MapstructUtils.convert(bo, SysUserGroup.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(SysUserGroup entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除【请填写功能名称】 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysUserModelServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysUserModelServiceImpl.java new file mode 100644 index 0000000..d3c3313 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysUserModelServiceImpl.java @@ -0,0 +1,109 @@ +package org.aibidding.system.service.impl; + +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.aibidding.system.domain.bo.SysUserModelBo; +import org.aibidding.system.domain.vo.SysUserModelVo; +import org.aibidding.system.domain.SysUserModel; +import org.aibidding.system.mapper.SysUserModelMapper; +import org.aibidding.system.service.ISysUserModelService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 【请填写功能名称】Service业务层处理 + * + * @author Lion Li + * @date 2024-08-03 + */ +@RequiredArgsConstructor +@Service +public class SysUserModelServiceImpl implements ISysUserModelService { + + private final SysUserModelMapper baseMapper; + + /** + * 查询【请填写功能名称】 + */ + @Override + public SysUserModelVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询【请填写功能名称】列表 + */ + @Override + public TableDataInfo queryPageList(SysUserModelBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询【请填写功能名称】列表 + */ + @Override + public List queryList(SysUserModelBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(SysUserModelBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(bo.getMid() != null, SysUserModel::getMid, bo.getMid()); + lqw.eq(bo.getGid() != null, SysUserModel::getGid, bo.getGid()); + return lqw; + } + + /** + * 新增【请填写功能名称】 + */ + @Override + public Boolean insertByBo(SysUserModelBo bo) { + SysUserModel add = MapstructUtils.convert(bo, SysUserModel.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改【请填写功能名称】 + */ + @Override + public Boolean updateByBo(SysUserModelBo bo) { + SysUserModel update = MapstructUtils.convert(bo, SysUserModel.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(SysUserModel entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除【请填写功能名称】 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysUserServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysUserServiceImpl.java new file mode 100644 index 0000000..bd71ebb --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/SysUserServiceImpl.java @@ -0,0 +1,567 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.aibidding.common.core.constant.CacheNames; +import org.aibidding.common.core.constant.UserConstants; +import org.aibidding.common.core.exception.ServiceException; +import org.aibidding.common.core.service.UserService; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StreamUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.helper.DataBaseHelper; +import org.aibidding.common.satoken.utils.LoginHelper; +import org.aibidding.system.domain.SysDept; +import org.aibidding.system.domain.SysUser; +import org.aibidding.system.domain.SysUserPost; +import org.aibidding.system.domain.SysUserRole; +import org.aibidding.system.domain.bo.SysUserBo; +import org.aibidding.system.domain.vo.SysPostVo; +import org.aibidding.system.domain.vo.SysRoleVo; +import org.aibidding.system.domain.vo.SysUserVo; +import org.aibidding.system.mapper.*; +import org.aibidding.system.service.ISysUserService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +/** + * 用户 业务层处理 + * + * @author Lion Li + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class SysUserServiceImpl implements ISysUserService, UserService { + + private final SysUserMapper baseMapper; + private final SysDeptMapper deptMapper; + private final SysRoleMapper roleMapper; + private final SysPostMapper postMapper; + private final SysUserRoleMapper userRoleMapper; + private final SysUserPostMapper userPostMapper; + + @Override + public TableDataInfo selectPageUserList(SysUserBo user, PageQuery pageQuery) { + Page page = baseMapper.selectPageUserList(pageQuery.build(), this.buildQueryWrapper(user)); + return TableDataInfo.build(page); + } + + /** + * 根据条件分页查询用户列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + @Override + public List selectUserList(SysUserBo user) { + return baseMapper.selectUserList(this.buildQueryWrapper(user)); + } + + private Wrapper buildQueryWrapper(SysUserBo user) { + Map params = user.getParams(); + QueryWrapper wrapper = Wrappers.query(); + wrapper.eq("u.del_flag", UserConstants.USER_NORMAL) + .eq(ObjectUtil.isNotNull(user.getUserId()), "u.user_id", user.getUserId()) + .eq(ObjectUtil.isNotNull(user.getUserGrade()), "u.user_grade", user.getUserGrade()) + .like(StringUtils.isNotBlank(user.getUserName()), "u.user_name", user.getUserName()) + .eq(StringUtils.isNotBlank(user.getStatus()), "u.status", user.getStatus()) + .like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + "u.create_time", params.get("beginTime"), params.get("endTime")) + .and(ObjectUtil.isNotNull(user.getDeptId()), w -> { + List deptList = deptMapper.selectList(new LambdaQueryWrapper() + .select(SysDept::getDeptId) + .apply(DataBaseHelper.findInSet(user.getDeptId(), "ancestors"))); + List ids = StreamUtils.toList(deptList, SysDept::getDeptId); + ids.add(user.getDeptId()); + w.in("u.dept_id", ids); + }); + return wrapper; + } + + /** + * 根据条件分页查询已分配用户角色列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + @Override + public TableDataInfo selectAllocatedList(SysUserBo user, PageQuery pageQuery) { + QueryWrapper wrapper = Wrappers.query(); + wrapper.eq("u.del_flag", UserConstants.USER_NORMAL) + .eq(ObjectUtil.isNotNull(user.getRoleId()), "r.role_id", user.getRoleId()) + .like(StringUtils.isNotBlank(user.getUserName()), "u.user_name", user.getUserName()) + .eq(StringUtils.isNotBlank(user.getStatus()), "u.status", user.getStatus()) + .like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber()); + Page page = baseMapper.selectAllocatedList(pageQuery.build(), wrapper); + return TableDataInfo.build(page); + } + + /** + * 根据条件分页查询未分配用户角色列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + @Override + public TableDataInfo selectUnallocatedList(SysUserBo user, PageQuery pageQuery) { + List userIds = userRoleMapper.selectUserIdsByRoleId(user.getRoleId()); + QueryWrapper wrapper = Wrappers.query(); + wrapper.eq("u.del_flag", UserConstants.USER_NORMAL) + .and(w -> w.ne("r.role_id", user.getRoleId()).or().isNull("r.role_id")) + .notIn(CollUtil.isNotEmpty(userIds), "u.user_id", userIds) + .like(StringUtils.isNotBlank(user.getUserName()), "u.user_name", user.getUserName()) + .like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber()); + Page page = baseMapper.selectUnallocatedList(pageQuery.build(), wrapper); + return TableDataInfo.build(page); + } + + /** + * 通过用户名查询用户 + * + * @param userName 用户名 + * @return 用户对象信息 + */ + @Override + public SysUserVo selectUserByUserName(String userName) { + return baseMapper.selectUserByUserName(userName); + } + + /** + * 通过OpenId查询用户 + * + * @param openId 用户名 + * @return 用户对象信息 + */ + @Override + public SysUserVo selectUserByOpenId(String openId) { + return baseMapper.selectUserByOpenId(openId); + } + + + /** + * 通过手机号查询用户 + * + * @param phonenumber 手机号 + * @return 用户对象信息 + */ + @Override + public SysUserVo selectUserByPhonenumber(String phonenumber) { + return baseMapper.selectUserByPhonenumber(phonenumber); + } + + /** + * 通过用户ID查询用户 + * + * @param userId 用户ID + * @return 用户对象信息 + */ + @Override + public SysUserVo selectUserById(Long userId) { + return baseMapper.selectUserById(userId); + } + + /** + * 查询用户所属角色组 + * + * @param userName 用户名 + * @return 结果 + */ + @Override + public String selectUserRoleGroup(String userName) { + List list = roleMapper.selectRolesByUserName(userName); + if (CollUtil.isEmpty(list)) { + return StringUtils.EMPTY; + } + return StreamUtils.join(list, SysRoleVo::getRoleName); + } + + /** + * 查询用户所属岗位组 + * + * @param userName 用户名 + * @return 结果 + */ + @Override + public String selectUserPostGroup(String userName) { + List list = postMapper.selectPostsByUserName(userName); + if (CollUtil.isEmpty(list)) { + return StringUtils.EMPTY; + } + return StreamUtils.join(list, SysPostVo::getPostName); + } + + /** + * 校验用户名称是否唯一 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public boolean checkUserNameUnique(SysUserBo user) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysUser::getUserName, user.getUserName()) + .ne(ObjectUtil.isNotNull(user.getUserId()), SysUser::getUserId, user.getUserId())); + return !exist; + } + + /** + * 校验手机号码是否唯一 + * + * @param user 用户信息 + */ + @Override + public boolean checkPhoneUnique(SysUserBo user) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysUser::getPhonenumber, user.getPhonenumber()) + .ne(ObjectUtil.isNotNull(user.getUserId()), SysUser::getUserId, user.getUserId())); + return !exist; + } + + /** + * 校验email是否唯一 + * + * @param user 用户信息 + */ + @Override + public boolean checkEmailUnique(SysUserBo user) { + boolean exist = baseMapper.exists(new LambdaQueryWrapper() + .eq(SysUser::getEmail, user.getEmail()) + .ne(ObjectUtil.isNotNull(user.getUserId()), SysUser::getUserId, user.getUserId())); + return !exist; + } + + /** + * 校验用户是否允许操作 + * + * @param userId 用户ID + */ + @Override + public void checkUserAllowed(Long userId) { + if (ObjectUtil.isNotNull(userId) && LoginHelper.isSuperAdmin(userId)) { + throw new ServiceException("不允许操作超级管理员用户"); + } + } + + /** + * 校验用户是否有数据权限 + * + * @param userId 用户id + */ + @Override + public void checkUserDataScope(Long userId) { + if (ObjectUtil.isNull(userId)) { + return; + } + if (LoginHelper.isSuperAdmin()) { + return; + } + if (ObjectUtil.isNull(baseMapper.selectUserById(userId))) { + throw new ServiceException("没有权限访问用户数据!"); + } + } + + /** + * 新增保存用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int insertUser(SysUserBo user) { + SysUser sysUser = MapstructUtils.convert(user, SysUser.class); + // 新增用户信息 + int rows = baseMapper.insert(sysUser); + user.setUserId(sysUser.getUserId()); + // 新增用户岗位关联 + insertUserPost(user, false); + // 新增用户与角色管理 + insertUserRole(user, false); + return rows; + } + + /** + * 注册用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public SysUser registerUser(SysUserBo user, String tenantId) { + user.setCreateBy(user.getUserId()); + user.setUpdateBy(user.getUserId()); + SysUser sysUser = MapstructUtils.convert(user, SysUser.class); + if (sysUser != null) { + sysUser.setTenantId(tenantId); + } + baseMapper.insert(sysUser); + return sysUser; + } + + /** + * 修改保存用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int updateUser(SysUserBo user) { + // 新增用户与角色管理 + //insertUserRole(user, true); + // 新增用户与岗位管理 + //insertUserPost(user, true); + SysUser sysUser = MapstructUtils.convert(user, SysUser.class); + // 防止错误更新后导致的数据误删除 + int flag = baseMapper.updateById(sysUser); + if (flag < 1) { + throw new ServiceException("修改用户" + user.getUserName() + "信息失败"); + } + return flag; + } + + /** + * 小程序 - 修改用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public SysUserVo updateXcxUser(SysUserBo user) { + baseMapper.updateXcxUser(user); + return baseMapper.selectUserByOpenId(user.getOpenId()); + } + + /** + * 用户授权角色 + * + * @param userId 用户ID + * @param roleIds 角色组 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUserAuth(Long userId, Long[] roleIds) { + insertUserRole(userId, roleIds, true); + } + + /** + * 修改用户状态 + * + * @param userId 用户ID + * @param status 帐号状态 + * @return 结果 + */ + @Override + public int updateUserStatus(Long userId, String status) { + return baseMapper.update(null, + new LambdaUpdateWrapper() + .set(SysUser::getStatus, status) + .eq(SysUser::getUserId, userId)); + } + + /** + * 修改用户基本信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public int updateUserProfile(SysUserBo user) { + return baseMapper.update(null, + new LambdaUpdateWrapper() + .set(ObjectUtil.isNotNull(user.getNickName()), SysUser::getNickName, user.getNickName()) + .set(SysUser::getPhonenumber, user.getPhonenumber()) + .set(SysUser::getEmail, user.getEmail()) + .set(SysUser::getSex, user.getSex()) + .eq(SysUser::getUserId, user.getUserId())); + } + + /** + * 修改用户头像 + * + * @param userId 用户ID + * @param avatar 头像地址 + * @return 结果 + */ + @Override + public boolean updateUserAvatar(Long userId, String avatar) { + return baseMapper.update(null, + new LambdaUpdateWrapper() + .set(SysUser::getAvatar, avatar) + .eq(SysUser::getUserId, userId)) > 0; + } + + @Override + public boolean updateUserName(Long userId, String nickName) { + return baseMapper.update(null, + new LambdaUpdateWrapper() + .set(SysUser::getNickName, nickName) + .eq(SysUser::getUserId, userId)) > 0; + } + + /** + * 重置用户密码 + * + * @param userId 用户ID + * @param password 密码 + * @return 结果 + */ + @Override + public int resetUserPwd(Long userId, String password) { + return baseMapper.update(null, + new LambdaUpdateWrapper() + .set(SysUser::getPassword, password) + .eq(SysUser::getUserId, userId)); + } + + + /** + * 新增用户角色信息 + * + * @param user 用户对象 + * @param clear 清除已存在的关联数据 + */ + private void insertUserRole(SysUserBo user, boolean clear) { + this.insertUserRole(user.getUserId(), user.getRoleIds(), clear); + } + + /** + * 新增用户岗位信息 + * + * @param user 用户对象 + * @param clear 清除已存在的关联数据 + */ + private void insertUserPost(SysUserBo user, boolean clear) { + Long[] posts = user.getPostIds(); + if (ArrayUtil.isNotEmpty(posts)) { + if (clear) { + // 删除用户与岗位关联 + userPostMapper.delete(new LambdaQueryWrapper().eq(SysUserPost::getUserId, user.getUserId())); + } + // 新增用户与岗位管理 + List list = StreamUtils.toList(List.of(posts), postId -> { + SysUserPost up = new SysUserPost(); + up.setUserId(user.getUserId()); + up.setPostId(postId); + return up; + }); + userPostMapper.insertBatch(list); + } + } + + /** + * 新增用户角色信息 + * + * @param userId 用户ID + * @param roleIds 角色组 + * @param clear 清除已存在的关联数据 + */ + private void insertUserRole(Long userId, Long[] roleIds, boolean clear) { + if (ArrayUtil.isNotEmpty(roleIds)) { + // 判断是否具有此角色的操作权限 + List roles = roleMapper.selectRoleList(new LambdaQueryWrapper<>()); + if (CollUtil.isEmpty(roles)) { + throw new ServiceException("没有权限访问角色的数据"); + } + List roleList = StreamUtils.toList(roles, SysRoleVo::getRoleId); + if (!LoginHelper.isSuperAdmin(userId)) { + roleList.remove(UserConstants.SUPER_ADMIN_ID); + } + List canDoRoleList = StreamUtils.filter(List.of(roleIds), roleList::contains); + if (CollUtil.isEmpty(canDoRoleList)) { + throw new ServiceException("没有权限访问角色的数据"); + } + if (clear) { + // 删除用户与角色关联 + userRoleMapper.delete(new LambdaQueryWrapper().eq(SysUserRole::getUserId, userId)); + } + // 新增用户与角色管理 + List list = StreamUtils.toList(canDoRoleList, roleId -> { + SysUserRole ur = new SysUserRole(); + ur.setUserId(userId); + ur.setRoleId(roleId); + return ur; + }); + userRoleMapper.insertBatch(list); + } + } + + /** + * 通过用户ID删除用户 + * + * @param userId 用户ID + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int deleteUserById(Long userId) { + // 删除用户与角色关联 + userRoleMapper.delete(new LambdaQueryWrapper().eq(SysUserRole::getUserId, userId)); + // 删除用户与岗位表 + userPostMapper.delete(new LambdaQueryWrapper().eq(SysUserPost::getUserId, userId)); + // 防止更新失败导致的数据删除 + int flag = baseMapper.deleteById(userId); + if (flag < 1) { + throw new ServiceException("删除用户失败!"); + } + return flag; + } + + /** + * 批量删除用户信息 + * + * @param userIds 需要删除的用户ID + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int deleteUserByIds(Long[] userIds) { + for (Long userId : userIds) { + checkUserAllowed(userId); + checkUserDataScope(userId); + } + List ids = List.of(userIds); + // 删除用户与角色关联 + userRoleMapper.delete(new LambdaQueryWrapper().in(SysUserRole::getUserId, ids)); + // 删除用户与岗位表 + userPostMapper.delete(new LambdaQueryWrapper().in(SysUserPost::getUserId, ids)); + // 防止更新失败导致的数据删除 + int flag = baseMapper.deleteBatchIds(ids); + if (flag < 1) { + throw new ServiceException("删除用户失败!"); + } + return flag; + } + + @Cacheable(cacheNames = CacheNames.SYS_USER_NAME, key = "#userId") + @Override + public String selectUserNameById(Long userId) { + SysUser sysUser = baseMapper.selectOne(new LambdaQueryWrapper() + .select(SysUser::getUserName).eq(SysUser::getUserId, userId)); + return ObjectUtil.isNull(sysUser) ? null : sysUser.getUserName(); + } + + @Override + public String selectUserByName(String userName) { + SysUser sysUser = baseMapper.selectOne(new LambdaQueryWrapper() + .eq(SysUser::getUserName, userName)); + return ObjectUtil.isNull(sysUser) ? null : sysUser.getUserBalance().toString(); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/WeixinUserServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/WeixinUserServiceImpl.java new file mode 100644 index 0000000..881c1df --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/WeixinUserServiceImpl.java @@ -0,0 +1,65 @@ +package org.aibidding.system.service.impl; + +import org.aibidding.system.domain.model.ReceiveMessage; +import org.aibidding.system.service.WeixinUserService; +import org.aibidding.system.util.WeixinMsgUtil; +import org.aibidding.system.util.WeixinQrCodeCacheUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.codec.digest.DigestUtils; +import org.springframework.stereotype.Service; + +import java.util.Arrays; + + +@Slf4j +@Service +public class WeixinUserServiceImpl implements WeixinUserService { + + private String token = "panda"; + + @Override + public void checkSignature(String signature, String timestamp, String nonce) { + String[] arr = new String[] {token, timestamp, nonce}; + Arrays.sort(arr); + StringBuilder content = new StringBuilder(); + for (String str : arr) { + content.append(str); + } + String tmpStr = DigestUtils.sha1Hex(content.toString()); + if (tmpStr.equals(signature)) { + log.info("check success"); + return; + } + log.error("check fail"); + throw new RuntimeException("check fail"); + } + + @Override + public String handleWeixinMsg(String requestBody) { + ReceiveMessage receiveMessage = WeixinMsgUtil.msgToReceiveMessage(requestBody); + // 扫码登录 + if (WeixinMsgUtil.isScanQrCode(receiveMessage)) { + return handleScanLogin(receiveMessage); + } + // 关注 + if (WeixinMsgUtil.isEventAndSubscribe(receiveMessage)) { + return receiveMessage.getReplyTextMsg("欢迎关注【熊猫办公助手】,请访问https://web.pandarobot.chat/使用AI助手"); + } + return receiveMessage.getReplyTextMsg("收到(自动回复)"); + } + + /** + * 处理扫码登录 + * + * @param receiveMessage + * @return + */ + private String handleScanLogin(ReceiveMessage receiveMessage) { + String qrCodeTicket = WeixinMsgUtil.getQrCodeTicket(receiveMessage); + if (WeixinQrCodeCacheUtil.get(qrCodeTicket) == null) { + String openId = receiveMessage.getFromUserName(); + WeixinQrCodeCacheUtil.put(qrCodeTicket, openId); + } + return receiveMessage.getReplyTextMsg("你已成功登录!"); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/WxRobConfigServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/WxRobConfigServiceImpl.java new file mode 100644 index 0000000..ec6e10b --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/WxRobConfigServiceImpl.java @@ -0,0 +1,138 @@ +package org.aibidding.system.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.aibidding.system.domain.SysUser; +import org.aibidding.system.mapper.SysUserMapper; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.aibidding.system.domain.bo.WxRobConfigBo; +import org.aibidding.system.domain.vo.WxRobConfigVo; +import org.aibidding.system.domain.WxRobConfig; +import org.aibidding.system.mapper.WxRobConfigMapper; +import org.aibidding.system.service.IWxRobConfigService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; +import java.util.stream.Collectors; + +/** + * 【请填写功能名称】Service业务层处理 + * + * @author Lion Li + * @date 2024-05-01 + */ +@RequiredArgsConstructor +@Service +public class WxRobConfigServiceImpl implements IWxRobConfigService { + + private final WxRobConfigMapper baseMapper; + + private final SysUserMapper sysUserMapper; + + /** + * 查询【请填写功能名称】 + */ + @Override + public WxRobConfigVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询【请填写功能名称】列表 + */ + @Override + public TableDataInfo queryPageList(WxRobConfigBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + if(CollectionUtil.isEmpty(result.getRecords())){ + return TableDataInfo.build(result); + } + // 获取所有userId + List userIds = result.getRecords().stream() + .map(WxRobConfigVo::getUserId) + .collect(Collectors.toList()); + // 一次性查询所有userName + Map userIdToUserNameMap = getUserNamesByUserIds(userIds); + // 设置userName + result.getRecords().forEach(wxRobConfigVo -> { + wxRobConfigVo.setUserName(userIdToUserNameMap.get(wxRobConfigVo.getUserId())); + }); + return TableDataInfo.build(result); + } + + private Map getUserNamesByUserIds(List userIds) { + // 实现批量查询userName的逻辑,例如通过sysUserMapper查询sys_user表 + List sysUsers = sysUserMapper.selectBatchIds(userIds); + return sysUsers.stream() + .collect(Collectors.toMap(SysUser::getUserId, SysUser::getUserName)); + } + /** + * 查询【请填写功能名称】列表 + */ + @Override + public List queryList(WxRobConfigBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(WxRobConfigBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(bo.getUserId() != null, WxRobConfig::getUserId, bo.getUserId()); + lqw.eq(StringUtils.isNotBlank(bo.getUniqueKey()), WxRobConfig::getUniqueKey, bo.getUniqueKey()); + lqw.eq(bo.getDefaultFriend() != null, WxRobConfig::getDefaultFriend, bo.getDefaultFriend()); + lqw.eq(bo.getDefaultGroup() != null, WxRobConfig::getDefaultGroup, bo.getDefaultGroup()); + lqw.eq(bo.getEnable() != null, WxRobConfig::getEnable, bo.getEnable()); + return lqw; + } + + /** + * 新增【请填写功能名称】 + */ + @Override + public Boolean insertByBo(WxRobConfigBo bo) { + WxRobConfig add = MapstructUtils.convert(bo, WxRobConfig.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改【请填写功能名称】 + */ + @Override + public Boolean updateByBo(WxRobConfigBo bo) { + WxRobConfig update = MapstructUtils.convert(bo, WxRobConfig.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(WxRobConfig entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除【请填写功能名称】 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/WxRobKeywordServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/WxRobKeywordServiceImpl.java new file mode 100644 index 0000000..41c856e --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/WxRobKeywordServiceImpl.java @@ -0,0 +1,115 @@ +package org.aibidding.system.service.impl; + +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.aibidding.system.domain.bo.WxRobKeywordBo; +import org.aibidding.system.domain.vo.WxRobKeywordVo; +import org.aibidding.system.domain.WxRobKeyword; +import org.aibidding.system.mapper.WxRobKeywordMapper; +import org.aibidding.system.service.IWxRobKeywordService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 【请填写功能名称】Service业务层处理 + * + * @author Lion Li + * @date 2024-05-01 + */ +@RequiredArgsConstructor +@Service +public class WxRobKeywordServiceImpl implements IWxRobKeywordService { + + private final WxRobKeywordMapper baseMapper; + + /** + * 查询【请填写功能名称】 + */ + @Override + public WxRobKeywordVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询【请填写功能名称】列表 + */ + @Override + public TableDataInfo queryPageList(WxRobKeywordBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询【请填写功能名称】列表 + */ + @Override + public List queryList(WxRobKeywordBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(WxRobKeywordBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getUniqueKey()), WxRobKeyword::getUniqueKey, bo.getUniqueKey()); + lqw.eq(StringUtils.isNotBlank(bo.getKeyData()), WxRobKeyword::getKeyData, bo.getKeyData()); + lqw.eq(StringUtils.isNotBlank(bo.getValueData()), WxRobKeyword::getValueData, bo.getValueData()); + lqw.eq(StringUtils.isNotBlank(bo.getTypeData()), WxRobKeyword::getTypeData, bo.getTypeData()); + lqw.like(StringUtils.isNotBlank(bo.getNickName()), WxRobKeyword::getNickName, bo.getNickName()); + lqw.eq(bo.getToGroup() != null, WxRobKeyword::getToGroup, bo.getToGroup()); + lqw.eq(bo.getEnable() != null, WxRobKeyword::getEnable, bo.getEnable()); + return lqw; + } + + /** + * 新增【请填写功能名称】 + */ + @Override + public Boolean insertByBo(WxRobKeywordBo bo) { + WxRobKeyword add = MapstructUtils.convert(bo, WxRobKeyword.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改【请填写功能名称】 + */ + @Override + public Boolean updateByBo(WxRobKeywordBo bo) { + WxRobKeyword update = MapstructUtils.convert(bo, WxRobKeyword.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(WxRobKeyword entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除【请填写功能名称】 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/WxRobRelationServiceImpl.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/WxRobRelationServiceImpl.java new file mode 100644 index 0000000..cdc1ba8 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/service/impl/WxRobRelationServiceImpl.java @@ -0,0 +1,114 @@ +package org.aibidding.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import org.aibidding.common.core.utils.MapstructUtils; +import org.aibidding.common.core.utils.StringUtils; +import org.aibidding.common.mybatis.core.page.PageQuery; +import org.aibidding.common.mybatis.core.page.TableDataInfo; +import org.aibidding.system.domain.WxRobRelation; +import org.aibidding.system.domain.bo.WxRobRelationBo; +import org.aibidding.system.domain.vo.WxRobRelationVo; +import org.aibidding.system.mapper.WxRobRelationMapper; +import org.aibidding.system.service.IWxRobRelationService; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 【请填写功能名称】Service业务层处理 + * + * @author Lion Li + * @date 2024-05-01 + */ +@RequiredArgsConstructor +@Service +public class WxRobRelationServiceImpl implements IWxRobRelationService { + + private final WxRobRelationMapper baseMapper; + + /** + * 查询【请填写功能名称】 + */ + @Override + public WxRobRelationVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 查询【请填写功能名称】列表 + */ + @Override + public TableDataInfo queryPageList(WxRobRelationBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询【请填写功能名称】列表 + */ + @Override + public List queryList(WxRobRelationBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(WxRobRelationBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getOutKey()), WxRobRelation::getOutKey, bo.getOutKey()); + lqw.eq(StringUtils.isNotBlank(bo.getUniqueKey()), WxRobRelation::getUniqueKey, bo.getUniqueKey()); + lqw.like(StringUtils.isNotBlank(bo.getNickName()), WxRobRelation::getNickName, bo.getNickName()); + lqw.eq(bo.getToGroup() != null, WxRobRelation::getToGroup, bo.getToGroup()); + lqw.eq(bo.getEnable() != null, WxRobRelation::getEnable, bo.getEnable()); + lqw.eq(StringUtils.isNotBlank(bo.getWhiteList()), WxRobRelation::getWhiteList, bo.getWhiteList()); + return lqw; + } + + /** + * 新增【请填写功能名称】 + */ + @Override + public Boolean insertByBo(WxRobRelationBo bo) { + WxRobRelation add = MapstructUtils.convert(bo, WxRobRelation.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改【请填写功能名称】 + */ + @Override + public Boolean updateByBo(WxRobRelationBo bo) { + WxRobRelation update = MapstructUtils.convert(bo, WxRobRelation.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(WxRobRelation entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除【请填写功能名称】 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/AesUtils.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/AesUtils.java new file mode 100644 index 0000000..0a2bb80 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/AesUtils.java @@ -0,0 +1,62 @@ +package org.aibidding.system.util; + +import lombok.SneakyThrows; +import org.springframework.stereotype.Component; + +import javax.crypto.Cipher; +import javax.crypto.spec.SecretKeySpec; +import java.util.Base64; + +/** + * Java 使用 AES 加密算法进行加密解密 + */ +@Component +public class AesUtils { + + /** + * 秘钥(需要使用长度为16、24或32的字节数组作为AES算法的密钥,否则就会遇到java.security.InvalidKeyException异常) + */ + // @Value("${ase.util.secret}") + public String key; + + /** + * AES算法加密 + * + * @Param:text原文 + * @Param:key密钥 + */ + + @SneakyThrows + public String aesEncrypt(String text) { + // 创建AES加密算法实例(根据传入指定的秘钥进行加密) + Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); + SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), "AES"); + // 初始化为加密模式,并将密钥注入到算法中 + cipher.init(Cipher.ENCRYPT_MODE, keySpec); + // 将传入的文本加密 + byte[] encrypted = cipher.doFinal(text.getBytes()); + //生成密文 + // 将密文进行Base64编码,方便传输 + return Base64.getEncoder().encodeToString(encrypted); + } + + /** + * AES算法解密 + * + * @Param:base64Encrypted密文 + * @Param:key密钥 + */ + public String aesDecrypt(String base64Encrypted) throws Exception { + // 创建AES解密算法实例 + Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); + SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), "AES"); + + // 初始化为解密模式,并将密钥注入到算法中 + cipher.init(Cipher.DECRYPT_MODE, keySpec); + // 将Base64编码的密文解码 + byte[] encrypted = Base64.getDecoder().decode(base64Encrypted); + // 解密 + byte[] decrypted = cipher.doFinal(encrypted); + return new String(decrypted); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/AudioOkHttpUtil.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/AudioOkHttpUtil.java new file mode 100644 index 0000000..3324128 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/AudioOkHttpUtil.java @@ -0,0 +1,67 @@ +package org.aibidding.system.util; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import okhttp3.*; +import org.aibidding.common.core.service.ConfigService; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.concurrent.TimeUnit; + +/** + * @author WangLe + */ +@RequiredArgsConstructor +@Component +@Slf4j +public class AudioOkHttpUtil { + + private final ConfigService configService; + + private static final String AUTHORIZATION = "Authorization"; + + private final OkHttpClient client = new OkHttpClient.Builder() + .connectTimeout(300, TimeUnit.SECONDS) + .writeTimeout(300, TimeUnit.SECONDS) + .readTimeout(300, TimeUnit.SECONDS) + .build(); + + public String executeRequest(Request request) { + try (Response response = client.newCall(request).execute()) { + if (!response.isSuccessful()) { + throw new IOException("Unexpected code " + response); + } + return response.body() != null ? response.body().string() : null; + } catch (IOException e) { + // 这里应根据实际情况使用适当的日志记录方式 + log.error("请求失败: {}",e.getMessage()); + return null; + } + } + + public Request createPostRequest(String url, String json) { + MediaType JSON = MediaType.get("application/json; charset=utf-8"); + RequestBody body = RequestBody.create(json, JSON); + return new Request.Builder() + .url(getKey("apiHost") + url) + .post(body) + .header("Content-Type", "application/json") + .header(AUTHORIZATION, "Bearer "+getKey("apiKey")) + .build(); + } + + + public Request createGetRequest(String url) { + return new Request.Builder() + .url(getKey("apiHost") + url) + .header(AUTHORIZATION, "Bearer "+getKey("apiKey")) + .build(); + } + + + public String getKey(String key) { + return configService.getConfigValue("audio", key); + } +} + diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/DesensitizationUtil.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/DesensitizationUtil.java new file mode 100644 index 0000000..40ac670 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/DesensitizationUtil.java @@ -0,0 +1,19 @@ +package org.aibidding.system.util; + + +public class DesensitizationUtil { + public static String maskData(String data) { + if (data == null || data.length() <= 4) { + return data; + } + int start = 2; + int end = data.length() - 2; + StringBuilder masked = new StringBuilder(); + masked.append(data, 0, start); + for (int i = start; i < end; i++) { + masked.append('*'); + } + masked.append(data.substring(end)); + return masked.toString(); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/HttpUtils.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/HttpUtils.java new file mode 100644 index 0000000..7428670 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/HttpUtils.java @@ -0,0 +1,634 @@ +package org.aibidding.system.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.io.IOUtils; +import org.apache.http.Header; +import org.apache.http.HttpEntity; +import org.apache.http.HttpEntityEnclosingRequest; +import org.apache.http.client.HttpClient; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.*; +import org.apache.http.config.Registry; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.conn.socket.ConnectionSocketFactory; +import org.apache.http.conn.socket.PlainConnectionSocketFactory; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.entity.*; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.X509TrustManager; +import java.io.*; +import java.net.HttpURLConnection; +import java.net.SocketException; +import java.net.URL; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.security.SecureRandom; +import java.security.cert.X509Certificate; +import java.util.*; +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Consumer; +import java.util.function.Function; + +/** + * HttpUtils + * + * @author NSL + * @since 2024-12-30 + */ +public class HttpUtils { + + public static final String CHARSET_DEFAULT = "UTF-8"; + public static final String CONTENT_TYPE = "Content-Type"; + public static final String CONTENT_TYPE_JSON = "application/json"; + public static final String CONTENT_TYPE_FORM_DATA = "application/x-www-form-urlencoded"; + private static final PoolingHttpClientConnectionManager CONNECTION_MANAGER; + private static final int MAX_CONNECT_TIMEOUT = 8000; + private static final int MAX_SOCKET_TIMEOUT = 90000; + + static { + CONNECTION_MANAGER = new PoolingHttpClientConnectionManager(getDefaultRegistry()); + CONNECTION_MANAGER.setMaxTotal(500); + CONNECTION_MANAGER.setDefaultMaxPerRoute(50); + CONNECTION_MANAGER.setValidateAfterInactivity(2000); + } + + public static HttpResponse get(String url) { + return get(url, null); + } + + public static HttpResponse get(String url, Map params) { + String urlLinks = getUrlLinks(params); + if (urlLinks != null) { + if (url.contains("?")) { + url = url + "&" + urlLinks; + } else { + url = url + "?" + urlLinks; + } + } + return request(HttpRequest.build(url, "GET")); + } + + public static void download(String url, File destFile) throws Exception { + HttpRequest request = HttpRequest.build(url, "GET"); + request.setResponseHandler(entity -> { + try { + if (!destFile.getParentFile().exists()) { + destFile.getParentFile().mkdirs(); + } + try (FileOutputStream fs = new FileOutputStream(destFile)) { + entity.writeTo(fs); + } + return destFile; + } catch (Exception e) { + return e; + } + }); + HttpResponse response = request(request); + if (response.getResponse() instanceof Exception) { + throw (Exception) response.getResponse(); + } + } + + public static HttpResponse postJson(String url, String bodyJson) { + HttpRequest request = HttpRequest.build(url, "POST").setBody(bodyJson); + if (request.getHeaders() == null) { + request.setHeaders(Collections.singletonMap(CONTENT_TYPE, CONTENT_TYPE_JSON)); + } else { + request.getHeaders().put(CONTENT_TYPE, CONTENT_TYPE_JSON); + } + return request(request); + } + + public static HttpResponse postForm(String url, Map params) { + String urlLinks = getUrlLinks(params); + HttpRequest request = HttpRequest.build(url, "POST").setBody(urlLinks != null ? urlLinks : ""); + if (request.getHeaders() == null) { + request.setHeaders(Collections.singletonMap(CONTENT_TYPE, CONTENT_TYPE_FORM_DATA)); + } else { + request.getHeaders().put(CONTENT_TYPE, CONTENT_TYPE_FORM_DATA); + } + return request(request); + } + + public static HttpResponse requestWithEventStream(ExecutorService executorService, long firstReadTimeout, HttpRequest request, Consumer dataConsumer) throws ExecutionException, InterruptedException, TimeoutException { + return requestWithEventStream(executorService, firstReadTimeout, request, dataConsumer, null); + } + + public static HttpResponse requestWithEventStream(ExecutorService executorService, long firstReadTimeout, HttpRequest request, Consumer dataConsumer, Consumer> futureConsumer) throws ExecutionException, InterruptedException, TimeoutException { + // status: 0 start 1 run 2 timeout + AtomicInteger status = new AtomicInteger(0); + Future submit = executorService.submit(() -> { + if (request.getMaxSocketTimeout() == null) { + request.setMaxSocketTimeout(30_000); + } + request.setResponseHandler(entity -> { + StringBuilder sb = new StringBuilder(); + try { + try (InputStream is = entity.getContent()) { + try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) { + String line; + while ((line = bufferedReader.readLine()) != null) { + if (status.get() == 2) { + throw new TimeoutException(); + } + status.set(1); + sb.append(line).append("\n"); + if (line.startsWith("data:")) { + dataConsumer.accept(line.substring(line.startsWith("data: ") ? 6 : 5)); + } + } + } + } + } catch (Exception e) { + throw new RuntimeException("eventStream 请求异常", e); + } + return sb.toString(); + }); + return request(request); + }); + if (futureConsumer != null) { + futureConsumer.accept(submit); + } + try { + HttpResponse httpResponse = submit.get(firstReadTimeout, TimeUnit.MILLISECONDS); + if (httpResponse != null) { + return httpResponse; + } + } catch (TimeoutException e) { + if (status.get() == 0) { + status.set(2); + submit.cancel(true); + throw e; + } + } + return submit.get(); + } + + public static HttpResponse requestWithEventStream(HttpRequest request, Consumer dataConsumer) { + if (request.getMaxSocketTimeout() == null) { + request.setMaxSocketTimeout(30_000); + } + request.setResponseHandler(entity -> { + StringBuilder sb = new StringBuilder(); + try { + try (InputStream is = entity.getContent()) { + try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) { + String line; + while ((line = bufferedReader.readLine()) != null) { + sb.append(line).append("\n"); + if (line.startsWith("data:")) { + dataConsumer.accept(line.substring(line.startsWith("data: ") ? 6 : 5)); + } + } + } + } + } catch (Exception e) { + throw new RuntimeException("eventStream 请求异常", e); + } + return sb.toString(); + }); + return request(request); + } + + public static int getUrlHttpStatus(String _url) { + HttpURLConnection urlConnection = null; + try { + URL url = new URL(_url); + urlConnection = (HttpURLConnection) url.openConnection(); + urlConnection.connect(); + return urlConnection.getResponseCode(); + } catch (Exception ignored) { + return -1; + } finally { + if (urlConnection != null) { + urlConnection.disconnect(); + } + } + } + + public static String getUrlLinks(Map params) { + if (params == null || params.isEmpty()) { + return null; + } + StringBuilder sb = new StringBuilder(); + try { + String[] sortedKeys = params.keySet().toArray(new String[0]); + Arrays.sort(sortedKeys); + for (String key : sortedKeys) { + if (key == null || key.isEmpty()) { + continue; + } + Object value = params.get(key); + sb.append(key).append("="); + if (value != null) { + sb.append(URLEncoder.encode(value.toString(), "UTF-8")); + } + sb.append("&"); + } + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + if (sb.length() > 0) { + sb.setLength(sb.length() - 1); + } + return sb.toString(); + } + + @SuppressWarnings("unchecked") + public static Map parseUrlLinks(String params) { + Map result = new LinkedHashMap<>(); + if (params == null || params.isEmpty()) { + return result; + } + for (String param : params.split("&")) { + String[] split = param.split("="); + String key = split[0]; + String value = ""; + if (split.length > 1) { + value = split[1]; + } + if (result.containsKey(key)) { + Object o = result.get(key); + if (o instanceof List) { + ((List) o).add(value); + } else { + List list = new ArrayList<>(); + list.add(o); + list.add(value); + result.put(key, list); + } + } else { + result.put(key, value); + } + } + return result; + } + + /** + * 通用接口请求 + */ + public static HttpResponse request(HttpRequest request) { + return request(request, 0); + } + + private static HttpResponse request(HttpRequest request, int retryCount) { + HttpRequestBase requestBase = toRequest(request); + Map headers = request.getHeaders(); + ContentType contentType = null; + if (headers != null && !headers.isEmpty()) { + for (Map.Entry entry : headers.entrySet()) { + String key = entry.getKey(); + if (key == null || key.isEmpty()) { + continue; + } + String value = entry.getValue(); + if (CONTENT_TYPE.equalsIgnoreCase(key) && value != null) { + contentType = ContentType.parse(value); + } + requestBase.setHeader(key, value); + } + } + + // body + setBodyEntity(requestBase, contentType, request.getBody()); + + try { + HttpClient client = getHttpClient(request, requestBase); + org.apache.http.HttpResponse response; + long startTime = System.currentTimeMillis(); + response = client.execute(requestBase); + HttpResponse httpResponse = new HttpResponse(); + httpResponse.setReqTime(System.currentTimeMillis() - startTime); + httpResponse.setStatus(response.getStatusLine().getStatusCode()); + Header[] allHeaders = response.getAllHeaders(); + if (allHeaders != null && allHeaders.length > 0) { + httpResponse.setHeaders(new HashMap<>()); + for (Header header : allHeaders) { + httpResponse.getHeaders().put(header.getName(), header.getValue()); + } + } + HttpEntity entity = response.getEntity(); + if (request.responseHandler != null) { + httpResponse.setResponse(request.responseHandler.apply(entity)); + } else { + String charset = null; + if (entity.getContentType() != null && entity.getContentType().getValue() != null) { + contentType = ContentType.parse(entity.getContentType().getValue()); + if (contentType.getCharset() != null) { + charset = contentType.getCharset().name(); + } + } + if (charset == null) { + charset = CHARSET_DEFAULT; + } + httpResponse.setResponse(IOUtils.toString(entity.getContent(), charset)); + } + return httpResponse; + } catch (Exception e) { + requestBase.abort(); + if (request.getMaxRetryCount() > retryCount) { + return request(request, retryCount + 1); + } else if (e instanceof SocketException && "Connection reset".equals(e.getMessage()) && retryCount == 0 && request.getMaxRetryCount() == 0) { + // 遇到 Connection reset 默认重试一次 + return request(request, retryCount + 1); + } else { + throw new RuntimeException("请求异常", e); + } + } finally { + requestBase.releaseConnection(); + } + } + + private static void setBodyEntity(HttpRequestBase requestBase, ContentType contentType, Object body) { + if (body != null && requestBase instanceof HttpEntityEnclosingRequest) { + HttpEntityEnclosingRequest entityRequest = (HttpEntityEnclosingRequest) requestBase; + if (body instanceof HttpEntity) { + entityRequest.setEntity((HttpEntity) body); + } else if (body instanceof String) { + entityRequest.setEntity(getStringEntity((String) body, contentType)); + } else if (body instanceof byte[]) { + entityRequest.setEntity(new ByteArrayEntity((byte[]) body, contentType)); + } else if (body instanceof File) { + entityRequest.setEntity(new FileEntity((File) body, contentType)); + } else if (body instanceof InputStream) { + entityRequest.setEntity(new InputStreamEntity((InputStream) body, contentType)); + } else if (ContentType.APPLICATION_JSON.equals(contentType)) { + entityRequest.setEntity(getStringEntity(JSON.toJSONString(body), contentType)); + } else { + entityRequest.setEntity(getStringEntity(body.toString(), contentType)); + } + } + } + + private static StringEntity getStringEntity(String body, ContentType contentType) { + if (contentType != null && contentType.getCharset() != null) { + return new StringEntity(body, contentType); + } else { + return new StringEntity(body, CHARSET_DEFAULT); + } + } + + public static HttpRequestBase toRequest(HttpRequest request) { + String url = request.getUrl(); + String method = request.getMethod(); + if (url == null || url.isEmpty()) { + throw new RuntimeException("url不能为空"); + } + if (method == null || method.isEmpty()) { + method = "GET"; + } + switch (method.toUpperCase()) { + case "GET": + return new HttpGet(url); + case "POST": + return new HttpPost(url); + case "PUT": + return new HttpPut(url); + case "PATCH": + return new HttpPatch(url); + case "DELETE": + return new HttpDelete(url); + default: + throw new RuntimeException("不支持的请求方式:" + method); + } + } + + private static HttpClient getHttpClient(HttpRequest req, HttpRequestBase request) { + RequestConfig.Builder customReqConf = RequestConfig.custom(); + if (req.getMaxSocketTimeout() != null) { + customReqConf.setSocketTimeout(req.getMaxSocketTimeout()); + } else { + customReqConf.setSocketTimeout(MAX_SOCKET_TIMEOUT); + } + customReqConf.setConnectTimeout(MAX_CONNECT_TIMEOUT); + customReqConf.setConnectionRequestTimeout(MAX_CONNECT_TIMEOUT); + if (req.getRequestConfigConsumer() != null) { + req.getRequestConfigConsumer().accept(customReqConf); + } + request.setConfig(customReqConf.build()); + return HttpClients.custom().setConnectionManager(CONNECTION_MANAGER).build(); + } + + private static Registry getDefaultRegistry() { + try { + // ssl: TLS / TLSv1.2 / TLSv1.3 + SSLContext context = SSLContext.getInstance("TLS"); + context.init(null, new X509TrustManager[]{new X509TrustManager() { + public void checkClientTrusted(X509Certificate[] x509Certificates, String s) { + } + + public void checkServerTrusted(X509Certificate[] x509Certificates, String s) { + } + + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + }}, new SecureRandom()); + return RegistryBuilder.create().register("http", PlainConnectionSocketFactory.getSocketFactory()).register("https", new SSLConnectionSocketFactory(context)).build(); + } catch (Exception e) { + return RegistryBuilder.create().register("http", PlainConnectionSocketFactory.getSocketFactory()).register("https", SSLConnectionSocketFactory.getSocketFactory()).build(); + } + } + + public static String toParamLinks(Map params, boolean encode) { + List keys = new ArrayList<>(params.keySet()); + Collections.sort(keys); + StringBuilder sb = new StringBuilder(); + try { + for (String key : keys) { + if (key == null || "".equals(key)) { + continue; + } + Object value = params.get(key); + if (value == null || "".equals(value)) { + continue; + } + if (encode) { + sb.append(key).append("=").append(URLEncoder.encode(value.toString(), "UTF-8")).append("&"); + } else { + sb.append(key).append("=").append(value).append("&"); + } + } + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("编码失败", e); + } + if (sb.length() > 0) { + sb.setLength(sb.length() - 1); + } + return sb.toString(); + } + + public static class HttpRequest implements Serializable { + + private String url; + private String method; + private Map headers; + private Object body; + private int maxRetryCount = 0; + private Integer maxSocketTimeout; + private Consumer requestConfigConsumer; + private Function responseHandler; + + public static HttpRequest build(String url, String method) { + HttpRequest request = new HttpRequest(); + request.url = url; + request.method = method; + return request; + } + + public static HttpRequest get(String url) { + return build(url, "GET"); + } + + public static HttpRequest postJson(String url) { + return build(url, "POST").setContentType(CONTENT_TYPE_JSON); + } + + public static HttpRequest postFormData(String url) { + return build(url, "POST").setContentType(CONTENT_TYPE_FORM_DATA); + } + + public String getUrl() { + return url; + } + + public HttpRequest setUrl(String url) { + this.url = url; + return this; + } + + public String getMethod() { + return method; + } + + public HttpRequest setMethod(String method) { + this.method = method; + return this; + } + + public Map getHeaders() { + return headers; + } + + public HttpRequest setHeaders(Map headers) { + this.headers = headers; + return this; + } + + public HttpRequest setContentType(String contentType) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(CONTENT_TYPE, contentType); + return this; + } + + public HttpRequest addHeaders(String key, Object value) { + if (headers == null) { + headers = new HashMap<>(); + } + headers.put(key, value != null ? value.toString() : null); + return this; + } + + public Object getBody() { + return body; + } + + public HttpRequest setBody(Object body) { + this.body = body; + return this; + } + + public void setMaxRetryCount(int maxRetryCount) { + this.maxRetryCount = maxRetryCount; + } + + public int getMaxRetryCount() { + return maxRetryCount; + } + + public HttpRequest setMaxSocketTimeout(Integer maxSocketTimeout) { + this.maxSocketTimeout = maxSocketTimeout; + return this; + } + + public Integer getMaxSocketTimeout() { + return maxSocketTimeout; + } + + public Consumer getRequestConfigConsumer() { + return requestConfigConsumer; + } + + public void setRequestConfigConsumer(Consumer requestConfigConsumer) { + this.requestConfigConsumer = requestConfigConsumer; + } + + public Function getResponseHandler() { + return responseHandler; + } + + public HttpRequest setResponseHandler(Function responseHandler) { + this.responseHandler = responseHandler; + return this; + } + } + + public static class HttpResponse implements Serializable { + + private int status; + private long reqTime; + private Object response; + private Map headers; + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public long getReqTime() { + return reqTime; + } + + public void setReqTime(long reqTime) { + this.reqTime = reqTime; + } + + public Object getResponse() { + return response; + } + + public String getResponseToString() { + if (response == null) { + return null; + } + return response instanceof String ? (String) response : String.valueOf(response); + } + + public JSONObject getResponseToJson() { + return JSON.parseObject(getResponseToString()); + } + + public void setResponse(Object response) { + this.response = response; + } + + public Map getHeaders() { + return headers; + } + + public void setHeaders(Map headers) { + this.headers = headers; + } + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/KeyUtils.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/KeyUtils.java new file mode 100644 index 0000000..946e8f5 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/KeyUtils.java @@ -0,0 +1,24 @@ +package org.aibidding.system.util; + +import org.apache.commons.lang3.RandomStringUtils; + +import java.util.UUID; + +/** + * @author https://www.wdbyte.com + */ +public class KeyUtils { + + public synchronized static String key6() { + return RandomStringUtils.randomAlphanumeric(6); + } + + public synchronized static String key16() { + return RandomStringUtils.randomAlphanumeric(16); + } + + public static String uuid32() { + return UUID.randomUUID().toString().replace("-", ""); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/OrderNumberGenerator.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/OrderNumberGenerator.java new file mode 100644 index 0000000..a043019 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/OrderNumberGenerator.java @@ -0,0 +1,24 @@ +package org.aibidding.system.util; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.concurrent.ThreadLocalRandom; +public class OrderNumberGenerator { + // 订单编号前缀 + private static final String PREFIX = "NO"; + + // 时间格式化 + private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyyMMddHHmm"); + + // 生成订单编号 + public static String generate() { + // 获取当前日期时间字符串 + String dateTimeStr = DATE_FORMAT.format(new Date()); + + // 生成随机数 (这里举例生成一个5位随机数) + int randomNum = ThreadLocalRandom.current().nextInt(10000, 99999); + + // 拼接订单编号 + return dateTimeStr + randomNum; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WddPptApi.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WddPptApi.java new file mode 100644 index 0000000..5388f08 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WddPptApi.java @@ -0,0 +1,438 @@ +package org.aibidding.system.util; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * 文多多PPT-API + * + * @author NSL + * @since 2024-12-30 + */ +public class WddPptApi { + + public static final String BASE_URL = "https://docmee.cn"; + private static Long DEFAULT_TIME_OUT = 5 * 60 * 1000L; + + public static String createApiToken(String apiKey, String uid, Integer limit) { + String url = BASE_URL + "/api/user/createApiToken"; + JSONObject body = new JSONObject(); + body.put("uid", uid); + body.put("limit", limit); + HttpUtils.HttpRequest httpRequest = HttpUtils.HttpRequest.postJson(url); + httpRequest.setBody(body.toJSONString()); + httpRequest.addHeaders("Api-Key", apiKey); + HttpUtils.HttpResponse response = HttpUtils.request(httpRequest); + if (response.getStatus() != 200) { + throw new RuntimeException("创建apiToken失败,httpStatus=" + response.getStatus()); + } + JSONObject result = response.getResponseToJson(); + if (result.getIntValue("code") != 0) { + throw new RuntimeException("创建apiToken异常," + result.getString("message")); + } + return result.getJSONObject("data").getString("token"); + } + + public static String parseFileData(String apiToken, File file, String content, String fileUrl) { + String url = BASE_URL + "/api/ppt/parseFileData"; + HttpUtils.HttpRequest httpRequest = new HttpUtils.HttpRequest(); + httpRequest.setUrl(url); + httpRequest.setMethod("POST"); + httpRequest.addHeaders("token", apiToken); + MultipartEntityBuilder multipartEntity = MultipartEntityBuilder.create(); + multipartEntity.setCharset(StandardCharsets.UTF_8); + if (file != null) { + multipartEntity.addBinaryBody("file", file); + } + if (content != null) { + multipartEntity.addTextBody("content", content, ContentType.create("text/plain", StandardCharsets.UTF_8)); + } + if (fileUrl != null) { + multipartEntity.addTextBody("fileUrl", fileUrl, ContentType.create("text/plain", StandardCharsets.UTF_8)); + } + httpRequest.setBody(multipartEntity.build()); + HttpUtils.HttpResponse response = HttpUtils.request(httpRequest); + if (response.getStatus() != 200) { + throw new RuntimeException("解析文件或内容失败,httpStatus=" + response.getStatus()); + } + JSONObject result = response.getResponseToJson(); + if (result.getIntValue("code") != 0) { + throw new RuntimeException("解析文件或内容异常," + result.getString("message")); + } + return result.getJSONObject("data").getString("dataUrl"); + } + + /** + * 生产大纲 + */ + public static String generateOutline(String apiToken, String subject, String dataUrl, String prompt) { + String url = BASE_URL + "/api/ppt/generateOutline"; + JSONObject body = new JSONObject(); + body.put("subject", subject); + body.put("dataUrl", dataUrl); + body.put("prompt", prompt); + HttpUtils.HttpRequest httpRequest = HttpUtils.HttpRequest.postJson(url); + httpRequest.setBody(body.toJSONString()); + httpRequest.addHeaders("token", apiToken); + StringBuilder sb = new StringBuilder(); + HttpUtils.HttpResponse response = HttpUtils.requestWithEventStream(httpRequest, data -> { + if (data == null || data.isEmpty()) { + return; + } + JSONObject json = JSONObject.parseObject(data); + if (Objects.equals(json.getInteger("status"), -1)) { + throw new RuntimeException(json.getString("error")); + } + String text = json.getString("text"); + sb.append(text); + // 打印输出 + System.out.print(text); + }); + if (response.getStatus() != 200) { + throw new RuntimeException("生成大纲失败,httpStatus=" + response.getStatus()); + } + if (response.getHeaders().getOrDefault("Content-Type", response.getHeaders().get("content-type")).contains("application/json")) { + JSONObject result = response.getResponseToJson(); + throw new RuntimeException("生成大纲失败:" + result.getString("message")); + } + return sb.toString(); + } + + /** + * 生产大纲 + */ + public static SseEmitter sseGenerateOutline(String apiToken, String subject, String dataUrl, String prompt) { + String url = BASE_URL + "/api/ppt/generateOutline"; + JSONObject body = new JSONObject(); + body.put("subject", subject); + body.put("dataUrl", dataUrl); + body.put("prompt", prompt); + HttpUtils.HttpRequest httpRequest = HttpUtils.HttpRequest.postJson(url); + httpRequest.setBody(body.toJSONString()); + httpRequest.addHeaders("token", apiToken); + SseEmitter sseEmitter = new SseEmitter(DEFAULT_TIME_OUT); + StringBuilder sb = new StringBuilder(); + new Thread(() -> { + HttpUtils.HttpResponse response = HttpUtils.requestWithEventStream(httpRequest, data -> { + if (data == null || data.isEmpty()) { + return; + } + JSONObject json = JSONObject.parseObject(data); + Integer status = json.getInteger("status"); + if (Objects.equals(status, -1)) { + throw new RuntimeException(json.getString("error")); + } + String text = json.getString("text"); + try { + sseEmitter.send(SseEmitter.event().data(text)); + } catch (IOException e) { + throw new RuntimeException(e); + } + sb.append(text); + // status 4 表示生成完成 + if (status == 4) { + // 打印输出 + System.out.print(sb); + sseEmitter.complete(); + } + }); + if (response.getStatus() != 200) { + throw new RuntimeException("生成大纲失败,httpStatus=" + response.getStatus()); + } + if (response.getHeaders().getOrDefault("Content-Type", response.getHeaders().get("content-type")).contains("application/json")) { + JSONObject result = response.getResponseToJson(); + throw new RuntimeException("生成大纲失败:" + result.getString("message")); + } + }).start(); + return sseEmitter; + } + + /** + * 生成大纲内容 + */ + public static String generateContent(String apiToken, String outlineMarkdown, String dataUrl, String prompt) { + String url = BASE_URL + "/api/ppt/generateContent"; + JSONObject body = new JSONObject(); + body.put("outlineMarkdown", outlineMarkdown); + body.put("dataUrl", dataUrl); + body.put("prompt", prompt); + HttpUtils.HttpRequest httpRequest = HttpUtils.HttpRequest.postJson(url); + httpRequest.setBody(body.toJSONString()); + httpRequest.addHeaders("token", apiToken); + StringBuilder sb = new StringBuilder(); + HttpUtils.HttpResponse response = HttpUtils.requestWithEventStream(httpRequest, data -> { + if (data == null || data.isEmpty()) { + return; + } + JSONObject json = JSONObject.parseObject(data); + if (Objects.equals(json.getInteger("status"), -1)) { + throw new RuntimeException(json.getString("error")); + } + String text = json.getString("text"); + sb.append(text); + // 打印输出 + System.out.print(text); + }); + if (response.getStatus() != 200) { + throw new RuntimeException("生成大纲内容失败,httpStatus=" + response.getStatus()); + } + if (response.getHeaders().getOrDefault("Content-Type", response.getHeaders().get("content-type")).contains("application/json")) { + JSONObject result = response.getResponseToJson(); + throw new RuntimeException("生成大纲内容失败:" + result.getString("message")); + } + return sb.toString(); + } + + /** + * 流式生成大纲内容 + */ + public static SseEmitter sseGenerateContent(String apiToken, String outlineMarkdown, String dataUrl, String prompt) { + String url = BASE_URL + "/api/ppt/generateContent"; + JSONObject body = new JSONObject(); + body.put("outlineMarkdown", outlineMarkdown); + body.put("dataUrl", dataUrl); + body.put("prompt", prompt); + HttpUtils.HttpRequest httpRequest = HttpUtils.HttpRequest.postJson(url); + httpRequest.setBody(body.toJSONString()); + httpRequest.addHeaders("token", apiToken); + SseEmitter sseEmitter = new SseEmitter(DEFAULT_TIME_OUT); + StringBuilder sb = new StringBuilder(); + new Thread(() -> { + HttpUtils.HttpResponse response = HttpUtils.requestWithEventStream(httpRequest, data -> { + if (data == null || data.isEmpty()) { + return; + } + JSONObject json = JSONObject.parseObject(data); + Integer status = json.getInteger("status"); + if (Objects.equals(status, -1)) { + throw new RuntimeException(json.getString("error")); + } + String text = json.getString("text"); + try { + sseEmitter.send(text); + } catch (IOException e) { + throw new RuntimeException(e); + } + sb.append(text); + // status 4 表示生成完成 + if (status == 4) { + // 打印输出 + System.out.print(sb); + sseEmitter.complete(); + } + }); + if (response.getStatus() != 200) { + throw new RuntimeException("生成大纲内容失败,httpStatus=" + response.getStatus()); + } + if (response.getHeaders().getOrDefault("Content-Type", response.getHeaders().get("content-type")).contains("application/json")) { + JSONObject result = response.getResponseToJson(); + throw new RuntimeException("生成大纲内容失败:" + result.getString("message")); + } + }).start(); + return sseEmitter; + } + + public static Map asyncGenerateContent(String apiToken, String outlineMarkdown, String dataUrl, String templateId, String prompt) { + String url = BASE_URL + "/api/ppt/generateContent"; + JSONObject body = new JSONObject(); + body.put("asyncGenPptx", true); + body.put("templateId", templateId); + body.put("outlineMarkdown", outlineMarkdown); + body.put("dataUrl", dataUrl); + body.put("prompt", prompt); + HttpUtils.HttpRequest httpRequest = HttpUtils.HttpRequest.postJson(url); + httpRequest.setBody(body.toJSONString()); + httpRequest.addHeaders("token", apiToken); + Map pptInfo = new HashMap<>(); + StringBuilder sb = new StringBuilder(); + HttpUtils.HttpResponse response = HttpUtils.requestWithEventStream(httpRequest, data -> { + if (data == null || data.isEmpty()) { + return; + } + JSONObject json = JSONObject.parseObject(data); + if (Objects.equals(json.getInteger("status"), -1)) { + throw new RuntimeException(json.getString("error")); + } + if (json.getString("pptId") != null) { + pptInfo.put("id", json.getString("pptId")); + } + String text = json.getString("text"); + sb.append(text); + // 打印输出 + System.out.print(text); + }); + if (response.getStatus() != 200) { + throw new RuntimeException("生成大纲内容失败,httpStatus=" + response.getStatus()); + } + if (response.getHeaders().getOrDefault("Content-Type", response.getHeaders().get("content-type")).contains("application/json")) { + JSONObject result = response.getResponseToJson(); + throw new RuntimeException("生成大纲内容失败:" + result.getString("message")); + } + pptInfo.put("markdown", sb.toString()); + return pptInfo; + } + + public static String randomOneTemplateId(String apiToken) { + String url = BASE_URL + "/api/ppt/randomTemplates"; + JSONObject body = new JSONObject(); + body.put("size", 1); + JSONObject filters = new JSONObject(); + filters.put("type", 1); + body.put("filters", filters); + HttpUtils.HttpRequest httpRequest = HttpUtils.HttpRequest.postJson(url); + httpRequest.setBody(body.toJSONString()); + httpRequest.addHeaders("token", apiToken); + HttpUtils.HttpResponse response = HttpUtils.request(httpRequest); + if (response.getStatus() != 200) { + throw new RuntimeException("获取模板失败,httpStatus=" + response.getStatus()); + } + JSONObject result = response.getResponseToJson(); + if (result.getIntValue("code") != 0) { + throw new RuntimeException("获取模板异常," + result.getString("message")); + } + JSONArray data = result.getJSONArray("data"); + JSONObject template = data.getJSONObject(0); + return template.getString("id"); + } + + /** + * 生成PPT + */ + public static JSONObject generatePptx(String apiToken, String templateId, String markdown, boolean pptxProperty) { + String url = BASE_URL + "/api/ppt/generatePptx"; + JSONObject body = new JSONObject(); + body.put("templateId", templateId); + body.put("outlineContentMarkdown", markdown); + body.put("pptxProperty", pptxProperty); + HttpUtils.HttpRequest httpRequest = HttpUtils.HttpRequest.postJson(url); + httpRequest.setBody(body.toJSONString()); + httpRequest.addHeaders("token", apiToken); + HttpUtils.HttpResponse response = HttpUtils.request(httpRequest); + if (response.getStatus() != 200) { + throw new RuntimeException("生成PPT失败,httpStatus=" + response.getStatus()); + } + JSONObject result = response.getResponseToJson(); + if (result.getIntValue("code") != 0) { + throw new RuntimeException("生成PPT异常," + result.getString("message")); + } + return result.getJSONObject("data").getJSONObject("pptInfo"); + } + + public static JSONObject downloadPptx(String apiToken, String id) { + String url = BASE_URL + "/api/ppt/downloadPptx"; + JSONObject body = new JSONObject(); + body.put("id", id); + HttpUtils.HttpRequest httpRequest = HttpUtils.HttpRequest.postJson(url); + httpRequest.setBody(body.toJSONString()); + httpRequest.addHeaders("token", apiToken); + HttpUtils.HttpResponse response = HttpUtils.request(httpRequest); + if (response.getStatus() != 200) { + throw new RuntimeException("下载PPT失败,httpStatus=" + response.getStatus()); + } + JSONObject result = response.getResponseToJson(); + if (result.getIntValue("code") != 0) { + throw new RuntimeException("下载PPT异常," + result.getString("message")); + } + return result.getJSONObject("data"); + } + + public static JSONObject directGeneratePptx(String apiToken, boolean stream, String templateId, String subject, String dataUrl, String prompt, boolean pptxProperty) { + String url = BASE_URL + "/api/ppt/directGeneratePptx"; + JSONObject body = new JSONObject(); + body.put("stream", stream); + body.put("templateId", templateId); + body.put("subject", subject); + body.put("dataUrl", dataUrl); + body.put("prompt", prompt); + body.put("pptxProperty", pptxProperty); + HttpUtils.HttpRequest httpRequest = HttpUtils.HttpRequest.postJson(url); + httpRequest.setBody(body.toJSONString()); + httpRequest.addHeaders("token", apiToken); + if (stream) { + // 流式生成 + JSONObject[] pptInfo = new JSONObject[1]; + HttpUtils.HttpResponse response = HttpUtils.requestWithEventStream(httpRequest, data -> { + if (data == null || data.isEmpty()) { + return; + } + JSONObject json = JSONObject.parseObject(data); + if (Objects.equals(json.getInteger("status"), -1)) { + throw new RuntimeException(json.getString("error")); + } + if (Objects.equals(json.getInteger("status"), 4) && json.containsKey("result")) { + pptInfo[0] = json.getJSONObject("result"); + } + String text = json.getString("text"); + // 打印输出 + System.out.print(text); + }); + if (response.getStatus() != 200) { + throw new RuntimeException("生成PPT失败,httpStatus=" + response.getStatus()); + } + if (response.getHeaders().getOrDefault("Content-Type", response.getHeaders().get("content-type")).contains("application/json")) { + JSONObject result = response.getResponseToJson(); + throw new RuntimeException("生成PPT失败:" + result.getString("message")); + } + return pptInfo[0]; + } else { + // 非流式生成 + HttpUtils.HttpResponse response = HttpUtils.request(httpRequest); + if (response.getStatus() != 200) { + throw new RuntimeException("生成PPT失败,httpStatus=" + response.getStatus()); + } + JSONObject result = response.getResponseToJson(); + if (result.getIntValue("code") != 0) { + throw new RuntimeException("生成PPT异常," + result.getString("message")); + } + return result.getJSONObject("data").getJSONObject("pptInfo"); + } + } + + /** + * 查询所有PPT列表 + */ + public static JSONObject listAllPptx(String apiToken, String body) { + String url = BASE_URL + "/api/ppt/listAllPptx"; + HttpUtils.HttpRequest httpRequest = HttpUtils.HttpRequest.postJson(url); + httpRequest.setBody(body); + httpRequest.addHeaders("token", apiToken); + HttpUtils.HttpResponse response = HttpUtils.request(httpRequest); + if (response.getStatus() != 200) { + throw new RuntimeException("查询所有PPT列表失败,httpStatus=" + response.getStatus()); + } + JSONObject result = response.getResponseToJson(); + if (result.getIntValue("code") != 0) { + throw new RuntimeException("查询所有PPT列表异常," + result.getString("message")); + } + return result; + } + + /** + * 分页查询 PPT 模板 + */ + public static JSONObject getPptTemplates(String apiToken, String body) { + String url = BASE_URL + "/api/ppt/templates"; + HttpUtils.HttpRequest httpRequest = HttpUtils.HttpRequest.postJson(url); + httpRequest.setBody(body); + httpRequest.addHeaders("token", apiToken); + HttpUtils.HttpResponse response = HttpUtils.request(httpRequest); + if (response.getStatus() != 200) { + throw new RuntimeException("分页查询 PPT 模板失败,httpStatus=" + response.getStatus()); + } + JSONObject result = response.getResponseToJson(); + if (result.getIntValue("code") != 0) { + throw new RuntimeException("分页查询 PPT 模板异常," + result.getString("message")); + } + return result; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WeChatScanHttpUtil.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WeChatScanHttpUtil.java new file mode 100644 index 0000000..599762e --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WeChatScanHttpUtil.java @@ -0,0 +1,59 @@ +package org.aibidding.system.util; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import okhttp3.*; +import org.aibidding.common.core.service.ConfigService; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.concurrent.TimeUnit; + +/** + * 绘声美音HTTP请求工具类 + * + * @author NSL + * @since 2024-12-25 + */ +@RequiredArgsConstructor +@Component +@Slf4j +public class WeChatScanHttpUtil { + + private final ConfigService configService; + + private static final String TOKEN = "token"; + + private final OkHttpClient client = new OkHttpClient.Builder() + .connectTimeout(300, TimeUnit.SECONDS) + .writeTimeout(300, TimeUnit.SECONDS) + .readTimeout(300, TimeUnit.SECONDS) + .build(); + + public String executeRequest(Request request) { + try (Response response = client.newCall(request).execute()) { + if (!response.isSuccessful()) { + throw new IOException("Unexpected code " + response); + } + return response.body() != null ? response.body().string() : null; + } catch (IOException e) { + // 这里应根据实际情况使用适当的日志记录方式 + log.error("请求失败: {}",e.getMessage()); + return null; + } + } + + public Request createPostRequest(String url, String json) { + RequestBody body = RequestBody.create(json, MediaType.get("application/json; charset=utf-8")); + return new Request.Builder() + .url(url) + .post(body) + .header("Content-Type", "application/json") + .header(TOKEN, getKey(TOKEN)) + .build(); + } + + public String getKey(String key) { + return configService.getConfigValue("cover", key); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WeixinApiUtil.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WeixinApiUtil.java new file mode 100644 index 0000000..0322a12 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WeixinApiUtil.java @@ -0,0 +1,81 @@ +package org.aibidding.system.util; + +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import org.aibidding.common.core.service.ConfigService; +import org.aibidding.system.domain.model.WeixinQrCode; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.net.URI; +import java.time.LocalDateTime; + +/** + * @author https://www.wdbyte.com + */ +@Slf4j +@Component +@RequiredArgsConstructor +public class WeixinApiUtil { + + private final ConfigService configService; + + private static String QR_CODE_URL_PREFIX = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="; + + private static String ACCESS_TOKEN = null; + private static LocalDateTime ACCESS_TOKEN_EXPIRE_TIME = null; + /** + * 二维码 Ticket 过期时间 + */ + private static int QR_CODE_TICKET_TIMEOUT = 10 * 60; + + /** + * 获取 access token + * + * @return + */ + public synchronized String getAccessToken() { + if (ACCESS_TOKEN != null && ACCESS_TOKEN_EXPIRE_TIME.isAfter(LocalDateTime.now())) { + return ACCESS_TOKEN; + } + String api = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + getKey("appid") + "&secret=" + + getKey("secret"); + String result = HttpUtil.get(api); + JSONObject jsonObject = JSON.parseObject(result); + ACCESS_TOKEN = jsonObject.getString("access_token"); + ACCESS_TOKEN_EXPIRE_TIME = LocalDateTime.now().plusSeconds(jsonObject.getLong("expires_in") - 10); + return ACCESS_TOKEN; + } + + /** + * 获取二维码 Ticket + * + * https://developers.weixin.qq.com/doc/offiaccount/Account_Management/Generating_a_Parametric_QR_Code.html + * + * @return + */ + public WeixinQrCode getQrCode() { + String api = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=" + getAccessToken(); + String jsonBody = String.format("{\n" + + " \"expire_seconds\": %d,\n" + + " \"action_name\": \"QR_STR_SCENE\",\n" + + " \"action_info\": {\n" + + " \"scene\": {\n" + + " \"scene_str\": \"%s\"\n" + + " }\n" + + " }\n" + + "}", QR_CODE_TICKET_TIMEOUT, KeyUtils.uuid32()); + String result = HttpUtil.post(api, jsonBody); + log.info("get qr code params:{}", jsonBody); + log.info("get qr code result:{}", result); + WeixinQrCode weixinQrCode = JSON.parseObject(result, WeixinQrCode.class); + weixinQrCode.setQrCodeUrl(QR_CODE_URL_PREFIX + URI.create(weixinQrCode.getTicket()).toASCIIString()); + return weixinQrCode; + } + + public String getKey(String key) { + return configService.getConfigValue("weixin", key); + } +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WeixinMsgUtil.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WeixinMsgUtil.java new file mode 100644 index 0000000..f1a90b3 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WeixinMsgUtil.java @@ -0,0 +1,66 @@ +package org.aibidding.system.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; +import org.aibidding.system.domain.model.ReceiveMessage; + +/** + * @author https://www.wdbyte.com + */ +public class WeixinMsgUtil { + + // 事件-关注 + private static String EVENT_SUBSCRIBE = "subscribe"; + + /** + * 微信消息转对象 + * + * @param xml + * @return + */ + public static ReceiveMessage msgToReceiveMessage(String xml) { + JSONObject jsonObject = JSON.parseObject(XmlUtil.xml2json(xml)); + ReceiveMessage receiveMessage = new ReceiveMessage(); + receiveMessage.setToUserName(jsonObject.getString("ToUserName")); + receiveMessage.setFromUserName(jsonObject.getString("FromUserName")); + receiveMessage.setCreateTime(jsonObject.getString("CreateTime")); + receiveMessage.setMsgType(jsonObject.getString("MsgType")); + receiveMessage.setContent(jsonObject.getString("Content")); + receiveMessage.setMsgId(jsonObject.getString("MsgId")); + receiveMessage.setEvent(jsonObject.getString("Event")); + receiveMessage.setTicket(jsonObject.getString("Ticket")); + return receiveMessage; + } + + /** + * 是否是订阅事件 + * + * @param receiveMessage + * @return + */ + public static boolean isEventAndSubscribe(ReceiveMessage receiveMessage) { + return StringUtils.equals(receiveMessage.getEvent(), EVENT_SUBSCRIBE); + } + + /** + * 是否是二维码扫描事件 + * + * @param receiveMessage + * @return + */ + public static boolean isScanQrCode(ReceiveMessage receiveMessage) { + return StringUtils.isNotEmpty(receiveMessage.getTicket()); + } + + /** + * 获取扫描的二维码 Ticket + * + * @param receiveMessage + * @return + */ + public static String getQrCodeTicket(ReceiveMessage receiveMessage) { + return receiveMessage.getTicket(); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WeixinQrCodeCacheUtil.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WeixinQrCodeCacheUtil.java new file mode 100644 index 0000000..cd71e87 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/WeixinQrCodeCacheUtil.java @@ -0,0 +1,34 @@ +package org.aibidding.system.util; + +import java.util.LinkedHashMap; + +/** + * 微信二维码缓存工具类 + * + * @author https://www.wdbyte.com + */ +public class WeixinQrCodeCacheUtil { + private static long MAX_CACHE_SIZE = 10000; + private static LinkedHashMap QR_CODE_TICKET_MAP = new LinkedHashMap<>(); + + /** + * 增加一个 Ticket + * 首次 put:value 为 "" + * 再次 put: value 有 openId,若openId已经存在,则已被扫码 + * + * @param key + * @param value + */ + public synchronized static void put(String key, String value) { + QR_CODE_TICKET_MAP.put(key, value); + if (QR_CODE_TICKET_MAP.size() > MAX_CACHE_SIZE) { + String first = QR_CODE_TICKET_MAP.keySet().stream().findFirst().get(); + QR_CODE_TICKET_MAP.remove(first); + } + } + + public synchronized static String get(String key) { + return QR_CODE_TICKET_MAP.remove(key); + } + +} diff --git a/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/XmlUtil.java b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/XmlUtil.java new file mode 100644 index 0000000..bc6bb5d --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/java/org/aibidding/system/util/XmlUtil.java @@ -0,0 +1,28 @@ +package org.aibidding.system.util; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +/** + * @author https://www.wdbyte.com + */ +@Slf4j +public class XmlUtil { + + public static String xml2json(String requestBody) { + requestBody = StringUtils.trim(requestBody); + XmlMapper xmlMapper = new XmlMapper(); + JsonNode node = null; + try { + node = xmlMapper.readTree(requestBody.getBytes()); + ObjectMapper jsonMapper = new ObjectMapper(); + return jsonMapper.writeValueAsString(node); + } catch (Exception e) { + log.error("xml 2 json error,msg:" + e.getMessage(), e); + } + return null; + } +} diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/ChatConfigMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/ChatConfigMapper.xml new file mode 100644 index 0000000..b620c1e --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/ChatConfigMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/ChatVisitorUsageMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/ChatVisitorUsageMapper.xml new file mode 100644 index 0000000..7a49c85 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/ChatVisitorUsageMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/ChatVoucherMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/ChatVoucherMapper.xml new file mode 100644 index 0000000..e5a8022 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/ChatVoucherMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/CoverMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/CoverMapper.xml new file mode 100644 index 0000000..b574532 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/CoverMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/CoverPromptAudioMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/CoverPromptAudioMapper.xml new file mode 100644 index 0000000..7274af5 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/CoverPromptAudioMapper.xml @@ -0,0 +1,17 @@ + + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/PaymentOrdersMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/PaymentOrdersMapper.xml new file mode 100644 index 0000000..d1ffcf6 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/PaymentOrdersMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysConfigMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysConfigMapper.xml new file mode 100644 index 0000000..903abec --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysConfigMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysDeptMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysDeptMapper.xml new file mode 100644 index 0000000..ff6a385 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysDictDataMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysDictDataMapper.xml new file mode 100644 index 0000000..91be2db --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysDictDataMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysDictTypeMapper.xml new file mode 100644 index 0000000..e772298 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysDictTypeMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysLogininforMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysLogininforMapper.xml new file mode 100644 index 0000000..712c9a8 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysLogininforMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysMenuMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysMenuMapper.xml new file mode 100644 index 0000000..7220e91 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysMenuMapper.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysModelMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysModelMapper.xml new file mode 100644 index 0000000..a2ace81 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysModelMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysNoticeMapper.xml new file mode 100644 index 0000000..8426de0 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysNoticeMapper.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysNoticeStateMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysNoticeStateMapper.xml new file mode 100644 index 0000000..48d72e7 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysNoticeStateMapper.xml @@ -0,0 +1,11 @@ + + + + + + UPDATE sys_notice_state SET read_status = 1 + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysOperLogMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysOperLogMapper.xml new file mode 100644 index 0000000..3f0d4b6 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysOperLogMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysOssConfigMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysOssConfigMapper.xml new file mode 100644 index 0000000..211a2f2 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysOssConfigMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysOssMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysOssMapper.xml new file mode 100644 index 0000000..b981c0c --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysOssMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysPackagePlanMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysPackagePlanMapper.xml new file mode 100644 index 0000000..1b7c4a1 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysPackagePlanMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysPostMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysPostMapper.xml new file mode 100644 index 0000000..82775f2 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysPostMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml new file mode 100644 index 0000000..1039977 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysRoleMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysRoleMapper.xml new file mode 100644 index 0000000..fe90d3d --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysRoleMapper.xml @@ -0,0 +1,61 @@ + + + + + + + + + select distinct r.role_id, + r.role_name, + r.role_key, + r.role_sort, + r.data_scope, + r.menu_check_strictly, + r.dept_check_strictly, + r.status, + r.del_flag, + r.create_time, + r.remark + from sys_role r + left join sys_user_role sur on sur.role_id = r.role_id + left join sys_user u on u.user_id = sur.user_id + left join sys_dept d on u.dept_id = d.dept_id + + + + + + + + + + + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml new file mode 100644 index 0000000..1a26549 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysTenantMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysTenantMapper.xml new file mode 100644 index 0000000..8e450b8 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysTenantMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysTenantPackageMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysTenantPackageMapper.xml new file mode 100644 index 0000000..46e7ee9 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysTenantPackageMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysUserMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysUserMapper.xml new file mode 100644 index 0000000..38b3510 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + select u.user_id, + u.tenant_id, + u.user_balance, + u.user_grade, + u.dept_id, + u.user_name, + u.nick_name, + u.user_type, + u.email, + u.avatar, + u.wx_avatar, + u.phonenumber, + u.password, + u.user_plan, + u.sex, + u.status, + u.del_flag, + u.login_ip, + u.login_date, + u.create_by, + u.create_time, + u.remark, + d.dept_id, + d.parent_id, + d.ancestors, + d.dept_name, + d.order_num, + d.leader, + d.status as dept_status, + r.role_id, + r.role_name, + r.role_key, + r.role_sort, + r.data_scope, + r.status as role_status + from sys_user u + left join sys_dept d on u.dept_id = d.dept_id + left join sys_user_role sur on u.user_id = sur.user_id + left join sys_role r on r.role_id = sur.role_id + + + + update sys_user + set nick_name = #{nickName}, + wx_avatar = #{wxAvatar} + WHERE user_id = #{userId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysUserPostMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysUserPostMapper.xml new file mode 100644 index 0000000..5e5a9a3 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysUserPostMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysUserRoleMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysUserRoleMapper.xml new file mode 100644 index 0000000..32234e8 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/SysUserRoleMapper.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/WxRobConfigMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/WxRobConfigMapper.xml new file mode 100644 index 0000000..c7af5bf --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/WxRobConfigMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/WxRobKeywordMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/WxRobKeywordMapper.xml new file mode 100644 index 0000000..32582d1 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/WxRobKeywordMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/aibidding-system/src/main/resources/mapper/system/WxRobRelationMapper.xml b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/WxRobRelationMapper.xml new file mode 100644 index 0000000..aab9663 --- /dev/null +++ b/aibidding-modules/aibidding-system/src/main/resources/mapper/system/WxRobRelationMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/aibidding-modules/pom.xml b/aibidding-modules/pom.xml new file mode 100644 index 0000000..6b11221 --- /dev/null +++ b/aibidding-modules/pom.xml @@ -0,0 +1,28 @@ + + + + ruoyi-ai + org.ruoyi + ${revision} + ../pom.xml + + 4.0.0 + aibidding-modules + pom + + + ruoyi-modules 业务模块 + + + + aibidding-demo + aibidding-fusion + aibidding-system + aibidding-live + aibidding-knowledge + aibidding-generator + + + diff --git a/image/00.png b/image/00.png new file mode 100644 index 0000000..5db8e1d Binary files /dev/null and b/image/00.png differ diff --git a/image/01.png b/image/01.png new file mode 100644 index 0000000..4f623f6 Binary files /dev/null and b/image/01.png differ diff --git a/image/02.png b/image/02.png new file mode 100644 index 0000000..794e086 Binary files /dev/null and b/image/02.png differ diff --git a/image/03.png b/image/03.png new file mode 100644 index 0000000..e3949c4 Binary files /dev/null and b/image/03.png differ diff --git a/image/04.png b/image/04.png new file mode 100644 index 0000000..65f5e0c Binary files /dev/null and b/image/04.png differ diff --git a/image/05.png b/image/05.png new file mode 100644 index 0000000..1414c46 Binary files /dev/null and b/image/05.png differ diff --git a/image/06.png b/image/06.png new file mode 100644 index 0000000..da49956 Binary files /dev/null and b/image/06.png differ diff --git a/image/07.png b/image/07.png new file mode 100644 index 0000000..e311e8d Binary files /dev/null and b/image/07.png differ diff --git a/image/08.png b/image/08.png new file mode 100644 index 0000000..abf6c32 Binary files /dev/null and b/image/08.png differ diff --git a/image/09.png b/image/09.png new file mode 100644 index 0000000..62ff7ca Binary files /dev/null and b/image/09.png differ diff --git a/image/10.png b/image/10.png new file mode 100644 index 0000000..2bf9850 Binary files /dev/null and b/image/10.png differ diff --git a/image/11.png b/image/11.png new file mode 100644 index 0000000..a301caf Binary files /dev/null and b/image/11.png differ diff --git a/image/12.png b/image/12.png new file mode 100644 index 0000000..b8ccba6 Binary files /dev/null and b/image/12.png differ diff --git a/image/13.png b/image/13.png new file mode 100644 index 0000000..657767e Binary files /dev/null and b/image/13.png differ diff --git a/logs/sys-console.log b/logs/sys-console.log new file mode 100644 index 0000000..b177f34 --- /dev/null +++ b/logs/sys-console.log @@ -0,0 +1,63 @@ +2025-05-18 23:07:31 [background-preinit] INFO o.h.validator.internal.util.Version - HV000001: Hibernate Validator 8.0.0.Final +2025-05-18 23:07:31 [main] INFO org.aibidding.RuoYiAIApplication - Starting RuoYiAIApplication using Java 17.0.15 with PID 25192 (C:\Users\him69\Desktop\projects9\ruoyi-ai\aibidding-admin\target\classes started by him69 in C:\Users\him69\Desktop\projects9\ruoyi-ai) +2025-05-18 23:07:31 [main] INFO org.aibidding.RuoYiAIApplication - The following 1 profile is active: "dev" +2025-05-18 23:07:38 [main] WARN o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[org.aibidding]' package. Please check your configuration. +2025-05-18 23:07:42 [main] INFO io.undertow.servlet - Initializing Spring embedded WebApplicationContext +2025-05-18 23:07:43 [main] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource detect P6SPY plugin and enabled it +2025-05-18 23:07:43 [main] INFO com.zaxxer.hikari.HikariDataSource - master - Starting... +2025-05-18 23:07:44 [main] INFO com.zaxxer.hikari.pool.HikariPool - master - Added connection com.mysql.cj.jdbc.ConnectionImpl@32d8e58d +2025-05-18 23:07:44 [main] INFO com.zaxxer.hikari.HikariDataSource - master - Start completed. +2025-05-18 23:07:44 [main] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource - add a datasource named [master] success +2025-05-18 23:07:44 [main] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource initial loaded [1] datasource,primary datasource named [master] +2025-05-18 23:07:48 [main] WARN c.b.m.c.t.support.ReflectLambdaMeta - Unable to make field private final java.lang.Class java.lang.invoke.SerializedLambda.capturingClass accessible: module java.base does not "opens java.lang.invoke" to unnamed module @48e4374 +2025-05-18 23:07:50 [main] INFO o.a.common.json.config.JacksonConfig - 初始化 jackson 配置 +2025-05-18 23:07:51 [main] INFO o.a.common.redis.config.RedisConfig - 初始化 redis 配置 +2025-05-18 23:07:51 [main] INFO org.redisson.Version - Redisson 3.20.1 +2025-05-18 23:07:52 [redisson-netty-3-4] INFO o.r.c.p.MasterPubSubConnectionPool - 1 connections initialized for 127.0.0.1/127.0.0.1:6379 +2025-05-18 23:07:52 [redisson-netty-3-3] INFO o.r.c.pool.MasterConnectionPool - 8 connections initialized for 127.0.0.1/127.0.0.1:6379 +2025-05-18 23:07:56 [main] INFO o.a.common.json.config.JacksonConfig - 初始化 jackson 配置 +2025-05-18 23:08:01 [main] WARN o.s.b.a.f.FreeMarkerAutoConfiguration - Cannot find template location(s): [classpath:/templates/] (please add some templates, check your FreeMarker configuration, or set spring.freemarker.check-template-location=false) +2025-05-18 23:08:02 [main] INFO io.undertow - starting server: Undertow - 2.3.5.Final +2025-05-18 23:08:02 [main] INFO org.xnio - XNIO version 3.8.8.Final +2025-05-18 23:08:02 [main] INFO org.xnio.nio - XNIO NIO Implementation Version 3.8.8.Final +2025-05-18 23:08:02 [main] INFO org.jboss.threads - JBoss Threads version 3.5.0.Final +2025-05-18 23:08:02 [main] INFO org.aibidding.RuoYiAIApplication - Started RuoYiAIApplication in 33.351 seconds (process running for 35.061) +2025-05-18 23:08:02 [main] INFO o.a.c.c.l.WebSocketTopicListener - 初始化WebSocket主题订阅监听器成功 +2025-05-18 23:08:03 [main] INFO o.a.s.runner.SystemApplicationRunner - 初始化OSS配置成功 +2025-05-18 23:08:03 [RMI TCP Connection(4)-10.17.122.103] INFO io.undertow.servlet - Initializing Spring DispatcherServlet 'dispatcherServlet' +2025-05-18 23:11:21 [SpringApplicationShutdownHook] INFO io.undertow - stopping server: Undertow - 2.3.5.Final +2025-05-18 23:11:21 [SpringApplicationShutdownHook] INFO io.undertow.servlet - Destroying Spring FrameworkServlet 'dispatcherServlet' +2025-05-18 23:11:21 [SpringApplicationShutdownHook] INFO o.a.c.core.manager.ShutdownManager - ====关闭后台任务任务线程池==== +2025-05-18 23:11:21 [SpringApplicationShutdownHook] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource start closing .... +2025-05-18 23:11:21 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource - master - Shutdown initiated... +2025-05-18 23:11:21 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource - master - Shutdown completed. +2025-05-18 23:11:21 [SpringApplicationShutdownHook] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource all closed success,bye +2025-05-18 23:26:04 [background-preinit] INFO o.h.validator.internal.util.Version - HV000001: Hibernate Validator 8.0.0.Final +2025-05-18 23:26:04 [main] INFO org.aibidding.RuoYiAIApplication - Starting RuoYiAIApplication using Java 17.0.15 with PID 20252 (C:\Users\him69\Desktop\projects9\新建文件夹\ai-bidding-2.0-backend\aibidding-admin\target\classes started by him69 in C:\Users\him69\Desktop\projects9\新建文件夹\ai-bidding-2.0-backend) +2025-05-18 23:26:04 [main] INFO org.aibidding.RuoYiAIApplication - The following 1 profile is active: "dev" +2025-05-18 23:26:11 [main] WARN o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[org.aibidding]' package. Please check your configuration. +2025-05-18 23:26:15 [main] INFO io.undertow.servlet - Initializing Spring embedded WebApplicationContext +2025-05-18 23:26:16 [main] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource detect P6SPY plugin and enabled it +2025-05-18 23:26:16 [main] INFO com.zaxxer.hikari.HikariDataSource - master - Starting... +2025-05-18 23:26:17 [main] INFO com.zaxxer.hikari.pool.HikariPool - master - Added connection com.mysql.cj.jdbc.ConnectionImpl@6892d403 +2025-05-18 23:26:17 [main] INFO com.zaxxer.hikari.HikariDataSource - master - Start completed. +2025-05-18 23:26:17 [main] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource - add a datasource named [master] success +2025-05-18 23:26:17 [main] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource initial loaded [1] datasource,primary datasource named [master] +2025-05-18 23:26:21 [main] WARN c.b.m.c.t.support.ReflectLambdaMeta - Unable to make field private final java.lang.Class java.lang.invoke.SerializedLambda.capturingClass accessible: module java.base does not "opens java.lang.invoke" to unnamed module @48e4374 +2025-05-18 23:26:23 [main] INFO o.a.common.json.config.JacksonConfig - 初始化 jackson 配置 +2025-05-18 23:26:24 [main] INFO o.a.common.redis.config.RedisConfig - 初始化 redis 配置 +2025-05-18 23:26:25 [main] INFO org.redisson.Version - Redisson 3.20.1 +2025-05-18 23:26:25 [redisson-netty-3-5] INFO o.r.c.p.MasterPubSubConnectionPool - 1 connections initialized for 127.0.0.1/127.0.0.1:6379 +2025-05-18 23:26:25 [redisson-netty-3-3] INFO o.r.c.pool.MasterConnectionPool - 8 connections initialized for 127.0.0.1/127.0.0.1:6379 +2025-05-18 23:26:29 [main] INFO o.a.common.json.config.JacksonConfig - 初始化 jackson 配置 +2025-05-18 23:26:35 [main] WARN o.s.b.a.f.FreeMarkerAutoConfiguration - Cannot find template location(s): [classpath:/templates/] (please add some templates, check your FreeMarker configuration, or set spring.freemarker.check-template-location=false) +2025-05-18 23:26:36 [main] INFO io.undertow - starting server: Undertow - 2.3.5.Final +2025-05-18 23:26:36 [main] INFO org.xnio - XNIO version 3.8.8.Final +2025-05-18 23:26:36 [main] INFO org.xnio.nio - XNIO NIO Implementation Version 3.8.8.Final +2025-05-18 23:26:36 [main] INFO org.jboss.threads - JBoss Threads version 3.5.0.Final +2025-05-18 23:26:36 [main] INFO org.aibidding.RuoYiAIApplication - Started RuoYiAIApplication in 34.287 seconds (process running for 36.047) +2025-05-18 23:26:36 [main] INFO o.a.c.c.l.WebSocketTopicListener - 初始化WebSocket主题订阅监听器成功 +2025-05-18 23:26:36 [main] INFO o.a.s.runner.SystemApplicationRunner - 初始化OSS配置成功 +2025-05-18 23:26:37 [RMI TCP Connection(3)-10.17.122.103] INFO io.undertow.servlet - Initializing Spring DispatcherServlet 'dispatcherServlet' +2025-05-18 23:26:44 [SpringApplicationShutdownHook] INFO io.undertow - stopping server: Undertow - 2.3.5.Final +2025-05-18 23:26:44 [SpringApplicationShutdownHook] INFO io.undertow.servlet - Destroying Spring FrameworkServlet 'dispatcherServlet' diff --git a/logs/sys-error.log b/logs/sys-error.log new file mode 100644 index 0000000..e69de29 diff --git a/logs/sys-info.log b/logs/sys-info.log new file mode 100644 index 0000000..d4110a3 --- /dev/null +++ b/logs/sys-info.log @@ -0,0 +1,57 @@ +2025-05-18 23:07:31 [background-preinit] INFO o.h.validator.internal.util.Version - HV000001: Hibernate Validator 8.0.0.Final +2025-05-18 23:07:31 [main] INFO org.aibidding.RuoYiAIApplication - Starting RuoYiAIApplication using Java 17.0.15 with PID 25192 (C:\Users\him69\Desktop\projects9\ruoyi-ai\aibidding-admin\target\classes started by him69 in C:\Users\him69\Desktop\projects9\ruoyi-ai) +2025-05-18 23:07:31 [main] INFO org.aibidding.RuoYiAIApplication - The following 1 profile is active: "dev" +2025-05-18 23:07:42 [main] INFO io.undertow.servlet - Initializing Spring embedded WebApplicationContext +2025-05-18 23:07:43 [main] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource detect P6SPY plugin and enabled it +2025-05-18 23:07:43 [main] INFO com.zaxxer.hikari.HikariDataSource - master - Starting... +2025-05-18 23:07:44 [main] INFO com.zaxxer.hikari.pool.HikariPool - master - Added connection com.mysql.cj.jdbc.ConnectionImpl@32d8e58d +2025-05-18 23:07:44 [main] INFO com.zaxxer.hikari.HikariDataSource - master - Start completed. +2025-05-18 23:07:44 [main] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource - add a datasource named [master] success +2025-05-18 23:07:44 [main] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource initial loaded [1] datasource,primary datasource named [master] +2025-05-18 23:07:50 [main] INFO o.a.common.json.config.JacksonConfig - 初始化 jackson 配置 +2025-05-18 23:07:51 [main] INFO o.a.common.redis.config.RedisConfig - 初始化 redis 配置 +2025-05-18 23:07:51 [main] INFO org.redisson.Version - Redisson 3.20.1 +2025-05-18 23:07:52 [redisson-netty-3-4] INFO o.r.c.p.MasterPubSubConnectionPool - 1 connections initialized for 127.0.0.1/127.0.0.1:6379 +2025-05-18 23:07:52 [redisson-netty-3-3] INFO o.r.c.pool.MasterConnectionPool - 8 connections initialized for 127.0.0.1/127.0.0.1:6379 +2025-05-18 23:07:56 [main] INFO o.a.common.json.config.JacksonConfig - 初始化 jackson 配置 +2025-05-18 23:08:02 [main] INFO io.undertow - starting server: Undertow - 2.3.5.Final +2025-05-18 23:08:02 [main] INFO org.xnio - XNIO version 3.8.8.Final +2025-05-18 23:08:02 [main] INFO org.xnio.nio - XNIO NIO Implementation Version 3.8.8.Final +2025-05-18 23:08:02 [main] INFO org.jboss.threads - JBoss Threads version 3.5.0.Final +2025-05-18 23:08:02 [main] INFO org.aibidding.RuoYiAIApplication - Started RuoYiAIApplication in 33.351 seconds (process running for 35.061) +2025-05-18 23:08:02 [main] INFO o.a.c.c.l.WebSocketTopicListener - 初始化WebSocket主题订阅监听器成功 +2025-05-18 23:08:03 [main] INFO o.a.s.runner.SystemApplicationRunner - 初始化OSS配置成功 +2025-05-18 23:08:03 [RMI TCP Connection(4)-10.17.122.103] INFO io.undertow.servlet - Initializing Spring DispatcherServlet 'dispatcherServlet' +2025-05-18 23:11:21 [SpringApplicationShutdownHook] INFO io.undertow - stopping server: Undertow - 2.3.5.Final +2025-05-18 23:11:21 [SpringApplicationShutdownHook] INFO io.undertow.servlet - Destroying Spring FrameworkServlet 'dispatcherServlet' +2025-05-18 23:11:21 [SpringApplicationShutdownHook] INFO o.a.c.core.manager.ShutdownManager - ====关闭后台任务任务线程池==== +2025-05-18 23:11:21 [SpringApplicationShutdownHook] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource start closing .... +2025-05-18 23:11:21 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource - master - Shutdown initiated... +2025-05-18 23:11:21 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource - master - Shutdown completed. +2025-05-18 23:11:21 [SpringApplicationShutdownHook] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource all closed success,bye +2025-05-18 23:26:04 [background-preinit] INFO o.h.validator.internal.util.Version - HV000001: Hibernate Validator 8.0.0.Final +2025-05-18 23:26:04 [main] INFO org.aibidding.RuoYiAIApplication - Starting RuoYiAIApplication using Java 17.0.15 with PID 20252 (C:\Users\him69\Desktop\projects9\新建文件夹\ai-bidding-2.0-backend\aibidding-admin\target\classes started by him69 in C:\Users\him69\Desktop\projects9\新建文件夹\ai-bidding-2.0-backend) +2025-05-18 23:26:04 [main] INFO org.aibidding.RuoYiAIApplication - The following 1 profile is active: "dev" +2025-05-18 23:26:15 [main] INFO io.undertow.servlet - Initializing Spring embedded WebApplicationContext +2025-05-18 23:26:16 [main] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource detect P6SPY plugin and enabled it +2025-05-18 23:26:16 [main] INFO com.zaxxer.hikari.HikariDataSource - master - Starting... +2025-05-18 23:26:17 [main] INFO com.zaxxer.hikari.pool.HikariPool - master - Added connection com.mysql.cj.jdbc.ConnectionImpl@6892d403 +2025-05-18 23:26:17 [main] INFO com.zaxxer.hikari.HikariDataSource - master - Start completed. +2025-05-18 23:26:17 [main] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource - add a datasource named [master] success +2025-05-18 23:26:17 [main] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource initial loaded [1] datasource,primary datasource named [master] +2025-05-18 23:26:23 [main] INFO o.a.common.json.config.JacksonConfig - 初始化 jackson 配置 +2025-05-18 23:26:24 [main] INFO o.a.common.redis.config.RedisConfig - 初始化 redis 配置 +2025-05-18 23:26:25 [main] INFO org.redisson.Version - Redisson 3.20.1 +2025-05-18 23:26:25 [redisson-netty-3-5] INFO o.r.c.p.MasterPubSubConnectionPool - 1 connections initialized for 127.0.0.1/127.0.0.1:6379 +2025-05-18 23:26:25 [redisson-netty-3-3] INFO o.r.c.pool.MasterConnectionPool - 8 connections initialized for 127.0.0.1/127.0.0.1:6379 +2025-05-18 23:26:29 [main] INFO o.a.common.json.config.JacksonConfig - 初始化 jackson 配置 +2025-05-18 23:26:36 [main] INFO io.undertow - starting server: Undertow - 2.3.5.Final +2025-05-18 23:26:36 [main] INFO org.xnio - XNIO version 3.8.8.Final +2025-05-18 23:26:36 [main] INFO org.xnio.nio - XNIO NIO Implementation Version 3.8.8.Final +2025-05-18 23:26:36 [main] INFO org.jboss.threads - JBoss Threads version 3.5.0.Final +2025-05-18 23:26:36 [main] INFO org.aibidding.RuoYiAIApplication - Started RuoYiAIApplication in 34.287 seconds (process running for 36.047) +2025-05-18 23:26:36 [main] INFO o.a.c.c.l.WebSocketTopicListener - 初始化WebSocket主题订阅监听器成功 +2025-05-18 23:26:36 [main] INFO o.a.s.runner.SystemApplicationRunner - 初始化OSS配置成功 +2025-05-18 23:26:37 [RMI TCP Connection(3)-10.17.122.103] INFO io.undertow.servlet - Initializing Spring DispatcherServlet 'dispatcherServlet' +2025-05-18 23:26:44 [SpringApplicationShutdownHook] INFO io.undertow - stopping server: Undertow - 2.3.5.Final +2025-05-18 23:26:44 [SpringApplicationShutdownHook] INFO io.undertow.servlet - Destroying Spring FrameworkServlet 'dispatcherServlet' diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..dcf7bb8 --- /dev/null +++ b/pom.xml @@ -0,0 +1,481 @@ + + + 4.0.0 + + org.ruoyi + ruoyi-ai + ${revision} + + ruoyi-ai + https://gitee.com/ageerle/ruoyi-ai + AI助手 + + + 1.0.0 + 3.0.6 + UTF-8 + UTF-8 + 17 + 3.0.1 + 2.1.0 + 0.15.0 + 5.2.3 + 3.2.1 + 2.3 + 1.34.0 + 3.5.3.1 + 3.9.1 + 5.8.18 + 4.10.0 + 3.0.3 + 3.20.1 + 2.2.4 + 3.6.1 + 2.14.2 + 2.4.0 + 1.2.1 + 0.2.0 + 1.18.26 + 1.72 + + 2.7.0 + + + 1.33 + + + 1.12.400 + + 2.0.23 + 3.1.687 + + + 3.2.2 + 3.2.2 + 3.11.0 + 3.0.0 + 1.3.0 + 4.5.0 + 4.6.0 + 4.6.0 + + + + + local + + + local + debug + + + + dev + + + dev + debug + + + + true + + + + prod + + prod + warn + + + + + + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + cn.hutool + hutool-bom + ${hutool.version} + pom + import + + + + + org.ruoyi + aibidding-common-bom + ${revision} + pom + import + + + + org.springdoc + springdoc-openapi-starter-webmvc-api + ${springdoc.version} + + + + com.github.therapi + therapi-runtime-javadoc + ${therapi-javadoc.version} + + + + org.projectlombok + lombok + ${lombok.version} + + + + org.apache.poi + poi + ${poi.version} + + + org.apache.poi + poi-ooxml + ${poi.version} + + + com.alibaba + easyexcel + ${easyexcel.version} + + + org.apache.poi + poi-ooxml-schemas + + + + + + + org.apache.velocity + velocity-engine-core + ${velocity.version} + + + + + cn.dev33 + sa-token-spring-boot3-starter + ${satoken.version} + + + + cn.dev33 + sa-token-jwt + ${satoken.version} + + + cn.hutool + hutool-all + + + + + cn.dev33 + sa-token-core + ${satoken.version} + + + + + com.baomidou + dynamic-datasource-spring-boot-starter + ${dynamic-ds.version} + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + ${spring-boot.mybatis} + + + + com.baomidou + mybatis-plus-boot-starter + ${mybatis-plus.version} + + + + com.baomidou + mybatis-plus-annotation + ${mybatis-plus.version} + + + + + p6spy + p6spy + ${p6spy.version} + + + + com.amazonaws + aws-java-sdk-s3 + ${aws-java-sdk-s3.version} + + + + com.aliyun + dysmsapi20170525 + ${aliyun.sms.version} + + + + com.tencentcloudapi + tencentcloud-sdk-java-sms + ${tencent.sms.version} + + + + + + + + + + + + + + + + org.redisson + redisson-spring-boot-starter + ${redisson.version} + + + + com.baomidou + lock4j-redisson-spring-boot-starter + ${lock4j.version} + + + + + com.xuxueli + xxl-job-core + ${xxl-job.version} + + + + com.alibaba + transmittable-thread-local + ${alibaba-ttl.version} + + + + + org.yaml + snakeyaml + ${snakeyaml.version} + + + + + org.bouncycastle + bcprov-jdk15to18 + ${bouncycastle.version} + + + + io.github.linpeilie + mapstruct-plus-spring-boot-starter + ${mapstruct-plus.version} + + + + + org.lionsoul + ip2region + ${ip2region.version} + + + + org.ruoyi + aibidding-system + ${revision} + + + + + org.ruoyi + aibidding-fusion + ${revision} + + + + + org.ruoyi + aibidding-knowledge + ${revision} + + + + org.ruoyi + aibidding-generator + ${revision} + + + + org.ruoyi + aibidding-demo + ${revision} + + + + + + + aibidding-admin + aibidding-common + aibidding-modules + + pom + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.verison} + + ${java.version} + ${java.version} + ${project.build.sourceEncoding} + + + com.github.therapi + therapi-runtime-javadoc-scribe + ${therapi-javadoc.version} + + + org.projectlombok + lombok + ${lombok.version} + + + org.springframework.boot + spring-boot-configuration-processor + ${spring-boot.version} + + + io.github.linpeilie + mapstruct-plus-processor + ${mapstruct-plus.version} + + + org.projectlombok + lombok-mapstruct-binding + ${mapstruct-plus.lombok.version} + + + + -parameters + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + ${profiles.active} + + exclude + + + + + org.codehaus.mojo + flatten-maven-plugin + ${flatten-maven-plugin.version} + + true + resolveCiFriendliesOnly + + + + flatten + process-resources + + flatten + + + + flatten.clean + clean + + clean + + + + + + + + src/main/resources + + false + + + src/main/resources + + + application* + bootstrap* + banner* + + + true + + + + + + + public + aliyun nexus + https://maven.aliyun.com/repository/public/ + + true + + + + + + + public + aliyun nexus + https://maven.aliyun.com/repository/public/ + + true + + + false + + + + + + + diff --git a/script/docker/database.yml b/script/docker/database.yml new file mode 100644 index 0000000..096a849 --- /dev/null +++ b/script/docker/database.yml @@ -0,0 +1,61 @@ +version: '3' + +services: + # 此镜像仅用于测试 正式环境需自行安装数据库 + # SID: XE user: system password: oracle + oracle: + image: tekintian/oracle12c:latest + container_name: oracle + environment: + # 时区上海 + TZ: Asia/Shanghai + DBCA_TOTAL_MEMORY: 16192 + ports: + - "18080:8080" + - "1521:1521" + volumes: + # 数据挂载 + - "/docker/oracle/data:/u01/app/oracle" + network_mode: "host" + + # 此镜像仅用于测试 正式环境需自行安装数据库 + sqlserver: + image: mcr.microsoft.com/mssql/server:2017-latest + container_name: sqlserver + environment: + # 时区上海 + TZ: Asia/Shanghai + ACCEPT_EULA: "Y" + SA_PASSWORD: "aibidding@123" + ports: + - "1433:1433" + volumes: + # 数据挂载 + - "/docker/sqlserver/data:/var/opt/mssql" + network_mode: "host" + + postgres: + image: postgres:14.2 + container_name: postgres + environment: + POSTGRES_USER: root + POSTGRES_PASSWORD: root + POSTGRES_DB: postgres + ports: + - "5432:5432" + volumes: + - /docker/postgres/data:/var/lib/postgresql/data + network_mode: "host" + + postgres13: + image: postgres:13.6 + container_name: postgres13 + environment: + POSTGRES_USER: root + POSTGRES_PASSWORD: root + POSTGRES_DB: postgres + ports: + - "5433:5432" + volumes: + - /docker/postgres13/data:/var/lib/postgresql/data + network_mode: "host" diff --git a/script/docker/docker-compose.yml b/script/docker/docker-compose.yml new file mode 100644 index 0000000..d0af7b8 --- /dev/null +++ b/script/docker/docker-compose.yml @@ -0,0 +1,64 @@ +version: '3' + +services: + mysql: + image: mysql:8.0.33 + container_name: mysql + environment: + TZ: Asia/Shanghai + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: ry-vue + ports: + - "3307:3306" + volumes: + - ./ry-vue.sql:/docker-entrypoint-initdb.d/ry-vue.sql + command: + --default-authentication-plugin=mysql_native_password + --character-set-server=utf8mb4 + --collation-server=utf8mb4_general_ci + --explicit_defaults_for_timestamp=true + --lower_case_table_names=1 + + ruoyi-server: + image: registry.cn-shanghai.aliyuncs.com/ruoyi-ai/ai:1.2.1 + ports: + - "6039:6039" + container_name: aibidding-server + environment: + TZ: Asia/Shanghai + # 运行端口号 + SERVER_PORT: 6039 + # 数据库连接地址 + DB_URL: jdbc:mysql://mysql:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true + # 数据库用户名 + DB_USERNAME: root + # 数据库用户密码 + DB_PASSWORD: root + # Redis地址 + REDIS_HOST: redis + # Redis端口 + REDIS_PORT: 6379 + # 数据库索引 + REDIS_DATABASE: 0 + # Redis密码 + REDIS_PASSWORD: + # 连接超时时间 + REDIS_TIMEOUT: 10s + volumes: + - /docker/server2/logs/:/aibidding/server/logs/ + + ruoyi-web: + image: registry.cn-shanghai.aliyuncs.com/ruoyi-ai/web:1.2.1 + ports: + - "8081:8081" + container_name: aibidding-web + + + ruoyi-admin: + image: registry.cn-shanghai.aliyuncs.com/ruoyi-ai/admin:1.2.1 + ports: + - "8082:8082" + container_name: aibidding-admin + + + diff --git a/script/docker/localModels/Dockerfile b/script/docker/localModels/Dockerfile new file mode 100644 index 0000000..0f1e606 --- /dev/null +++ b/script/docker/localModels/Dockerfile @@ -0,0 +1,26 @@ +# 使用 Python 3.8 slim 作为基础镜像(轻量稳定) +FROM python:3.10 + +# 设置工作目录 +WORKDIR /app + +# 复制所有文件到容器 +COPY . /app + +# 更新 pip 并安装 wheel(避免依赖问题) +RUN pip install --upgrade pip wheel + +# 使用阿里云 PyPI 镜像安装依赖,并添加 trusted-host +RUN pip install -i https://mirrors.aliyun.com/pypi/simple \ + --trusted-host mirrors.aliyun.com \ + --no-cache-dir -r requirements.txt + +# 暴露 Flask 端口 +EXPOSE 5000 + +# 设置环境变量 +ENV FLASK_APP=app.py +ENV FLASK_RUN_HOST=0.0.0.0 + +# 运行 Flask +CMD ["flask", "run", "--host=0.0.0.0"] diff --git a/script/docker/localModels/app.py b/script/docker/localModels/app.py new file mode 100644 index 0000000..645a9b4 --- /dev/null +++ b/script/docker/localModels/app.py @@ -0,0 +1,116 @@ +from flask import Flask, request, jsonify +from sentence_transformers import SentenceTransformer +from sklearn.metrics.pairwise import cosine_similarity +import json + +app = Flask(__name__) + +# 创建一个全局的模型缓存字典 +model_cache = {} + +# 分割文本块 +def split_text(text, block_size, overlap_chars, delimiter): + chunks = text.split(delimiter) + text_blocks = [] + current_block = "" + + for chunk in chunks: + if len(current_block) + len(chunk) + 1 <= block_size: + if current_block: + current_block += " " + chunk + else: + current_block = chunk + else: + text_blocks.append(current_block) + current_block = chunk + if current_block: + text_blocks.append(current_block) + + overlap_blocks = [] + for i in range(len(text_blocks)): + if i > 0: + overlap_block = text_blocks[i - 1][-overlap_chars:] + text_blocks[i] + overlap_blocks.append(overlap_block) + overlap_blocks.append(text_blocks[i]) + + return overlap_blocks + +# 文本向量化 +def vectorize_text_blocks(text_blocks, model): + return model.encode(text_blocks) + +# 文本检索 +def retrieve_top_k(query, knowledge_base, k, block_size, overlap_chars, delimiter, model): + # 将知识库拆分为文本块 + text_blocks = split_text(knowledge_base, block_size, overlap_chars, delimiter) + # 向量化文本块 + knowledge_vectors = vectorize_text_blocks(text_blocks, model) + # 向量化查询文本 + query_vector = model.encode([query]).reshape(1, -1) + # 计算相似度 + similarities = cosine_similarity(query_vector, knowledge_vectors) + # 获取相似度最高的 k 个文本块的索引 + top_k_indices = similarities[0].argsort()[-k:][::-1] + + # 返回文本块和它们的向量 + top_k_texts = [text_blocks[i] for i in top_k_indices] + top_k_embeddings = [knowledge_vectors[i] for i in top_k_indices] + + return top_k_texts, top_k_embeddings + +@app.route('/vectorize', methods=['POST']) +def vectorize_text(): + # 从请求中获取 JSON 数据 + data = request.json + print(f"Received request data: {data}") # 调试输出请求数据 + + text_list = data.get("text", []) + model_name = data.get("model_name", "msmarco-distilbert-base-tas-b") # 默认模型 + + delimiter = data.get("delimiter", "\n") # 默认分隔符 + k = int(data.get("k", 3)) # 默认检索条数 + block_size = int(data.get("block_size", 500)) # 默认文本块大小 + overlap_chars = int(data.get("overlap_chars", 50)) # 默认重叠字符数 + + if not text_list: + return jsonify({"error": "Text is required."}), 400 + + # 检查模型是否已经加载 + if model_name not in model_cache: + try: + model = SentenceTransformer(model_name) + model_cache[model_name] = model # 缓存模型 + except Exception as e: + return jsonify({"error": f"Failed to load model: {e}"}), 500 + + model = model_cache[model_name] + + top_k_texts_all = [] + top_k_embeddings_all = [] + + # 如果只有一个查询文本 + if len(text_list) == 1: + top_k_texts, top_k_embeddings = retrieve_top_k(text_list[0], text_list[0], k, block_size, overlap_chars, delimiter, model) + top_k_texts_all.append(top_k_texts) + top_k_embeddings_all.append(top_k_embeddings) + elif len(text_list) > 1: + # 如果多个查询文本,依次处理 + for query in text_list: + top_k_texts, top_k_embeddings = retrieve_top_k(query, text_list[0], k, block_size, overlap_chars, delimiter, model) + top_k_texts_all.append(top_k_texts) + top_k_embeddings_all.append(top_k_embeddings) + + # 将嵌入向量(ndarray)转换为可序列化的列表 + top_k_embeddings_all = [[embedding.tolist() for embedding in embeddings] for embeddings in top_k_embeddings_all] + + print(f"Top K texts: {top_k_texts_all}") # 打印检索到的文本 + print(f"Top K embeddings: {top_k_embeddings_all}") # 打印检索到的向量 + + # 返回 JSON 格式的数据 + return jsonify({ + + "topKEmbeddings": top_k_embeddings_all # 返回嵌入向量 + }) + +if __name__ == '__main__': + app.run(host="0.0.0.0", port=5000, debug=True) diff --git a/script/docker/localModels/remade.md b/script/docker/localModels/remade.md new file mode 100644 index 0000000..d6af3d2 --- /dev/null +++ b/script/docker/localModels/remade.md @@ -0,0 +1,4 @@ +1.下载镜像 +docker pull registry.cn-hangzhou.aliyuncs.com/hejh-docker/localmodel:0.1.1 +2. 启动 +docker run -p 5000:5000 \ No newline at end of file diff --git a/script/docker/localModels/requirements.txt b/script/docker/localModels/requirements.txt new file mode 100644 index 0000000..2d62483 --- /dev/null +++ b/script/docker/localModels/requirements.txt @@ -0,0 +1,5 @@ +Flask==3.1.0 +sentence-transformers==3.4.1 +scikit-learn==1.6.1 +werkzeug>=3.1 + diff --git a/script/docker/milvus/docker-compose.yml b/script/docker/milvus/docker-compose.yml new file mode 100644 index 0000000..37506be --- /dev/null +++ b/script/docker/milvus/docker-compose.yml @@ -0,0 +1,63 @@ +version: '3.5' + +services: + etcd: + container_name: milvus-etcd + image: quay.io/coreos/etcd:v3.5.5 + environment: + - ETCD_AUTO_COMPACTION_MODE=revision + - ETCD_AUTO_COMPACTION_RETENTION=1000 + - ETCD_QUOTA_BACKEND_BYTES=4294967296 + - ETCD_SNAPSHOT_COUNT=50000 + volumes: + - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/etcd:/etcd + command: etcd -advertise-client-urls=http://127.0.0.1:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd + healthcheck: + test: ["CMD", "etcdctl", "endpoint", "health"] + interval: 30s + timeout: 20s + retries: 3 + + minio: + container_name: milvus-minio + image: minio/minio:RELEASE.2023-03-20T20-16-18Z + environment: + MINIO_ACCESS_KEY: minioadmin + MINIO_SECRET_KEY: minioadmin + ports: + - "9001:9001" + - "9000:9000" + volumes: + - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/minio:/minio_data + command: minio server /minio_data --console-address ":9001" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] + interval: 30s + timeout: 20s + retries: 3 + + standalone: + container_name: milvus-standalone + image: milvusdb/milvus:v2.3.1 + command: ["milvus", "run", "standalone"] + environment: + ETCD_ENDPOINTS: etcd:2379 + MINIO_ADDRESS: minio:9000 + volumes: + - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/milvus:/var/lib/milvus + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"] + interval: 30s + start_period: 90s + timeout: 20s + retries: 3 + ports: + - "19530:19530" + - "9091:9091" + depends_on: + - "etcd" + - "minio" + +networks: + default: + name: milvus diff --git a/script/docker/nginx/conf/nginx.conf b/script/docker/nginx/conf/nginx.conf new file mode 100644 index 0000000..e9630aa --- /dev/null +++ b/script/docker/nginx/conf/nginx.conf @@ -0,0 +1,111 @@ +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + # 限制body大小 + client_max_body_size 100m; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + upstream server { + ip_hash; + server 127.0.0.1:8080; + server 127.0.0.1:8081; + } + + upstream monitor-admin { + server 127.0.0.1:9090; + } + + upstream xxljob-admin { + server 127.0.0.1:9100; + } + + server { + listen 80; + server_name localhost; + + # https配置参考 start + #listen 443 ssl; + + # 证书直接存放 /docker/nginx/cert/ 目录下即可 更改证书名称即可 无需更改证书路径 + #ssl on; + #ssl_certificate /etc/nginx/cert/xxx.local.crt; # /etc/nginx/cert/ 为docker映射路径 不允许更改 + #ssl_certificate_key /etc/nginx/cert/xxx.local.key; # /etc/nginx/cert/ 为docker映射路径 不允许更改 + #ssl_session_timeout 5m; + #ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; + #ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + #ssl_prefer_server_ciphers on; + # https配置参考 end + + # 演示环境配置 拦截除 GET POST 之外的所有请求 + # if ($request_method !~* GET|POST) { + # rewrite ^/(.*)$ /403; + # } + + # location = /403 { + # default_type application/json; + # return 200 '{"msg":"演示模式,不允许操作","code":500}'; + # } + + # 限制外网访问内网 actuator 相关路径 + location ~ ^(/[^/]*)?/actuator(/.*)?$ { + return 403; + } + + location / { + root /usr/share/nginx/html; + try_files $uri $uri/ /index.html; + index index.html index.htm; + } + + location /prod-api/ { + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header REMOTE-HOST $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://server/; + } + + # https 会拦截内链所有的 http 请求 造成功能无法使用 + # 解决方案1 将 admin 服务 也配置成 https + # 解决方案2 将菜单配置为外链访问 走独立页面 http 访问 + location /admin/ { + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header REMOTE-HOST $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://monitor-admin/admin/; + } + + # https 会拦截内链所有的 http 请求 造成功能无法使用 + # 解决方案1 将 xxljob 服务 也配置成 https + # 解决方案2 将菜单配置为外链访问 走独立页面 http 访问 + location /xxl-job-admin/ { + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header REMOTE-HOST $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://xxljob-admin/xxl-job-admin/; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + } +} diff --git a/script/docker/redis/conf/redis.conf b/script/docker/redis/conf/redis.conf new file mode 100644 index 0000000..72255c6 --- /dev/null +++ b/script/docker/redis/conf/redis.conf @@ -0,0 +1,28 @@ +# redis 密码 +requirepass ruoyi123 + +# key 监听器配置 +# notify-keyspace-events Ex + +# 配置持久化文件存储路径 +dir /redis/data +# 配置rdb +# 15分钟内有至少1个key被更改则进行快照 +save 900 1 +# 5分钟内有至少10个key被更改则进行快照 +save 300 10 +# 1分钟内有至少10000个key被更改则进行快照 +save 60 10000 +# 开启压缩 +rdbcompression yes +# rdb文件名 用默认的即可 +dbfilename dump.rdb + +# 开启aof +appendonly yes +# 文件名 +appendfilename "appendonly.aof" +# 持久化策略,no:不同步,everysec:每秒一次,always:总是同步,速度比较慢 +# appendfsync always +appendfsync everysec +# appendfsync no diff --git a/script/docker/redis/data/README.md b/script/docker/redis/data/README.md new file mode 100644 index 0000000..fbc5474 --- /dev/null +++ b/script/docker/redis/data/README.md @@ -0,0 +1 @@ +数据目录 请执行 `chmod 777 /docker/redis/data` 赋予读写权限 否则将无法写入数据 \ No newline at end of file diff --git a/script/docker/weaviate/docker-compose.yml b/script/docker/weaviate/docker-compose.yml new file mode 100644 index 0000000..b43bd5d --- /dev/null +++ b/script/docker/weaviate/docker-compose.yml @@ -0,0 +1,28 @@ +--- +version: '3.4' +services: + weaviate: + command: + - --host + - 0.0.0.0 + - --port + - '6038' + - --scheme + - http + image: cr.weaviate.io/semitechnologies/weaviate:1.19.7 + ports: + - 6038:6038 + - 50051:50051 + volumes: + - weaviate_data:/var/lib/weaviate + restart: on-failure:0 + environment: + QUERY_DEFAULTS_LIMIT: 25 + AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true' + PERSISTENCE_DATA_PATH: '/var/lib/weaviate' + DEFAULT_VECTORIZER_MODULE: 'none' + ENABLE_MODULES: 'text2vec-cohere,text2vec-huggingface,text2vec-palm,text2vec-openai,generative-openai,generative-cohere,generative-palm,ref2vec-centroid,reranker-cohere,qna-openai' + CLUSTER_HOSTNAME: 'node1' +volumes: + weaviate_data: +... diff --git a/script/sql/ruoyi-ai.sql b/script/sql/ruoyi-ai.sql new file mode 100644 index 0000000..755a78a --- /dev/null +++ b/script/sql/ruoyi-ai.sql @@ -0,0 +1,2772 @@ +/* + Navicat Premium Dump SQL + + Source Server : aibidding-ai + Source Server Type : MySQL + Source Server Version : 50740 (5.7.40-log) + Source Host : 43.139.70.230:3306 + Source Schema : aibidding-ai + + Target Server Type : MySQL + Target Server Version : 50740 (5.7.40-log) + File Encoding : 65001 + + Date: 18/03/2025 13:58:52 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for chat_app_store +-- ---------------------------- +DROP TABLE IF EXISTS `chat_app_store`; +CREATE TABLE `chat_app_store` ( + `id` bigint(20) NOT NULL COMMENT 'id', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', + `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '描述', + `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'logo', + `app_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址', + `create_dept` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '应用商店' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of chat_app_store +-- ---------------------------- +INSERT INTO `chat_app_store` VALUES (1, '知识库', '创建属于自己的本地知识库', 'http://panda-1253683406.cos.ap-guangzhou.myqcloud.com/panda/2025/02/11/9178bd7126b0478b9713e18844de58d4.png', '/knowledge', '', NULL, NULL, NULL, NULL, NULL); +INSERT INTO `chat_app_store` VALUES (2, '绘画', '开启创意绘画之旅', 'http://panda-1253683406.cos.ap-guangzhou.myqcloud.com/panda/2025/02/11/e8b4ff15af6945d09accb59f5dd6279b.png', '/draw', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `chat_app_store` VALUES (3, '翻译', '提供精准高效的语言翻译服务', 'http://panda-1253683406.cos.ap-guangzhou.myqcloud.com/panda/2025/02/11/3b5e87263c004ba389d6af8d43552770.png', '/fanyi', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `chat_app_store` VALUES (4, '音乐创作', '激发音乐创作潜能', 'http://panda-1253683406.cos.ap-guangzhou.myqcloud.com/panda/2025/02/11/a761c32e823945d29daeaeaf45a6dfe9.png', '/music', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `chat_app_store` VALUES (5, '智能PPT', '一键生成专业 PPT', 'http://panda-1253683406.cos.ap-guangzhou.myqcloud.com/panda/2025/02/11/8de63c7a2d5e4c22bc8121a3c9e0fec1.png', '/ppt', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `chat_app_store` VALUES (6, '文生视频', '将文字内容转化为生动视频', 'http://panda-1253683406.cos.ap-guangzhou.myqcloud.com/panda/2025/02/11/15d878c58db248afa886032efb292467.png', '/video', NULL, NULL, NULL, NULL, NULL, NULL); + +-- ---------------------------- +-- Table structure for chat_config +-- ---------------------------- +DROP TABLE IF EXISTS `chat_config`; +CREATE TABLE `chat_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置类型', + `config_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置名称', + `config_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置值', + `config_dict` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '说明', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + `version` int(11) NULL DEFAULT NULL COMMENT '版本', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 1代表删除)', + `update_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新IP', + `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户Id', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `unique_category_key`(`category`, `config_name`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1897610056458412058 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '配置信息表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of chat_config +-- ---------------------------- +INSERT INTO `chat_config` VALUES (1779450794448789505, 'chat', 'apiKey', 'sk-xx', 'API 密钥', 103, '2024-04-14 18:05:05', '1', '1', '2024-04-23 23:56:54', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779450794448799507, 'cover', 'token', 'xx', '绘声美音token', 103, '2024-04-14 18:05:05', '1', '1', '2024-04-23 23:56:54', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779450794448799508, 'cover', 'cover_url', 'https://wechatscan.com/a/open/karaoke/cover', '翻唱地址', 103, '2024-04-14 18:05:05', '1', '1', '2024-04-23 23:56:54', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779450794448799509, 'cover', 'search_music_url', 'https://wechatscan.com/a/open/karaoke/search', '查找歌曲', 103, '2024-04-14 18:05:05', '1', '1', '2024-04-23 23:56:54', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779450794448799601, 'ppt', 'apiKey', 'xx', '文多多apikey', 103, '2024-04-14 18:05:05', '1', '1', '2024-04-23 23:56:54', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779450794872414210, 'chat', 'apiHost', 'https://api.pandarobot.chat/', 'API 地址', 103, '2024-04-14 18:05:05', '1', '1', '2024-04-23 23:56:54', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779497340548784129, 'pay', 'pid', '1000', '商户PID', 103, '2024-04-14 21:10:02', '1', '1', '2024-04-28 17:46:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779497340938854401, 'pay', 'key', 'xx', '商户密钥', 103, '2024-04-14 21:10:02', '1', '1', '2024-04-28 17:46:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779497341135986690, 'pay', 'payUrl', 'https://pay.pandarobot.chat/mapi.php', '支付地址', 103, '2024-04-14 21:10:02', '1', '1', '2024-04-28 17:46:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779497341400227842, 'pay', 'notify_url', 'https://www.pandarobot.chat/pay/notifyUrl', '回调地址', 103, '2024-04-14 21:10:02', '1', '1', '2024-04-28 17:46:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779497341588971522, 'pay', 'return_url', 'https://www.pandarobot.chat/pay/returnUrl', '跳转通知', 103, '2024-04-14 21:10:02', '1', '1', '2024-04-28 17:46:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779513580331835394, 'mail', 'host', 'smtp.163.com', '主机地址', 103, '2024-04-14 22:14:34', '1', '1', '2024-07-17 17:28:51', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779513580658991106, 'mail', 'port', '465', '主机端口', 103, '2024-04-14 22:14:34', '1', '1', '2024-07-17 17:28:51', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779513580919037953, 'mail', 'from', 'ageerle@163.com', '发送方', 103, '2024-04-14 22:14:34', '1', '1', '2024-07-17 17:28:51', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779513581107781634, 'mail', 'user', 'ageerle@163.com', '用户名', 103, '2024-04-14 22:14:34', '1', '1', '2024-07-17 17:28:52', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779513581309108225, 'mail', 'pass', 'xx', '邮箱授权码', 103, '2024-04-14 22:14:34', '1', '1', '2024-07-17 17:28:52', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779726450625687553, 'mj', 'apiKey', 'sk-xx', 'API 密钥', 103, '2024-04-15 12:20:26', '1', '1', '2024-04-23 23:56:58', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1779726451036729346, 'mj', 'apiHost', 'https://api.pandarobot.chat/', 'API 地址', 103, '2024-04-15 12:20:26', '1', '1', '2024-04-23 23:56:59', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1782331509679181825, 'mj', 'imagine', '0.3', '文生图', 103, '2024-04-22 16:52:01', '1', '1', '2024-04-23 23:56:59', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1782331509939228674, 'mj', 'blend', '0.3', '图生图', 103, '2024-04-22 16:52:01', '1', '1', '2024-04-23 23:56:59', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1782331510199275522, 'mj', 'describe', '0.1', '图生文', 103, '2024-04-22 16:52:01', '1', '1', '2024-04-23 23:56:59', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1782331510392213505, 'mj', 'change', '0.3', '变化价格', 103, '2024-04-22 16:52:01', '1', '1', '2024-04-23 23:56:59', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1782331510652260353, 'mj', 'upsample', '0.1', '放大价格', 103, '2024-04-22 16:52:01', '1', '1', '2024-04-23 23:56:59', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1782331510845198338, 'mj', 'inpaint', '0.3', '局部重绘', 103, '2024-04-22 16:52:01', '1', '1', '2024-04-23 23:56:59', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1782331511117828098, 'mj', 'faceSwapping', '0.3', '换脸价格', 103, '2024-04-22 16:52:01', '1', '1', '2024-04-23 23:56:59', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1782331511306571778, 'mj', 'shorten', '0.1', '提示词分析', 103, '2024-04-22 16:52:01', '1', '1', '2024-04-23 23:56:59', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1782766864937119746, 'mail', 'amount', '1', '用户注册额度', 103, '2024-04-23 21:41:57', '1', '1', '2024-07-17 17:28:52', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1784166479104135169, 'audio', 'apiKey', 'sk-xx', 'API 密钥', 103, '2024-04-27 18:23:31', '1', '1', '2024-04-27 18:24:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1784166479615840258, 'audio', 'apiHost', 'https://v1.reecho.cn/', 'API 地址', 103, '2024-04-27 18:23:32', '1', '1', '2024-04-27 18:24:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1786058372188569602, 'review', 'enabled', 'false', '文本审核', 103, '2024-05-02 23:41:14', '1', '1', '2024-05-03 01:18:50', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1786058372637360129, 'review', 'apiKey', 'xx', 'apiKey', 103, '2024-05-02 23:41:14', '1', '1', '2024-05-03 01:18:50', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1786058372897406977, 'review', 'secretKey', 'xx', 'secretKey', 103, '2024-05-02 23:41:14', '1', '1', '2024-05-03 01:18:50', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1792069350789324801, 'weixin', 'appId', 'xx', '应用ID', 103, '2024-05-19 13:46:43', '1', '1', '2024-05-19 22:34:39', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1792069351246503938, 'weixin', 'appSecret', 'xx', '应用密钥', 103, '2024-05-19 13:46:43', '1', '1', '2024-05-19 22:34:39', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1792069351246503939, 'weixin', 'mchId', '1677338089', '商户ID', 103, '2024-05-19 13:46:43', '1', '1', '2024-05-19 22:34:39', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1792183360796790785, 'weixin', 'notifyUrl', 'https://mp.pandarobot.chat/pay/notify/wxOrder', '回调地址', 103, '2024-05-19 21:19:45', '1', '1', '2024-05-19 22:34:40', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1792183361065226241, 'weixin', 'enabled', 'true', '开启支付', 103, '2024-05-19 21:19:45', '1', '1', '2024-05-19 22:34:40', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1792207511704100866, 'sys', 'name', '熊猫助手', '网站名称', 103, '2024-05-19 22:55:43', '1', '1', '2024-08-11 12:03:04', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1792207512089976834, 'sys', 'logoImage', 'http://panda-1253683406.cos.ap-guangzhou.myqcloud.com/panda/2024/05/19/4c106628754b4bd882a4c002eaa317f5.jpg', '网站logo', 103, '2024-05-19 22:55:43', '1', '1', '2024-08-11 12:03:04', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1792207512412938241, 'sys', 'copyright', 'Copyright © ageerle 2025 ', '版权信息', 103, '2024-05-19 22:55:43', '1', '1', '2024-08-11 12:03:04', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1792207512740093954, 'sys', 'customImage', 'http://panda-1253683406.cos.ap-guangzhou.myqcloud.com/panda/2024/05/19/2faba7a5fa174d7c8d573ce3f031ec51.jpg', '客服二维码', 103, '2024-05-19 22:55:43', '1', '1', '2024-08-11 12:03:04', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1792207512740093955, 'sys', 'activate', 'true', '系统激活状态', 103, '2024-05-19 22:55:43', '1', '1', '2024-06-04 04:26:14', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1795022320576143362, 'sys', 'authcode', '1716475338010', '证书编号', 103, '2024-05-27 17:20:46', NULL, NULL, '2024-05-27 17:20:46', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1795022320576143363, 'stripe', 'success', 'http://xx:6039/success', '成功回调', 103, '2024-05-27 17:20:46', NULL, '1', '2024-08-11 12:02:41', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1795022320576143364, 'stripe', 'cancel', 'http://xx:6039/cancel', '取消回调', 103, '2024-05-27 17:20:46', NULL, '1', '2024-08-11 12:02:41', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1795022320576143365, 'stripe', 'key', 'xx0005', '支付密钥', 103, '2024-05-27 17:20:46', NULL, '1', '2024-08-11 12:02:42', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1795022320576143366, 'stripe', 'secret', 'xx0005', '回调密钥', 103, '2024-05-27 17:20:46', NULL, '1', '2024-08-11 12:02:42', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1811317731650797570, 'mail', 'free', '3', '免费对话次数', 103, '2024-07-11 16:32:55', '1', '1', '2024-07-17 17:28:52', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1811317732300914689, 'mail', 'mailModel', '

您此次的验证码为:{code},有效期为30分钟,请尽快填写!


', '邮箱模板', 103, '2024-07-11 16:32:55', '1', '1', '2024-07-17 17:28:52', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1813506141979254785, 'mail', 'mailTitle', '【熊猫助手】验证码', '邮箱标题', 103, '2024-07-17 17:28:52', '1', '1', '2024-07-17 17:28:52', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1818270017648070657, 'stripe', 'prompt', 'This system is for demonstration only and does not currently support this feature!', '提示语', 103, '2024-07-30 20:58:49', '1', '1', '2024-08-11 12:02:42', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1818270017966837761, 'stripe', 'enabled', 'true', '开启支付', 103, '2024-07-30 20:58:49', '1', '1', '2024-08-11 12:02:42', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1897610056458412050, 'weaviate', 'protocol', 'http', '协议', 103, '2025-03-06 21:10:02', '1', '1', '2025-03-06 21:10:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1897610056458412051, 'weaviate', 'host', '127.0.0.1:6038', '地址', 103, '2025-03-06 21:10:02', '1', '1', '2025-03-06 21:10:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1897610056458412052, 'weaviate', 'classname', 'LocalKnowledge', '分类名称', 103, '2025-03-06 21:10:02', '1', '1', '2025-03-06 21:10:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1897610056458412053, 'milvus', 'host', '127.0.0.1', '地址', 103, '2025-03-06 21:10:02', '1', '1', '2025-03-06 21:10:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1897610056458412054, 'milvus', 'port', '19530', '端口', 103, '2025-03-06 21:10:02', '1', '1', '2025-03-06 21:10:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1897610056458412055, 'milvus', 'dimension', '1536', '维度', 103, '2025-03-06 21:10:02', '1', '1', '2025-03-06 21:10:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1897610056458412056, 'milvus', 'collection', 'LocalKnowledge', '分类名称', 103, '2025-03-06 21:10:02', '1', '1', '2025-03-06 21:10:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` VALUES (1897610056458412057, 'zhipu', 'key', '', '智谱清言key', 103, '2025-03-12 00:13:12', '1', '1', '2025-03-12 00:13:10', NULL, NULL, '0', NULL, 0); + +-- ---------------------------- +-- Table structure for chat_gpts +-- ---------------------------- +DROP TABLE IF EXISTS `chat_gpts`; +CREATE TABLE `chat_gpts` ( + `id` bigint(20) NOT NULL COMMENT 'id', + `gid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'gpts应用id', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'gpts应用名称', + `logo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'gpts图标', + `info` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'gpts描述', + `author_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '作者id', + `author_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '作者名称', + `use_cnt` int(11) NULL DEFAULT 0 COMMENT '点赞', + `bad` int(11) NULL DEFAULT 0 COMMENT '差评', + `type` char(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类型', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + `version` int(11) NULL DEFAULT NULL COMMENT '版本', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 1代表删除)', + `update_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新IP', + `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户Id', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '应用管理' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of chat_gpts +-- ---------------------------- +INSERT INTO `chat_gpts` VALUES (1810602934286237698, 'gpt-4-gizmo-g-RQAWjtI6u', '翻译助手', 'https://external-content.duckduckgo.com/ip3/chat.openai.com.ico', '中英和英中翻译专家', NULL, NULL, 0, 0, NULL, 103, '2024-07-09 17:12:34', '1', '1', '2024-07-12 15:40:13', 'Ms. Smith, the AI-powered Language Teacher, is a revolutionary GPT-based bot that offers personalized language learning experiences in over 20 languages, including Spanish, German, French, English, Chinese, Korean, Japanese, and more\n', NULL, '0', NULL, 0); +INSERT INTO `chat_gpts` VALUES (1811668415990931458, 'gpt-4-gizmo-g-XbReEL4Uq', '清北全科医生', 'https://external-content.duckduckgo.com/ip3/chat.openai.com.ico', '富有同情心的全科医生提供健康指导', NULL, NULL, 0, 0, NULL, 103, '2024-07-12 15:46:24', '1', '1', '2024-07-12 15:46:24', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_gpts` VALUES (1811670922074988545, 'gpt-4-gizmo-g-AphhNRLxt', '提示词优化', 'https://external-content.duckduckgo.com/ip3/chat.openai.com.ico', '擅长为Prompt 提升清晰度和创造力的大师', NULL, NULL, 0, 0, NULL, 103, '2024-07-12 15:56:22', '1', '1', '2024-07-12 15:56:22', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_gpts` VALUES (1811815442062188545, 'gpt-4-gizmo-g-ThuHxKi7e', '小红书文案生成器', 'https://external-content.duckduckgo.com/ip3/chat.openai.com.ico', '小红书文案生成器', NULL, NULL, 0, 0, NULL, 103, '2024-07-13 01:30:38', '1', '1', '2024-07-13 01:30:38', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_gpts` VALUES (1811817605668741121, 'gpt-4-gizmo-g-AsQCd3k8', '中国法律助手', 'https://external-content.duckduckgo.com/ip3/chat.openai.com.ico', '全面掌握中国法律的智能助手,可帮助起草文书,分析案件,进行法律咨询', NULL, NULL, 0, 0, NULL, 103, '2024-07-13 01:39:14', '1', '1', '2024-07-13 01:39:14', NULL, NULL, '2', NULL, 0); +INSERT INTO `chat_gpts` VALUES (1811817605668741122, 'gpt-4-gizmo-g-IXwub6dJu', '英语老师', 'https://external-content.duckduckgo.com/ip3/chat.openai.com.ico', '英语学习GPT是一个专门设计来帮助用户提高他们的英语技能的人工智能助手', NULL, NULL, 0, 0, NULL, NULL, NULL, '', '', NULL, NULL, NULL, '0', NULL, 0); + +-- ---------------------------- +-- Table structure for chat_message +-- ---------------------------- +DROP TABLE IF EXISTS `chat_message`; +CREATE TABLE `chat_message` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `user_id` bigint(20) NOT NULL COMMENT '用户id', + `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '消息内容', + `deduct_cost` double(20, 2) NULL DEFAULT 0.00 COMMENT '扣除金额\r\n\r\n', + `total_tokens` int(20) NULL DEFAULT 0 COMMENT '累计 Tokens', + `model_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型名称', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '聊天消息表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of chat_message +-- ---------------------------- + +-- ---------------------------- +-- Table structure for chat_model +-- ---------------------------- +DROP TABLE IF EXISTS `chat_model`; +CREATE TABLE `chat_model` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `model_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型名称', + `model_describe` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型描述', + `model_price` double NULL DEFAULT NULL COMMENT '模型价格', + `model_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '计费类型', + `model_show` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否显示', + `system_prompt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '系统提示词', + `api_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '请求地址', + `api_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密钥', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '聊天模型' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of chat_model +-- ---------------------------- +INSERT INTO `chat_model` VALUES (1781709495515783171, 'gpt-4-all', 'gpt-4-all', 0.2, '1', '1', NULL, 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2024-04-20 23:40:41', 1, '2025-03-15 16:46:11', 'gpt-all'); +INSERT INTO `chat_model` VALUES (1781715781896646657, 'suno-v3', 'suno-v3', 0.3, '2', '1', NULL, 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2024-04-21 00:05:20', 1, '2025-03-12 15:06:39', 'suno-v3'); +INSERT INTO `chat_model` VALUES (1781728235120791553, 'stable-diffusion', 'stable-diffusion', 0.1, '2', '1', NULL, 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2024-04-21 00:54:49', 1, '2025-03-04 22:09:12', 'stable-diffusion'); +INSERT INTO `chat_model` VALUES (1782736322308943873, 'dall-e-3', 'dall3', 0.3, '2', '1', '', 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2024-04-23 19:40:36', 1, '2025-03-06 09:13:59', 'dall3'); +INSERT INTO `chat_model` VALUES (1782736729471004673, 'gpt-4-gizmo', 'gpt-4-gizmo', 0.2, '2', '1', NULL, 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2024-04-23 19:42:13', 1, '2025-03-06 20:16:42', 'gpt-4-gizmo'); +INSERT INTO `chat_model` VALUES (1782792839548735490, 'midjourney', 'midjourney', 0.5, '2', '1', NULL, 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2024-04-23 23:25:10', 1, '2025-03-06 13:48:34', 'midjourney'); +INSERT INTO `chat_model` VALUES (1782792839548735491, 'suno', 'suno', 0.3, '2', '1', NULL, 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2024-04-23 23:25:10', 1, '2024-12-27 22:29:15', 'suno'); +INSERT INTO `chat_model` VALUES (1782792839548735492, 'luma', 'luma', 1, '2', '1', NULL, 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2024-04-23 23:25:10', 1, '2024-12-27 22:29:19', 'luma'); +INSERT INTO `chat_model` VALUES (1782792839548735493, 'ppt', 'ppt', 1.1, '2', '1', NULL, 'https://docmee.cn', 'sk-xx', 103, 1, '2025-01-10 23:25:10', 1, '2025-03-05 20:14:10', 'ppt'); +INSERT INTO `chat_model` VALUES (1811030708604317697, 'gemini-1.5-pro', 'gemini-1.5-pro', 0.2, '1', '1', '', 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2024-07-10 21:32:23', 1, '2024-12-27 22:29:24', 'gemini-1.5-pro'); +INSERT INTO `chat_model` VALUES (1813306888443305986, 'claude-3-5-sonnet-20240620', 'claude-3-5-sonnet-20240620', 0.2, '1', '0', NULL, 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2024-07-17 04:17:06', 1, '2025-03-13 12:06:18', 'claude-3-5-sonnet-20240620'); +INSERT INTO `chat_model` VALUES (1814227154275082242, 'o1-mini-2024-09-12', 'o1-mini-2024-09-12', 0.01, '1', '0', NULL, 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2024-07-19 17:13:55', 1, '2024-12-27 22:29:32', 'o1-mini-2024-09-12'); +INSERT INTO `chat_model` VALUES (1828324413241466881, 'deepseek-r3', 'deepseek-r3', 0.01, '1', '0', NULL, '785252', 'sk-xx', 103, 1, '2024-08-27 14:51:23', 1, '2025-03-14 17:08:57', 'chatgpt-4o-latest'); +INSERT INTO `chat_model` VALUES (1859570229117022211, 'gpt-4o-mini', 'gpt-4o-mini', 0.1, '2', '0', '', 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2024-11-21 20:11:06', 1, '2025-03-13 11:39:24', '1'); +INSERT INTO `chat_model` VALUES (1859570229117022212, 'o3-mini-2025-01-31', 'o3-mini-2025-01-31', 0.1, '1', '0', '', 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2024-11-21 20:11:06', 1, '2024-11-21 20:12:30', ''); +INSERT INTO `chat_model` VALUES (1859570229117022213, 'ollama-qwen2.5:7b', 'ollama-qwen2.5:7b', 0.1, '1', '0', '', 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2024-11-21 20:11:06', 1, '2024-11-21 20:12:30', ''); +INSERT INTO `chat_model` VALUES (1897618774806515713, 'mink', 'mink大模型', 0.01, '1', '0', NULL, 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2025-03-06 20:02:27', 1, '2025-03-08 02:28:59', '111'); +INSERT INTO `chat_model` VALUES (1897618774806515714, 'openCmd', 'openCmd', 0.01, '1', '0', '结合上下文只用回复成功或者失败', 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2025-03-06 20:02:27', 1, '2025-03-08 02:28:59', '111'); +INSERT INTO `chat_model` VALUES (1897618774806515715, 'sqlPlugin', 'sqlPlugin', 0.01, '1', '0', NULL, 'https://api.pandarobot.chat/', 'sk-xx', 103, 1, '2025-03-06 20:02:27', 1, '2025-03-08 02:28:59', '111'); +INSERT INTO `chat_model` VALUES (1899652265652015105, 'deepseek-r1:5b', '本地部署', 0.5, '2', '0', NULL, 'http://127.0.0.1:11434/', 'sk-xx', 103, 1, '2025-03-12 10:42:49', 1, '2025-03-15 20:49:36', '测试'); +INSERT INTO `chat_model` VALUES (1899658241792823297, 'siliconflow', '硅基流动', 0.1, '1', '1', NULL, 'https://api.siliconflow.cn', 'sk-xx', 103, 1, '2025-03-12 11:06:33', 1, '2025-03-12 11:13:49', '111'); + +-- ---------------------------- +-- Table structure for chat_package_plan +-- ---------------------------- +DROP TABLE IF EXISTS `chat_package_plan`; +CREATE TABLE `chat_package_plan` ( + `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '套餐名称', + `price` double(10, 2) NOT NULL COMMENT '套餐价格', + `duration` int(11) NOT NULL COMMENT '有效时间', + `plan_detail` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '计划详情', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1819934166912442370 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '套餐管理' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of chat_package_plan +-- ---------------------------- +INSERT INTO `chat_package_plan` VALUES (1787085620534378498, '初级套餐', 4.90, 30, 'o1-mini-2024-09-12', 103, 1, '2024-05-05 19:43:09', 1, '2024-08-27 15:00:35', '3'); +INSERT INTO `chat_package_plan` VALUES (1787085808271425538, '中级套餐', 9.90, 30, 'o1-mini-2024-09-12', 103, 1, '2024-05-05 19:43:54', 1, '2024-08-27 15:01:32', '3'); +INSERT INTO `chat_package_plan` VALUES (1787085903419211778, '高级套餐', 14.90, 30, 'o1-mini-2024-09-12', 103, 1, '2024-05-05 19:44:16', 1, '2024-08-27 15:02:16', '3'); +INSERT INTO `chat_package_plan` VALUES (1819933853652459522, 'Visitor', 0.00, 365, 'o1-mini-2024-09-12', 103, 1, '2024-08-04 11:10:18', 1, '2024-08-27 15:32:01', '1'); +INSERT INTO `chat_package_plan` VALUES (1819934166912442369, 'Free', 0.00, 365, 'o1-mini-2024-09-12', 103, 1, '2024-08-04 11:11:33', 1, '2024-08-27 15:31:51', '2'); + +-- ---------------------------- +-- Table structure for chat_pay_order +-- ---------------------------- +DROP TABLE IF EXISTS `chat_pay_order`; +CREATE TABLE `chat_pay_order` ( + `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `order_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '订单编号', + `order_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '订单名称', + `amount` decimal(10, 2) NOT NULL COMMENT '金额', + `payment_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '支付状态', + `payment_method` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '支付方式', + `user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户ID', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '支付订单表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of chat_pay_order +-- ---------------------------- + +-- ---------------------------- +-- Table structure for chat_rob_config +-- ---------------------------- +DROP TABLE IF EXISTS `chat_rob_config`; +CREATE TABLE `chat_rob_config` ( + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', + `user_id` bigint(20) NULL DEFAULT NULL COMMENT '所属用户', + `bot_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '机器人名称', + `unique_key` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '机器唯一码', + `default_friend` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '\0' COMMENT '默认好友回复开关', + `default_group` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '\0' COMMENT '默认群回复开关', + `enable` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '机器人状态 0正常 1启用', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `udx_wx_rob_config_uniquekey`(`unique_key`) USING BTREE, + UNIQUE INDEX `udx_wx_name`(`bot_name`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '聊天机器人配置' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of chat_rob_config +-- ---------------------------- + +-- ---------------------------- +-- Table structure for chat_usage_token +-- ---------------------------- +DROP TABLE IF EXISTS `chat_usage_token`; +CREATE TABLE `chat_usage_token` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `user_id` bigint(20) NOT NULL COMMENT '用户', + `token` int(10) NULL DEFAULT NULL COMMENT '待结算token', + `model_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型名称', + `total_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '累计使用token', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户token使用详情' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of chat_usage_token +-- ---------------------------- + +-- ---------------------------- +-- Table structure for chat_voucher +-- ---------------------------- +DROP TABLE IF EXISTS `chat_voucher`; +CREATE TABLE `chat_voucher` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '兑换码', + `amount` double(10, 2) NOT NULL COMMENT '兑换金额', + `user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '兑换状态', + `balance_before` double(10, 2) NULL DEFAULT NULL COMMENT '兑换前余额', + `balance_after` double(10, 2) NULL DEFAULT NULL COMMENT '兑换后余额', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户兑换记录' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of chat_voucher +-- ---------------------------- + +-- ---------------------------- +-- Table structure for gen_table +-- ---------------------------- +DROP TABLE IF EXISTS `gen_table`; +CREATE TABLE `gen_table` ( + `table_id` bigint(20) NOT NULL COMMENT '编号', + `table_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '表名称', + `table_comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '表描述', + `sub_table_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '关联子表的表名', + `sub_table_fk_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '子表关联的外键名', + `class_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '实体类名称', + `tpl_category` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'crud' COMMENT '使用的模板(crud单表操作 tree树表操作)', + `package_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成包路径', + `module_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成模块名', + `business_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成业务名', + `function_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成功能名', + `function_author` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生成功能作者', + `gen_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '生成代码方式(0zip压缩包 1自定义路径)', + `gen_path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '/' COMMENT '生成路径(不填默认项目路径)', + `options` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '其它生成选项', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`table_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代码生成业务表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of gen_table +-- ---------------------------- +INSERT INTO `gen_table` VALUES (1661288222902505474, 'sys_notice', '通知公告表', NULL, NULL, 'SysNotice', 'crud', 'org.dromara.system', 'system', 'notice', '通知公告', 'Lion Li', '0', '/', NULL, 103, 1, '2023-05-20 18:05:11', 1, '2023-05-20 18:05:11', NULL); +INSERT INTO `gen_table` VALUES (1661288223338713089, 'sys_oper_log', '操作日志记录', NULL, NULL, 'SysOperLog', 'crud', 'org.dromara.system', 'system', 'operLog', '操作日志记录', 'Lion Li', '0', '/', NULL, 103, 1, '2023-05-20 18:05:11', 1, '2023-05-20 18:05:11', NULL); +INSERT INTO `gen_table` VALUES (1661288223477125122, 'sys_oss', 'OSS对象存储表', NULL, NULL, 'SysOss', 'crud', 'org.dromara.system', 'system', 'oss', 'OSS对象存储', 'Lion Li', '0', '/', NULL, 103, 1, '2023-05-20 18:05:11', 1, '2023-05-20 18:05:11', NULL); +INSERT INTO `gen_table` VALUES (1661288223586177025, 'sys_oss_config', '对象存储配置表', NULL, NULL, 'SysOssConfig', 'crud', 'org.dromara.system', 'system', 'ossConfig', '对象存储配置', 'Lion Li', '0', '/', NULL, 103, 1, '2023-05-20 18:05:11', 1, '2023-05-20 18:05:11', NULL); +INSERT INTO `gen_table` VALUES (1661288223728783361, 'sys_post', '岗位信息表', NULL, NULL, 'SysPost', 'crud', 'org.dromara.system', 'system', 'post', '岗位信息', 'Lion Li', '0', '/', NULL, 103, 1, '2023-05-20 18:05:11', 1, '2023-05-20 18:05:11', NULL); +INSERT INTO `gen_table` VALUES (1661288223821058050, 'sys_role', '角色信息表', NULL, NULL, 'SysRole', 'crud', 'org.dromara.system', 'system', 'role', '角色信息', 'Lion Li', '0', '/', NULL, 103, 1, '2023-05-20 18:05:11', 1, '2023-05-20 18:05:11', NULL); +INSERT INTO `gen_table` VALUES (1661288223925915650, 'sys_user_post', '用户与岗位关联表', NULL, NULL, 'SysUserPost', 'crud', 'org.dromara.system', 'system', 'userPost', '用户与岗位关联', 'Lion Li', '0', '/', NULL, 103, 1, '2023-05-20 18:05:11', 1, '2023-05-20 18:05:11', NULL); +INSERT INTO `gen_table` VALUES (1661288223967858689, 'sys_user_role', '用户和角色关联表', NULL, NULL, 'SysUserRole', 'crud', 'org.dromara.system', 'system', 'userRole', '用户和角色关联', 'Lion Li', '0', '/', NULL, 103, 1, '2023-05-20 18:05:11', 1, '2023-05-20 18:05:11', NULL); +INSERT INTO `gen_table` VALUES (1661288385096241154, 'sys_config', '参数配置表', NULL, NULL, 'SysConfig', 'crud', 'org.dromara.system', 'system', 'config', '参数配置', 'Lion Li', '0', '/', NULL, 103, 1, '2023-05-20 18:05:10', 1, '2023-05-20 18:05:10', NULL); +INSERT INTO `gen_table` VALUES (1680196323445579778, 'sys_file_detail', '文件记录表', NULL, NULL, 'SysFileDetail', 'crud', 'org.aibiddingding.system', 'system', 'fileDetail', '文件记录', 'Lion Li', '0', '/', NULL, 103, 1, '2023-07-15 20:40:00', 1, '2023-07-15 20:40:00', NULL); +INSERT INTO `gen_table` VALUES (1680196323521077249, 'sys_file_detail', '文件记录表', NULL, NULL, 'SysFileDetail', 'crud', 'org.aibiddingding.system', 'system', 'fileDetail', '文件记录', 'Lion Li', '0', '/', NULL, 103, 1, '2023-07-15 20:40:00', 1, '2023-07-15 20:40:00', NULL); +INSERT INTO `gen_table` VALUES (1680199147407806465, 'sys_file_info', '文件记录表', NULL, NULL, 'SysFileInfo', 'crud', 'org.aibiddingding.system', 'system', 'fileInfo', '文件记录', 'Lion Li', '0', '/', NULL, 103, 1, '2023-07-15 20:53:56', 1, '2023-07-15 20:53:56', NULL); +INSERT INTO `gen_table` VALUES (1680481752850145282, 'sd_model_param', '模型参数信息表', NULL, NULL, 'SdModelParam', 'crud', 'org.aibiddingding.system', 'system', 'modelParam', '模型参数信息', 'Lion Li', '0', '/', NULL, 103, 1, '2023-07-16 15:18:34', 1, '2023-07-16 15:18:34', NULL); +INSERT INTO `gen_table` VALUES (1740573614897897473, 'payment_orders', '支付订单表', NULL, NULL, 'PaymentOrders', 'crud', 'org.aibiddingding.system', 'system', 'orders', '支付订单', 'Lion Li', '0', '/', NULL, 103, 1, '2023-12-27 23:04:45', 1, '2023-12-27 23:04:45', NULL); +INSERT INTO `gen_table` VALUES (1775895242171076610, 'sys_model', '系统模型', NULL, NULL, 'SysModel', 'crud', 'org.aibiddingding.system', 'system', 'model', '系统模型', 'Lion Li', '0', '/', NULL, 103, 1, '2024-04-04 22:27:08', 1, '2024-04-04 22:27:08', NULL); +INSERT INTO `gen_table` VALUES (1785390411861803009, 'wx_rob_config', '微信机器人管理', NULL, NULL, 'WxRobConfig', 'crud', 'org.aibiddingding.system', 'system', 'robConfig', 'robot', 'Lion Li', '0', '/', '{\"treeCode\":null,\"treeName\":null,\"treeParentCode\":null,\"parentMenuId\":null}', 103, 1, '2024-05-01 01:10:04', 1, '2024-05-03 21:00:51', NULL); +INSERT INTO `gen_table` VALUES (1785390413745045505, 'wx_rob_keyword', '', NULL, NULL, 'WxRobKeyword', 'crud', 'org.aibiddingding.system', 'system', 'robKeyword', '', 'Lion Li', '0', '/', NULL, 103, 1, '2024-04-30 23:51:44', 1, '2024-04-30 23:51:44', NULL); +INSERT INTO `gen_table` VALUES (1785390414860730369, 'wx_rob_relation', '', NULL, NULL, 'WxRobRelation', 'crud', 'org.aibiddingding.system', 'system', 'robRelation', '', 'Lion Li', '0', '/', NULL, 103, 1, '2024-04-30 23:51:44', 1, '2024-04-30 23:51:44', NULL); +INSERT INTO `gen_table` VALUES (1786379560181882881, 'chat_voucher', '用户兑换记录', NULL, NULL, 'ChatVoucher', 'crud', 'org.aibiddingding.system', 'system', 'voucher', '用户兑换记录', 'Lion Li', '0', '/', NULL, 103, 1, '2024-05-03 20:57:18', 1, '2024-05-03 20:57:18', NULL); +INSERT INTO `gen_table` VALUES (1789155611035381761, 'sys_notice_state', '用户阅读状态表', NULL, NULL, 'SysNoticeState', 'crud', 'org.aibiddingding.system', 'system', 'noticeState', '用户阅读状态', 'Lion Li', '0', '/', NULL, 103, 1, '2024-05-11 12:48:14', 1, '2024-05-11 12:48:14', NULL); + +-- ---------------------------- +-- Table structure for gen_table_column +-- ---------------------------- +DROP TABLE IF EXISTS `gen_table_column`; +CREATE TABLE `gen_table_column` ( + `column_id` bigint(20) NOT NULL COMMENT '编号', + `table_id` bigint(20) NULL DEFAULT NULL COMMENT '归属表编号', + `column_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列名称', + `column_comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列描述', + `column_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列类型', + `java_type` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'JAVA类型', + `java_field` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'JAVA字段名', + `is_pk` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否主键(1是)', + `is_increment` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否自增(1是)', + `is_required` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否必填(1是)', + `is_insert` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否为插入字段(1是)', + `is_edit` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否编辑字段(1是)', + `is_list` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否列表字段(1是)', + `is_query` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否查询字段(1是)', + `query_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'EQ' COMMENT '查询方式(等于、不等于、大于、小于、范围)', + `html_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)', + `dict_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', + `sort` int(11) NULL DEFAULT NULL COMMENT '排序', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`column_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代码生成业务表字段' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of gen_table_column +-- ---------------------------- +INSERT INTO `gen_table_column` VALUES (1661288223078666241, 1661288222902505474, 'notice_id', '公告ID', 'bigint(20)', 'Long', 'noticeId', '1', '0', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223108026369, 1661288222902505474, 'tenant_id', '租户编号', 'varchar(20)', 'String', 'tenantId', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 2, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223108026370, 1661288222902505474, 'notice_title', '公告标题', 'varchar(50)', 'String', 'noticeTitle', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223108026371, 1661288222902505474, 'notice_type', '公告类型(1通知 2公告)', 'char(1)', 'String', 'noticeType', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'select', '', 4, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223108026372, 1661288222902505474, 'notice_content', '公告内容', 'longblob', 'String', 'noticeContent', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'editor', '', 5, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223120609282, 1661288222902505474, 'status', '公告状态(0正常 1关闭)', 'char(1)', 'String', 'status', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'radio', '', 6, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223120609283, 1661288222902505474, 'create_dept', '创建部门', 'bigint(20)', 'Long', 'createDept', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 7, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223120609284, 1661288222902505474, 'create_by', '创建者', 'bigint(20)', 'Long', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 8, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223120609285, 1661288222902505474, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 9, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223120609286, 1661288222902505474, 'update_by', '更新者', 'bigint(20)', 'Long', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 10, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223120609287, 1661288222902505474, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 11, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223120609288, 1661288222902505474, 'remark', '备注', 'varchar(255)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'input', '', 12, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223363878913, 1661288223338713089, 'oper_id', '日志主键', 'bigint(20)', 'Long', 'operId', '1', '0', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223363878914, 1661288223338713089, 'tenant_id', '租户编号', 'varchar(20)', 'String', 'tenantId', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 2, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223363878915, 1661288223338713089, 'title', '模块标题', 'varchar(50)', 'String', 'title', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223363878916, 1661288223338713089, 'business_type', '业务类型(0其它 1新增 2修改 3删除)', 'int(2)', 'Integer', 'businessType', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'select', '', 4, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223401627649, 1661288223338713089, 'method', '方法名称', 'varchar(100)', 'String', 'method', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 5, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223401627650, 1661288223338713089, 'request_method', '请求方式', 'varchar(10)', 'String', 'requestMethod', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 6, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223401627651, 1661288223338713089, 'operator_type', '操作类别(0其它 1后台用户 2手机端用户)', 'int(1)', 'Integer', 'operatorType', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'select', '', 7, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223401627652, 1661288223338713089, 'oper_name', '操作人员', 'varchar(50)', 'String', 'operName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 8, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223401627653, 1661288223338713089, 'dept_name', '部门名称', 'varchar(50)', 'String', 'deptName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 9, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223401627654, 1661288223338713089, 'oper_url', '请求URL', 'varchar(255)', 'String', 'operUrl', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 10, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223401627655, 1661288223338713089, 'oper_ip', '主机地址', 'varchar(128)', 'String', 'operIp', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 11, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223401627656, 1661288223338713089, 'oper_location', '操作地点', 'varchar(255)', 'String', 'operLocation', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 12, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223401627657, 1661288223338713089, 'oper_param', '请求参数', 'varchar(2000)', 'String', 'operParam', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 13, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223401627658, 1661288223338713089, 'json_result', '返回参数', 'varchar(2000)', 'String', 'jsonResult', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 14, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223401627659, 1661288223338713089, 'status', '操作状态(0正常 1异常)', 'int(1)', 'Integer', 'status', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'radio', '', 15, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223401627660, 1661288223338713089, 'error_msg', '错误消息', 'varchar(2000)', 'String', 'errorMsg', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 16, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223401627661, 1661288223338713089, 'oper_time', '操作时间', 'datetime', 'Date', 'operTime', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'datetime', '', 17, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223401627662, 1661288223338713089, 'cost_time', '消耗时间', 'bigint(20)', 'Long', 'costTime', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 18, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223502290946, 1661288223477125122, 'oss_id', '对象存储主键', 'bigint(20)', 'Long', 'ossId', '1', '0', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223502290947, 1661288223477125122, 'tenant_id', '租户编号', 'varchar(20)', 'String', 'tenantId', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 2, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223502290948, 1661288223477125122, 'file_name', '文件名', 'varchar(255)', 'String', 'fileName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 3, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223502290949, 1661288223477125122, 'original_name', '原名', 'varchar(255)', 'String', 'originalName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 4, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223502290950, 1661288223477125122, 'file_suffix', '文件后缀名', 'varchar(10)', 'String', 'fileSuffix', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 5, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223502290951, 1661288223477125122, 'url', 'URL地址', 'varchar(500)', 'String', 'url', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 6, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223502290952, 1661288223477125122, 'create_dept', '创建部门', 'bigint(20)', 'Long', 'createDept', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 7, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223502290953, 1661288223477125122, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 8, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223502290954, 1661288223477125122, 'create_by', '上传人', 'bigint(20)', 'Long', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 9, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223502290955, 1661288223477125122, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 10, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223502290956, 1661288223477125122, 'update_by', '更新人', 'bigint(20)', 'Long', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 11, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223502290957, 1661288223477125122, 'service', '服务商', 'varchar(20)', 'String', 'service', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 12, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223611342850, 1661288223586177025, 'oss_config_id', '主建', 'bigint(20)', 'Long', 'ossConfigId', '1', '0', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223611342851, 1661288223586177025, 'tenant_id', '租户编号', 'varchar(20)', 'String', 'tenantId', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 2, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223611342852, 1661288223586177025, 'config_key', '配置key', 'varchar(20)', 'String', 'configKey', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223611342853, 1661288223586177025, 'access_key', 'accessKey', 'varchar(255)', 'String', 'accessKey', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 4, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223611342854, 1661288223586177025, 'secret_key', '秘钥', 'varchar(255)', 'String', 'secretKey', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 5, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223611342855, 1661288223586177025, 'bucket_name', '桶名称', 'varchar(255)', 'String', 'bucketName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 6, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223611342856, 1661288223586177025, 'prefix', '前缀', 'varchar(255)', 'String', 'prefix', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 7, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223611342857, 1661288223586177025, 'endpoint', '访问站点', 'varchar(255)', 'String', 'endpoint', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 8, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223611342858, 1661288223586177025, 'domain', '自定义域名', 'varchar(255)', 'String', 'domain', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 9, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223611342859, 1661288223586177025, 'is_https', '是否https(Y=是,N=否)', 'char(1)', 'String', 'isHttps', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 10, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223611342860, 1661288223586177025, 'region', '域', 'varchar(255)', 'String', 'region', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 11, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223653285889, 1661288223586177025, 'access_policy', '桶权限类型(0=private 1=public 2=custom)', 'char(1)', 'String', 'accessPolicy', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 12, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223653285890, 1661288223586177025, 'status', '是否默认(0=是,1=否)', 'char(1)', 'String', 'status', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'radio', '', 13, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223653285891, 1661288223586177025, 'ext1', '扩展字段', 'varchar(255)', 'String', 'ext1', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 14, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223653285892, 1661288223586177025, 'create_dept', '创建部门', 'bigint(20)', 'Long', 'createDept', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 15, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223653285893, 1661288223586177025, 'create_by', '创建者', 'bigint(20)', 'Long', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 16, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223653285894, 1661288223586177025, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 17, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223653285895, 1661288223586177025, 'update_by', '更新者', 'bigint(20)', 'Long', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 18, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223653285896, 1661288223586177025, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 19, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223653285897, 1661288223586177025, 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'textarea', '', 20, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223749754881, 1661288223728783361, 'post_id', '岗位ID', 'bigint(20)', 'Long', 'postId', '1', '0', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223749754882, 1661288223728783361, 'tenant_id', '租户编号', 'varchar(20)', 'String', 'tenantId', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 2, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223749754883, 1661288223728783361, 'post_code', '岗位编码', 'varchar(64)', 'String', 'postCode', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223749754884, 1661288223728783361, 'post_name', '岗位名称', 'varchar(50)', 'String', 'postName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 4, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223749754885, 1661288223728783361, 'post_sort', '显示顺序', 'int(4)', 'Integer', 'postSort', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 5, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223749754886, 1661288223728783361, 'status', '状态(0正常 1停用)', 'char(1)', 'String', 'status', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'radio', '', 6, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223749754887, 1661288223728783361, 'create_dept', '创建部门', 'bigint(20)', 'Long', 'createDept', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 7, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223749754888, 1661288223728783361, 'create_by', '创建者', 'bigint(20)', 'Long', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 8, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223749754889, 1661288223728783361, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 9, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223749754890, 1661288223728783361, 'update_by', '更新者', 'bigint(20)', 'Long', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 10, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223749754891, 1661288223728783361, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 11, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223749754892, 1661288223728783361, 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'textarea', '', 12, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223874, 1661288223821058050, 'role_id', '角色ID', 'bigint(20)', 'Long', 'roleId', '1', '0', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223875, 1661288223821058050, 'tenant_id', '租户编号', 'varchar(20)', 'String', 'tenantId', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 2, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223876, 1661288223821058050, 'role_name', '角色名称', 'varchar(30)', 'String', 'roleName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 3, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223877, 1661288223821058050, 'role_key', '角色权限字符串', 'varchar(100)', 'String', 'roleKey', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 4, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223878, 1661288223821058050, 'role_sort', '显示顺序', 'int(4)', 'Integer', 'roleSort', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 5, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223879, 1661288223821058050, 'data_scope', '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)', 'char(1)', 'String', 'dataScope', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 6, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223880, 1661288223821058050, 'menu_check_strictly', '菜单树选择项是否关联显示', 'tinyint(1)', 'Integer', 'menuCheckStrictly', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 7, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223881, 1661288223821058050, 'dept_check_strictly', '部门树选择项是否关联显示', 'tinyint(1)', 'Integer', 'deptCheckStrictly', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 8, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223882, 1661288223821058050, 'status', '角色状态(0正常 1停用)', 'char(1)', 'String', 'status', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'radio', '', 9, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223883, 1661288223821058050, 'del_flag', '删除标志(0代表存在 2代表删除)', 'char(1)', 'String', 'delFlag', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 10, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223884, 1661288223821058050, 'create_dept', '创建部门', 'bigint(20)', 'Long', 'createDept', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 11, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223885, 1661288223821058050, 'create_by', '创建者', 'bigint(20)', 'Long', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 12, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223886, 1661288223821058050, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 13, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223887, 1661288223821058050, 'update_by', '更新者', 'bigint(20)', 'Long', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 14, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223888, 1661288223821058050, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 15, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223846223889, 1661288223821058050, 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'textarea', '', 16, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223951081474, 1661288223925915650, 'user_id', '用户ID', 'bigint(20)', 'Long', 'userId', '1', '0', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223951081475, 1661288223925915650, 'post_id', '岗位ID', 'bigint(20)', 'Long', 'postId', '1', '0', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 2, 103, 1, '2023-05-24 16:29:12', 1, '2023-05-24 16:29:12'); +INSERT INTO `gen_table_column` VALUES (1661288223993024514, 1661288223967858689, 'user_id', '用户ID', 'bigint(20)', 'Long', 'userId', '1', '0', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); +INSERT INTO `gen_table_column` VALUES (1661288223993024515, 1661288223967858689, 'role_id', '角色ID', 'bigint(20)', 'Long', 'roleId', '1', '0', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 2, 103, 1, '2023-05-24 16:29:13', 1, '2023-05-24 16:29:13'); +INSERT INTO `gen_table_column` VALUES (1661288385121406978, 1661288385096241154, 'config_id', '参数主键', 'bigint(20)', 'Long', 'configId', '1', '0', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-05-24 16:29:51', 1, '2023-05-24 16:29:51'); +INSERT INTO `gen_table_column` VALUES (1661288385121406979, 1661288385096241154, 'tenant_id', '租户编号', 'varchar(20)', 'String', 'tenantId', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 2, 103, 1, '2023-05-24 16:29:51', 1, '2023-05-24 16:29:51'); +INSERT INTO `gen_table_column` VALUES (1661288385121406980, 1661288385096241154, 'config_name', '参数名称', 'varchar(100)', 'String', 'configName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 3, 103, 1, '2023-05-24 16:29:51', 1, '2023-05-24 16:29:51'); +INSERT INTO `gen_table_column` VALUES (1661288385121406981, 1661288385096241154, 'config_key', '参数键名', 'varchar(100)', 'String', 'configKey', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 4, 103, 1, '2023-05-24 16:29:51', 1, '2023-05-24 16:29:51'); +INSERT INTO `gen_table_column` VALUES (1661288385121406982, 1661288385096241154, 'config_value', '参数键值', 'varchar(500)', 'String', 'configValue', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 5, 103, 1, '2023-05-24 16:29:51', 1, '2023-05-24 16:29:51'); +INSERT INTO `gen_table_column` VALUES (1661288385121406983, 1661288385096241154, 'config_type', '系统内置(Y是 N否)', 'char(1)', 'String', 'configType', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'select', '', 6, 103, 1, '2023-05-24 16:29:51', 1, '2023-05-24 16:29:51'); +INSERT INTO `gen_table_column` VALUES (1661288385121406984, 1661288385096241154, 'create_dept', '创建部门', 'bigint(20)', 'Long', 'createDept', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 7, 103, 1, '2023-05-24 16:29:51', 1, '2023-05-24 16:29:51'); +INSERT INTO `gen_table_column` VALUES (1661288385142378498, 1661288385096241154, 'create_by', '创建者', 'bigint(20)', 'Long', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 8, 103, 1, '2023-05-24 16:29:51', 1, '2023-05-24 16:29:51'); +INSERT INTO `gen_table_column` VALUES (1661288385142378499, 1661288385096241154, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 9, 103, 1, '2023-05-24 16:29:51', 1, '2023-05-24 16:29:51'); +INSERT INTO `gen_table_column` VALUES (1661288385142378500, 1661288385096241154, 'update_by', '更新者', 'bigint(20)', 'Long', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 10, 103, 1, '2023-05-24 16:29:51', 1, '2023-05-24 16:29:51'); +INSERT INTO `gen_table_column` VALUES (1661288385142378501, 1661288385096241154, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 11, 103, 1, '2023-05-24 16:29:51', 1, '2023-05-24 16:29:51'); +INSERT INTO `gen_table_column` VALUES (1661288385142378502, 1661288385096241154, 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'textarea', '', 12, 103, 1, '2023-05-24 16:29:51', 1, '2023-05-24 16:29:51'); +INSERT INTO `gen_table_column` VALUES (1680196323806289921, 1680196323521077249, 'id', '文件id', 'bigint(20) unsigned', 'Long', 'id', '1', '1', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323806289922, 1680196323521077249, 'url', '文件访问地址', 'varchar(512)', 'String', 'url', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 2, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323835650050, 1680196323445579778, 'id', '文件id', 'bigint(20) unsigned', 'Long', 'id', '1', '1', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323835650051, 1680196323445579778, 'url', '文件访问地址', 'varchar(512)', 'String', 'url', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 2, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323835650052, 1680196323445579778, 'size', '文件大小,单位字节', 'bigint(20)', 'Long', 'size', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323873398785, 1680196323445579778, 'filename', '文件名称', 'varchar(256)', 'String', 'filename', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 4, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323873398786, 1680196323445579778, 'original_filename', '原始文件名', 'varchar(256)', 'String', 'originalFilename', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 5, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323873398787, 1680196323445579778, 'base_path', '基础存储路径', 'varchar(256)', 'String', 'basePath', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 6, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323873398788, 1680196323445579778, 'path', '存储路径', 'varchar(256)', 'String', 'path', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 7, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323873398789, 1680196323445579778, 'ext', '文件扩展名', 'varchar(32)', 'String', 'ext', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 8, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323873398790, 1680196323445579778, 'object_id', '文件所属对象id', 'varchar(32)', 'String', 'objectId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 9, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323873398791, 1680196323445579778, 'file_type', '文件类型', 'varchar(32)', 'String', 'fileType', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'select', '', 10, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323932119041, 1680196323445579778, 'attr', '附加属性', 'text', 'String', 'attr', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 11, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323932119042, 1680196323445579778, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 12, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323940507649, 1680196323445579778, 'create_by', '创建者', 'varchar(64)', 'String', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 13, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323940507650, 1680196323445579778, 'update_by', '更新者', 'varchar(64)', 'String', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 14, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323940507651, 1680196323445579778, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 15, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323940507652, 1680196323445579778, 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'textarea', '', 16, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323940507653, 1680196323445579778, 'version', '版本', 'int(11)', 'Long', 'version', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 17, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323940507654, 1680196323445579778, 'del_flag', '删除标志(0代表存在 1代表删除)', 'char(1)', 'String', 'delFlag', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 18, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323961479170, 1680196323521077249, 'size', '文件大小,单位字节', 'bigint(20)', 'Long', 'size', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323961479171, 1680196323521077249, 'filename', '文件名称', 'varchar(256)', 'String', 'filename', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 4, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323961479172, 1680196323521077249, 'original_filename', '原始文件名', 'varchar(256)', 'String', 'originalFilename', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 5, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323961479173, 1680196323521077249, 'base_path', '基础存储路径', 'varchar(256)', 'String', 'basePath', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 6, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323961479174, 1680196323521077249, 'path', '存储路径', 'varchar(256)', 'String', 'path', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 7, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323961479175, 1680196323521077249, 'ext', '文件扩展名', 'varchar(32)', 'String', 'ext', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 8, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323961479176, 1680196323521077249, 'object_id', '文件所属对象id', 'varchar(32)', 'String', 'objectId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 9, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323961479177, 1680196323521077249, 'file_type', '文件类型', 'varchar(32)', 'String', 'fileType', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'select', '', 10, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323961479178, 1680196323521077249, 'attr', '附加属性', 'text', 'String', 'attr', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 11, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323999227905, 1680196323445579778, 'update_ip', '更新IP', 'varchar(128)', 'String', 'updateIp', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 19, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196323999227906, 1680196323445579778, 'tenant_id', '租户Id', 'bigint(20)', 'Long', 'tenantId', '0', '0', '1', NULL, NULL, NULL, NULL, 'EQ', 'input', '', 20, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196324020199425, 1680196323521077249, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 12, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196324020199426, 1680196323521077249, 'create_by', '创建者', 'varchar(64)', 'String', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 13, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196324020199427, 1680196323521077249, 'update_by', '更新者', 'varchar(64)', 'String', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 14, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196324020199428, 1680196323521077249, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 15, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196324020199429, 1680196323521077249, 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'textarea', '', 16, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196324020199430, 1680196323521077249, 'version', '版本', 'int(11)', 'Long', 'version', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 17, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196324020199431, 1680196323521077249, 'del_flag', '删除标志(0代表存在 1代表删除)', 'char(1)', 'String', 'delFlag', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 18, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196324020199432, 1680196323521077249, 'update_ip', '更新IP', 'varchar(128)', 'String', 'updateIp', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 19, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680196324020199433, 1680196323521077249, 'tenant_id', '租户Id', 'bigint(20)', 'Long', 'tenantId', '0', '0', '1', NULL, NULL, NULL, NULL, 'EQ', 'input', '', 20, 103, 1, '2023-07-15 20:43:15', 1, '2023-07-15 20:43:15'); +INSERT INTO `gen_table_column` VALUES (1680199147667853313, 1680199147407806465, 'id', '文件id', 'bigint(20) unsigned', 'Long', 'id', '1', '1', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147667853314, 1680199147407806465, 'url', '文件访问地址', 'varchar(512)', 'String', 'url', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 2, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147667853315, 1680199147407806465, 'size', '文件大小,单位字节', 'bigint(20)', 'Long', 'size', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147667853316, 1680199147407806465, 'filename', '文件名称', 'varchar(256)', 'String', 'filename', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 4, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147667853317, 1680199147407806465, 'original_filename', '原始文件名', 'varchar(256)', 'String', 'originalFilename', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 5, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147667853318, 1680199147407806465, 'base_path', '基础存储路径', 'varchar(256)', 'String', 'basePath', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 6, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147734962178, 1680199147407806465, 'path', '存储路径', 'varchar(256)', 'String', 'path', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 7, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147734962179, 1680199147407806465, 'ext', '文件扩展名', 'varchar(32)', 'String', 'ext', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 8, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147734962180, 1680199147407806465, 'object_id', '文件所属对象id', 'varchar(32)', 'String', 'objectId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 9, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147734962181, 1680199147407806465, 'file_type', '文件类型', 'varchar(32)', 'String', 'fileType', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'select', '', 10, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147734962182, 1680199147407806465, 'attr', '附加属性', 'text', 'String', 'attr', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 11, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147734962183, 1680199147407806465, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 12, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147734962184, 1680199147407806465, 'create_by', '创建者', 'varchar(64)', 'String', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 13, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147734962185, 1680199147407806465, 'update_by', '更新者', 'varchar(64)', 'String', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 14, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147734962186, 1680199147407806465, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 15, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147734962187, 1680199147407806465, 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'textarea', '', 16, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147734962188, 1680199147407806465, 'version', '版本', 'int(11)', 'Long', 'version', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 17, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147734962189, 1680199147407806465, 'del_flag', '删除标志(0代表存在 1代表删除)', 'char(1)', 'String', 'delFlag', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 18, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147734962190, 1680199147407806465, 'update_ip', '更新IP', 'varchar(128)', 'String', 'updateIp', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 19, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680199147734962191, 1680199147407806465, 'tenant_id', '租户Id', 'bigint(20)', 'Long', 'tenantId', '0', '0', '1', NULL, NULL, NULL, NULL, 'EQ', 'input', '', 20, 103, 1, '2023-07-15 20:54:28', 1, '2023-07-15 20:54:28'); +INSERT INTO `gen_table_column` VALUES (1680481753240215553, 1680481752850145282, 'id', 'id', 'bigint(20) unsigned', 'Long', 'id', '1', '1', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215554, 1680481752850145282, 'prompt', '描述词', 'text', 'String', 'prompt', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 2, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215555, 1680481752850145282, 'negative_prompt', '负面词', 'text', 'String', 'negativePrompt', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 3, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215556, 1680481752850145282, 'model_name', '模型名称', 'varchar(256)', 'String', 'modelName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 4, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215557, 1680481752850145282, 'steps', '迭代步数', 'int(10)', 'Integer', 'steps', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 5, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215558, 1680481752850145282, 'seed', '种子', 'varchar(256)', 'String', 'seed', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 6, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215559, 1680481752850145282, 'width', '图片宽度', 'varchar(256)', 'String', 'width', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 7, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215560, 1680481752850145282, 'height', '图片高度', 'varchar(32)', 'String', 'height', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 8, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215561, 1680481752850145282, 'sampler_name', '采样方法', 'varchar(32)', 'String', 'samplerName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 9, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215562, 1680481752850145282, 'create_dept', '创建部门', 'bigint(20)', 'Long', 'createDept', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 10, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215563, 1680481752850145282, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 11, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215564, 1680481752850145282, 'create_by', '创建者', 'varchar(64)', 'String', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 12, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215565, 1680481752850145282, 'update_by', '更新者', 'varchar(64)', 'String', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 13, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215566, 1680481752850145282, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 14, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215567, 1680481752850145282, 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'textarea', '', 15, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215568, 1680481752850145282, 'version', '版本', 'int(11)', 'Long', 'version', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 16, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215569, 1680481752850145282, 'del_flag', '删除标志(0代表存在 1代表删除)', 'char(1)', 'String', 'delFlag', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 17, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215570, 1680481752850145282, 'update_ip', '更新IP', 'varchar(128)', 'String', 'updateIp', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 18, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1680481753240215571, 1680481752850145282, 'tenant_id', '租户Id', 'bigint(20)', 'Long', 'tenantId', '0', '0', '1', NULL, NULL, NULL, NULL, 'EQ', 'input', '', 19, 103, 1, '2023-07-16 15:37:26', 1, '2023-07-16 15:37:26'); +INSERT INTO `gen_table_column` VALUES (1740573615225053185, 1740573614897897473, 'id', '主键', 'int(11)', 'Long', 'id', '1', '1', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2023-12-29 11:21:03', 1, '2023-12-29 11:21:03'); +INSERT INTO `gen_table_column` VALUES (1740573615225053186, 1740573614897897473, 'order_no', '订单编号', 'varchar(20)', 'String', 'orderNo', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 2, 103, 1, '2023-12-29 11:21:03', 1, '2023-12-29 11:21:03'); +INSERT INTO `gen_table_column` VALUES (1740573615225053187, 1740573614897897473, 'order_name', '订单名称', 'varchar(100)', 'String', 'orderName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 3, 103, 1, '2023-12-29 11:21:03', 1, '2023-12-29 11:21:03'); +INSERT INTO `gen_table_column` VALUES (1740573615225053188, 1740573614897897473, 'amount', '金额', 'decimal(10,2)', 'BigDecimal', 'amount', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 4, 103, 1, '2023-12-29 11:21:03', 1, '2023-12-29 11:21:03'); +INSERT INTO `gen_table_column` VALUES (1740573615225053189, 1740573614897897473, 'payment_status', '支付状态', 'char(1)', 'String', 'paymentStatus', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'radio', '', 5, 103, 1, '2023-12-29 11:21:03', 1, '2023-12-29 11:21:03'); +INSERT INTO `gen_table_column` VALUES (1740573615225053190, 1740573614897897473, 'payment_method', '支付方式', 'char(1)', 'String', 'paymentMethod', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 6, 103, 1, '2023-12-29 11:21:03', 1, '2023-12-29 11:21:03'); +INSERT INTO `gen_table_column` VALUES (1740573615225053191, 1740573614897897473, 'user_id', '用户ID', 'timestamp', 'Date', 'userId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'datetime', '', 7, 103, 1, '2023-12-29 11:21:03', 1, '2023-12-29 11:21:03'); +INSERT INTO `gen_table_column` VALUES (1740573615225053192, 1740573614897897473, 'create_by', '创建者', 'bigint(20)', 'Long', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 8, 103, 1, '2023-12-29 11:21:03', 1, '2023-12-29 11:21:03'); +INSERT INTO `gen_table_column` VALUES (1740573615225053193, 1740573614897897473, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 9, 103, 1, '2023-12-29 11:21:03', 1, '2023-12-29 11:21:03'); +INSERT INTO `gen_table_column` VALUES (1740573615225053194, 1740573614897897473, 'update_by', '更新者', 'bigint(20)', 'Long', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 10, 103, 1, '2023-12-29 11:21:03', 1, '2023-12-29 11:21:03'); +INSERT INTO `gen_table_column` VALUES (1740573615225053195, 1740573614897897473, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 11, 103, 1, '2023-12-29 11:21:03', 1, '2023-12-29 11:21:03'); +INSERT INTO `gen_table_column` VALUES (1740573615225053196, 1740573614897897473, 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'textarea', '', 12, 103, 1, '2023-12-29 11:21:03', 1, '2023-12-29 11:21:03'); +INSERT INTO `gen_table_column` VALUES (1775895242624061441, 1775895242171076610, 'id', '主键', 'bigint(20)', 'Long', 'id', '1', '0', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2024-04-04 22:36:35', 1, '2024-04-04 22:36:35'); +INSERT INTO `gen_table_column` VALUES (1775895242624061442, 1775895242171076610, 'model_name', '模型名称', 'varchar(50)', 'String', 'modelName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 2, 103, 1, '2024-04-04 22:36:35', 1, '2024-04-04 22:36:35'); +INSERT INTO `gen_table_column` VALUES (1775895242624061443, 1775895242171076610, 'model_no', '模型编号', 'varchar(255)', 'String', 'modelNo', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2024-04-04 22:36:35', 1, '2024-04-04 22:36:35'); +INSERT INTO `gen_table_column` VALUES (1775895242624061444, 1775895242171076610, 'model_describe', '模型描述', 'varchar(255)', 'String', 'modelDescribe', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 4, 103, 1, '2024-04-04 22:36:35', 1, '2024-04-04 22:36:35'); +INSERT INTO `gen_table_column` VALUES (1775895242624061445, 1775895242171076610, 'model_price', '模型价格', 'double', 'Long', 'modelPrice', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 5, 103, 1, '2024-04-04 22:36:35', 1, '2024-04-04 22:36:35'); +INSERT INTO `gen_table_column` VALUES (1775895242624061446, 1775895242171076610, 'model_type', '计费类型', 'char(1)', 'String', 'modelType', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'select', '', 6, 103, 1, '2024-04-04 22:36:35', 1, '2024-04-04 22:36:35'); +INSERT INTO `gen_table_column` VALUES (1775895242624061447, 1775895242171076610, 'create_dept', '创建部门', 'bigint(20)', 'Long', 'createDept', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 7, 103, 1, '2024-04-04 22:36:35', 1, '2024-04-04 22:36:35'); +INSERT INTO `gen_table_column` VALUES (1775895242624061448, 1775895242171076610, 'create_by', '创建者', 'bigint(20)', 'Long', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 8, 103, 1, '2024-04-04 22:36:35', 1, '2024-04-04 22:36:35'); +INSERT INTO `gen_table_column` VALUES (1775895242624061449, 1775895242171076610, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 9, 103, 1, '2024-04-04 22:36:35', 1, '2024-04-04 22:36:35'); +INSERT INTO `gen_table_column` VALUES (1775895242624061450, 1775895242171076610, 'update_by', '更新者', 'bigint(20)', 'Long', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 10, 103, 1, '2024-04-04 22:36:35', 1, '2024-04-04 22:36:35'); +INSERT INTO `gen_table_column` VALUES (1775895242624061451, 1775895242171076610, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 11, 103, 1, '2024-04-04 22:36:35', 1, '2024-04-04 22:36:35'); +INSERT INTO `gen_table_column` VALUES (1775895242624061452, 1775895242171076610, 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'textarea', '', 12, 103, 1, '2024-04-04 22:36:35', 1, '2024-04-04 22:36:35'); +INSERT INTO `gen_table_column` VALUES (1785390412381896706, 1785390411861803009, 'id', '主键', 'int(11) unsigned', 'Long', 'id', '1', '1', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-03 21:00:52'); +INSERT INTO `gen_table_column` VALUES (1785390412381896707, 1785390411861803009, 'user_id', '用户id', 'bigint(20)', 'Long', 'userId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 2, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-03 21:00:52'); +INSERT INTO `gen_table_column` VALUES (1785390412381896708, 1785390411861803009, 'unique_key', '机器唯一码', 'varchar(16)', 'String', 'uniqueKey', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-03 21:00:52'); +INSERT INTO `gen_table_column` VALUES (1785390412381896709, 1785390411861803009, 'remark', '备注(微信号)', 'varchar(64)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'input', '', 4, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-03 21:00:52'); +INSERT INTO `gen_table_column` VALUES (1785390412444811265, 1785390411861803009, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', '1', NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 5, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-03 21:00:52'); +INSERT INTO `gen_table_column` VALUES (1785390412444811266, 1785390411861803009, 'update_time', '修改时间', 'datetime', 'Date', 'updateTime', '0', '0', '1', NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 6, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-03 21:00:52'); +INSERT INTO `gen_table_column` VALUES (1785390412444811267, 1785390411861803009, 'to_friend', '指定好友回复开关', 'bit(1)', 'Integer', 'toFriend', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 7, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-03 21:00:52'); +INSERT INTO `gen_table_column` VALUES (1785390412444811268, 1785390411861803009, 'to_group', '指定群回复开关', 'bit(1)', 'Integer', 'toGroup', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 8, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-03 21:00:52'); +INSERT INTO `gen_table_column` VALUES (1785390412444811269, 1785390411861803009, 'default_friend', '默认好友回复开关', 'bit(1)', 'Integer', 'defaultFriend', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 9, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-03 21:00:52'); +INSERT INTO `gen_table_column` VALUES (1785390412444811270, 1785390411861803009, 'default_group', '默认群回复开关', 'bit(1)', 'Integer', 'defaultGroup', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 10, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-03 21:00:52'); +INSERT INTO `gen_table_column` VALUES (1785390412444811271, 1785390411861803009, 'from_out', '对外接口开关', 'bit(1)', 'Integer', 'fromOut', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 11, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-03 21:00:52'); +INSERT INTO `gen_table_column` VALUES (1785390412444811272, 1785390411861803009, 'enable', '机器启用1禁用0', 'bit(1)', 'Integer', 'enable', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 12, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-03 21:00:52'); +INSERT INTO `gen_table_column` VALUES (1785390414135115778, 1785390413745045505, 'id', '', 'int(11) unsigned', 'Long', 'id', '1', '1', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-01 03:27:00'); +INSERT INTO `gen_table_column` VALUES (1785390414135115779, 1785390413745045505, 'unique_key', '机器唯一码', 'varchar(16)', 'String', 'uniqueKey', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 2, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-01 03:27:00'); +INSERT INTO `gen_table_column` VALUES (1785390414135115780, 1785390413745045505, 'key_data', '关键词', 'varchar(64)', 'String', 'keyData', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-01 03:27:00'); +INSERT INTO `gen_table_column` VALUES (1785390414135115781, 1785390413745045505, 'value_data', '回复内容', 'varchar(1024)', 'String', 'valueData', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'textarea', '', 4, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-01 03:27:00'); +INSERT INTO `gen_table_column` VALUES (1785390414135115782, 1785390413745045505, 'type_data', '回复类型', 'varchar(64)', 'String', 'typeData', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 5, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-01 03:27:00'); +INSERT INTO `gen_table_column` VALUES (1785390414135115783, 1785390413745045505, 'nick_name', '目标昵称', 'varchar(64)', 'String', 'nickName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 6, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-01 03:27:00'); +INSERT INTO `gen_table_column` VALUES (1785390414135115784, 1785390413745045505, 'to_group', '群1好友0', 'bit(1)', 'Integer', 'toGroup', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 7, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-01 03:27:00'); +INSERT INTO `gen_table_column` VALUES (1785390414135115785, 1785390413745045505, 'enable', '启用1禁用0', 'bit(1)', 'Integer', 'enable', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 8, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-01 03:27:00'); +INSERT INTO `gen_table_column` VALUES (1785390414135115786, 1785390413745045505, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', '1', NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 9, 103, 1, '2024-05-01 03:27:00', 1, '2024-05-01 03:27:00'); +INSERT INTO `gen_table_column` VALUES (1785390415250800642, 1785390414860730369, 'id', '', 'int(11) unsigned', 'Long', 'id', '1', '1', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2024-05-01 03:27:01', 1, '2024-05-01 03:27:01'); +INSERT INTO `gen_table_column` VALUES (1785390415250800643, 1785390414860730369, 'out_key', '外接唯一码', 'varchar(16)', 'String', 'outKey', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 2, 103, 1, '2024-05-01 03:27:01', 1, '2024-05-01 03:27:01'); +INSERT INTO `gen_table_column` VALUES (1785390415250800644, 1785390414860730369, 'unique_key', '机器唯一码', 'varchar(16)', 'String', 'uniqueKey', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2024-05-01 03:27:01', 1, '2024-05-01 03:27:01'); +INSERT INTO `gen_table_column` VALUES (1785390415250800645, 1785390414860730369, 'nick_name', '目标昵称', 'varchar(64)', 'String', 'nickName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 4, 103, 1, '2024-05-01 03:27:01', 1, '2024-05-01 03:27:01'); +INSERT INTO `gen_table_column` VALUES (1785390415250800646, 1785390414860730369, 'to_group', '群1好友0', 'bit(1)', 'Integer', 'toGroup', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 5, 103, 1, '2024-05-01 03:27:01', 1, '2024-05-01 03:27:01'); +INSERT INTO `gen_table_column` VALUES (1785390415250800647, 1785390414860730369, 'enable', '启用1禁用0', 'bit(1)', 'Integer', 'enable', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 6, 103, 1, '2024-05-01 03:27:01', 1, '2024-05-01 03:27:01'); +INSERT INTO `gen_table_column` VALUES (1785390415250800648, 1785390414860730369, 'white_list', 'IP白名单', 'varchar(255)', 'String', 'whiteList', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 7, 103, 1, '2024-05-01 03:27:01', 1, '2024-05-01 03:27:01'); +INSERT INTO `gen_table_column` VALUES (1785390415250800649, 1785390414860730369, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', '1', NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 8, 103, 1, '2024-05-01 03:27:01', 1, '2024-05-01 03:27:01'); +INSERT INTO `gen_table_column` VALUES (1786379560827805698, 1786379560181882881, 'id', '主键', 'bigint(20)', 'Long', 'id', '1', '1', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2024-05-03 20:57:31', 1, '2024-05-03 20:57:31'); +INSERT INTO `gen_table_column` VALUES (1786379560827805699, 1786379560181882881, 'user_id', '用户id', 'bigint(20)', 'Long', 'userId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 2, 103, 1, '2024-05-03 20:57:31', 1, '2024-05-03 20:57:31'); +INSERT INTO `gen_table_column` VALUES (1786379560827805700, 1786379560181882881, 'code', '兑换码', 'varchar(255)', 'String', 'code', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2024-05-03 20:57:31', 1, '2024-05-03 20:57:31'); +INSERT INTO `gen_table_column` VALUES (1786379560827805701, 1786379560181882881, 'amount', '兑换金额', 'double(10,2)', 'BigDecimal', 'amount', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 4, 103, 1, '2024-05-03 20:57:31', 1, '2024-05-03 20:57:31'); +INSERT INTO `gen_table_column` VALUES (1786379560827805702, 1786379560181882881, 'status', '兑换状态', 'char(1)', 'String', 'status', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'radio', '', 5, 103, 1, '2024-05-03 20:57:31', 1, '2024-05-03 20:57:31'); +INSERT INTO `gen_table_column` VALUES (1786379560827805703, 1786379560181882881, 'balance_before', '兑换前余额', 'double(10,2)', 'BigDecimal', 'balanceBefore', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 6, 103, 1, '2024-05-03 20:57:31', 1, '2024-05-03 20:57:31'); +INSERT INTO `gen_table_column` VALUES (1786379560827805704, 1786379560181882881, 'balance_after', '兑换后余额', 'double(10,2)', 'BigDecimal', 'balanceAfter', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 7, 103, 1, '2024-05-03 20:57:31', 1, '2024-05-03 20:57:31'); +INSERT INTO `gen_table_column` VALUES (1786379560827805705, 1786379560181882881, 'create_dept', '创建部门', 'bigint(20)', 'Long', 'createDept', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 8, 103, 1, '2024-05-03 20:57:31', 1, '2024-05-03 20:57:31'); +INSERT INTO `gen_table_column` VALUES (1786379560827805706, 1786379560181882881, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 9, 103, 1, '2024-05-03 20:57:31', 1, '2024-05-03 20:57:31'); +INSERT INTO `gen_table_column` VALUES (1786379560827805707, 1786379560181882881, 'create_by', '创建者', 'varchar(64)', 'String', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 10, 103, 1, '2024-05-03 20:57:31', 1, '2024-05-03 20:57:31'); +INSERT INTO `gen_table_column` VALUES (1786379560827805708, 1786379560181882881, 'update_by', '更新者', 'varchar(64)', 'String', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 11, 103, 1, '2024-05-03 20:57:31', 1, '2024-05-03 20:57:31'); +INSERT INTO `gen_table_column` VALUES (1786379560827805709, 1786379560181882881, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 12, 103, 1, '2024-05-03 20:57:31', 1, '2024-05-03 20:57:31'); +INSERT INTO `gen_table_column` VALUES (1786379560890720257, 1786379560181882881, 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'textarea', '', 13, 103, 1, '2024-05-03 20:57:31', 1, '2024-05-03 20:57:31'); +INSERT INTO `gen_table_column` VALUES (1789155611425452034, 1789155611035381761, 'id', 'ID', 'bigint(20)', 'Long', 'id', '1', '0', '1', NULL, '1', '1', NULL, 'EQ', 'input', '', 1, 103, 1, '2024-05-11 12:48:33', 1, '2024-05-11 12:48:33'); +INSERT INTO `gen_table_column` VALUES (1789155611425452035, 1789155611035381761, 'user_id', '用户ID', 'bigint(20)', 'Long', 'userId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 2, 103, 1, '2024-05-11 12:48:33', 1, '2024-05-11 12:48:33'); +INSERT INTO `gen_table_column` VALUES (1789155611425452036, 1789155611035381761, 'notice_id', '公告ID', 'bigint(20)', 'Long', 'noticeId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 103, 1, '2024-05-11 12:48:33', 1, '2024-05-11 12:48:33'); +INSERT INTO `gen_table_column` VALUES (1789155611425452037, 1789155611035381761, 'read_status', '阅读状态(0未读 1已读)', 'char(1)', 'String', 'readStatus', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'radio', '', 4, 103, 1, '2024-05-11 12:48:33', 1, '2024-05-11 12:48:33'); +INSERT INTO `gen_table_column` VALUES (1789155611425452038, 1789155611035381761, 'create_dept', '创建部门', 'bigint(20)', 'Long', 'createDept', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 5, 103, 1, '2024-05-11 12:48:33', 1, '2024-05-11 12:48:33'); +INSERT INTO `gen_table_column` VALUES (1789155611425452039, 1789155611035381761, 'create_by', '创建者', 'bigint(20)', 'Long', 'createBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 6, 103, 1, '2024-05-11 12:48:33', 1, '2024-05-11 12:48:33'); +INSERT INTO `gen_table_column` VALUES (1789155611425452040, 1789155611035381761, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 7, 103, 1, '2024-05-11 12:48:33', 1, '2024-05-11 12:48:33'); +INSERT INTO `gen_table_column` VALUES (1789155611425452041, 1789155611035381761, 'update_by', '更新者', 'bigint(20)', 'Long', 'updateBy', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 8, 103, 1, '2024-05-11 12:48:33', 1, '2024-05-11 12:48:33'); +INSERT INTO `gen_table_column` VALUES (1789155611425452042, 1789155611035381761, 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'datetime', '', 9, 103, 1, '2024-05-11 12:48:33', 1, '2024-05-11 12:48:33'); +INSERT INTO `gen_table_column` VALUES (1789155611425452043, 1789155611035381761, 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', '1', '1', '1', '1', NULL, 'EQ', 'textarea', '', 10, 103, 1, '2024-05-11 12:48:33', 1, '2024-05-11 12:48:33'); + +-- ---------------------------- +-- Table structure for knowledge_attach +-- ---------------------------- +DROP TABLE IF EXISTS `knowledge_attach`; +CREATE TABLE `knowledge_attach` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `kid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '知识库ID', + `doc_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文档ID', + `doc_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文档名称', + `doc_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文档类型', + `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '文档内容', + `create_time` datetime NULL DEFAULT NULL, + `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `idx_kname`(`kid`, `doc_name`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1900472441872076802 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '知识库附件' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of knowledge_attach +-- ---------------------------- + +-- ---------------------------- +-- Table structure for knowledge_fragment +-- ---------------------------- +DROP TABLE IF EXISTS `knowledge_fragment`; +CREATE TABLE `knowledge_fragment` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `kid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '知识库ID', + `doc_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文档ID', + `fid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '知识片段ID', + `idx` int(11) NOT NULL COMMENT '片段索引下标', + `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文档内容', + `create_time` datetime NULL DEFAULT NULL, + `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1900472441846910978 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '知识片段' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of knowledge_fragment +-- ---------------------------- + +-- ---------------------------- +-- Table structure for knowledge_info +-- ---------------------------- +DROP TABLE IF EXISTS `knowledge_info`; +CREATE TABLE `knowledge_info` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `kid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '知识库ID', + `uid` bigint(20) NOT NULL DEFAULT 0 COMMENT '用户ID', + `kname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '知识库名称', + `share` tinyint(4) NULL DEFAULT NULL COMMENT '是否公开知识库(0 否 1是)', + `description` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述', + `knowledge_separator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '知识分隔符', + `question_separator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '提问分隔符', + `overlap_char` int(11) NULL DEFAULT NULL COMMENT '重叠字符数', + `retrieve_limit` int(11) NULL DEFAULT NULL COMMENT '知识库中检索的条数', + `text_block_size` int(11) NULL DEFAULT NULL COMMENT '文本块大小', + `vector` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '向量库', + `vector_model` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '向量模型', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `idx_kid`(`kid`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1900203785917321219 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '知识库' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of knowledge_info +-- ---------------------------- + +-- ---------------------------- +-- Table structure for sys_config +-- ---------------------------- +DROP TABLE IF EXISTS `sys_config`; +CREATE TABLE `sys_config` ( + `config_id` bigint(20) NOT NULL COMMENT '参数主键', + `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', + `config_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '参数名称', + `config_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '参数键名', + `config_value` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '参数键值', + `config_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '系统内置(Y是 N否)', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`config_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '参数配置表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_config +-- ---------------------------- +INSERT INTO `sys_config` VALUES (1, '000000', '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 103, 1, '2023-05-14 15:19:42', 1, '2025-03-12 12:24:07', '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow'); +INSERT INTO `sys_config` VALUES (2, '000000', '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'N', 103, 1, '2023-05-14 15:19:42', 1, '2025-03-12 10:22:57', '初始化密码 123456'); +INSERT INTO `sys_config` VALUES (3, '000000', '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'N', 103, 1, '2023-05-14 15:19:42', 1, '2025-03-12 10:23:02', '深色主题theme-dark,浅色主题theme-light'); +INSERT INTO `sys_config` VALUES (5, '000000', '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 103, 1, '2023-05-14 15:19:42', NULL, NULL, '是否开启注册用户功能(true开启,false关闭)'); +INSERT INTO `sys_config` VALUES (11, '000000', 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 103, 1, '2023-05-14 15:19:42', NULL, NULL, 'true:开启, false:关闭'); + +-- ---------------------------- +-- Table structure for sys_dept +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dept`; +CREATE TABLE `sys_dept` ( + `dept_id` bigint(20) NOT NULL COMMENT '部门id', + `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', + `parent_id` bigint(20) NULL DEFAULT 0 COMMENT '父部门id', + `ancestors` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '祖级列表', + `dept_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '部门名称', + `order_num` int(4) NULL DEFAULT 0 COMMENT '显示顺序', + `leader` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '负责人', + `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话', + `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '部门状态(0正常 1停用)', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`dept_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '部门表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_dept +-- ---------------------------- +INSERT INTO `sys_dept` VALUES (100, '000000', 0, '0', '熊猫科技', 0, 'ageerle', '15888888888', 'ageerle@163.com', '0', '0', 103, 1, '2023-05-14 15:19:39', 1, '2023-12-29 11:18:24'); +INSERT INTO `sys_dept` VALUES (101, '000000', 100, '0,100', '深圳总公司', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, '2023-05-14 15:19:39', NULL, NULL); +INSERT INTO `sys_dept` VALUES (102, '000000', 100, '0,100', '长沙分公司', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '2', 103, 1, '2023-05-14 15:19:39', NULL, NULL); +INSERT INTO `sys_dept` VALUES (103, '000000', 101, '0,100,101', '研发部门', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '0', 103, 1, '2023-05-14 15:19:39', NULL, NULL); +INSERT INTO `sys_dept` VALUES (104, '000000', 101, '0,100,101', '市场部门', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '2', 103, 1, '2023-05-14 15:19:39', NULL, NULL); +INSERT INTO `sys_dept` VALUES (105, '000000', 101, '0,100,101', '测试部门', 3, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '2', 103, 1, '2023-05-14 15:19:39', NULL, NULL); +INSERT INTO `sys_dept` VALUES (106, '000000', 101, '0,100,101', '财务部门', 4, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '2', 103, 1, '2023-05-14 15:19:39', NULL, NULL); +INSERT INTO `sys_dept` VALUES (107, '000000', 101, '0,100,101', '运维部门', 5, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '2', 103, 1, '2023-05-14 15:19:39', NULL, NULL); +INSERT INTO `sys_dept` VALUES (108, '000000', 102, '0,100,102', '市场部门', 1, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '2', 103, 1, '2023-05-14 15:19:39', NULL, NULL); +INSERT INTO `sys_dept` VALUES (109, '000000', 102, '0,100,102', '财务部门', 2, '疯狂的狮子Li', '15888888888', 'xxx@qq.com', '0', '2', 103, 1, '2023-05-14 15:19:39', NULL, NULL); + +-- ---------------------------- +-- Table structure for sys_dict_data +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dict_data`; +CREATE TABLE `sys_dict_data` ( + `dict_code` bigint(20) NOT NULL COMMENT '字典编码', + `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', + `dict_sort` int(4) NULL DEFAULT 0 COMMENT '字典排序', + `dict_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典标签', + `dict_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典键值', + `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', + `css_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '样式属性(其他样式扩展)', + `list_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表格回显样式', + `is_default` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '是否默认(Y是 N否)', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`dict_code`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典数据表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_dict_data +-- ---------------------------- +INSERT INTO `sys_dict_data` VALUES (1, '000000', 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '性别男'); +INSERT INTO `sys_dict_data` VALUES (2, '000000', 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '性别女'); +INSERT INTO `sys_dict_data` VALUES (3, '000000', 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '性别未知'); +INSERT INTO `sys_dict_data` VALUES (4, '000000', 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '显示菜单'); +INSERT INTO `sys_dict_data` VALUES (5, '000000', 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '隐藏菜单'); +INSERT INTO `sys_dict_data` VALUES (6, '000000', 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '正常状态'); +INSERT INTO `sys_dict_data` VALUES (7, '000000', 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '停用状态'); +INSERT INTO `sys_dict_data` VALUES (12, '000000', 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '系统默认是'); +INSERT INTO `sys_dict_data` VALUES (13, '000000', 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '系统默认否'); +INSERT INTO `sys_dict_data` VALUES (14, '000000', 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '通知'); +INSERT INTO `sys_dict_data` VALUES (15, '000000', 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '公告'); +INSERT INTO `sys_dict_data` VALUES (16, '000000', 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '正常状态'); +INSERT INTO `sys_dict_data` VALUES (17, '000000', 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '关闭状态'); +INSERT INTO `sys_dict_data` VALUES (18, '000000', 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '新增操作'); +INSERT INTO `sys_dict_data` VALUES (19, '000000', 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '修改操作'); +INSERT INTO `sys_dict_data` VALUES (20, '000000', 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '删除操作'); +INSERT INTO `sys_dict_data` VALUES (21, '000000', 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '授权操作'); +INSERT INTO `sys_dict_data` VALUES (22, '000000', 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '导出操作'); +INSERT INTO `sys_dict_data` VALUES (23, '000000', 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '导入操作'); +INSERT INTO `sys_dict_data` VALUES (24, '000000', 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '强退操作'); +INSERT INTO `sys_dict_data` VALUES (25, '000000', 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '生成操作'); +INSERT INTO `sys_dict_data` VALUES (26, '000000', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '清空操作'); +INSERT INTO `sys_dict_data` VALUES (27, '000000', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '正常状态'); +INSERT INTO `sys_dict_data` VALUES (28, '000000', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '停用状态'); +INSERT INTO `sys_dict_data` VALUES (29, '000000', 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '其他操作'); +INSERT INTO `sys_dict_data` VALUES (1775756996568993793, '000000', 1, '免费用户', '0', 'sys_user_grade', '', 'info', 'N', '0', 103, 1, '2024-04-04 13:27:15', 1, '2024-04-04 13:30:09', ''); +INSERT INTO `sys_dict_data` VALUES (1775757116970684418, '000000', 2, '高级会员', '1', 'sys_user_grade', '', 'success', 'N', '0', 103, 1, '2024-04-04 13:27:43', 1, '2024-04-04 13:30:15', ''); +INSERT INTO `sys_dict_data` VALUES (1776109770934677506, '000000', 0, 'token计费', '1', 'sys_model_billing', '', 'primary', 'N', '0', 103, 1, '2024-04-05 12:49:03', 1, '2024-04-21 00:05:41', ''); +INSERT INTO `sys_dict_data` VALUES (1776109853377916929, '000000', 0, '次数计费', '2', 'sys_model_billing', '', 'success', 'N', '0', 103, 1, '2024-04-05 12:49:22', 1, '2024-04-05 12:49:22', ''); +INSERT INTO `sys_dict_data` VALUES (1780264338471858177, '000000', 0, '未支付', '1', 'pay_state', '', 'info', 'N', '0', 103, 1, '2024-04-16 23:57:49', 1, '2024-04-16 23:58:29', ''); +INSERT INTO `sys_dict_data` VALUES (1780264431589601282, '000000', 2, '已支付', '2', 'pay_state', '', 'success', 'N', '0', 103, 1, '2024-04-16 23:58:11', 1, '2024-04-16 23:58:21', ''); + +-- ---------------------------- +-- Table structure for sys_dict_type +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dict_type`; +CREATE TABLE `sys_dict_type` ( + `dict_id` bigint(20) NOT NULL COMMENT '字典主键', + `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', + `dict_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典名称', + `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`dict_id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `dict_type`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典类型表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_dict_type +-- ---------------------------- +INSERT INTO `sys_dict_type` VALUES (1, '000000', '用户性别', 'sys_user_sex', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '用户性别列表'); +INSERT INTO `sys_dict_type` VALUES (2, '000000', '菜单状态', 'sys_show_hide', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '菜单状态列表'); +INSERT INTO `sys_dict_type` VALUES (3, '000000', '系统开关', 'sys_normal_disable', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '系统开关列表'); +INSERT INTO `sys_dict_type` VALUES (6, '000000', '系统是否', 'sys_yes_no', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '系统是否列表'); +INSERT INTO `sys_dict_type` VALUES (7, '000000', '通知类型', 'sys_notice_type', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '通知类型列表'); +INSERT INTO `sys_dict_type` VALUES (8, '000000', '通知状态', 'sys_notice_status', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '通知状态列表'); +INSERT INTO `sys_dict_type` VALUES (9, '000000', '操作类型', 'sys_oper_type', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '操作类型列表'); +INSERT INTO `sys_dict_type` VALUES (10, '000000', '系统状态', 'sys_common_status', '0', 103, 1, '2023-05-14 15:19:41', NULL, NULL, '登录状态列表'); +INSERT INTO `sys_dict_type` VALUES (1729685494468083714, '911866', '用户性别', 'sys_user_sex', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '用户性别列表'); +INSERT INTO `sys_dict_type` VALUES (1729685494468083715, '911866', '菜单状态', 'sys_show_hide', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '菜单状态列表'); +INSERT INTO `sys_dict_type` VALUES (1729685494468083716, '911866', '系统开关', 'sys_normal_disable', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '系统开关列表'); +INSERT INTO `sys_dict_type` VALUES (1729685494468083717, '911866', '系统是否', 'sys_yes_no', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '系统是否列表'); +INSERT INTO `sys_dict_type` VALUES (1729685494468083718, '911866', '通知类型', 'sys_notice_type', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '通知类型列表'); +INSERT INTO `sys_dict_type` VALUES (1729685494468083719, '911866', '通知状态', 'sys_notice_status', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '通知状态列表'); +INSERT INTO `sys_dict_type` VALUES (1729685494468083720, '911866', '操作类型', 'sys_oper_type', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '操作类型列表'); +INSERT INTO `sys_dict_type` VALUES (1729685494468083721, '911866', '系统状态', 'sys_common_status', '0', 103, 1, '2023-05-14 15:19:41', 1, '2023-05-14 15:19:41', '登录状态列表'); +INSERT INTO `sys_dict_type` VALUES (1775756736895438849, '000000', '用户等级', 'sys_user_grade', '0', 103, 1, '2024-04-04 13:26:13', 1, '2024-04-04 13:26:13', ''); +INSERT INTO `sys_dict_type` VALUES (1776109665045278721, '000000', '模型计费方式', 'sys_model_billing', '0', 103, 1, '2024-04-05 12:48:37', 1, '2024-04-08 11:22:18', '模型计费方式'); +INSERT INTO `sys_dict_type` VALUES (1780263881368219649, '000000', '支付状态', 'pay_state', '0', 103, 1, '2024-04-16 23:56:00', 1, '2024-04-16 23:56:00', '支付状态'); + +-- ---------------------------- +-- Table structure for sys_file_info +-- ---------------------------- +DROP TABLE IF EXISTS `sys_file_info`; +CREATE TABLE `sys_file_info` ( + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '文件id', + `url` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件访问地址', + `size` bigint(20) NULL DEFAULT NULL COMMENT '文件大小,单位字节', + `filename` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件名称', + `original_filename` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '原始文件名', + `base_path` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '基础存储路径', + `path` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '存储路径', + `ext` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件扩展名', + `user_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件所属用户', + `file_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件类型', + `attr` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '附加属性', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + `version` int(11) NULL DEFAULT NULL COMMENT '版本', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 1代表删除)', + `update_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新IP', + `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户Id', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文件记录表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_file_info +-- ---------------------------- + +-- ---------------------------- +-- Table structure for sys_logininfor +-- ---------------------------- +DROP TABLE IF EXISTS `sys_logininfor`; +CREATE TABLE `sys_logininfor` ( + `info_id` bigint(20) NOT NULL COMMENT '访问ID', + `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', + `user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户账号', + `ipaddr` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '登录IP地址', + `login_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '登录地点', + `browser` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '浏览器类型', + `os` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '操作系统', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '登录状态(0成功 1失败)', + `msg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '提示消息', + `login_time` datetime NULL DEFAULT NULL COMMENT '访问时间', + PRIMARY KEY (`info_id`) USING BTREE, + INDEX `idx_sys_logininfor_s`(`status`) USING BTREE, + INDEX `idx_sys_logininfor_lt`(`login_time`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统访问记录' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_logininfor +-- ---------------------------- + +-- ---------------------------- +-- Table structure for sys_menu +-- ---------------------------- +DROP TABLE IF EXISTS `sys_menu`; +CREATE TABLE `sys_menu` ( + `menu_id` bigint(20) NOT NULL COMMENT '菜单ID', + `menu_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '菜单名称', + `parent_id` bigint(20) NULL DEFAULT 0 COMMENT '父菜单ID', + `order_num` int(11) NULL DEFAULT 0 COMMENT '显示顺序', + `path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '路由地址', + `component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组件路径', + `query_param` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '路由参数', + `is_frame` int(11) NULL DEFAULT 1 COMMENT '是否为外链(0是 1否)', + `is_cache` int(11) NULL DEFAULT 0 COMMENT '是否缓存(0缓存 1不缓存)', + `menu_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)', + `visible` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '显示状态(0显示 1隐藏)', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0正常 1停用)', + `perms` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '权限标识', + `icon` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '#' COMMENT '菜单图标', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注', + PRIMARY KEY (`menu_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单权限表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_menu +-- ---------------------------- +INSERT INTO `sys_menu` VALUES (1, '系统管理', 0, 2, 'system', NULL, '', 1, 0, 'M', '0', '0', '', 'eos-icons:system-group', 103, 1, '2023-05-14 15:19:39', 1, '2024-10-06 21:08:06', '系统管理目录'); +INSERT INTO `sys_menu` VALUES (100, '用户管理', 1775500307898949634, 1, 'user', 'system/user/index', '', 1, 0, 'C', '0', '0', 'system:user:list', 'ph:user-fill', 103, 1, '2023-05-14 15:19:39', 1, '2024-10-07 21:29:29', '用户管理菜单'); +INSERT INTO `sys_menu` VALUES (101, '角色管理', 1, 2, 'role', 'system/role/index', '', 1, 0, 'C', '0', '0', 'system:role:list', 'ri:user-3-fill', 103, 1, '2023-05-14 15:19:39', 1, '2024-10-07 21:04:59', '角色管理菜单'); +INSERT INTO `sys_menu` VALUES (102, '菜单管理', 1, 3, 'menu', 'system/menu/index', '', 1, 0, 'C', '0', '0', 'system:menu:list', 'typcn:th-menu-outline', 103, 1, '2023-05-14 15:19:39', 1, '2024-10-07 21:06:06', '菜单管理菜单'); +INSERT INTO `sys_menu` VALUES (103, '部门管理', 1, 4, 'dept', 'system/dept/index', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'mdi:company', 103, 1, '2023-05-14 15:19:39', 1, '2025-03-03 16:44:16', '部门管理菜单'); +INSERT INTO `sys_menu` VALUES (104, '岗位管理', 1, 5, 'post', 'system/post/index', '', 1, 0, 'C', '0', '0', 'system:post:list', 'post', 103, 1, '2023-05-14 15:19:39', 1, '2025-03-11 13:58:09', '岗位管理菜单'); +INSERT INTO `sys_menu` VALUES (105, '字典管理', 1, 6, 'dict', 'system/dict/index', '', 1, 0, 'C', '0', '0', 'system:dict:list', 'fluent-mdl2:dictionary', 103, 1, '2023-05-14 15:19:40', 1, '2024-10-07 21:14:33', '字典管理菜单'); +INSERT INTO `sys_menu` VALUES (106, '系统参数', 1, 10, 'config', 'system/config/index', '', 1, 0, 'C', '0', '0', 'system:config:list', 'tdesign:system-code', 103, 1, '2023-05-14 15:19:40', 1, '2024-10-07 21:11:07', '参数设置菜单'); +INSERT INTO `sys_menu` VALUES (107, '通知公告', 1, 14, 'notice', 'system/notice/index', '', 1, 0, 'C', '0', '0', 'system:notice:list', 'icon-park-solid:volume-notice', 103, 1, '2023-05-14 15:19:40', 1, '2024-10-07 21:11:42', '通知公告菜单'); +INSERT INTO `sys_menu` VALUES (108, '日志管理', 1, 9, 'log', '', '', 1, 0, 'M', '0', '0', '', 'icon-park-solid:log', 103, 1, '2023-05-14 15:19:40', 1, '2024-10-07 21:10:41', '日志管理菜单'); +INSERT INTO `sys_menu` VALUES (113, '缓存监控', 1, 5, 'cache', 'monitor/cache/index', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'octicon:cache-24', 103, 1, '2023-05-14 15:19:40', 1, '2024-10-07 21:09:44', '缓存监控菜单'); +INSERT INTO `sys_menu` VALUES (500, '操作日志', 108, 1, 'operlog', 'monitor/operlog/index', '', 1, 0, 'C', '0', '0', 'monitor:operlog:list', 'icon-park-solid:log', 103, 1, '2023-05-14 15:19:40', 1, '2024-10-07 21:13:20', '操作日志菜单'); +INSERT INTO `sys_menu` VALUES (501, '登录日志', 108, 2, 'logininfor', 'monitor/logininfor/index', '', 1, 0, 'C', '0', '0', 'monitor:logininfor:list', 'icon-park-solid:log', 103, 1, '2023-05-14 15:19:40', 1, '2024-10-07 21:13:33', '登录日志菜单'); +INSERT INTO `sys_menu` VALUES (1001, '用户查询', 100, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:user:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1002, '用户新增', 100, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:user:add', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1003, '用户修改', 100, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:user:edit', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1004, '用户删除', 100, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:user:remove', '#', 103, 1, '2023-05-14 15:19:40', 1, '2025-03-05 17:27:08', ''); +INSERT INTO `sys_menu` VALUES (1005, '用户导出', 100, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:user:export', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1006, '用户导入', 100, 6, '', '', '', 1, 0, 'F', '0', '0', 'system:user:import', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1007, '重置密码', 100, 7, '', '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1008, '角色查询', 101, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:role:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1009, '角色新增', 101, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:role:add', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1010, '角色修改', 101, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:role:edit', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1011, '角色删除', 101, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:role:remove', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1012, '角色导出', 101, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:role:export', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1013, '菜单查询', 102, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1014, '菜单新增', 102, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1015, '菜单修改', 102, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1016, '菜单删除', 102, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1017, '部门查询', 103, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1018, '部门新增', 103, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1019, '部门修改', 103, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1020, '部门删除', 103, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1021, '岗位查询', 104, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1022, '岗位新增', 104, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1023, '岗位修改', 104, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:post:edit', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1024, '岗位删除', 104, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:post:remove', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1025, '岗位导出', 104, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:post:export', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1026, '字典查询', 105, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1027, '字典新增', 105, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:add', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1028, '字典修改', 105, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:edit', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1029, '字典删除', 105, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:remove', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1030, '字典导出', 105, 5, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:export', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1031, '参数查询', 106, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1032, '参数新增', 106, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:add', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1033, '参数修改', 106, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:edit', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1034, '参数删除', 106, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:remove', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1035, '参数导出', 106, 5, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:export', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1036, '公告查询', 107, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1037, '公告新增', 107, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:add', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1038, '公告修改', 107, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:edit', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1039, '公告删除', 107, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:remove', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1040, '操作查询', 500, 1, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1041, '操作删除', 500, 2, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:remove', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1042, '日志导出', 500, 4, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:export', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1043, '登录查询', 501, 1, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:query', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1044, '登录删除', 501, 2, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:remove', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1045, '日志导出', 501, 3, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:export', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1050, '账户解锁', 501, 4, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:unlock', '#', 103, 1, '2023-05-14 15:19:40', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1775500307898949634, '运营管理', 0, 0, 'operate', NULL, NULL, 1, 0, 'M', '0', '0', NULL, 'icon-park-outline:appointment', 103, 1, '2024-04-03 20:27:15', 1, '2024-10-06 21:10:18', ''); +INSERT INTO `sys_menu` VALUES (1775895273104068610, '系统模型', 1775500307898949634, 2, 'model', 'system/model/index', NULL, 1, 0, 'C', '0', '0', 'system:model:list', 'ph:list-fill', 103, 1, '2024-04-05 12:00:38', 1, '2024-10-07 21:36:00', '系统模型菜单'); +INSERT INTO `sys_menu` VALUES (1775895273104068611, '系统模型查询', 1775895273104068610, 1, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:model:query', '#', 103, 1, '2024-04-05 12:00:38', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1775895273104068612, '系统模型新增', 1775895273104068610, 2, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:model:add', '#', 103, 1, '2024-04-05 12:00:38', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1775895273104068613, '系统模型修改', 1775895273104068610, 3, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:model:edit', '#', 103, 1, '2024-04-05 12:00:38', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1775895273104068614, '系统模型删除', 1775895273104068610, 4, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:model:remove', '#', 103, 1, '2024-04-05 12:00:38', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1775895273104068615, '系统模型导出', 1775895273104068610, 5, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:model:export', '#', 103, 1, '2024-04-05 12:00:38', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1780240077690507266, '聊天消息', 1775500307898949634, 5, 'chatMessage', 'system/message/index', NULL, 1, 0, 'C', '0', '0', 'system:message:list', 'bx:chat', 103, 1, '2024-04-16 22:24:48', 1, '2024-10-07 21:38:49', '聊天消息菜单'); +INSERT INTO `sys_menu` VALUES (1780240077690507267, '聊天消息查询', 1780240077690507266, 1, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:message:query', '#', 103, 1, '2024-04-16 22:24:48', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1780240077690507268, '聊天消息新增', 1780240077690507266, 2, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:message:add', '#', 103, 1, '2024-04-16 22:24:48', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1780240077690507269, '聊天消息修改', 1780240077690507266, 3, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:message:edit', '#', 103, 1, '2024-04-16 22:24:48', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1780240077690507270, '聊天消息删除', 1780240077690507266, 4, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:message:remove', '#', 103, 1, '2024-04-16 22:24:48', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1780240077690507271, '聊天消息导出', 1780240077690507266, 5, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:message:export', '#', 103, 1, '2024-04-16 22:24:48', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1780255628576018433, '支付订单', 1775500307898949634, 6, 'order', 'system/order/index', NULL, 1, 0, 'C', '0', '0', 'system:order:list', 'material-symbols:order-approve', 103, 1, '2024-04-16 23:32:48', 1, '2024-11-02 22:21:15', '支付订单菜单'); +INSERT INTO `sys_menu` VALUES (1780255628576018434, '支付订单查询', 1780255628576018433, 1, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:orders:query', '#', 103, 1, '2024-04-16 23:32:48', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1780255628576018435, '支付订单新增', 1780255628576018433, 2, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:orders:add', '#', 103, 1, '2024-04-16 23:32:48', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1780255628576018436, '支付订单修改', 1780255628576018433, 3, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:orders:edit', '#', 103, 1, '2024-04-16 23:32:48', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1780255628576018437, '支付订单删除', 1780255628576018433, 4, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:orders:remove', '#', 103, 1, '2024-04-16 23:32:48', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1780255628576018438, '支付订单导出', 1780255628576018433, 5, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:orders:export', '#', 103, 1, '2024-04-16 23:32:48', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1786379590171156481, '兑换管理', 1775500307898949634, 8, 'exchange', 'system/exchange/index', NULL, 1, 0, 'C', '0', '0', 'system:exchange:list', 'mingcute:exchange-cny-fill', 103, 1, '2024-05-03 20:59:54', 1, '2024-11-02 22:22:41', '用户兑换记录菜单'); +INSERT INTO `sys_menu` VALUES (1786379590171156482, '用户兑换记录查询', 1786379590171156481, 1, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:voucher:query', '#', 103, 1, '2024-05-03 20:59:54', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1786379590171156483, '用户兑换记录新增', 1786379590171156481, 2, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:voucher:add', '#', 103, 1, '2024-05-03 20:59:54', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1786379590171156484, '用户兑换记录修改', 1786379590171156481, 3, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:voucher:edit', '#', 103, 1, '2024-05-03 20:59:55', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1786379590171156485, '用户兑换记录删除', 1786379590171156481, 4, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:voucher:remove', '#', 103, 1, '2024-05-03 20:59:55', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1786379590171156486, '用户兑换记录导出', 1786379590171156481, 5, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:voucher:export', '#', 103, 1, '2024-05-03 20:59:55', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1787078000285122561, '套餐管理', 1775500307898949634, 3, 'package', 'system/package/index', NULL, 1, 0, 'C', '0', '0', 'system:package:list', 'lets-icons:order', 103, 1, '2024-05-05 19:13:53', 1, '2025-03-05 18:56:22', '套餐管理菜单'); +INSERT INTO `sys_menu` VALUES (1810594719028834305, '应用管理', 1775500307898949634, 4, 'gpts', 'system/gpts/index', NULL, 1, 0, 'C', '0', '0', 'system:gpts:list', 'tdesign:app', 103, 1, '2024-07-09 16:40:18', 1, '2025-03-13 23:59:07', 'gpts管理菜单'); +INSERT INTO `sys_menu` VALUES (1810594719028834306, 'gpts管理查询', 1810594719028834305, 1, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:gpts:query', '#', 103, 1, '2024-07-09 16:40:19', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1810594719028834307, 'gpts管理新增', 1810594719028834305, 2, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:gpts:add', '#', 103, 1, '2024-07-09 16:40:19', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1810594719028834308, 'gpts管理修改', 1810594719028834305, 3, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:gpts:edit', '#', 103, 1, '2024-07-09 16:40:19', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1810594719028834309, 'gpts管理删除', 1810594719028834305, 4, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:gpts:remove', '#', 103, 1, '2024-07-09 16:40:19', 1, '2025-03-05 19:02:06', ''); +INSERT INTO `sys_menu` VALUES (1810594719028834310, 'gpts管理导出', 1810594719028834305, 5, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:gpts:export', '#', 103, 1, '2024-07-09 16:40:19', NULL, NULL, ''); +INSERT INTO `sys_menu` VALUES (1843281231381852162, '文件管理', 1775500307898949634, 20, 'file', 'system/oss/index', NULL, 1, 0, 'C', '0', '0', NULL, 'material-symbols-light:folder', 103, 1, '2024-10-07 21:24:27', 1, '2024-12-27 23:03:04', ''); +INSERT INTO `sys_menu` VALUES (1860690448695549953, '配置管理', 1775500307898949634, 9, 'configurationManage', 'system/configurationManage/index', NULL, 1, 0, 'C', '0', '0', NULL, 'mdi:archive-cog-outline', 103, 1, '2024-11-24 22:22:28', 1, '2024-12-30 21:24:01', ''); +INSERT INTO `sys_menu` VALUES (1898286496441393153, '知识库管理', 1775500307898949634, 10, 'knowledgeBase', 'system/knowledgeBase/index', NULL, 1, 0, 'C', '0', '0', NULL, 'garden:knowledge-base-26', 103, 1, '2025-03-08 16:15:44', 1, '2025-03-09 13:35:32', ''); +INSERT INTO `sys_menu` VALUES (1900172314827739137, '流程编排', 1775500307898949634, 11, 'processOrchestration', 'system/processOrchestration/index', NULL, 1, 0, 'C', '0', '0', NULL, '#', 103, 1, '2025-03-13 21:09:18', 1, '2025-03-13 21:09:18', ''); +INSERT INTO `sys_menu` VALUES (1900854435890089985, '聊天测试', 0, 1, '#', '', NULL, 1, 0, 'M', '0', '0', NULL, '#', 103, 1, '2025-03-15 18:19:48', 1, '2025-03-15 18:19:48', ''); + +-- ---------------------------- +-- Table structure for sys_notice +-- ---------------------------- +DROP TABLE IF EXISTS `sys_notice`; +CREATE TABLE `sys_notice` ( + `notice_id` bigint(20) NOT NULL COMMENT '公告ID', + `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', + `notice_title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公告标题', + `notice_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公告类型(1通知 2公告)', + `notice_content` longblob NULL COMMENT '公告内容', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '公告状态(0正常 1关闭)', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`notice_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '通知公告表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_notice +-- ---------------------------- +INSERT INTO `sys_notice` VALUES (1789324923280932865, '000000', '公告', '1', 0x3C703E3C7374726F6E67207374796C653D22636F6C6F723A20236666393930303B223EE69CACE7BD91E7AB99E4B88EE4BBBBE4BD95E585B6E4BB96E585ACE58FB8E68896E59586E6A087E6B2A1E69C89E4BBBBE4BD95E585B3E88194E68896E59088E4BD9CE585B3E7B3BB3C2F7374726F6E673E3C2F703E0A3C703E3C7370616E207374796C653D22636F6C6F723A20236536303030303B223E4149E4B99FE4BC9AE78AAFE99499E38082E8AFB7E58BBFE5B086E585B6E794A8E4BA8EE9878DE8A681E79BAEE79A843C2F7370616E3E3C2F703E0A3C703E3C7370616E207374796C653D22636F6C6F723A20236666393930303B223EE68891E4BBACE79BAEE5898DE6ADA3E59CA8E4BFAEE5A48DE68891E4BBACE7BD91E7AB99E4B88AE79A84E99499E8AFAFE5B9B6E694B9E8BF9BE7BB86E88A82E38082E5A682E69E9CE682A8E69C89E4BBBBE4BD95E79691E997AEEFBC8CE8AFB7E9809AE8BF87E4BBA5E4B88BE696B9E5BC8FE88194E7B3BBE68891E4BBACEFBC9A61676565726C65403136332E636F6D313434343434353535353C2F7370616E3E3C2F703E0A3C703E266E6273703B3C2F703E, '0', 103, 1, '2024-05-12 00:01:20', 1, '2025-03-11 19:31:59', ''); +INSERT INTO `sys_notice` VALUES (1895352010039119874, '000000', '你好', '1', 0x3C703E6E6968616F3C2F703E, '0', 103, 1, '2025-02-28 13:55:08', 1, '2025-02-28 13:55:08', NULL); + +-- ---------------------------- +-- Table structure for sys_notice_state +-- ---------------------------- +DROP TABLE IF EXISTS `sys_notice_state`; +CREATE TABLE `sys_notice_state` ( + `id` bigint(20) NOT NULL COMMENT 'ID', + `user_id` bigint(20) NOT NULL COMMENT '用户ID', + `notice_id` bigint(20) NOT NULL COMMENT '公告ID', + `read_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '阅读状态(0未读 1已读)', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户阅读状态表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_notice_state +-- ---------------------------- + +-- ---------------------------- +-- Table structure for sys_oper_log +-- ---------------------------- +DROP TABLE IF EXISTS `sys_oper_log`; +CREATE TABLE `sys_oper_log` ( + `oper_id` bigint(20) NOT NULL COMMENT '日志主键', + `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', + `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '模块标题', + `business_type` int(2) NULL DEFAULT 0 COMMENT '业务类型(0其它 1新增 2修改 3删除)', + `method` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '方法名称', + `request_method` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '请求方式', + `operator_type` int(1) NULL DEFAULT 0 COMMENT '操作类别(0其它 1后台用户 2手机端用户)', + `oper_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '操作人员', + `dept_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '部门名称', + `oper_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '请求URL', + `oper_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '主机地址', + `oper_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '操作地点', + `oper_param` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '请求参数', + `json_result` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '返回参数', + `status` int(1) NULL DEFAULT 0 COMMENT '操作状态(0正常 1异常)', + `error_msg` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '错误消息', + `oper_time` datetime NULL DEFAULT NULL COMMENT '操作时间', + `cost_time` bigint(20) NULL DEFAULT 0 COMMENT '消耗时间', + PRIMARY KEY (`oper_id`) USING BTREE, + INDEX `idx_sys_oper_log_bt`(`business_type`) USING BTREE, + INDEX `idx_sys_oper_log_s`(`status`) USING BTREE, + INDEX `idx_sys_oper_log_ot`(`oper_time`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '操作日志记录' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_oper_log +-- ---------------------------- + +-- ---------------------------- +-- Table structure for sys_oss +-- ---------------------------- +DROP TABLE IF EXISTS `sys_oss`; +CREATE TABLE `sys_oss` ( + `oss_id` bigint(20) NOT NULL COMMENT '对象存储主键', + `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', + `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '文件名', + `original_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '原名', + `file_suffix` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '文件后缀名', + `url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'URL地址', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '上传人', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新人', + `service` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'minio' COMMENT '服务商', + PRIMARY KEY (`oss_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'OSS对象存储表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_oss +-- ---------------------------- + +-- ---------------------------- +-- Table structure for sys_oss_config +-- ---------------------------- +DROP TABLE IF EXISTS `sys_oss_config`; +CREATE TABLE `sys_oss_config` ( + `oss_config_id` bigint(20) NOT NULL COMMENT '主建', + `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', + `config_key` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '配置key', + `access_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'accessKey', + `secret_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '秘钥', + `bucket_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '桶名称', + `prefix` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '前缀', + `endpoint` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '访问站点', + `domain` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '自定义域名', + `is_https` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '是否https(Y=是,N=否)', + `region` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '域', + `access_policy` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1' COMMENT '桶权限类型(0=private 1=public 2=custom)', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '是否默认(0=是,1=否)', + `ext1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '扩展字段', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`oss_config_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '对象存储配置表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_oss_config +-- ---------------------------- +INSERT INTO `sys_oss_config` VALUES (1, '000000', 'minio', 'aibidding', 'ruoyi123', 'aibidding', '', '127.0.0.1:9000', '', 'N', '', '1', '0', '', 103, 1, '2023-05-14 15:19:42', 1, '2025-03-14 09:55:25', NULL); +INSERT INTO `sys_oss_config` VALUES (2, '000000', 'qiniu', 'aibidding', 'ruoyi123', 'aibidding', '', 's3-cn-north-1.qiniucs.com', '', 'N', '', '1', '1', '', 103, 1, '2023-05-14 15:19:42', 1, '2025-03-14 09:55:22', NULL); +INSERT INTO `sys_oss_config` VALUES (3, '000000', 'aliyun', 'aibidding', 'ruoyi123', 'aibidding', '', 'oss-cn-beijing.aliyuncs.com', '', 'N', '', '1', '1', '', 103, 1, '2023-05-14 15:19:42', 1, '2025-03-13 13:13:04', NULL); +INSERT INTO `sys_oss_config` VALUES (4, '000000', 'qcloud', 'aibidding', 'ruoyi123', 'aibidding', 'panda', 'cos.ap-guangzhou.myqcloud.com', '', 'N', 'ap-guangzhou', '1', '1', '', 103, 1, '2023-05-14 15:19:42', 1, '2025-03-05 14:33:35', ''); +INSERT INTO `sys_oss_config` VALUES (5, '000000', 'image', 'aibidding', 'ruoyi123', 'aibidding', 'image', '127.0.0.1:9000', '', 'N', '', '1', '1', '', 103, 1, '2023-05-14 15:19:42', 1, '2025-03-13 13:12:57', NULL); + +-- ---------------------------- +-- Table structure for sys_post +-- ---------------------------- +DROP TABLE IF EXISTS `sys_post`; +CREATE TABLE `sys_post` ( + `post_id` bigint(20) NOT NULL COMMENT '岗位ID', + `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', + `post_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位编码', + `post_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位名称', + `post_sort` int(4) NOT NULL COMMENT '显示顺序', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '状态(0正常 1停用)', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`post_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '岗位信息表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_post +-- ---------------------------- +INSERT INTO `sys_post` VALUES (1, '000000', 'ceo', '董事长', 1, '0', 103, 1, '2023-05-14 15:19:39', NULL, NULL, ''); +INSERT INTO `sys_post` VALUES (2, '000000', 'se', '项目经理', 2, '0', 103, 1, '2023-05-14 15:19:39', NULL, NULL, ''); +INSERT INTO `sys_post` VALUES (3, '000000', 'hr', '人力资源', 3, '0', 103, 1, '2023-05-14 15:19:39', NULL, NULL, ''); +INSERT INTO `sys_post` VALUES (4, '000000', 'user', '普通员工', 4, '0', 103, 1, '2023-05-14 15:19:39', NULL, NULL, ''); + +-- ---------------------------- +-- Table structure for sys_role +-- ---------------------------- +DROP TABLE IF EXISTS `sys_role`; +CREATE TABLE `sys_role` ( + `role_id` bigint(20) NOT NULL COMMENT '角色ID', + `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', + `role_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名称', + `role_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色权限字符串', + `role_sort` int(4) NOT NULL COMMENT '显示顺序', + `data_scope` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)', + `menu_check_strictly` tinyint(1) NULL DEFAULT 1 COMMENT '菜单树选择项是否关联显示', + `dept_check_strictly` tinyint(1) NULL DEFAULT 1 COMMENT '部门树选择项是否关联显示', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色状态(0正常 1停用)', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`role_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色信息表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_role +-- ---------------------------- +INSERT INTO `sys_role` VALUES (1, '000000', '超级管理员', 'superadmin', 1, '1', 1, 1, '0', '0', 103, 1, '2023-05-14 15:19:39', NULL, NULL, '超级管理员'); +INSERT INTO `sys_role` VALUES (2, '000000', '普通角色', 'common', 2, '2', 1, 1, '0', '0', 103, 1, '2023-05-14 15:19:39', 1, '2025-03-12 10:07:23', '普通角色'); +INSERT INTO `sys_role` VALUES (3, '000000', '本部门及以下', 'test1', 3, '4', 1, 1, '0', '0', 103, 1, '2023-05-14 15:20:00', 1, '2025-03-17 09:29:25', NULL); +INSERT INTO `sys_role` VALUES (4, '000000', '仅本人', 'test2', 4, '5', 1, 1, '0', '0', 103, 1, '2023-05-14 15:20:00', 1, '2023-06-04 10:21:01', NULL); +INSERT INTO `sys_role` VALUES (1661661183933177857, '000000', '小程序管理员', 'xcxadmin', 1, '1', 1, 1, '0', '0', 103, 1, '2023-05-25 17:11:13', 1, '2025-03-14 14:26:26', ''); +INSERT INTO `sys_role` VALUES (1729685491108446210, '911866', '管理员', 'admin', 4, '1', 1, 1, '0', '0', 103, 1, '2023-11-29 10:15:32', 1, '2025-03-12 10:07:57', NULL); + +-- ---------------------------- +-- Table structure for sys_role_dept +-- ---------------------------- +DROP TABLE IF EXISTS `sys_role_dept`; +CREATE TABLE `sys_role_dept` ( + `role_id` bigint(20) NOT NULL COMMENT '角色ID', + `dept_id` bigint(20) NOT NULL COMMENT '部门ID', + PRIMARY KEY (`role_id`, `dept_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色和部门关联表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_role_dept +-- ---------------------------- +INSERT INTO `sys_role_dept` VALUES (2, 100); +INSERT INTO `sys_role_dept` VALUES (2, 101); +INSERT INTO `sys_role_dept` VALUES (2, 105); +INSERT INTO `sys_role_dept` VALUES (1729685491108446210, 1729685491964084226); + +-- ---------------------------- +-- Table structure for sys_role_menu +-- ---------------------------- +DROP TABLE IF EXISTS `sys_role_menu`; +CREATE TABLE `sys_role_menu` ( + `role_id` bigint(20) NOT NULL COMMENT '角色ID', + `menu_id` bigint(20) NOT NULL COMMENT '菜单ID', + PRIMARY KEY (`role_id`, `menu_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色和菜单关联表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_role_menu +-- ---------------------------- +INSERT INTO `sys_role_menu` VALUES (2, 1); +INSERT INTO `sys_role_menu` VALUES (2, 100); +INSERT INTO `sys_role_menu` VALUES (2, 101); +INSERT INTO `sys_role_menu` VALUES (2, 102); +INSERT INTO `sys_role_menu` VALUES (2, 103); +INSERT INTO `sys_role_menu` VALUES (2, 104); +INSERT INTO `sys_role_menu` VALUES (2, 105); +INSERT INTO `sys_role_menu` VALUES (2, 106); +INSERT INTO `sys_role_menu` VALUES (2, 107); +INSERT INTO `sys_role_menu` VALUES (2, 108); +INSERT INTO `sys_role_menu` VALUES (2, 113); +INSERT INTO `sys_role_menu` VALUES (2, 500); +INSERT INTO `sys_role_menu` VALUES (2, 501); +INSERT INTO `sys_role_menu` VALUES (2, 1001); +INSERT INTO `sys_role_menu` VALUES (2, 1002); +INSERT INTO `sys_role_menu` VALUES (2, 1003); +INSERT INTO `sys_role_menu` VALUES (2, 1004); +INSERT INTO `sys_role_menu` VALUES (2, 1005); +INSERT INTO `sys_role_menu` VALUES (2, 1006); +INSERT INTO `sys_role_menu` VALUES (2, 1007); +INSERT INTO `sys_role_menu` VALUES (2, 1008); +INSERT INTO `sys_role_menu` VALUES (2, 1009); +INSERT INTO `sys_role_menu` VALUES (2, 1010); +INSERT INTO `sys_role_menu` VALUES (2, 1011); +INSERT INTO `sys_role_menu` VALUES (2, 1012); +INSERT INTO `sys_role_menu` VALUES (2, 1013); +INSERT INTO `sys_role_menu` VALUES (2, 1014); +INSERT INTO `sys_role_menu` VALUES (2, 1015); +INSERT INTO `sys_role_menu` VALUES (2, 1016); +INSERT INTO `sys_role_menu` VALUES (2, 1017); +INSERT INTO `sys_role_menu` VALUES (2, 1018); +INSERT INTO `sys_role_menu` VALUES (2, 1019); +INSERT INTO `sys_role_menu` VALUES (2, 1020); +INSERT INTO `sys_role_menu` VALUES (2, 1021); +INSERT INTO `sys_role_menu` VALUES (2, 1022); +INSERT INTO `sys_role_menu` VALUES (2, 1023); +INSERT INTO `sys_role_menu` VALUES (2, 1024); +INSERT INTO `sys_role_menu` VALUES (2, 1025); +INSERT INTO `sys_role_menu` VALUES (2, 1026); +INSERT INTO `sys_role_menu` VALUES (2, 1027); +INSERT INTO `sys_role_menu` VALUES (2, 1028); +INSERT INTO `sys_role_menu` VALUES (2, 1029); +INSERT INTO `sys_role_menu` VALUES (2, 1030); +INSERT INTO `sys_role_menu` VALUES (2, 1031); +INSERT INTO `sys_role_menu` VALUES (2, 1032); +INSERT INTO `sys_role_menu` VALUES (2, 1033); +INSERT INTO `sys_role_menu` VALUES (2, 1034); +INSERT INTO `sys_role_menu` VALUES (2, 1035); +INSERT INTO `sys_role_menu` VALUES (2, 1036); +INSERT INTO `sys_role_menu` VALUES (2, 1037); +INSERT INTO `sys_role_menu` VALUES (2, 1038); +INSERT INTO `sys_role_menu` VALUES (2, 1039); +INSERT INTO `sys_role_menu` VALUES (2, 1040); +INSERT INTO `sys_role_menu` VALUES (2, 1041); +INSERT INTO `sys_role_menu` VALUES (2, 1042); +INSERT INTO `sys_role_menu` VALUES (2, 1043); +INSERT INTO `sys_role_menu` VALUES (2, 1044); +INSERT INTO `sys_role_menu` VALUES (2, 1045); +INSERT INTO `sys_role_menu` VALUES (2, 1050); +INSERT INTO `sys_role_menu` VALUES (2, 1775500307898949634); +INSERT INTO `sys_role_menu` VALUES (2, 1775895273104068610); +INSERT INTO `sys_role_menu` VALUES (2, 1775895273104068611); +INSERT INTO `sys_role_menu` VALUES (2, 1775895273104068612); +INSERT INTO `sys_role_menu` VALUES (2, 1775895273104068613); +INSERT INTO `sys_role_menu` VALUES (2, 1775895273104068614); +INSERT INTO `sys_role_menu` VALUES (2, 1775895273104068615); +INSERT INTO `sys_role_menu` VALUES (2, 1780240077690507266); +INSERT INTO `sys_role_menu` VALUES (2, 1780240077690507267); +INSERT INTO `sys_role_menu` VALUES (2, 1780240077690507268); +INSERT INTO `sys_role_menu` VALUES (2, 1780240077690507269); +INSERT INTO `sys_role_menu` VALUES (2, 1780240077690507270); +INSERT INTO `sys_role_menu` VALUES (2, 1780240077690507271); +INSERT INTO `sys_role_menu` VALUES (2, 1780255628576018433); +INSERT INTO `sys_role_menu` VALUES (2, 1780255628576018434); +INSERT INTO `sys_role_menu` VALUES (2, 1780255628576018435); +INSERT INTO `sys_role_menu` VALUES (2, 1780255628576018436); +INSERT INTO `sys_role_menu` VALUES (2, 1780255628576018437); +INSERT INTO `sys_role_menu` VALUES (2, 1780255628576018438); +INSERT INTO `sys_role_menu` VALUES (2, 1786379590171156481); +INSERT INTO `sys_role_menu` VALUES (2, 1786379590171156482); +INSERT INTO `sys_role_menu` VALUES (2, 1786379590171156483); +INSERT INTO `sys_role_menu` VALUES (2, 1786379590171156484); +INSERT INTO `sys_role_menu` VALUES (2, 1786379590171156485); +INSERT INTO `sys_role_menu` VALUES (2, 1786379590171156486); +INSERT INTO `sys_role_menu` VALUES (2, 1787078000285122561); +INSERT INTO `sys_role_menu` VALUES (2, 1810594719028834305); +INSERT INTO `sys_role_menu` VALUES (2, 1810594719028834306); +INSERT INTO `sys_role_menu` VALUES (2, 1810594719028834307); +INSERT INTO `sys_role_menu` VALUES (2, 1810594719028834308); +INSERT INTO `sys_role_menu` VALUES (2, 1810594719028834309); +INSERT INTO `sys_role_menu` VALUES (2, 1810594719028834310); +INSERT INTO `sys_role_menu` VALUES (2, 1843281231381852162); +INSERT INTO `sys_role_menu` VALUES (2, 1860690448695549953); +INSERT INTO `sys_role_menu` VALUES (2, 1898286496441393153); +INSERT INTO `sys_role_menu` VALUES (3, 1); +INSERT INTO `sys_role_menu` VALUES (3, 100); +INSERT INTO `sys_role_menu` VALUES (3, 101); +INSERT INTO `sys_role_menu` VALUES (3, 102); +INSERT INTO `sys_role_menu` VALUES (3, 103); +INSERT INTO `sys_role_menu` VALUES (3, 104); +INSERT INTO `sys_role_menu` VALUES (3, 105); +INSERT INTO `sys_role_menu` VALUES (3, 106); +INSERT INTO `sys_role_menu` VALUES (3, 107); +INSERT INTO `sys_role_menu` VALUES (3, 108); +INSERT INTO `sys_role_menu` VALUES (3, 113); +INSERT INTO `sys_role_menu` VALUES (3, 500); +INSERT INTO `sys_role_menu` VALUES (3, 501); +INSERT INTO `sys_role_menu` VALUES (3, 1001); +INSERT INTO `sys_role_menu` VALUES (3, 1002); +INSERT INTO `sys_role_menu` VALUES (3, 1003); +INSERT INTO `sys_role_menu` VALUES (3, 1004); +INSERT INTO `sys_role_menu` VALUES (3, 1005); +INSERT INTO `sys_role_menu` VALUES (3, 1006); +INSERT INTO `sys_role_menu` VALUES (3, 1007); +INSERT INTO `sys_role_menu` VALUES (3, 1008); +INSERT INTO `sys_role_menu` VALUES (3, 1009); +INSERT INTO `sys_role_menu` VALUES (3, 1010); +INSERT INTO `sys_role_menu` VALUES (3, 1011); +INSERT INTO `sys_role_menu` VALUES (3, 1012); +INSERT INTO `sys_role_menu` VALUES (3, 1013); +INSERT INTO `sys_role_menu` VALUES (3, 1014); +INSERT INTO `sys_role_menu` VALUES (3, 1015); +INSERT INTO `sys_role_menu` VALUES (3, 1016); +INSERT INTO `sys_role_menu` VALUES (3, 1017); +INSERT INTO `sys_role_menu` VALUES (3, 1018); +INSERT INTO `sys_role_menu` VALUES (3, 1019); +INSERT INTO `sys_role_menu` VALUES (3, 1020); +INSERT INTO `sys_role_menu` VALUES (3, 1021); +INSERT INTO `sys_role_menu` VALUES (3, 1022); +INSERT INTO `sys_role_menu` VALUES (3, 1023); +INSERT INTO `sys_role_menu` VALUES (3, 1024); +INSERT INTO `sys_role_menu` VALUES (3, 1025); +INSERT INTO `sys_role_menu` VALUES (3, 1026); +INSERT INTO `sys_role_menu` VALUES (3, 1027); +INSERT INTO `sys_role_menu` VALUES (3, 1028); +INSERT INTO `sys_role_menu` VALUES (3, 1029); +INSERT INTO `sys_role_menu` VALUES (3, 1030); +INSERT INTO `sys_role_menu` VALUES (3, 1031); +INSERT INTO `sys_role_menu` VALUES (3, 1032); +INSERT INTO `sys_role_menu` VALUES (3, 1033); +INSERT INTO `sys_role_menu` VALUES (3, 1034); +INSERT INTO `sys_role_menu` VALUES (3, 1035); +INSERT INTO `sys_role_menu` VALUES (3, 1036); +INSERT INTO `sys_role_menu` VALUES (3, 1037); +INSERT INTO `sys_role_menu` VALUES (3, 1038); +INSERT INTO `sys_role_menu` VALUES (3, 1039); +INSERT INTO `sys_role_menu` VALUES (3, 1040); +INSERT INTO `sys_role_menu` VALUES (3, 1041); +INSERT INTO `sys_role_menu` VALUES (3, 1042); +INSERT INTO `sys_role_menu` VALUES (3, 1043); +INSERT INTO `sys_role_menu` VALUES (3, 1044); +INSERT INTO `sys_role_menu` VALUES (3, 1045); +INSERT INTO `sys_role_menu` VALUES (3, 1050); +INSERT INTO `sys_role_menu` VALUES (3, 1775500307898949634); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 100); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 107); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1001); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1002); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1003); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1004); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1005); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1006); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1007); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1036); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1037); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1038); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1039); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1775500307898949634); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1775895273104068610); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1775895273104068611); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1775895273104068612); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1775895273104068613); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1775895273104068614); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1775895273104068615); +INSERT INTO `sys_role_menu` VALUES (1661661183933177857, 1787078000285122561); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 100); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 101); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 102); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 103); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 104); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 105); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 106); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 107); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 108); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 113); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 500); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 501); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1001); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1002); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1003); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1004); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1005); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1006); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1007); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1008); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1009); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1010); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1011); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1012); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1013); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1014); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1015); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1016); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1017); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1018); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1019); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1020); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1021); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1022); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1023); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1024); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1025); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1026); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1027); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1028); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1029); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1030); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1031); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1032); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1033); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1034); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1035); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1036); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1037); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1038); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1039); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1040); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1041); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1042); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1043); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1044); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1045); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1050); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1775500307898949634); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1775895273104068610); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1775895273104068611); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1775895273104068612); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1775895273104068613); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1775895273104068614); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1775895273104068615); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1780240077690507266); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1780240077690507267); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1780240077690507268); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1780240077690507269); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1780240077690507270); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1780240077690507271); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1780255628576018433); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1780255628576018434); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1780255628576018435); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1780255628576018436); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1780255628576018437); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1780255628576018438); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1786379590171156481); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1786379590171156482); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1786379590171156483); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1786379590171156484); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1786379590171156485); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1786379590171156486); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1787078000285122561); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1810594719028834305); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1810594719028834306); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1810594719028834307); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1810594719028834308); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1810594719028834309); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1810594719028834310); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1843281231381852162); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1860690448695549953); +INSERT INTO `sys_role_menu` VALUES (1729685491108446210, 1898286496441393153); + +-- ---------------------------- +-- Table structure for sys_tenant +-- ---------------------------- +DROP TABLE IF EXISTS `sys_tenant`; +CREATE TABLE `sys_tenant` ( + `id` bigint(20) NOT NULL COMMENT 'id', + `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租户编号', + `contact_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人', + `contact_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话', + `company_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '企业名称', + `license_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '统一社会信用代码', + `address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址', + `intro` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '企业简介', + `domain` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '域名', + `remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + `package_id` bigint(20) NULL DEFAULT NULL COMMENT '租户套餐编号', + `expire_time` datetime NULL DEFAULT NULL COMMENT '过期时间', + `account_count` int(11) NULL DEFAULT -1 COMMENT '用户数量(-1不限制)', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '租户状态(0正常 1停用)', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '租户表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_tenant +-- ---------------------------- +INSERT INTO `sys_tenant` VALUES (1, '000000', '管理组', '15888888888', 'XXX有限公司', NULL, NULL, '多租户通用后台管理管理系统', NULL, NULL, NULL, NULL, -1, '0', '0', 103, 1, '2023-05-14 15:19:39', NULL, NULL); +INSERT INTO `sys_tenant` VALUES (1729685490647072769, '911866', '测试', '11111111111', '5126', '', '', '', '', '', 1729685389795033090, NULL, 1, '0', '2', 103, 1, '2023-11-29 10:15:32', 1, '2023-11-29 10:15:32'); + +-- ---------------------------- +-- Table structure for sys_tenant_package +-- ---------------------------- +DROP TABLE IF EXISTS `sys_tenant_package`; +CREATE TABLE `sys_tenant_package` ( + `package_id` bigint(20) NOT NULL COMMENT '租户套餐id', + `package_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '套餐名称', + `menu_ids` varchar(3000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '关联菜单id', + `remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + `menu_check_strictly` tinyint(1) NULL DEFAULT 1 COMMENT '菜单树选择项是否关联显示', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`package_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '租户套餐表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_tenant_package +-- ---------------------------- +INSERT INTO `sys_tenant_package` VALUES (1729685389795033090, '测试', '1689205943360188417, 1689243466220355585, 1689201668374556674, 1689243465037561858', '', 1, '0', '2', 103, 1, '2023-11-29 10:15:08', 1, '2023-11-29 10:15:08'); + +-- ---------------------------- +-- Table structure for sys_user +-- ---------------------------- +DROP TABLE IF EXISTS `sys_user`; +CREATE TABLE `sys_user` ( + `user_id` bigint(20) NOT NULL COMMENT '用户ID', + `open_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '微信用户标识', + `user_grade` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '用户等级', + `user_balance` double(20, 2) NULL DEFAULT 0.00 COMMENT '账户余额', + `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', + `dept_id` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', + `user_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户账号', + `nick_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户昵称', + `user_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'sys_user' COMMENT '用户类型(sys_user系统用户)', + `user_plan` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'Free' COMMENT '用户套餐', + `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户邮箱', + `phonenumber` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '手机号码', + `sex` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '用户性别(0男 1女 2未知)', + `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像地址', + `wx_avatar` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '微信头像地址', + `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '密码', + `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '帐号状态(0正常 1停用)', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `login_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '最后登录IP', + `login_date` datetime NULL DEFAULT NULL COMMENT '最后登录时间', + `domain_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '注册域名', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`user_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户信息表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_user +-- ---------------------------- +INSERT INTO `sys_user` VALUES (1, NULL, '1', 100.00, '00000', 103, 'admin', '熊猫助手', 'sys_user', 'Free', 'ageerle@163.com', '15888888888', '1', 'http://panda-1253683406.cos.ap-guangzhou.myqcloud.com/panda/2024/10/07/09bd580f55954b50a3093231945123e0.jpg', NULL, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', '2025-03-17 09:46:22', NULL, 103, 1, '2023-05-14 15:19:39', 1, '2025-03-17 09:46:22', '管理员'); +INSERT INTO `sys_user` VALUES (1714176194496339970, NULL, '1', 88.88, '00000', NULL, 'pandarobot@163.com', '问答助手', 'sys_user', 'Free', '', '', '0', 'http://panda-1253683406.cos.ap-guangzhou.myqcloud.com/panda/2024/04/28/346796f5c32744c1987bf28d5820325b.jpg', NULL, '$2a$10$u3LIdNBg6kM3iYqHFJe2IOWCMbT2h5NUI.CeXlF5dyBGcy3nwW836', '1', '2', '127.0.0.1', '2025-03-05 17:18:42', NULL, 103, 1713440206715650049, '2023-10-17 15:07:07', 1714176194496339970, '2025-03-05 17:18:42', NULL); +INSERT INTO `sys_user` VALUES (1898270044544028674, NULL, '1', 1.00, '00000', NULL, '1150039659@qq.com', '1150039659@qq.com', 'sys_user', 'Free', '', '', '0', NULL, NULL, '$2a$10$Mw9T.kzBuYqvT14ZDP2VoORLU9WMWdaT/iatJxEtCQCZoBYBNmKw6', '0', '2', '127.0.0.1', '2025-03-09 23:01:03', '192.168.20.162', NULL, NULL, '2025-03-08 15:10:21', 1898270044544028674, '2025-03-09 23:01:03', NULL); +INSERT INTO `sys_user` VALUES (1898283021590552578, NULL, '0', 1.00, '00000', NULL, '1434841024@qq.com', '1434841024@qq.com', 'sys_user', 'Free', '', '', '0', NULL, NULL, '$2a$10$R6rClsJdJK5Ovhp14Xc0w.IITFBDyocgxWqsJ9SS7AhWW6.vCKiAa', '0', '2', '192.168.20.161', '2025-03-08 17:04:37', '127.0.0.1', NULL, NULL, '2025-03-08 16:01:55', 1898283021590552578, '2025-03-08 17:04:37', NULL); + +-- ---------------------------- +-- Table structure for sys_user_post +-- ---------------------------- +DROP TABLE IF EXISTS `sys_user_post`; +CREATE TABLE `sys_user_post` ( + `user_id` bigint(20) NOT NULL COMMENT '用户ID', + `post_id` bigint(20) NOT NULL COMMENT '岗位ID', + PRIMARY KEY (`user_id`, `post_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户与岗位关联表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_user_post +-- ---------------------------- +INSERT INTO `sys_user_post` VALUES (1, 1); +INSERT INTO `sys_user_post` VALUES (2, 2); +INSERT INTO `sys_user_post` VALUES (1661660085084250114, 2); +INSERT INTO `sys_user_post` VALUES (1661660804847788034, 1); + +-- ---------------------------- +-- Table structure for sys_user_role +-- ---------------------------- +DROP TABLE IF EXISTS `sys_user_role`; +CREATE TABLE `sys_user_role` ( + `user_id` bigint(20) NOT NULL COMMENT '用户ID', + `role_id` bigint(20) NOT NULL COMMENT '角色ID', + PRIMARY KEY (`user_id`, `role_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户和角色关联表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of sys_user_role +-- ---------------------------- +INSERT INTO `sys_user_role` VALUES (1, 1); +INSERT INTO `sys_user_role` VALUES (2, 2); +INSERT INTO `sys_user_role` VALUES (3, 3); +INSERT INTO `sys_user_role` VALUES (4, 4); +INSERT INTO `sys_user_role` VALUES (1661646824293031937, 1661661183933177857); +INSERT INTO `sys_user_role` VALUES (1661660085084250114, 1661661183933177857); +INSERT INTO `sys_user_role` VALUES (1661660804847788034, 2); +INSERT INTO `sys_user_role` VALUES (1713427806956404738, 1); +INSERT INTO `sys_user_role` VALUES (1713439839684689921, 1); +INSERT INTO `sys_user_role` VALUES (1713440206715650049, 1); +INSERT INTO `sys_user_role` VALUES (1714267685998907393, 1); +INSERT INTO `sys_user_role` VALUES (1714269581270667265, 1); +INSERT INTO `sys_user_role` VALUES (1714270420659949569, 1); +INSERT INTO `sys_user_role` VALUES (1714455864827723777, 1); +INSERT INTO `sys_user_role` VALUES (1714536425072115714, 1); +INSERT INTO `sys_user_role` VALUES (1714819715117105153, 1); +INSERT INTO `sys_user_role` VALUES (1714820415783976961, 1); +INSERT INTO `sys_user_role` VALUES (1714820611611836417, 1); +INSERT INTO `sys_user_role` VALUES (1714820755698761729, 1); +INSERT INTO `sys_user_role` VALUES (1714823588305190914, 1); +INSERT INTO `sys_user_role` VALUES (1714829502936530945, 1); +INSERT INTO `sys_user_role` VALUES (1714898663033290754, 1); +INSERT INTO `sys_user_role` VALUES (1714942733206175746, 1); +INSERT INTO `sys_user_role` VALUES (1714943378361434113, 1); +INSERT INTO `sys_user_role` VALUES (1714943388671033346, 1); +INSERT INTO `sys_user_role` VALUES (1714945928464711682, 1); +INSERT INTO `sys_user_role` VALUES (1714946100850606082, 1); +INSERT INTO `sys_user_role` VALUES (1714952355237347329, 1); +INSERT INTO `sys_user_role` VALUES (1714954192279584770, 1); +INSERT INTO `sys_user_role` VALUES (1714960721598758913, 1); +INSERT INTO `sys_user_role` VALUES (1714961357132283906, 1); +INSERT INTO `sys_user_role` VALUES (1714963426656403458, 1); +INSERT INTO `sys_user_role` VALUES (1714980339130318850, 1); +INSERT INTO `sys_user_role` VALUES (1714985002550444034, 1); +INSERT INTO `sys_user_role` VALUES (1714996959085084674, 1); +INSERT INTO `sys_user_role` VALUES (1715000784541990913, 1); +INSERT INTO `sys_user_role` VALUES (1715160830886297602, 1); +INSERT INTO `sys_user_role` VALUES (1715174792021426177, 1); +INSERT INTO `sys_user_role` VALUES (1715176760861278209, 1); +INSERT INTO `sys_user_role` VALUES (1715187418688405506, 1); +INSERT INTO `sys_user_role` VALUES (1715263570077564930, 1); +INSERT INTO `sys_user_role` VALUES (1715273299113820162, 1); +INSERT INTO `sys_user_role` VALUES (1715289765028577281, 1); +INSERT INTO `sys_user_role` VALUES (1715642509052624897, 1); +INSERT INTO `sys_user_role` VALUES (1715645217792868353, 1); +INSERT INTO `sys_user_role` VALUES (1715655140035543041, 1); +INSERT INTO `sys_user_role` VALUES (1715688813166346242, 1); +INSERT INTO `sys_user_role` VALUES (1715695623109623810, 1); +INSERT INTO `sys_user_role` VALUES (1716076523383177217, 1); +INSERT INTO `sys_user_role` VALUES (1716077329079615490, 1); +INSERT INTO `sys_user_role` VALUES (1716316658037178370, 1); +INSERT INTO `sys_user_role` VALUES (1716375479287824386, 1); +INSERT INTO `sys_user_role` VALUES (1716376929359380482, 1); +INSERT INTO `sys_user_role` VALUES (1716449431389487106, 1); +INSERT INTO `sys_user_role` VALUES (1716626232627707906, 1); +INSERT INTO `sys_user_role` VALUES (1716668774639484929, 1); +INSERT INTO `sys_user_role` VALUES (1716723582348050434, 1); +INSERT INTO `sys_user_role` VALUES (1717010625036828674, 1); +INSERT INTO `sys_user_role` VALUES (1717112818712723458, 1); +INSERT INTO `sys_user_role` VALUES (1717171039955599361, 1); +INSERT INTO `sys_user_role` VALUES (1717382776042569730, 1); +INSERT INTO `sys_user_role` VALUES (1717383874597896194, 1); +INSERT INTO `sys_user_role` VALUES (1717463477270102018, 1); +INSERT INTO `sys_user_role` VALUES (1717550755342467074, 1); +INSERT INTO `sys_user_role` VALUES (1718643906618605569, 1); +INSERT INTO `sys_user_role` VALUES (1719357065528623105, 1); +INSERT INTO `sys_user_role` VALUES (1719629669720145921, 1); +INSERT INTO `sys_user_role` VALUES (1719631746265530370, 1); +INSERT INTO `sys_user_role` VALUES (1719969371128086529, 1); +INSERT INTO `sys_user_role` VALUES (1719994192431955970, 1); +INSERT INTO `sys_user_role` VALUES (1720001597920264194, 1); +INSERT INTO `sys_user_role` VALUES (1720054174099718145, 1); +INSERT INTO `sys_user_role` VALUES (1720373256426635265, 1); +INSERT INTO `sys_user_role` VALUES (1720615324298264578, 1); +INSERT INTO `sys_user_role` VALUES (1720966085100191746, 1); +INSERT INTO `sys_user_role` VALUES (1721433118342397954, 1); +INSERT INTO `sys_user_role` VALUES (1721798759096270850, 1); +INSERT INTO `sys_user_role` VALUES (1721869407395332097, 1); +INSERT INTO `sys_user_role` VALUES (1721869952080232450, 1); +INSERT INTO `sys_user_role` VALUES (1722083875718737921, 1); +INSERT INTO `sys_user_role` VALUES (1722126825769185282, 1); +INSERT INTO `sys_user_role` VALUES (1722453238653169665, 1); +INSERT INTO `sys_user_role` VALUES (1722501722198552577, 1); +INSERT INTO `sys_user_role` VALUES (1722546398997819394, 1); +INSERT INTO `sys_user_role` VALUES (1722635856464097281, 1); +INSERT INTO `sys_user_role` VALUES (1722652602847768578, 1); +INSERT INTO `sys_user_role` VALUES (1722787874222682114, 1); +INSERT INTO `sys_user_role` VALUES (1722799180870889473, 1); +INSERT INTO `sys_user_role` VALUES (1722872660475817986, 1); +INSERT INTO `sys_user_role` VALUES (1722874592401600514, 1); +INSERT INTO `sys_user_role` VALUES (1722883137289367554, 1); +INSERT INTO `sys_user_role` VALUES (1722918534182645762, 1); +INSERT INTO `sys_user_role` VALUES (1723173295586848769, 1); +INSERT INTO `sys_user_role` VALUES (1723222687891107841, 1); +INSERT INTO `sys_user_role` VALUES (1723224404040921089, 1); +INSERT INTO `sys_user_role` VALUES (1723225015520112641, 1); +INSERT INTO `sys_user_role` VALUES (1723278284531478529, 1); +INSERT INTO `sys_user_role` VALUES (1723330835209564161, 1); +INSERT INTO `sys_user_role` VALUES (1723708198137147393, 1); +INSERT INTO `sys_user_role` VALUES (1723754683843260417, 1); +INSERT INTO `sys_user_role` VALUES (1723878185250369537, 1); +INSERT INTO `sys_user_role` VALUES (1723940614634254337, 1); +INSERT INTO `sys_user_role` VALUES (1723975861757325314, 1); +INSERT INTO `sys_user_role` VALUES (1724306907803725826, 1); +INSERT INTO `sys_user_role` VALUES (1724308252862492673, 1); +INSERT INTO `sys_user_role` VALUES (1724382895124295681, 1); +INSERT INTO `sys_user_role` VALUES (1724727778758406145, 1); +INSERT INTO `sys_user_role` VALUES (1724815478295425026, 1); +INSERT INTO `sys_user_role` VALUES (1725026071145107458, 1); +INSERT INTO `sys_user_role` VALUES (1725026978817658881, 1); +INSERT INTO `sys_user_role` VALUES (1725043562961457154, 1); +INSERT INTO `sys_user_role` VALUES (1725058936893362178, 1); +INSERT INTO `sys_user_role` VALUES (1725363117009162242, 1); +INSERT INTO `sys_user_role` VALUES (1725538633251049474, 1); +INSERT INTO `sys_user_role` VALUES (1725564937467875329, 1); +INSERT INTO `sys_user_role` VALUES (1725891713243021314, 1); +INSERT INTO `sys_user_role` VALUES (1725905000621932546, 1); +INSERT INTO `sys_user_role` VALUES (1726440708294049793, 1); +INSERT INTO `sys_user_role` VALUES (1726443526979584002, 1); +INSERT INTO `sys_user_role` VALUES (1726445663797116929, 1); +INSERT INTO `sys_user_role` VALUES (1726452867329687553, 1); +INSERT INTO `sys_user_role` VALUES (1726472827451998209, 1); +INSERT INTO `sys_user_role` VALUES (1726479651370696705, 1); +INSERT INTO `sys_user_role` VALUES (1726487492674195458, 1); +INSERT INTO `sys_user_role` VALUES (1726496513055784961, 1); +INSERT INTO `sys_user_role` VALUES (1726498781398302722, 1); +INSERT INTO `sys_user_role` VALUES (1726506873632587778, 1); +INSERT INTO `sys_user_role` VALUES (1726529248394739714, 1); +INSERT INTO `sys_user_role` VALUES (1726578079102664705, 1); +INSERT INTO `sys_user_role` VALUES (1726582181383634946, 1); +INSERT INTO `sys_user_role` VALUES (1726583555672506369, 1); +INSERT INTO `sys_user_role` VALUES (1726596448690372609, 1); +INSERT INTO `sys_user_role` VALUES (1726599361261207553, 1); +INSERT INTO `sys_user_role` VALUES (1726604511749079041, 1); +INSERT INTO `sys_user_role` VALUES (1726606973822304258, 1); +INSERT INTO `sys_user_role` VALUES (1726609379524083713, 1); +INSERT INTO `sys_user_role` VALUES (1726616151265640450, 1); +INSERT INTO `sys_user_role` VALUES (1726775811478126594, 1); +INSERT INTO `sys_user_role` VALUES (1726795490141667329, 1); +INSERT INTO `sys_user_role` VALUES (1726798403169681410, 1); +INSERT INTO `sys_user_role` VALUES (1726830794655399937, 1); +INSERT INTO `sys_user_role` VALUES (1726862038013313026, 1); +INSERT INTO `sys_user_role` VALUES (1726919220696186882, 1); +INSERT INTO `sys_user_role` VALUES (1727140184050630658, 1); +INSERT INTO `sys_user_role` VALUES (1727506163368722433, 1); +INSERT INTO `sys_user_role` VALUES (1727518983086931969, 1); +INSERT INTO `sys_user_role` VALUES (1727580969606840321, 1); +INSERT INTO `sys_user_role` VALUES (1727590505323429890, 1); +INSERT INTO `sys_user_role` VALUES (1727918393172164609, 1); +INSERT INTO `sys_user_role` VALUES (1728249002000121857, 1); +INSERT INTO `sys_user_role` VALUES (1728680561446486017, 1); +INSERT INTO `sys_user_role` VALUES (1728964404182577153, 1); +INSERT INTO `sys_user_role` VALUES (1729020459675611137, 1); +INSERT INTO `sys_user_role` VALUES (1729051002043691009, 1); +INSERT INTO `sys_user_role` VALUES (1729423744832172033, 1); +INSERT INTO `sys_user_role` VALUES (1729429590291050497, 1); +INSERT INTO `sys_user_role` VALUES (1729685493222375426, 1729685491108446210); +INSERT INTO `sys_user_role` VALUES (1730050324466036738, 1); +INSERT INTO `sys_user_role` VALUES (1730102403335254018, 1); +INSERT INTO `sys_user_role` VALUES (1730129923250122754, 1); +INSERT INTO `sys_user_role` VALUES (1730155108925763586, 1); +INSERT INTO `sys_user_role` VALUES (1730273428207366145, 1); +INSERT INTO `sys_user_role` VALUES (1730498722784669697, 1); +INSERT INTO `sys_user_role` VALUES (1730815105229713410, 1); +INSERT INTO `sys_user_role` VALUES (1730858886951923714, 1); +INSERT INTO `sys_user_role` VALUES (1731357405659824130, 1); +INSERT INTO `sys_user_role` VALUES (1731475532557090818, 1); +INSERT INTO `sys_user_role` VALUES (1731480953627901953, 1); +INSERT INTO `sys_user_role` VALUES (1731502381106495490, 1); +INSERT INTO `sys_user_role` VALUES (1731524458442162177, 1); +INSERT INTO `sys_user_role` VALUES (1731524630094053377, 1); +INSERT INTO `sys_user_role` VALUES (1731524650293821441, 1); +INSERT INTO `sys_user_role` VALUES (1731529253710233601, 1); +INSERT INTO `sys_user_role` VALUES (1731559936046432258, 1); +INSERT INTO `sys_user_role` VALUES (1731564032228884482, 1); +INSERT INTO `sys_user_role` VALUES (1731565926737281026, 1); +INSERT INTO `sys_user_role` VALUES (1731566918589513729, 1); +INSERT INTO `sys_user_role` VALUES (1731567740094283778, 1); +INSERT INTO `sys_user_role` VALUES (1731575439263563777, 1); +INSERT INTO `sys_user_role` VALUES (1731583864055824385, 1); +INSERT INTO `sys_user_role` VALUES (1731588155382464513, 1); +INSERT INTO `sys_user_role` VALUES (1731589827840212993, 1); +INSERT INTO `sys_user_role` VALUES (1731635461435719682, 1); +INSERT INTO `sys_user_role` VALUES (1731668049902731266, 1); +INSERT INTO `sys_user_role` VALUES (1731922694168412162, 1); +INSERT INTO `sys_user_role` VALUES (1731944975456305153, 1); +INSERT INTO `sys_user_role` VALUES (1731949019394506753, 1); +INSERT INTO `sys_user_role` VALUES (1731951425054343170, 1); +INSERT INTO `sys_user_role` VALUES (1732000242621513729, 1); +INSERT INTO `sys_user_role` VALUES (1732027163380056066, 1); +INSERT INTO `sys_user_role` VALUES (1732289382269353985, 1); +INSERT INTO `sys_user_role` VALUES (1732289439282528258, 1); +INSERT INTO `sys_user_role` VALUES (1732289699585228801, 1); +INSERT INTO `sys_user_role` VALUES (1732290827173527553, 1); +INSERT INTO `sys_user_role` VALUES (1732291549344595969, 1); +INSERT INTO `sys_user_role` VALUES (1732293265184030721, 1); +INSERT INTO `sys_user_role` VALUES (1732329664117506049, 1); +INSERT INTO `sys_user_role` VALUES (1732334104450990081, 1); +INSERT INTO `sys_user_role` VALUES (1732578671045672962, 1); +INSERT INTO `sys_user_role` VALUES (1732584047426174978, 1); +INSERT INTO `sys_user_role` VALUES (1732608690321129474, 1); +INSERT INTO `sys_user_role` VALUES (1732678147815014401, 1); +INSERT INTO `sys_user_role` VALUES (1732731410102910977, 1); +INSERT INTO `sys_user_role` VALUES (1733005266763939841, 1); +INSERT INTO `sys_user_role` VALUES (1733016149837774850, 1); +INSERT INTO `sys_user_role` VALUES (1733053523871432705, 1); +INSERT INTO `sys_user_role` VALUES (1733061400367497218, 1); +INSERT INTO `sys_user_role` VALUES (1733167090469732353, 1); +INSERT INTO `sys_user_role` VALUES (1733298702729641986, 1); +INSERT INTO `sys_user_role` VALUES (1733488544511983617, 1); +INSERT INTO `sys_user_role` VALUES (1733720554119659521, 1); +INSERT INTO `sys_user_role` VALUES (1733846657777827842, 1); +INSERT INTO `sys_user_role` VALUES (1733859832720031745, 1); +INSERT INTO `sys_user_role` VALUES (1734137817339559938, 1); +INSERT INTO `sys_user_role` VALUES (1734227535762849793, 1); +INSERT INTO `sys_user_role` VALUES (1734492373726560257, 1); +INSERT INTO `sys_user_role` VALUES (1734508040978726914, 1); +INSERT INTO `sys_user_role` VALUES (1734513545461661697, 1); +INSERT INTO `sys_user_role` VALUES (1734581580998451202, 1); +INSERT INTO `sys_user_role` VALUES (1734751884580298754, 1); +INSERT INTO `sys_user_role` VALUES (1734781716483612674, 1); +INSERT INTO `sys_user_role` VALUES (1734833221987278849, 1); +INSERT INTO `sys_user_role` VALUES (1734834063154946050, 1); +INSERT INTO `sys_user_role` VALUES (1734880697666576386, 1); +INSERT INTO `sys_user_role` VALUES (1734891995888427009, 1); +INSERT INTO `sys_user_role` VALUES (1735132534701367297, 1); +INSERT INTO `sys_user_role` VALUES (1735242647239991298, 1); +INSERT INTO `sys_user_role` VALUES (1735486862444273666, 1); +INSERT INTO `sys_user_role` VALUES (1735487912727355394, 1); +INSERT INTO `sys_user_role` VALUES (1735542352767426561, 1); +INSERT INTO `sys_user_role` VALUES (1735551915889598466, 1); +INSERT INTO `sys_user_role` VALUES (1735616653411557377, 1); +INSERT INTO `sys_user_role` VALUES (1735835864146714626, 1); +INSERT INTO `sys_user_role` VALUES (1735953007769100289, 1); +INSERT INTO `sys_user_role` VALUES (1735960189784891393, 1); +INSERT INTO `sys_user_role` VALUES (1736265950381547522, 1); +INSERT INTO `sys_user_role` VALUES (1736577606684844034, 1); +INSERT INTO `sys_user_role` VALUES (1736638822375563266, 1); +INSERT INTO `sys_user_role` VALUES (1736779069306511361, 1); +INSERT INTO `sys_user_role` VALUES (1737028378602053634, 1); +INSERT INTO `sys_user_role` VALUES (1737271234797314050, 1); +INSERT INTO `sys_user_role` VALUES (1737315322405920770, 1); +INSERT INTO `sys_user_role` VALUES (1737445221154234370, 1); +INSERT INTO `sys_user_role` VALUES (1737452907568635906, 1); +INSERT INTO `sys_user_role` VALUES (1737453186955419649, 1); +INSERT INTO `sys_user_role` VALUES (1737717777685880833, 1); +INSERT INTO `sys_user_role` VALUES (1737768515594166274, 1); +INSERT INTO `sys_user_role` VALUES (1738108912170246145, 1); +INSERT INTO `sys_user_role` VALUES (1738118086488825858, 1); +INSERT INTO `sys_user_role` VALUES (1738520430804279297, 1); +INSERT INTO `sys_user_role` VALUES (1738802060248817666, 1); +INSERT INTO `sys_user_role` VALUES (1738812447119712257, 1); +INSERT INTO `sys_user_role` VALUES (1738941480197234689, 1); +INSERT INTO `sys_user_role` VALUES (1738963430776840194, 1); +INSERT INTO `sys_user_role` VALUES (1739121784341995522, 1); +INSERT INTO `sys_user_role` VALUES (1739166931951886338, 1); +INSERT INTO `sys_user_role` VALUES (1739272055240073217, 1); +INSERT INTO `sys_user_role` VALUES (1739451838930427905, 1); +INSERT INTO `sys_user_role` VALUES (1739452037375533057, 1); +INSERT INTO `sys_user_role` VALUES (1739452376946384898, 1); +INSERT INTO `sys_user_role` VALUES (1739484503888961537, 1); +INSERT INTO `sys_user_role` VALUES (1739485282335006722, 1); +INSERT INTO `sys_user_role` VALUES (1739577551431999490, 1); +INSERT INTO `sys_user_role` VALUES (1739825609910591489, 1); +INSERT INTO `sys_user_role` VALUES (1739916453439152130, 1); +INSERT INTO `sys_user_role` VALUES (1740188388454629378, 1); +INSERT INTO `sys_user_role` VALUES (1741339991320580097, 1); +INSERT INTO `sys_user_role` VALUES (1741803737633542145, 1); +INSERT INTO `sys_user_role` VALUES (1741823858229923841, 1); +INSERT INTO `sys_user_role` VALUES (1741845883943227393, 1); +INSERT INTO `sys_user_role` VALUES (1742179775941201921, 1); +INSERT INTO `sys_user_role` VALUES (1742437553771458562, 1); +INSERT INTO `sys_user_role` VALUES (1742451201315254273, 1); +INSERT INTO `sys_user_role` VALUES (1742469913120419841, 1); +INSERT INTO `sys_user_role` VALUES (1742798283280568321, 1); +INSERT INTO `sys_user_role` VALUES (1742798987701342210, 1); +INSERT INTO `sys_user_role` VALUES (1742799476950126594, 1); +INSERT INTO `sys_user_role` VALUES (1742799839619010562, 1); +INSERT INTO `sys_user_role` VALUES (1742801019527057410, 1); +INSERT INTO `sys_user_role` VALUES (1742804073915699202, 1); +INSERT INTO `sys_user_role` VALUES (1742821280687149058, 1); +INSERT INTO `sys_user_role` VALUES (1742821467476283394, 1); +INSERT INTO `sys_user_role` VALUES (1742822775600009217, 1); +INSERT INTO `sys_user_role` VALUES (1742823890928357377, 1); +INSERT INTO `sys_user_role` VALUES (1742838225297821697, 1); +INSERT INTO `sys_user_role` VALUES (1742902317295423490, 1); +INSERT INTO `sys_user_role` VALUES (1742910854243373058, 1); +INSERT INTO `sys_user_role` VALUES (1742961994725150721, 1); +INSERT INTO `sys_user_role` VALUES (1742969861079388161, 1); +INSERT INTO `sys_user_role` VALUES (1743068363130228737, 1); +INSERT INTO `sys_user_role` VALUES (1743075924621479938, 1); +INSERT INTO `sys_user_role` VALUES (1743079200725225474, 1); +INSERT INTO `sys_user_role` VALUES (1743085878682144769, 1); +INSERT INTO `sys_user_role` VALUES (1743110774967586818, 1); +INSERT INTO `sys_user_role` VALUES (1743162481042870274, 1); +INSERT INTO `sys_user_role` VALUES (1743166491284033537, 1); +INSERT INTO `sys_user_role` VALUES (1743251016219447297, 1); +INSERT INTO `sys_user_role` VALUES (1743469820367142914, 1); +INSERT INTO `sys_user_role` VALUES (1743514389280522242, 1); +INSERT INTO `sys_user_role` VALUES (1743519646916083714, 1); +INSERT INTO `sys_user_role` VALUES (1743670356026654722, 1); +INSERT INTO `sys_user_role` VALUES (1743892570516815874, 1); +INSERT INTO `sys_user_role` VALUES (1743952049409146882, 1); +INSERT INTO `sys_user_role` VALUES (1744268693259993089, 1); +INSERT INTO `sys_user_role` VALUES (1744351384550567938, 1); +INSERT INTO `sys_user_role` VALUES (1744561041202278402, 1); +INSERT INTO `sys_user_role` VALUES (1744574752277196801, 1); +INSERT INTO `sys_user_role` VALUES (1744619123995373569, 1); +INSERT INTO `sys_user_role` VALUES (1744627110742913025, 1); +INSERT INTO `sys_user_role` VALUES (1744634408357916673, 1); +INSERT INTO `sys_user_role` VALUES (1744645281965207554, 1); +INSERT INTO `sys_user_role` VALUES (1744724410316156930, 1); +INSERT INTO `sys_user_role` VALUES (1744892307919400962, 1); +INSERT INTO `sys_user_role` VALUES (1744903174606090241, 1); +INSERT INTO `sys_user_role` VALUES (1744904968014983169, 1); +INSERT INTO `sys_user_role` VALUES (1744905787204497410, 1); +INSERT INTO `sys_user_role` VALUES (1744911513595473921, 1); +INSERT INTO `sys_user_role` VALUES (1744912178359103490, 1); +INSERT INTO `sys_user_role` VALUES (1744912486720139266, 1); +INSERT INTO `sys_user_role` VALUES (1744915552240463874, 1); +INSERT INTO `sys_user_role` VALUES (1744923917133869058, 1); +INSERT INTO `sys_user_role` VALUES (1744971513579761666, 1); +INSERT INTO `sys_user_role` VALUES (1744984070818426882, 1); +INSERT INTO `sys_user_role` VALUES (1744984147393835010, 1); +INSERT INTO `sys_user_role` VALUES (1744992401243041793, 1); +INSERT INTO `sys_user_role` VALUES (1745011131444424706, 1); +INSERT INTO `sys_user_role` VALUES (1745061549180514306, 1); +INSERT INTO `sys_user_role` VALUES (1745346479991091201, 1); +INSERT INTO `sys_user_role` VALUES (1745346822607007745, 1); +INSERT INTO `sys_user_role` VALUES (1745368346374217730, 1); +INSERT INTO `sys_user_role` VALUES (1745424741765259266, 1); +INSERT INTO `sys_user_role` VALUES (1745426757090582530, 1); +INSERT INTO `sys_user_role` VALUES (1745620173124575234, 1); +INSERT INTO `sys_user_role` VALUES (1745623876426571777, 1); +INSERT INTO `sys_user_role` VALUES (1745654577691664386, 1); +INSERT INTO `sys_user_role` VALUES (1745663259879972865, 1); +INSERT INTO `sys_user_role` VALUES (1745686038692012034, 1); +INSERT INTO `sys_user_role` VALUES (1745738268480675842, 1); +INSERT INTO `sys_user_role` VALUES (1745790952546017281, 1); +INSERT INTO `sys_user_role` VALUES (1746397384551211009, 1); +INSERT INTO `sys_user_role` VALUES (1746400980533551105, 1); +INSERT INTO `sys_user_role` VALUES (1746522414111039489, 1); +INSERT INTO `sys_user_role` VALUES (1746873386528223234, 1); +INSERT INTO `sys_user_role` VALUES (1747067318369333249, 1); +INSERT INTO `sys_user_role` VALUES (1747071365822361602, 1); +INSERT INTO `sys_user_role` VALUES (1747153912031948801, 1); +INSERT INTO `sys_user_role` VALUES (1747197655195922434, 1); +INSERT INTO `sys_user_role` VALUES (1747519480203390977, 1); +INSERT INTO `sys_user_role` VALUES (1747521265550831618, 1); +INSERT INTO `sys_user_role` VALUES (1747523421662162945, 1); +INSERT INTO `sys_user_role` VALUES (1747797864993075201, 1); +INSERT INTO `sys_user_role` VALUES (1747800427213697025, 1); +INSERT INTO `sys_user_role` VALUES (1747910191046275073, 1); +INSERT INTO `sys_user_role` VALUES (1747923453217419265, 1); +INSERT INTO `sys_user_role` VALUES (1748187110132232193, 1); +INSERT INTO `sys_user_role` VALUES (1748260926648823809, 1); +INSERT INTO `sys_user_role` VALUES (1748276826697445377, 1); +INSERT INTO `sys_user_role` VALUES (1748312313952808962, 1); +INSERT INTO `sys_user_role` VALUES (1748635584837529601, 1); +INSERT INTO `sys_user_role` VALUES (1748642479459610625, 1); +INSERT INTO `sys_user_role` VALUES (1748663294624346114, 1); +INSERT INTO `sys_user_role` VALUES (1748703876608503810, 1); +INSERT INTO `sys_user_role` VALUES (1748704145589219329, 1); +INSERT INTO `sys_user_role` VALUES (1748708285178523649, 1); +INSERT INTO `sys_user_role` VALUES (1748728575929430017, 1); +INSERT INTO `sys_user_role` VALUES (1748761666442047490, 1); +INSERT INTO `sys_user_role` VALUES (1748925826178035713, 1); +INSERT INTO `sys_user_role` VALUES (1749259130492235778, 1); +INSERT INTO `sys_user_role` VALUES (1749280237328871426, 1); +INSERT INTO `sys_user_role` VALUES (1749289400549322754, 1); +INSERT INTO `sys_user_role` VALUES (1749327661225291778, 1); +INSERT INTO `sys_user_role` VALUES (1749365593797636097, 1); +INSERT INTO `sys_user_role` VALUES (1749407786692325378, 1); +INSERT INTO `sys_user_role` VALUES (1749519043344805890, 1); +INSERT INTO `sys_user_role` VALUES (1749683041063219202, 1); +INSERT INTO `sys_user_role` VALUES (1749683546774646786, 1); +INSERT INTO `sys_user_role` VALUES (1749691765567860737, 1); +INSERT INTO `sys_user_role` VALUES (1749705571236917249, 1); +INSERT INTO `sys_user_role` VALUES (1749740828837359618, 1); +INSERT INTO `sys_user_role` VALUES (1749741179162406914, 1); +INSERT INTO `sys_user_role` VALUES (1749741340039131137, 1); +INSERT INTO `sys_user_role` VALUES (1749747618241130497, 1); +INSERT INTO `sys_user_role` VALUES (1749747701439344641, 1); +INSERT INTO `sys_user_role` VALUES (1749786825391157250, 1); +INSERT INTO `sys_user_role` VALUES (1749789665819963394, 1); +INSERT INTO `sys_user_role` VALUES (1749797707705823234, 1); +INSERT INTO `sys_user_role` VALUES (1749974903762210818, 1); +INSERT INTO `sys_user_role` VALUES (1749982777750081537, 1); +INSERT INTO `sys_user_role` VALUES (1749990634667134978, 1); +INSERT INTO `sys_user_role` VALUES (1749991325137653761, 1); +INSERT INTO `sys_user_role` VALUES (1749992779328016386, 1); +INSERT INTO `sys_user_role` VALUES (1749993573204905985, 1); +INSERT INTO `sys_user_role` VALUES (1749994406877351937, 1); +INSERT INTO `sys_user_role` VALUES (1749995279187726337, 1); +INSERT INTO `sys_user_role` VALUES (1749995486029828097, 1); +INSERT INTO `sys_user_role` VALUES (1749995707686211586, 1); +INSERT INTO `sys_user_role` VALUES (1750000406883749890, 1); +INSERT INTO `sys_user_role` VALUES (1750000942706085889, 1); +INSERT INTO `sys_user_role` VALUES (1750005079111913473, 1); +INSERT INTO `sys_user_role` VALUES (1750428606466117633, 1); +INSERT INTO `sys_user_role` VALUES (1750553534423126017, 1); +INSERT INTO `sys_user_role` VALUES (1750690119441469441, 1); +INSERT INTO `sys_user_role` VALUES (1750723725312413698, 1); +INSERT INTO `sys_user_role` VALUES (1750724537434525697, 1); +INSERT INTO `sys_user_role` VALUES (1750743381616119810, 1); +INSERT INTO `sys_user_role` VALUES (1750822931356192769, 1); +INSERT INTO `sys_user_role` VALUES (1750823004563574785, 1); +INSERT INTO `sys_user_role` VALUES (1751548639330177026, 1); +INSERT INTO `sys_user_role` VALUES (1751796140318658561, 1); +INSERT INTO `sys_user_role` VALUES (1751889049818763265, 1); +INSERT INTO `sys_user_role` VALUES (1751896081141600258, 1); +INSERT INTO `sys_user_role` VALUES (1751949653564723201, 1); +INSERT INTO `sys_user_role` VALUES (1751955373517443073, 1); +INSERT INTO `sys_user_role` VALUES (1751980511470292993, 1); +INSERT INTO `sys_user_role` VALUES (1752128867307884546, 1); +INSERT INTO `sys_user_role` VALUES (1752128948195037185, 1); +INSERT INTO `sys_user_role` VALUES (1752138835683708930, 1); +INSERT INTO `sys_user_role` VALUES (1752148500127682561, 1); +INSERT INTO `sys_user_role` VALUES (1752276638077816834, 1); +INSERT INTO `sys_user_role` VALUES (1752299834210521089, 1); +INSERT INTO `sys_user_role` VALUES (1752306117726703618, 1); +INSERT INTO `sys_user_role` VALUES (1752504006021222402, 1); +INSERT INTO `sys_user_role` VALUES (1752602885546840066, 1); +INSERT INTO `sys_user_role` VALUES (1752724639351050242, 1); +INSERT INTO `sys_user_role` VALUES (1753215436756357122, 1); +INSERT INTO `sys_user_role` VALUES (1753402656570216449, 1); +INSERT INTO `sys_user_role` VALUES (1753486557368029185, 1); +INSERT INTO `sys_user_role` VALUES (1753797902466551809, 1); +INSERT INTO `sys_user_role` VALUES (1753967757819908098, 1); +INSERT INTO `sys_user_role` VALUES (1754016754462887938, 1); +INSERT INTO `sys_user_role` VALUES (1754029247868440577, 1); +INSERT INTO `sys_user_role` VALUES (1754413960445562882, 1); +INSERT INTO `sys_user_role` VALUES (1754424078633537538, 1); +INSERT INTO `sys_user_role` VALUES (1754764137119354881, 1); +INSERT INTO `sys_user_role` VALUES (1755042084761899009, 1); +INSERT INTO `sys_user_role` VALUES (1755047141691625473, 1); +INSERT INTO `sys_user_role` VALUES (1756274975479173121, 1); +INSERT INTO `sys_user_role` VALUES (1756308183021260801, 1); +INSERT INTO `sys_user_role` VALUES (1757325877958938626, 1); +INSERT INTO `sys_user_role` VALUES (1758445439802675202, 1); +INSERT INTO `sys_user_role` VALUES (1759032628991234049, 1); +INSERT INTO `sys_user_role` VALUES (1759050804781125634, 1); +INSERT INTO `sys_user_role` VALUES (1759089524834045954, 1); +INSERT INTO `sys_user_role` VALUES (1759092949802029057, 1); +INSERT INTO `sys_user_role` VALUES (1759100324189573121, 1); +INSERT INTO `sys_user_role` VALUES (1759103449889771521, 1); +INSERT INTO `sys_user_role` VALUES (1759147026191749121, 1); +INSERT INTO `sys_user_role` VALUES (1759413482020147202, 1); +INSERT INTO `sys_user_role` VALUES (1759427862430486529, 1); +INSERT INTO `sys_user_role` VALUES (1759428010174844929, 1); +INSERT INTO `sys_user_role` VALUES (1759496088514465794, 1); +INSERT INTO `sys_user_role` VALUES (1759764705965510657, 1); +INSERT INTO `sys_user_role` VALUES (1759777481207320578, 1); +INSERT INTO `sys_user_role` VALUES (1759806155667279873, 1); +INSERT INTO `sys_user_role` VALUES (1759812015655227394, 1); +INSERT INTO `sys_user_role` VALUES (1759815447778693121, 1); +INSERT INTO `sys_user_role` VALUES (1759832486966726658, 1); +INSERT INTO `sys_user_role` VALUES (1759858071113830402, 1); +INSERT INTO `sys_user_role` VALUES (1759863475847827458, 1); +INSERT INTO `sys_user_role` VALUES (1759868018195173378, 1); +INSERT INTO `sys_user_role` VALUES (1759869729374736385, 1); +INSERT INTO `sys_user_role` VALUES (1760186079276175362, 1); +INSERT INTO `sys_user_role` VALUES (1760319626808922114, 1); +INSERT INTO `sys_user_role` VALUES (1760347236137963522, 1); +INSERT INTO `sys_user_role` VALUES (1760358546837868546, 1); +INSERT INTO `sys_user_role` VALUES (1760377107434180609, 1); +INSERT INTO `sys_user_role` VALUES (1760472305161998338, 1); +INSERT INTO `sys_user_role` VALUES (1760472829932343298, 1); +INSERT INTO `sys_user_role` VALUES (1760477732188721153, 1); +INSERT INTO `sys_user_role` VALUES (1760502088176504833, 1); +INSERT INTO `sys_user_role` VALUES (1760508166310203394, 1); +INSERT INTO `sys_user_role` VALUES (1760511294409543681, 1); +INSERT INTO `sys_user_role` VALUES (1760562604135682049, 1); +INSERT INTO `sys_user_role` VALUES (1760841877480280066, 1); +INSERT INTO `sys_user_role` VALUES (1760896840365510658, 1); +INSERT INTO `sys_user_role` VALUES (1760903600501428226, 1); +INSERT INTO `sys_user_role` VALUES (1761404022634844162, 1); +INSERT INTO `sys_user_role` VALUES (1761954868732891138, 1); +INSERT INTO `sys_user_role` VALUES (1761955584197267458, 1); +INSERT INTO `sys_user_role` VALUES (1762003524345401345, 1); +INSERT INTO `sys_user_role` VALUES (1762004833618366465, 1); +INSERT INTO `sys_user_role` VALUES (1762010183880937474, 1); +INSERT INTO `sys_user_role` VALUES (1762298283890839554, 1); +INSERT INTO `sys_user_role` VALUES (1762363188014747649, 1); +INSERT INTO `sys_user_role` VALUES (1762389902388367361, 1); +INSERT INTO `sys_user_role` VALUES (1762401081961746434, 1); +INSERT INTO `sys_user_role` VALUES (1762481911417540610, 1); +INSERT INTO `sys_user_role` VALUES (1762482221645041665, 1); +INSERT INTO `sys_user_role` VALUES (1762482243174404097, 1); +INSERT INTO `sys_user_role` VALUES (1762483838461153282, 1); +INSERT INTO `sys_user_role` VALUES (1762487212380262401, 1); +INSERT INTO `sys_user_role` VALUES (1762498553535008770, 1); +INSERT INTO `sys_user_role` VALUES (1762636163465138177, 1); +INSERT INTO `sys_user_role` VALUES (1762655625413185537, 1); +INSERT INTO `sys_user_role` VALUES (1762656108559257601, 1); +INSERT INTO `sys_user_role` VALUES (1762673833499217922, 1); +INSERT INTO `sys_user_role` VALUES (1762677825344163842, 1); +INSERT INTO `sys_user_role` VALUES (1762677876015550465, 1); +INSERT INTO `sys_user_role` VALUES (1762678082262061057, 1); +INSERT INTO `sys_user_role` VALUES (1762678138012749825, 1); +INSERT INTO `sys_user_role` VALUES (1762678144652333057, 1); +INSERT INTO `sys_user_role` VALUES (1762678174192816129, 1); +INSERT INTO `sys_user_role` VALUES (1762678472563019777, 1); +INSERT INTO `sys_user_role` VALUES (1762678534596775938, 1); +INSERT INTO `sys_user_role` VALUES (1762678534894571521, 1); +INSERT INTO `sys_user_role` VALUES (1762678581635895298, 1); +INSERT INTO `sys_user_role` VALUES (1762678844920745985, 1); +INSERT INTO `sys_user_role` VALUES (1762679194973163522, 1); +INSERT INTO `sys_user_role` VALUES (1762679425299173378, 1); +INSERT INTO `sys_user_role` VALUES (1762679810776682498, 1); +INSERT INTO `sys_user_role` VALUES (1762679862656028674, 1); +INSERT INTO `sys_user_role` VALUES (1762679937360777217, 1); +INSERT INTO `sys_user_role` VALUES (1762680184698884098, 1); +INSERT INTO `sys_user_role` VALUES (1762680290076577794, 1); +INSERT INTO `sys_user_role` VALUES (1762680350055124993, 1); +INSERT INTO `sys_user_role` VALUES (1762681014038614017, 1); +INSERT INTO `sys_user_role` VALUES (1762681042207559681, 1); +INSERT INTO `sys_user_role` VALUES (1762681082732924929, 1); +INSERT INTO `sys_user_role` VALUES (1762681088869191682, 1); +INSERT INTO `sys_user_role` VALUES (1762681283195490306, 1); +INSERT INTO `sys_user_role` VALUES (1762681876752420865, 1); +INSERT INTO `sys_user_role` VALUES (1762681980129431553, 1); +INSERT INTO `sys_user_role` VALUES (1762682038488977410, 1); +INSERT INTO `sys_user_role` VALUES (1762682208211488769, 1); +INSERT INTO `sys_user_role` VALUES (1762683406603833346, 1); +INSERT INTO `sys_user_role` VALUES (1762683500048732162, 1); +INSERT INTO `sys_user_role` VALUES (1762683740843724801, 1); +INSERT INTO `sys_user_role` VALUES (1762683806404890625, 1); +INSERT INTO `sys_user_role` VALUES (1762684131715108865, 1); +INSERT INTO `sys_user_role` VALUES (1762684408442703874, 1); +INSERT INTO `sys_user_role` VALUES (1762684686994821121, 1); +INSERT INTO `sys_user_role` VALUES (1762686405808017409, 1); +INSERT INTO `sys_user_role` VALUES (1762687370061729794, 1); +INSERT INTO `sys_user_role` VALUES (1762687537527705602, 1); +INSERT INTO `sys_user_role` VALUES (1762687814947360769, 1); +INSERT INTO `sys_user_role` VALUES (1762688734347186177, 1); +INSERT INTO `sys_user_role` VALUES (1762690035701305346, 1); +INSERT INTO `sys_user_role` VALUES (1762690104575971330, 1); +INSERT INTO `sys_user_role` VALUES (1762691273243283457, 1); +INSERT INTO `sys_user_role` VALUES (1762691277462753282, 1); +INSERT INTO `sys_user_role` VALUES (1762692468406013954, 1); +INSERT INTO `sys_user_role` VALUES (1762693304498573314, 1); +INSERT INTO `sys_user_role` VALUES (1762693710704332801, 1); +INSERT INTO `sys_user_role` VALUES (1762694382220791809, 1); +INSERT INTO `sys_user_role` VALUES (1762696242545610754, 1); +INSERT INTO `sys_user_role` VALUES (1762696275626086402, 1); +INSERT INTO `sys_user_role` VALUES (1762696945854894082, 1); +INSERT INTO `sys_user_role` VALUES (1762698940057702402, 1); +INSERT INTO `sys_user_role` VALUES (1762699511732948994, 1); +INSERT INTO `sys_user_role` VALUES (1762701338956320769, 1); +INSERT INTO `sys_user_role` VALUES (1762701352860438530, 1); +INSERT INTO `sys_user_role` VALUES (1762703221934575617, 1); +INSERT INTO `sys_user_role` VALUES (1762705239214444546, 1); +INSERT INTO `sys_user_role` VALUES (1762705858788642817, 1); +INSERT INTO `sys_user_role` VALUES (1762706220585111553, 1); +INSERT INTO `sys_user_role` VALUES (1762707979655237633, 1); +INSERT INTO `sys_user_role` VALUES (1762709372369686529, 1); +INSERT INTO `sys_user_role` VALUES (1762717698755186689, 1); +INSERT INTO `sys_user_role` VALUES (1762719280540471297, 1); +INSERT INTO `sys_user_role` VALUES (1762719395619590146, 1); +INSERT INTO `sys_user_role` VALUES (1762721161459322881, 1); +INSERT INTO `sys_user_role` VALUES (1762721300685049857, 1); +INSERT INTO `sys_user_role` VALUES (1762724284441612290, 1); +INSERT INTO `sys_user_role` VALUES (1762728759105474561, 1); +INSERT INTO `sys_user_role` VALUES (1762732886506131458, 1); +INSERT INTO `sys_user_role` VALUES (1762744418904354818, 1); +INSERT INTO `sys_user_role` VALUES (1762749711537188865, 1); +INSERT INTO `sys_user_role` VALUES (1762749741056700418, 1); +INSERT INTO `sys_user_role` VALUES (1762750396991320065, 1); +INSERT INTO `sys_user_role` VALUES (1762752966828797954, 1); +INSERT INTO `sys_user_role` VALUES (1762753464445218817, 1); +INSERT INTO `sys_user_role` VALUES (1762753558548623362, 1); +INSERT INTO `sys_user_role` VALUES (1762755306625478657, 1); +INSERT INTO `sys_user_role` VALUES (1762756726481268737, 1); +INSERT INTO `sys_user_role` VALUES (1762756744172843010, 1); +INSERT INTO `sys_user_role` VALUES (1762760948073410562, 1); +INSERT INTO `sys_user_role` VALUES (1762768424588062721, 1); +INSERT INTO `sys_user_role` VALUES (1762770353779159041, 1); +INSERT INTO `sys_user_role` VALUES (1762770690174922754, 1); +INSERT INTO `sys_user_role` VALUES (1762773352299671554, 1); +INSERT INTO `sys_user_role` VALUES (1762809323107954689, 1); +INSERT INTO `sys_user_role` VALUES (1762839585439133698, 1); +INSERT INTO `sys_user_role` VALUES (1762854389474177026, 1); +INSERT INTO `sys_user_role` VALUES (1762962461110611969, 1); +INSERT INTO `sys_user_role` VALUES (1763011242199920642, 1); +INSERT INTO `sys_user_role` VALUES (1763014994155843586, 1); +INSERT INTO `sys_user_role` VALUES (1763017291741048833, 1); +INSERT INTO `sys_user_role` VALUES (1763021759299760129, 1); +INSERT INTO `sys_user_role` VALUES (1763033286434140162, 1); +INSERT INTO `sys_user_role` VALUES (1763034914528735233, 1); +INSERT INTO `sys_user_role` VALUES (1763039329885138945, 1); +INSERT INTO `sys_user_role` VALUES (1763046791925248001, 1); +INSERT INTO `sys_user_role` VALUES (1763059898533851137, 1); +INSERT INTO `sys_user_role` VALUES (1763074956366229505, 1); +INSERT INTO `sys_user_role` VALUES (1763083906738335746, 1); +INSERT INTO `sys_user_role` VALUES (1763087371808059394, 1); +INSERT INTO `sys_user_role` VALUES (1763110723763351554, 1); +INSERT INTO `sys_user_role` VALUES (1763119583433633794, 1); +INSERT INTO `sys_user_role` VALUES (1763121912195100674, 1); +INSERT INTO `sys_user_role` VALUES (1763150617374142466, 1); +INSERT INTO `sys_user_role` VALUES (1763219512067928065, 1); +INSERT INTO `sys_user_role` VALUES (1763232955600777217, 1); +INSERT INTO `sys_user_role` VALUES (1763234635201425410, 1); +INSERT INTO `sys_user_role` VALUES (1763246126281568257, 1); +INSERT INTO `sys_user_role` VALUES (1763323873230106626, 1); +INSERT INTO `sys_user_role` VALUES (1763384782623387650, 1); +INSERT INTO `sys_user_role` VALUES (1763386804647014401, 1); +INSERT INTO `sys_user_role` VALUES (1763396269777661953, 1); +INSERT INTO `sys_user_role` VALUES (1763405607485353985, 1); +INSERT INTO `sys_user_role` VALUES (1763432831823425537, 1); +INSERT INTO `sys_user_role` VALUES (1763453676952268802, 1); +INSERT INTO `sys_user_role` VALUES (1763456811204653057, 1); +INSERT INTO `sys_user_role` VALUES (1763461579713064962, 1); +INSERT INTO `sys_user_role` VALUES (1763491204732379137, 1); +INSERT INTO `sys_user_role` VALUES (1763497378051612674, 1); +INSERT INTO `sys_user_role` VALUES (1763559058706096130, 1); +INSERT INTO `sys_user_role` VALUES (1763577018824876033, 1); +INSERT INTO `sys_user_role` VALUES (1763633124087521281, 1); +INSERT INTO `sys_user_role` VALUES (1763886812869775362, 1); +INSERT INTO `sys_user_role` VALUES (1763913997563285506, 1); +INSERT INTO `sys_user_role` VALUES (1764173595432013826, 1); +INSERT INTO `sys_user_role` VALUES (1764261292183998465, 1); +INSERT INTO `sys_user_role` VALUES (1764287995094585346, 1); +INSERT INTO `sys_user_role` VALUES (1764461290695774209, 1); +INSERT INTO `sys_user_role` VALUES (1764474718197993473, 1); +INSERT INTO `sys_user_role` VALUES (1764482496870305794, 1); +INSERT INTO `sys_user_role` VALUES (1764495637402439682, 1); +INSERT INTO `sys_user_role` VALUES (1764498159743619073, 1); +INSERT INTO `sys_user_role` VALUES (1764498751559913473, 1); +INSERT INTO `sys_user_role` VALUES (1764514945641828354, 1); +INSERT INTO `sys_user_role` VALUES (1764519088087453698, 1); +INSERT INTO `sys_user_role` VALUES (1764520899728986114, 1); +INSERT INTO `sys_user_role` VALUES (1764525084016988161, 1); +INSERT INTO `sys_user_role` VALUES (1764539443405475842, 1); +INSERT INTO `sys_user_role` VALUES (1764564174649249794, 1); +INSERT INTO `sys_user_role` VALUES (1764583176607977474, 1); +INSERT INTO `sys_user_role` VALUES (1764607755468505089, 1); +INSERT INTO `sys_user_role` VALUES (1764634462757920770, 1); +INSERT INTO `sys_user_role` VALUES (1764827973771915265, 1); +INSERT INTO `sys_user_role` VALUES (1764831906313596929, 1); +INSERT INTO `sys_user_role` VALUES (1764857801929715713, 1); +INSERT INTO `sys_user_role` VALUES (1764882243925913602, 1); +INSERT INTO `sys_user_role` VALUES (1764897874259816449, 1); +INSERT INTO `sys_user_role` VALUES (1764945289142677505, 1); +INSERT INTO `sys_user_role` VALUES (1764973230396354562, 1); +INSERT INTO `sys_user_role` VALUES (1765026702110044161, 1); +INSERT INTO `sys_user_role` VALUES (1765029529888829441, 1); +INSERT INTO `sys_user_role` VALUES (1765032464647532546, 1); +INSERT INTO `sys_user_role` VALUES (1765189908342321154, 1); +INSERT INTO `sys_user_role` VALUES (1765214567611838465, 1); +INSERT INTO `sys_user_role` VALUES (1765219002413035521, 1); +INSERT INTO `sys_user_role` VALUES (1765220951434801153, 1); +INSERT INTO `sys_user_role` VALUES (1765248990147325954, 1); +INSERT INTO `sys_user_role` VALUES (1765249652247572481, 1); +INSERT INTO `sys_user_role` VALUES (1765256689840893953, 1); +INSERT INTO `sys_user_role` VALUES (1765258070287003649, 1); +INSERT INTO `sys_user_role` VALUES (1765276219292069890, 1); +INSERT INTO `sys_user_role` VALUES (1765276256986279938, 1); +INSERT INTO `sys_user_role` VALUES (1765288006737539074, 1); +INSERT INTO `sys_user_role` VALUES (1765312970979094529, 1); +INSERT INTO `sys_user_role` VALUES (1765626857976840193, 1); +INSERT INTO `sys_user_role` VALUES (1765662415604236289, 1); +INSERT INTO `sys_user_role` VALUES (1765673187432546306, 1); +INSERT INTO `sys_user_role` VALUES (1765733893087510530, 1); +INSERT INTO `sys_user_role` VALUES (1765927148689326081, 1); +INSERT INTO `sys_user_role` VALUES (1765946481549279233, 1); +INSERT INTO `sys_user_role` VALUES (1765987575418880002, 1); +INSERT INTO `sys_user_role` VALUES (1765991619675848705, 1); +INSERT INTO `sys_user_role` VALUES (1765997037533822977, 1); +INSERT INTO `sys_user_role` VALUES (1766008273063411714, 1); +INSERT INTO `sys_user_role` VALUES (1766011496348286978, 1); +INSERT INTO `sys_user_role` VALUES (1766017335771561986, 1); +INSERT INTO `sys_user_role` VALUES (1766020112446947329, 1); +INSERT INTO `sys_user_role` VALUES (1766085955713269762, 1); +INSERT INTO `sys_user_role` VALUES (1766102635604639746, 1); +INSERT INTO `sys_user_role` VALUES (1766323008493355009, 1); +INSERT INTO `sys_user_role` VALUES (1766387294112612353, 1); +INSERT INTO `sys_user_role` VALUES (1766842982618136577, 1); +INSERT INTO `sys_user_role` VALUES (1767018925722730497, 1); +INSERT INTO `sys_user_role` VALUES (1767098572703563778, 1); +INSERT INTO `sys_user_role` VALUES (1767193870939488258, 1); +INSERT INTO `sys_user_role` VALUES (1767371461667356673, 1); +INSERT INTO `sys_user_role` VALUES (1767472876167397377, 1); +INSERT INTO `sys_user_role` VALUES (1767484503956684801, 1); +INSERT INTO `sys_user_role` VALUES (1767494435045146626, 1); +INSERT INTO `sys_user_role` VALUES (1767502928200368129, 1); +INSERT INTO `sys_user_role` VALUES (1767790695329333250, 1); +INSERT INTO `sys_user_role` VALUES (1767797421759823874, 1); +INSERT INTO `sys_user_role` VALUES (1767867514107756545, 1); +INSERT INTO `sys_user_role` VALUES (1768123513418842114, 1); +INSERT INTO `sys_user_role` VALUES (1768125846164897794, 1); +INSERT INTO `sys_user_role` VALUES (1768137512021688322, 1); +INSERT INTO `sys_user_role` VALUES (1768172797870768129, 1); +INSERT INTO `sys_user_role` VALUES (1768257272084463617, 1); +INSERT INTO `sys_user_role` VALUES (1768452168263172097, 1); +INSERT INTO `sys_user_role` VALUES (1768487959811096578, 1); +INSERT INTO `sys_user_role` VALUES (1768522172358754306, 1); +INSERT INTO `sys_user_role` VALUES (1768523379651411969, 1); +INSERT INTO `sys_user_role` VALUES (1768528826072596482, 1); +INSERT INTO `sys_user_role` VALUES (1768554562896560130, 1); +INSERT INTO `sys_user_role` VALUES (1768560191165988866, 1); +INSERT INTO `sys_user_role` VALUES (1768560307197214722, 1); +INSERT INTO `sys_user_role` VALUES (1768561334289989633, 1); +INSERT INTO `sys_user_role` VALUES (1768565063735083009, 1); +INSERT INTO `sys_user_role` VALUES (1768570261782167553, 1); +INSERT INTO `sys_user_role` VALUES (1768598711431626753, 1); +INSERT INTO `sys_user_role` VALUES (1768635967806668802, 1); +INSERT INTO `sys_user_role` VALUES (1768887604487946241, 1); +INSERT INTO `sys_user_role` VALUES (1768911351987077122, 1); +INSERT INTO `sys_user_role` VALUES (1769186172289449986, 1); +INSERT INTO `sys_user_role` VALUES (1769408371134857218, 1); +INSERT INTO `sys_user_role` VALUES (1769520576635371521, 1); +INSERT INTO `sys_user_role` VALUES (1769561862704758786, 1); +INSERT INTO `sys_user_role` VALUES (1769569234722521089, 1); +INSERT INTO `sys_user_role` VALUES (1769607528399273986, 1); +INSERT INTO `sys_user_role` VALUES (1769617177890553857, 1); +INSERT INTO `sys_user_role` VALUES (1769663440459694082, 1); +INSERT INTO `sys_user_role` VALUES (1769908456541233154, 1); +INSERT INTO `sys_user_role` VALUES (1769957357877043201, 1); +INSERT INTO `sys_user_role` VALUES (1770021611783168002, 1); +INSERT INTO `sys_user_role` VALUES (1770063295095087106, 1); +INSERT INTO `sys_user_role` VALUES (1770063700436819970, 1); +INSERT INTO `sys_user_role` VALUES (1770281104395837442, 1); +INSERT INTO `sys_user_role` VALUES (1770288338521661441, 1); +INSERT INTO `sys_user_role` VALUES (1770322814056333313, 1); +INSERT INTO `sys_user_role` VALUES (1770338641849679874, 1); +INSERT INTO `sys_user_role` VALUES (1770351581952802817, 1); +INSERT INTO `sys_user_role` VALUES (1770357305466486786, 1); +INSERT INTO `sys_user_role` VALUES (1770364755406028802, 1); +INSERT INTO `sys_user_role` VALUES (1770381062524436482, 1); +INSERT INTO `sys_user_role` VALUES (1770470677998534657, 1); +INSERT INTO `sys_user_role` VALUES (1770642413331218434, 1); +INSERT INTO `sys_user_role` VALUES (1770648858382630914, 1); +INSERT INTO `sys_user_role` VALUES (1770715116272680962, 1); +INSERT INTO `sys_user_role` VALUES (1770720646688997377, 1); +INSERT INTO `sys_user_role` VALUES (1770726609303175170, 1); +INSERT INTO `sys_user_role` VALUES (1770757521378181121, 1); +INSERT INTO `sys_user_role` VALUES (1770759021907214338, 1); +INSERT INTO `sys_user_role` VALUES (1771002145573240833, 1); +INSERT INTO `sys_user_role` VALUES (1771019340902629377, 1); +INSERT INTO `sys_user_role` VALUES (1771085212270788610, 1); +INSERT INTO `sys_user_role` VALUES (1771091102206066689, 1); +INSERT INTO `sys_user_role` VALUES (1771105696307806210, 1); +INSERT INTO `sys_user_role` VALUES (1771529088861274114, 1); +INSERT INTO `sys_user_role` VALUES (1772148936234565634, 1); +INSERT INTO `sys_user_role` VALUES (1772170742823714818, 1); +INSERT INTO `sys_user_role` VALUES (1772173596070313986, 1); +INSERT INTO `sys_user_role` VALUES (1772181791232819201, 1); +INSERT INTO `sys_user_role` VALUES (1772807697592832001, 1); +INSERT INTO `sys_user_role` VALUES (1772821509767254018, 1); +INSERT INTO `sys_user_role` VALUES (1772947270113251330, 1); +INSERT INTO `sys_user_role` VALUES (1773149840576434178, 1); +INSERT INTO `sys_user_role` VALUES (1773180693536919554, 1); +INSERT INTO `sys_user_role` VALUES (1773192472325345282, 1); +INSERT INTO `sys_user_role` VALUES (1773200350612377601, 1); +INSERT INTO `sys_user_role` VALUES (1773307685607395329, 1); +INSERT INTO `sys_user_role` VALUES (1773529379840282625, 1); +INSERT INTO `sys_user_role` VALUES (1773543535003914241, 1); +INSERT INTO `sys_user_role` VALUES (1773615949826052097, 1); +INSERT INTO `sys_user_role` VALUES (1773714968015278082, 1); +INSERT INTO `sys_user_role` VALUES (1773741523022123010, 1); +INSERT INTO `sys_user_role` VALUES (1773774290929848321, 1); +INSERT INTO `sys_user_role` VALUES (1773969452180258818, 1); +INSERT INTO `sys_user_role` VALUES (1774094144111198210, 1); +INSERT INTO `sys_user_role` VALUES (1774326191970926594, 1); +INSERT INTO `sys_user_role` VALUES (1774595110106685441, 1); +INSERT INTO `sys_user_role` VALUES (1774603290157113346, 1); +INSERT INTO `sys_user_role` VALUES (1774671916088287233, 1); +INSERT INTO `sys_user_role` VALUES (1774712059876728833, 1); +INSERT INTO `sys_user_role` VALUES (1775005868787359746, 1); +INSERT INTO `sys_user_role` VALUES (1775039514470637569, 1); +INSERT INTO `sys_user_role` VALUES (1775046202846208002, 1); +INSERT INTO `sys_user_role` VALUES (1775055115012399106, 1); +INSERT INTO `sys_user_role` VALUES (1775058985780371458, 1); +INSERT INTO `sys_user_role` VALUES (1775066829695082497, 1); +INSERT INTO `sys_user_role` VALUES (1775078808497283074, 1); +INSERT INTO `sys_user_role` VALUES (1775109977754427393, 1); +INSERT INTO `sys_user_role` VALUES (1775109977771204609, 1); +INSERT INTO `sys_user_role` VALUES (1775192704981786626, 1); +INSERT INTO `sys_user_role` VALUES (1775421589681987586, 1); +INSERT INTO `sys_user_role` VALUES (1776124571507613697, 1); +INSERT INTO `sys_user_role` VALUES (1776550027549597698, 1); +INSERT INTO `sys_user_role` VALUES (1776815081159254018, 1); +INSERT INTO `sys_user_role` VALUES (1776827459129171969, 1); +INSERT INTO `sys_user_role` VALUES (1776861348769947650, 1); +INSERT INTO `sys_user_role` VALUES (1776864185373548546, 1); +INSERT INTO `sys_user_role` VALUES (1776871215274516482, 1); +INSERT INTO `sys_user_role` VALUES (1776872376396275714, 1); +INSERT INTO `sys_user_role` VALUES (1776889562355589122, 1); +INSERT INTO `sys_user_role` VALUES (1777118704363757570, 1); +INSERT INTO `sys_user_role` VALUES (1777126438664527874, 1); +INSERT INTO `sys_user_role` VALUES (1777157190659727362, 1); +INSERT INTO `sys_user_role` VALUES (1777217669537062914, 1); +INSERT INTO `sys_user_role` VALUES (1777220647320936449, 1); +INSERT INTO `sys_user_role` VALUES (1777252116550508545, 1); +INSERT INTO `sys_user_role` VALUES (1777260896986193921, 1); +INSERT INTO `sys_user_role` VALUES (1777296499484254210, 1); +INSERT INTO `sys_user_role` VALUES (1777301747972038657, 1); +INSERT INTO `sys_user_role` VALUES (1777363539016409089, 1); +INSERT INTO `sys_user_role` VALUES (1777483372982820866, 1); +INSERT INTO `sys_user_role` VALUES (1777537906459402242, 1); +INSERT INTO `sys_user_role` VALUES (1777610641428570114, 1); +INSERT INTO `sys_user_role` VALUES (1777613556604067842, 1); +INSERT INTO `sys_user_role` VALUES (1777718773123244034, 1); +INSERT INTO `sys_user_role` VALUES (1777743939492503554, 1); +INSERT INTO `sys_user_role` VALUES (1777887539056467969, 1); +INSERT INTO `sys_user_role` VALUES (1777887799262699521, 1); +INSERT INTO `sys_user_role` VALUES (1777890253115088897, 1); +INSERT INTO `sys_user_role` VALUES (1777909423068274689, 1); +INSERT INTO `sys_user_role` VALUES (1777930481544585218, 1); +INSERT INTO `sys_user_role` VALUES (1777954050559303681, 1); +INSERT INTO `sys_user_role` VALUES (1778078614597525506, 1); +INSERT INTO `sys_user_role` VALUES (1778307871026307073, 1); +INSERT INTO `sys_user_role` VALUES (1778341191034462209, 1); +INSERT INTO `sys_user_role` VALUES (1778352526686281729, 1); +INSERT INTO `sys_user_role` VALUES (1778591039688138754, 1); +INSERT INTO `sys_user_role` VALUES (1778625241280274433, 1); +INSERT INTO `sys_user_role` VALUES (1778645603636338689, 1); +INSERT INTO `sys_user_role` VALUES (1779329016437530626, 1); +INSERT INTO `sys_user_role` VALUES (1779509451201306625, 1); +INSERT INTO `sys_user_role` VALUES (1781359789389049858, 1); +INSERT INTO `sys_user_role` VALUES (1781463900025450497, 1); +INSERT INTO `sys_user_role` VALUES (1781519961809940482, 1); +INSERT INTO `sys_user_role` VALUES (1781570458679963650, 1); +INSERT INTO `sys_user_role` VALUES (1781679536911609858, 1); +INSERT INTO `sys_user_role` VALUES (1781680345497923586, 1); +INSERT INTO `sys_user_role` VALUES (1781938051479711745, 1); +INSERT INTO `sys_user_role` VALUES (1781979644345659393, 1); +INSERT INTO `sys_user_role` VALUES (1781982608724537345, 1); +INSERT INTO `sys_user_role` VALUES (1782339521316294658, 1); +INSERT INTO `sys_user_role` VALUES (1782584811885596674, 1); +INSERT INTO `sys_user_role` VALUES (1782597966938411009, 1); +INSERT INTO `sys_user_role` VALUES (1782598345608564738, 1); +INSERT INTO `sys_user_role` VALUES (1782599696132509698, 1); +INSERT INTO `sys_user_role` VALUES (1782655923667505153, 1); +INSERT INTO `sys_user_role` VALUES (1782658558470557698, 1); +INSERT INTO `sys_user_role` VALUES (1782697212870037505, 1); +INSERT INTO `sys_user_role` VALUES (1782711689380270082, 1); +INSERT INTO `sys_user_role` VALUES (1782733890905083906, 1); +INSERT INTO `sys_user_role` VALUES (1782734018948796418, 1); +INSERT INTO `sys_user_role` VALUES (1782741134992379906, 1); +INSERT INTO `sys_user_role` VALUES (1782926062560382978, 1); +INSERT INTO `sys_user_role` VALUES (1782941277477834753, 1); +INSERT INTO `sys_user_role` VALUES (1782982532157050881, 1); +INSERT INTO `sys_user_role` VALUES (1783068876598317057, 1); +INSERT INTO `sys_user_role` VALUES (1783086777506107393, 1); +INSERT INTO `sys_user_role` VALUES (1783144268357079041, 1); +INSERT INTO `sys_user_role` VALUES (1783297415947915265, 1); +INSERT INTO `sys_user_role` VALUES (1783310569679523841, 1); +INSERT INTO `sys_user_role` VALUES (1783326930816372738, 1); +INSERT INTO `sys_user_role` VALUES (1783358421143293953, 1); +INSERT INTO `sys_user_role` VALUES (1783421941125910530, 1); +INSERT INTO `sys_user_role` VALUES (1783439451980206081, 1); +INSERT INTO `sys_user_role` VALUES (1783471940098494466, 1); +INSERT INTO `sys_user_role` VALUES (1783777388311777281, 1); +INSERT INTO `sys_user_role` VALUES (1783796572785643521, 1); +INSERT INTO `sys_user_role` VALUES (1783877442208960514, 1); +INSERT INTO `sys_user_role` VALUES (1784199358216048642, 1); +INSERT INTO `sys_user_role` VALUES (1784389326918029313, 1); +INSERT INTO `sys_user_role` VALUES (1784400528377286657, 1); +INSERT INTO `sys_user_role` VALUES (1784435756558880770, 1); +INSERT INTO `sys_user_role` VALUES (1784457537797656577, 1); +INSERT INTO `sys_user_role` VALUES (1784521057603538945, 1); +INSERT INTO `sys_user_role` VALUES (1784522252246724609, 1); +INSERT INTO `sys_user_role` VALUES (1784548227567202306, 1); +INSERT INTO `sys_user_role` VALUES (1784569508068995073, 1); +INSERT INTO `sys_user_role` VALUES (1784777389905162242, 1); +INSERT INTO `sys_user_role` VALUES (1784783910114308097, 1); +INSERT INTO `sys_user_role` VALUES (1784821184902344705, 1); +INSERT INTO `sys_user_role` VALUES (1784838825360633858, 1); +INSERT INTO `sys_user_role` VALUES (1784870260805087233, 1); +INSERT INTO `sys_user_role` VALUES (1784910451020279810, 1); +INSERT INTO `sys_user_role` VALUES (1785130539233193985, 1); +INSERT INTO `sys_user_role` VALUES (1785240710601125890, 1); +INSERT INTO `sys_user_role` VALUES (1785360485289439233, 1); +INSERT INTO `sys_user_role` VALUES (1785588726424023041, 1); +INSERT INTO `sys_user_role` VALUES (1785975035152019458, 1); +INSERT INTO `sys_user_role` VALUES (1786448824117735425, 1); +INSERT INTO `sys_user_role` VALUES (1787036511853850625, 1); +INSERT INTO `sys_user_role` VALUES (1787040098730356738, 1); +INSERT INTO `sys_user_role` VALUES (1787442869522636802, 1); +INSERT INTO `sys_user_role` VALUES (1787802087576530946, 1); +INSERT INTO `sys_user_role` VALUES (1787878100067119105, 1); +INSERT INTO `sys_user_role` VALUES (1788016335816716290, 1); +INSERT INTO `sys_user_role` VALUES (1788135951385718786, 1); +INSERT INTO `sys_user_role` VALUES (1788136924611047425, 1); +INSERT INTO `sys_user_role` VALUES (1788564791958401026, 1); +INSERT INTO `sys_user_role` VALUES (1788861563763126273, 1); +INSERT INTO `sys_user_role` VALUES (1789104577664217090, 1); +INSERT INTO `sys_user_role` VALUES (1789215891946434561, 1); +INSERT INTO `sys_user_role` VALUES (1789891068120231937, 1); +INSERT INTO `sys_user_role` VALUES (1789916787885961218, 1); +INSERT INTO `sys_user_role` VALUES (1790285085844664322, 1); +INSERT INTO `sys_user_role` VALUES (1790395963663413250, 1); +INSERT INTO `sys_user_role` VALUES (1790626495441698817, 1); +INSERT INTO `sys_user_role` VALUES (1790733204311015425, 1); +INSERT INTO `sys_user_role` VALUES (1790747738857832449, 1); +INSERT INTO `sys_user_role` VALUES (1790893072141549570, 1); +INSERT INTO `sys_user_role` VALUES (1790953693902045186, 1); +INSERT INTO `sys_user_role` VALUES (1790986267617689601, 1); +INSERT INTO `sys_user_role` VALUES (1791058271444172801, 1); +INSERT INTO `sys_user_role` VALUES (1791123542645178370, 1); +INSERT INTO `sys_user_role` VALUES (1791170948304764929, 1); +INSERT INTO `sys_user_role` VALUES (1791173160204533762, 1); +INSERT INTO `sys_user_role` VALUES (1791181681805524994, 1); +INSERT INTO `sys_user_role` VALUES (1791184448041287681, 1); +INSERT INTO `sys_user_role` VALUES (1791281872491544578, 1); +INSERT INTO `sys_user_role` VALUES (1791281970680201217, 1); +INSERT INTO `sys_user_role` VALUES (1791283037744693249, 1); +INSERT INTO `sys_user_role` VALUES (1791285337913589762, 1); +INSERT INTO `sys_user_role` VALUES (1791289816255856641, 1); +INSERT INTO `sys_user_role` VALUES (1791296357612683266, 1); +INSERT INTO `sys_user_role` VALUES (1791299213191315457, 1); +INSERT INTO `sys_user_role` VALUES (1791308308178829314, 1); +INSERT INTO `sys_user_role` VALUES (1791318977032781826, 1); +INSERT INTO `sys_user_role` VALUES (1791371260403687425, 1); +INSERT INTO `sys_user_role` VALUES (1791387421707116546, 1); +INSERT INTO `sys_user_role` VALUES (1791447204858470402, 1); +INSERT INTO `sys_user_role` VALUES (1791729117863124993, 1); +INSERT INTO `sys_user_role` VALUES (1793165965818912770, 1); +INSERT INTO `sys_user_role` VALUES (1793568337082740737, 1); +INSERT INTO `sys_user_role` VALUES (1794560044937154561, 1); +INSERT INTO `sys_user_role` VALUES (1794749939555143681, 1); +INSERT INTO `sys_user_role` VALUES (1795107096276410369, 1); +INSERT INTO `sys_user_role` VALUES (1795403915137032194, 1); +INSERT INTO `sys_user_role` VALUES (1795789913440296962, 1); +INSERT INTO `sys_user_role` VALUES (1796141206390349825, 1); +INSERT INTO `sys_user_role` VALUES (1796355287995031553, 1); +INSERT INTO `sys_user_role` VALUES (1796407753490997250, 1); +INSERT INTO `sys_user_role` VALUES (1796463188688412674, 1); +INSERT INTO `sys_user_role` VALUES (1796906411999272961, 1); +INSERT INTO `sys_user_role` VALUES (1797537246867791874, 1); +INSERT INTO `sys_user_role` VALUES (1797817711835127809, 1); +INSERT INTO `sys_user_role` VALUES (1797909973524979713, 1); +INSERT INTO `sys_user_role` VALUES (1798175479586791425, 1); +INSERT INTO `sys_user_role` VALUES (1798235243616313345, 1); +INSERT INTO `sys_user_role` VALUES (1798520237534388226, 1); +INSERT INTO `sys_user_role` VALUES (1798712494199840770, 1); +INSERT INTO `sys_user_role` VALUES (1799280384053518338, 1); +INSERT INTO `sys_user_role` VALUES (1799744018567307266, 1); +INSERT INTO `sys_user_role` VALUES (1800533174780338178, 1); +INSERT INTO `sys_user_role` VALUES (1800536812638609409, 1); +INSERT INTO `sys_user_role` VALUES (1800674959565430786, 1); +INSERT INTO `sys_user_role` VALUES (1801079442480996354, 1); +INSERT INTO `sys_user_role` VALUES (1801092008536088577, 1); +INSERT INTO `sys_user_role` VALUES (1801164484339212289, 1); +INSERT INTO `sys_user_role` VALUES (1801390702451924994, 1); +INSERT INTO `sys_user_role` VALUES (1801448239394103297, 1); +INSERT INTO `sys_user_role` VALUES (1801450423980564482, 1); +INSERT INTO `sys_user_role` VALUES (1801600035647299585, 1); +INSERT INTO `sys_user_role` VALUES (1801917626890756098, 1); +INSERT INTO `sys_user_role` VALUES (1802151483346952194, 1); +INSERT INTO `sys_user_role` VALUES (1802185387541962754, 1); +INSERT INTO `sys_user_role` VALUES (1802352201437716481, 1); +INSERT INTO `sys_user_role` VALUES (1802595299652706305, 1); +INSERT INTO `sys_user_role` VALUES (1802615605641519105, 1); +INSERT INTO `sys_user_role` VALUES (1802884960002416641, 1); +INSERT INTO `sys_user_role` VALUES (1803244799710896130, 1); +INSERT INTO `sys_user_role` VALUES (1803310345022251010, 1); +INSERT INTO `sys_user_role` VALUES (1803350775793360898, 1); +INSERT INTO `sys_user_role` VALUES (1803952381528145922, 1); +INSERT INTO `sys_user_role` VALUES (1804409446046400513, 1); +INSERT INTO `sys_user_role` VALUES (1804412156426616834, 1); +INSERT INTO `sys_user_role` VALUES (1805074712967282689, 1); +INSERT INTO `sys_user_role` VALUES (1806151742303535105, 1); +INSERT INTO `sys_user_role` VALUES (1806589360086482945, 1); +INSERT INTO `sys_user_role` VALUES (1806743654970458113, 1); +INSERT INTO `sys_user_role` VALUES (1807019618258419713, 1); +INSERT INTO `sys_user_role` VALUES (1807670449198628866, 1); +INSERT INTO `sys_user_role` VALUES (1808432476074573826, 1); +INSERT INTO `sys_user_role` VALUES (1809093167261450242, 1); +INSERT INTO `sys_user_role` VALUES (1809123002226606082, 1); +INSERT INTO `sys_user_role` VALUES (1811926844047654913, 1); +INSERT INTO `sys_user_role` VALUES (1813103212164841473, 1); +INSERT INTO `sys_user_role` VALUES (1815634871045087233, 1); +INSERT INTO `sys_user_role` VALUES (1816485229208297473, 1); +INSERT INTO `sys_user_role` VALUES (1821084376519434241, 1); +INSERT INTO `sys_user_role` VALUES (1821169552259833858, 1); +INSERT INTO `sys_user_role` VALUES (1821804728467873793, 1); +INSERT INTO `sys_user_role` VALUES (1822834793930637314, 1); +INSERT INTO `sys_user_role` VALUES (1822959243497914370, 1); +INSERT INTO `sys_user_role` VALUES (1826249520908156930, 1); +INSERT INTO `sys_user_role` VALUES (1829035060720123905, 1); +INSERT INTO `sys_user_role` VALUES (1831211798115991553, 1); +INSERT INTO `sys_user_role` VALUES (1831273555001950210, 1); +INSERT INTO `sys_user_role` VALUES (1834083211252416513, 1); +INSERT INTO `sys_user_role` VALUES (1838475187125043201, 1); +INSERT INTO `sys_user_role` VALUES (1846455089220632577, 1); +INSERT INTO `sys_user_role` VALUES (1847910185208987649, 1); +INSERT INTO `sys_user_role` VALUES (1871910972567822337, 1); +INSERT INTO `sys_user_role` VALUES (1897620177094057985, 1); + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/script/sql/update/update20250302.sql b/script/sql/update/update20250302.sql new file mode 100644 index 0000000..b3aa42b --- /dev/null +++ b/script/sql/update/update20250302.sql @@ -0,0 +1 @@ +ALTER TABLE `knowledge_info` ADD COLUMN `share` tinyint(4) NULL DEFAULT NULL COMMENT '是否公开知识库(0 否 1是)' AFTER `kname`; diff --git a/script/sql/update/update20250307.sql b/script/sql/update/update20250307.sql new file mode 100644 index 0000000..7c2087b --- /dev/null +++ b/script/sql/update/update20250307.sql @@ -0,0 +1,18 @@ +ALTER TABLE `knowledge_info` + ADD COLUMN `knowledge_separator` varchar(255) NULL COMMENT '知识分隔符' AFTER `create_by`, +ADD COLUMN `question_separator` varchar(255) NULL COMMENT '提问分隔符' AFTER `knowledge_separator`, +ADD COLUMN `overlap_char` int NULL COMMENT '重叠字符数' AFTER `question_separator`, +ADD COLUMN `retrieve_limit` int NULL COMMENT '知识库中检索的条数' AFTER `overlap_char`, +ADD COLUMN `text_block_size` int NULL COMMENT '文本块大小' AFTER `retrieve_limit`, +ADD COLUMN `vector` varchar(50) NULL COMMENT '向量库' AFTER `text_block_size`, +ADD COLUMN `vector_model` varchar(50) NULL COMMENT '向量模型' AFTER `vector`; + + +INSERT INTO `chat_config` (`id`, `category`, `config_name`, `config_value`, `config_dict`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`) VALUES (1897610056458412050, 'weaviate', 'protocol', 'http', '协议', 103, '2025-03-06 21:10:02', '1', '1', '2025-03-06 21:10:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` (`id`, `category`, `config_name`, `config_value`, `config_dict`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`) VALUES (1897610056458412051, 'weaviate', 'host', '127.0.0.1:6038', '地址', 103, '2025-03-06 21:10:02', '1', '1', '2025-03-06 21:10:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` (`id`, `category`, `config_name`, `config_value`, `config_dict`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`) VALUES (1897610056458412052, 'weaviate', 'classname', 'LocalKnowledge', '分类名称', 103, '2025-03-06 21:10:02', '1', '1', '2025-03-06 21:10:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` (`id`, `category`, `config_name`, `config_value`, `config_dict`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`) VALUES (1897610056458412053, 'milvus', 'host', '127.0.0.1', '地址', 103, '2025-03-06 21:10:02', '1', '1', '2025-03-06 21:10:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` (`id`, `category`, `config_name`, `config_value`, `config_dict`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`) VALUES (1897610056458412054, 'milvus', 'port', '19530', '端口', 103, '2025-03-06 21:10:02', '1', '1', '2025-03-06 21:10:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` (`id`, `category`, `config_name`, `config_value`, `config_dict`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`) VALUES (1897610056458412055, 'milvus', 'dimension', '1536', '维度', 103, '2025-03-06 21:10:02', '1', '1', '2025-03-06 21:10:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` (`id`, `category`, `config_name`, `config_value`, `config_dict`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`) VALUES (1897610056458412056, 'milvus', 'collection', 'LocalKnowledge', '分类名称', 103, '2025-03-06 21:10:02', '1', '1', '2025-03-06 21:10:31', NULL, NULL, '0', NULL, 0); +INSERT INTO `chat_config` (`id`, `category`, `config_name`, `config_value`, `config_dict`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`) VALUES (1897610056458412057, 'zhipu', 'key', '', '智谱清言key', 103, '2025-03-12 00:13:12', '1', '1', '2025-03-12 00:13:10', NULL, NULL, '0', NULL, 0); diff --git a/script/sql/update/update20250328.sql b/script/sql/update/update20250328.sql new file mode 100644 index 0000000..3f703ee --- /dev/null +++ b/script/sql/update/update20250328.sql @@ -0,0 +1,2 @@ +ALTER TABLE `chat_message` + ADD COLUMN `role` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '对话角色' AFTER `content`; diff --git a/spy.log b/spy.log new file mode 100644 index 0000000..5c7fc79 --- /dev/null +++ b/spy.log @@ -0,0 +1,58 @@ +1747580868693|15|statement|connection 0|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id, category, config_name, config_value, config_dict, remark, del_flag, update_ip, tenant_id, create_dept, create_by, create_time, update_by, update_time FROM chat_config WHERE del_flag = '0' AND (category = ? AND config_name LIKE ?)|SELECT id, category, config_name, config_value, config_dict, remark, del_flag, update_ip, tenant_id, create_dept, create_by, create_time, update_by, update_time FROM chat_config WHERE del_flag = '0' AND (category = 'weaviate' AND config_name LIKE '%protocol%') +1747580868826|12|statement|connection 1|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'weaviate' AND config_name LIKE '%host%') +1747580868841|11|statement|connection 2|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'weaviate' AND config_name LIKE '%classname%') +1747580868872|11|statement|connection 3|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'milvus' AND config_name LIKE '%host%') +1747580868886|11|statement|connection 4|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'milvus' AND config_name LIKE '%port%') +1747580869846|11|statement|connection 5|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'milvus' AND config_name LIKE '%dimension%') +1747580869861|12|statement|connection 6|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'milvus' AND config_name LIKE '%collection%') +1747580870496|11|statement|connection 7|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id, model_name, model_describe, model_price, model_type, model_show, system_prompt, api_host, api_key, remark, create_dept, create_by, create_time, update_by, update_time FROM chat_model WHERE (model_name LIKE ?)|SELECT id, model_name, model_describe, model_price, model_type, model_show, system_prompt, api_host, api_key, remark, create_dept, create_by, create_time, update_by, update_time FROM chat_model WHERE (model_name LIKE '%suno%') +1747580870515|10|statement|connection 8|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,model_name,model_describe,model_price,model_type,model_show,system_prompt,api_host,api_key,remark,create_dept,create_by,create_time,update_by,update_time FROM chat_model WHERE (model_name LIKE ?)|SELECT id,model_name,model_describe,model_price,model_type,model_show,system_prompt,api_host,api_key,remark,create_dept,create_by,create_time,update_by,update_time FROM chat_model WHERE (model_name LIKE '%luma%') +1747580870531|10|statement|connection 9|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,model_name,model_describe,model_price,model_type,model_show,system_prompt,api_host,api_key,remark,create_dept,create_by,create_time,update_by,update_time FROM chat_model WHERE (model_name LIKE ?)|SELECT id,model_name,model_describe,model_price,model_type,model_show,system_prompt,api_host,api_key,remark,create_dept,create_by,create_time,update_by,update_time FROM chat_model WHERE (model_name LIKE '%ppt%') +1747580873373|11|statement|connection 10|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'pay' AND config_name LIKE '%pid%') +1747580873387|11|statement|connection 11|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'pay' AND config_name LIKE '%key%') +1747580873400|10|statement|connection 12|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'pay' AND config_name LIKE '%payUrl%') +1747580873416|11|statement|connection 13|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'pay' AND config_name LIKE '%notify_url%') +1747580873430|11|statement|connection 14|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'pay' AND config_name LIKE '%return_url%') +1747580873576|11|statement|connection 15|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'weixin' AND config_name LIKE '%appId%') +1747580873594|13|statement|connection 16|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'weixin' AND config_name LIKE '%mchId%') +1747580873609|12|statement|connection 17|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'weixin' AND config_name LIKE '%appSecret%') +1747580874990|9|statement|connection 18|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,model_name,model_describe,model_price,model_type,model_show,system_prompt,api_host,api_key,remark,create_dept,create_by,create_time,update_by,update_time FROM chat_model WHERE (model_name LIKE ?)|SELECT id,model_name,model_describe,model_price,model_type,model_show,system_prompt,api_host,api_key,remark,create_dept,create_by,create_time,update_by,update_time FROM chat_model WHERE (model_name LIKE '%midjourney%') +1747580875682|11|statement|connection 19|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'chat' AND config_name LIKE '%apiHost%') +1747580875700|13|statement|connection 20|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'chat' AND config_name LIKE '%apiKey%') +1747580879823|10|statement|connection 21|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'mail' AND config_name LIKE '%host%') +1747580879837|11|statement|connection 22|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'mail' AND config_name LIKE '%port%') +1747580879854|10|statement|connection 23|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'mail' AND config_name LIKE '%from%') +1747580879867|10|statement|connection 24|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'mail' AND config_name LIKE '%user%') +1747580879881|10|statement|connection 25|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'mail' AND config_name LIKE '%pass%') +1747580879893|10|statement|connection 26|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'mail' AND config_name LIKE '%port%') +1747580882881|11|statement|connection 27|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT oss_config_id, config_key, access_key, secret_key, bucket_name, prefix, endpoint, domain, is_https, region, status, ext1, remark, access_policy, tenant_id, create_dept, create_by, create_time, update_by, update_time FROM sys_oss_config ORDER BY tenant_id ASC|SELECT oss_config_id, config_key, access_key, secret_key, bucket_name, prefix, endpoint, domain, is_https, region, status, ext1, remark, access_policy, tenant_id, create_dept, create_by, create_time, update_by, update_time FROM sys_oss_config ORDER BY tenant_id ASC +1747580883808|10|statement|connection 29|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT 1|SELECT 1 +1747581981766|15|statement|connection 0|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id, category, config_name, config_value, config_dict, remark, del_flag, update_ip, tenant_id, create_dept, create_by, create_time, update_by, update_time FROM chat_config WHERE del_flag = '0' AND (category = ? AND config_name LIKE ?)|SELECT id, category, config_name, config_value, config_dict, remark, del_flag, update_ip, tenant_id, create_dept, create_by, create_time, update_by, update_time FROM chat_config WHERE del_flag = '0' AND (category = 'weaviate' AND config_name LIKE '%protocol%') +1747581981909|11|statement|connection 1|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'weaviate' AND config_name LIKE '%host%') +1747581981926|11|statement|connection 2|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'weaviate' AND config_name LIKE '%classname%') +1747581981958|11|statement|connection 3|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'milvus' AND config_name LIKE '%host%') +1747581981971|10|statement|connection 4|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'milvus' AND config_name LIKE '%port%') +1747581982980|11|statement|connection 5|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'milvus' AND config_name LIKE '%dimension%') +1747581982994|10|statement|connection 6|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'milvus' AND config_name LIKE '%collection%') +1747581983631|12|statement|connection 7|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id, model_name, model_describe, model_price, model_type, model_show, system_prompt, api_host, api_key, remark, create_dept, create_by, create_time, update_by, update_time FROM chat_model WHERE (model_name LIKE ?)|SELECT id, model_name, model_describe, model_price, model_type, model_show, system_prompt, api_host, api_key, remark, create_dept, create_by, create_time, update_by, update_time FROM chat_model WHERE (model_name LIKE '%suno%') +1747581983655|12|statement|connection 8|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,model_name,model_describe,model_price,model_type,model_show,system_prompt,api_host,api_key,remark,create_dept,create_by,create_time,update_by,update_time FROM chat_model WHERE (model_name LIKE ?)|SELECT id,model_name,model_describe,model_price,model_type,model_show,system_prompt,api_host,api_key,remark,create_dept,create_by,create_time,update_by,update_time FROM chat_model WHERE (model_name LIKE '%luma%') +1747581983672|11|statement|connection 9|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,model_name,model_describe,model_price,model_type,model_show,system_prompt,api_host,api_key,remark,create_dept,create_by,create_time,update_by,update_time FROM chat_model WHERE (model_name LIKE ?)|SELECT id,model_name,model_describe,model_price,model_type,model_show,system_prompt,api_host,api_key,remark,create_dept,create_by,create_time,update_by,update_time FROM chat_model WHERE (model_name LIKE '%ppt%') +1747581986752|11|statement|connection 10|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'pay' AND config_name LIKE '%pid%') +1747581986766|11|statement|connection 11|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'pay' AND config_name LIKE '%key%') +1747581986780|11|statement|connection 12|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'pay' AND config_name LIKE '%payUrl%') +1747581986795|11|statement|connection 13|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'pay' AND config_name LIKE '%notify_url%') +1747581986809|12|statement|connection 14|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'pay' AND config_name LIKE '%return_url%') +1747581986965|11|statement|connection 15|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'weixin' AND config_name LIKE '%appId%') +1747581986980|10|statement|connection 16|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'weixin' AND config_name LIKE '%mchId%') +1747581986995|11|statement|connection 17|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'weixin' AND config_name LIKE '%appSecret%') +1747581988417|10|statement|connection 18|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,model_name,model_describe,model_price,model_type,model_show,system_prompt,api_host,api_key,remark,create_dept,create_by,create_time,update_by,update_time FROM chat_model WHERE (model_name LIKE ?)|SELECT id,model_name,model_describe,model_price,model_type,model_show,system_prompt,api_host,api_key,remark,create_dept,create_by,create_time,update_by,update_time FROM chat_model WHERE (model_name LIKE '%midjourney%') +1747581989111|12|statement|connection 19|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'chat' AND config_name LIKE '%apiHost%') +1747581989126|10|statement|connection 20|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'chat' AND config_name LIKE '%apiKey%') +1747581993440|11|statement|connection 21|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'mail' AND config_name LIKE '%host%') +1747581993456|12|statement|connection 22|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'mail' AND config_name LIKE '%port%') +1747581993473|12|statement|connection 23|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'mail' AND config_name LIKE '%from%') +1747581993487|10|statement|connection 24|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'mail' AND config_name LIKE '%user%') +1747581993503|12|statement|connection 25|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'mail' AND config_name LIKE '%pass%') +1747581993518|12|statement|connection 26|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = ? AND config_name LIKE ?)|SELECT id,category,config_name,config_value,config_dict,remark,del_flag,update_ip,tenant_id,create_dept,create_by,create_time,update_by,update_time FROM chat_config WHERE del_flag='0' AND (category = 'mail' AND config_name LIKE '%port%') +1747581996594|11|statement|connection 27|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT oss_config_id, config_key, access_key, secret_key, bucket_name, prefix, endpoint, domain, is_https, region, status, ext1, remark, access_policy, tenant_id, create_dept, create_by, create_time, update_by, update_time FROM sys_oss_config ORDER BY tenant_id ASC|SELECT oss_config_id, config_key, access_key, secret_key, bucket_name, prefix, endpoint, domain, is_https, region, status, ext1, remark, access_policy, tenant_id, create_dept, create_by, create_time, update_by, update_time FROM sys_oss_config ORDER BY tenant_id ASC +1747581997575|11|statement|connection 29|url jdbc:mysql://47.104.134.46:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true|SELECT 1|SELECT 1